From d4db46988f486877ca0ac97e0ce8c695a2593413 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 15:27:51 +0000 Subject: [PATCH 1/3] fix: apply audit fixes --- dist/index.js | 178013 +++++++++++++++++++++++++---------------------- 1 file changed, 95649 insertions(+), 82364 deletions(-) diff --git a/dist/index.js b/dist/index.js index c624216..fd47566 100644 --- a/dist/index.js +++ b/dist/index.js @@ -813,7 +813,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); __exportStar(__nccwpck_require__(35592), exports); __exportStar(__nccwpck_require__(78806), exports); __exportStar(__nccwpck_require__(68614), exports); -__exportStar(__nccwpck_require__(51706), exports); +__exportStar(__nccwpck_require__(31800), exports); //# sourceMappingURL=index.js.map /***/ }), @@ -824,7 +824,7 @@ __exportStar(__nccwpck_require__(51706), exports); "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ArtifactService = exports.DeleteArtifactResponse = exports.DeleteArtifactRequest = exports.GetSignedArtifactURLResponse = exports.GetSignedArtifactURLRequest = exports.ListArtifactsResponse_MonolithArtifact = exports.ListArtifactsResponse = exports.ListArtifactsRequest = exports.FinalizeArtifactResponse = exports.FinalizeArtifactRequest = exports.CreateArtifactResponse = exports.CreateArtifactRequest = void 0; +exports.ArtifactService = exports.DeleteArtifactResponse = exports.DeleteArtifactRequest = exports.GetSignedArtifactURLResponse = exports.GetSignedArtifactURLRequest = exports.ListArtifactsResponse_MonolithArtifact = exports.ListArtifactsResponse = exports.ListArtifactsRequest = exports.FinalizeArtifactResponse = exports.FinalizeArtifactRequest = exports.CreateArtifactResponse = exports.CreateArtifactRequest = exports.FinalizeMigratedArtifactResponse = exports.FinalizeMigratedArtifactRequest = exports.MigrateArtifactResponse = exports.MigrateArtifactRequest = void 0; // @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_none,generate_dependencies // @generated from protobuf file "results/api/v1/artifact.proto" (package "github.actions.results.api.v1", syntax proto3) // tslint:disable @@ -838,6 +838,236 @@ const wrappers_1 = __nccwpck_require__(78806); const wrappers_2 = __nccwpck_require__(78806); const timestamp_1 = __nccwpck_require__(35592); // @generated message type with reflection information, may provide speed optimized methods +class MigrateArtifactRequest$Type extends runtime_5.MessageType { + constructor() { + super("github.actions.results.api.v1.MigrateArtifactRequest", [ + { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "expires_at", kind: "message", T: () => timestamp_1.Timestamp } + ]); + } + create(value) { + const message = { workflowRunBackendId: "", name: "" }; + globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + (0, runtime_3.reflectionMergePartial)(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string workflow_run_backend_id */ 1: + message.workflowRunBackendId = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + case /* google.protobuf.Timestamp expires_at */ 3: + message.expiresAt = timestamp_1.Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + /* string workflow_run_backend_id = 1; */ + if (message.workflowRunBackendId !== "") + writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.name); + /* google.protobuf.Timestamp expires_at = 3; */ + if (message.expiresAt) + timestamp_1.Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.MigrateArtifactRequest + */ +exports.MigrateArtifactRequest = new MigrateArtifactRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MigrateArtifactResponse$Type extends runtime_5.MessageType { + constructor() { + super("github.actions.results.api.v1.MigrateArtifactResponse", [ + { no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value) { + const message = { ok: false, signedUploadUrl: "" }; + globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + (0, runtime_3.reflectionMergePartial)(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool ok */ 1: + message.ok = reader.bool(); + break; + case /* string signed_upload_url */ 2: + message.signedUploadUrl = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + /* bool ok = 1; */ + if (message.ok !== false) + writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); + /* string signed_upload_url = 2; */ + if (message.signedUploadUrl !== "") + writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.signedUploadUrl); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.MigrateArtifactResponse + */ +exports.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FinalizeMigratedArtifactRequest$Type extends runtime_5.MessageType { + constructor() { + super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ + { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + ]); + } + create(value) { + const message = { workflowRunBackendId: "", name: "", size: "0" }; + globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + (0, runtime_3.reflectionMergePartial)(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string workflow_run_backend_id */ 1: + message.workflowRunBackendId = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + case /* int64 size */ 3: + message.size = reader.int64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + /* string workflow_run_backend_id = 1; */ + if (message.workflowRunBackendId !== "") + writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.workflowRunBackendId); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.name); + /* int64 size = 3; */ + if (message.size !== "0") + writer.tag(3, runtime_1.WireType.Varint).int64(message.size); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.FinalizeMigratedArtifactRequest + */ +exports.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FinalizeMigratedArtifactResponse$Type extends runtime_5.MessageType { + constructor() { + super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ + { no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "artifact_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + ]); + } + create(value) { + const message = { ok: false, artifactId: "0" }; + globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + (0, runtime_3.reflectionMergePartial)(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool ok */ 1: + message.ok = reader.bool(); + break; + case /* int64 artifact_id */ 2: + message.artifactId = reader.int64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + /* bool ok = 1; */ + if (message.ok !== false) + writer.tag(1, runtime_1.WireType.Varint).bool(message.ok); + /* int64 artifact_id = 2; */ + if (message.artifactId !== "0") + writer.tag(2, runtime_1.WireType.Varint).int64(message.artifactId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.FinalizeMigratedArtifactResponse + */ +exports.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods class CreateArtifactRequest$Type extends runtime_5.MessageType { constructor() { super("github.actions.results.api.v1.CreateArtifactRequest", [ @@ -1219,7 +1449,8 @@ class ListArtifactsResponse_MonolithArtifact$Type extends runtime_5.MessageType { no: 3, name: "database_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 6, name: "created_at", kind: "message", T: () => timestamp_1.Timestamp } + { no: 6, name: "created_at", kind: "message", T: () => timestamp_1.Timestamp }, + { no: 7, name: "digest", kind: "message", T: () => wrappers_2.StringValue } ]); } create(value) { @@ -1252,6 +1483,9 @@ class ListArtifactsResponse_MonolithArtifact$Type extends runtime_5.MessageType case /* google.protobuf.Timestamp created_at */ 6: message.createdAt = timestamp_1.Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt); break; + case /* google.protobuf.StringValue digest */ 7: + message.digest = wrappers_2.StringValue.internalBinaryRead(reader, reader.uint32(), options, message.digest); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -1282,6 +1516,9 @@ class ListArtifactsResponse_MonolithArtifact$Type extends runtime_5.MessageType /* google.protobuf.Timestamp created_at = 6; */ if (message.createdAt) timestamp_1.Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, runtime_1.WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.StringValue digest = 7; */ + if (message.digest) + wrappers_2.StringValue.internalBinaryWrite(message.digest, writer.tag(7, runtime_1.WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -1523,29 +1760,21 @@ exports.ArtifactService = new runtime_rpc_1.ServiceType("github.actions.results. { name: "FinalizeArtifact", options: {}, I: exports.FinalizeArtifactRequest, O: exports.FinalizeArtifactResponse }, { name: "ListArtifacts", options: {}, I: exports.ListArtifactsRequest, O: exports.ListArtifactsResponse }, { name: "GetSignedArtifactURL", options: {}, I: exports.GetSignedArtifactURLRequest, O: exports.GetSignedArtifactURLResponse }, - { name: "DeleteArtifact", options: {}, I: exports.DeleteArtifactRequest, O: exports.DeleteArtifactResponse } + { name: "DeleteArtifact", options: {}, I: exports.DeleteArtifactRequest, O: exports.DeleteArtifactResponse }, + { name: "MigrateArtifact", options: {}, I: exports.MigrateArtifactRequest, O: exports.MigrateArtifactResponse }, + { name: "FinalizeMigratedArtifact", options: {}, I: exports.FinalizeMigratedArtifactRequest, O: exports.FinalizeMigratedArtifactResponse } ]); //# sourceMappingURL=artifact.js.map /***/ }), -/***/ 51706: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 31800: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createArtifactServiceServer = exports.ArtifactServiceMethodList = exports.ArtifactServiceMethod = exports.ArtifactServiceClientProtobuf = exports.ArtifactServiceClientJSON = void 0; -const twirp_ts_1 = __nccwpck_require__(30430); +exports.ArtifactServiceClientProtobuf = exports.ArtifactServiceClientJSON = void 0; const artifact_1 = __nccwpck_require__(68614); class ArtifactServiceClientJSON { constructor(rpc) { @@ -1642,405 +1871,7 @@ class ArtifactServiceClientProtobuf { } } exports.ArtifactServiceClientProtobuf = ArtifactServiceClientProtobuf; -var ArtifactServiceMethod; -(function (ArtifactServiceMethod) { - ArtifactServiceMethod["CreateArtifact"] = "CreateArtifact"; - ArtifactServiceMethod["FinalizeArtifact"] = "FinalizeArtifact"; - ArtifactServiceMethod["ListArtifacts"] = "ListArtifacts"; - ArtifactServiceMethod["GetSignedArtifactURL"] = "GetSignedArtifactURL"; - ArtifactServiceMethod["DeleteArtifact"] = "DeleteArtifact"; -})(ArtifactServiceMethod || (exports.ArtifactServiceMethod = ArtifactServiceMethod = {})); -exports.ArtifactServiceMethodList = [ - ArtifactServiceMethod.CreateArtifact, - ArtifactServiceMethod.FinalizeArtifact, - ArtifactServiceMethod.ListArtifacts, - ArtifactServiceMethod.GetSignedArtifactURL, - ArtifactServiceMethod.DeleteArtifact, -]; -function createArtifactServiceServer(service) { - return new twirp_ts_1.TwirpServer({ - service, - packageName: "github.actions.results.api.v1", - serviceName: "ArtifactService", - methodList: exports.ArtifactServiceMethodList, - matchRoute: matchArtifactServiceRoute, - }); -} -exports.createArtifactServiceServer = createArtifactServiceServer; -function matchArtifactServiceRoute(method, events) { - switch (method) { - case "CreateArtifact": - return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () { - ctx = Object.assign(Object.assign({}, ctx), { methodName: "CreateArtifact" }); - yield events.onMatch(ctx); - return handleArtifactServiceCreateArtifactRequest(ctx, service, data, interceptors); - }); - case "FinalizeArtifact": - return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () { - ctx = Object.assign(Object.assign({}, ctx), { methodName: "FinalizeArtifact" }); - yield events.onMatch(ctx); - return handleArtifactServiceFinalizeArtifactRequest(ctx, service, data, interceptors); - }); - case "ListArtifacts": - return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () { - ctx = Object.assign(Object.assign({}, ctx), { methodName: "ListArtifacts" }); - yield events.onMatch(ctx); - return handleArtifactServiceListArtifactsRequest(ctx, service, data, interceptors); - }); - case "GetSignedArtifactURL": - return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () { - ctx = Object.assign(Object.assign({}, ctx), { methodName: "GetSignedArtifactURL" }); - yield events.onMatch(ctx); - return handleArtifactServiceGetSignedArtifactURLRequest(ctx, service, data, interceptors); - }); - case "DeleteArtifact": - return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () { - ctx = Object.assign(Object.assign({}, ctx), { methodName: "DeleteArtifact" }); - yield events.onMatch(ctx); - return handleArtifactServiceDeleteArtifactRequest(ctx, service, data, interceptors); - }); - default: - events.onNotFound(); - const msg = `no handler found`; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg); - } -} -function handleArtifactServiceCreateArtifactRequest(ctx, service, data, interceptors) { - switch (ctx.contentType) { - case twirp_ts_1.TwirpContentType.JSON: - return handleArtifactServiceCreateArtifactJSON(ctx, service, data, interceptors); - case twirp_ts_1.TwirpContentType.Protobuf: - return handleArtifactServiceCreateArtifactProtobuf(ctx, service, data, interceptors); - default: - const msg = "unexpected Content-Type"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg); - } -} -function handleArtifactServiceFinalizeArtifactRequest(ctx, service, data, interceptors) { - switch (ctx.contentType) { - case twirp_ts_1.TwirpContentType.JSON: - return handleArtifactServiceFinalizeArtifactJSON(ctx, service, data, interceptors); - case twirp_ts_1.TwirpContentType.Protobuf: - return handleArtifactServiceFinalizeArtifactProtobuf(ctx, service, data, interceptors); - default: - const msg = "unexpected Content-Type"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg); - } -} -function handleArtifactServiceListArtifactsRequest(ctx, service, data, interceptors) { - switch (ctx.contentType) { - case twirp_ts_1.TwirpContentType.JSON: - return handleArtifactServiceListArtifactsJSON(ctx, service, data, interceptors); - case twirp_ts_1.TwirpContentType.Protobuf: - return handleArtifactServiceListArtifactsProtobuf(ctx, service, data, interceptors); - default: - const msg = "unexpected Content-Type"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg); - } -} -function handleArtifactServiceGetSignedArtifactURLRequest(ctx, service, data, interceptors) { - switch (ctx.contentType) { - case twirp_ts_1.TwirpContentType.JSON: - return handleArtifactServiceGetSignedArtifactURLJSON(ctx, service, data, interceptors); - case twirp_ts_1.TwirpContentType.Protobuf: - return handleArtifactServiceGetSignedArtifactURLProtobuf(ctx, service, data, interceptors); - default: - const msg = "unexpected Content-Type"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg); - } -} -function handleArtifactServiceDeleteArtifactRequest(ctx, service, data, interceptors) { - switch (ctx.contentType) { - case twirp_ts_1.TwirpContentType.JSON: - return handleArtifactServiceDeleteArtifactJSON(ctx, service, data, interceptors); - case twirp_ts_1.TwirpContentType.Protobuf: - return handleArtifactServiceDeleteArtifactProtobuf(ctx, service, data, interceptors); - default: - const msg = "unexpected Content-Type"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg); - } -} -function handleArtifactServiceCreateArtifactJSON(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - const body = JSON.parse(data.toString() || "{}"); - request = artifact_1.CreateArtifactRequest.fromJson(body, { - ignoreUnknownFields: true, - }); - } - catch (e) { - if (e instanceof Error) { - const msg = "the json request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.CreateArtifact(ctx, inputReq); - }); - } - else { - response = yield service.CreateArtifact(ctx, request); - } - return JSON.stringify(artifact_1.CreateArtifactResponse.toJson(response, { - useProtoFieldName: true, - emitDefaultValues: false, - })); - }); -} -function handleArtifactServiceFinalizeArtifactJSON(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - const body = JSON.parse(data.toString() || "{}"); - request = artifact_1.FinalizeArtifactRequest.fromJson(body, { - ignoreUnknownFields: true, - }); - } - catch (e) { - if (e instanceof Error) { - const msg = "the json request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.FinalizeArtifact(ctx, inputReq); - }); - } - else { - response = yield service.FinalizeArtifact(ctx, request); - } - return JSON.stringify(artifact_1.FinalizeArtifactResponse.toJson(response, { - useProtoFieldName: true, - emitDefaultValues: false, - })); - }); -} -function handleArtifactServiceListArtifactsJSON(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - const body = JSON.parse(data.toString() || "{}"); - request = artifact_1.ListArtifactsRequest.fromJson(body, { - ignoreUnknownFields: true, - }); - } - catch (e) { - if (e instanceof Error) { - const msg = "the json request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.ListArtifacts(ctx, inputReq); - }); - } - else { - response = yield service.ListArtifacts(ctx, request); - } - return JSON.stringify(artifact_1.ListArtifactsResponse.toJson(response, { - useProtoFieldName: true, - emitDefaultValues: false, - })); - }); -} -function handleArtifactServiceGetSignedArtifactURLJSON(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - const body = JSON.parse(data.toString() || "{}"); - request = artifact_1.GetSignedArtifactURLRequest.fromJson(body, { - ignoreUnknownFields: true, - }); - } - catch (e) { - if (e instanceof Error) { - const msg = "the json request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.GetSignedArtifactURL(ctx, inputReq); - }); - } - else { - response = yield service.GetSignedArtifactURL(ctx, request); - } - return JSON.stringify(artifact_1.GetSignedArtifactURLResponse.toJson(response, { - useProtoFieldName: true, - emitDefaultValues: false, - })); - }); -} -function handleArtifactServiceDeleteArtifactJSON(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - const body = JSON.parse(data.toString() || "{}"); - request = artifact_1.DeleteArtifactRequest.fromJson(body, { - ignoreUnknownFields: true, - }); - } - catch (e) { - if (e instanceof Error) { - const msg = "the json request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.DeleteArtifact(ctx, inputReq); - }); - } - else { - response = yield service.DeleteArtifact(ctx, request); - } - return JSON.stringify(artifact_1.DeleteArtifactResponse.toJson(response, { - useProtoFieldName: true, - emitDefaultValues: false, - })); - }); -} -function handleArtifactServiceCreateArtifactProtobuf(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - request = artifact_1.CreateArtifactRequest.fromBinary(data); - } - catch (e) { - if (e instanceof Error) { - const msg = "the protobuf request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.CreateArtifact(ctx, inputReq); - }); - } - else { - response = yield service.CreateArtifact(ctx, request); - } - return Buffer.from(artifact_1.CreateArtifactResponse.toBinary(response)); - }); -} -function handleArtifactServiceFinalizeArtifactProtobuf(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - request = artifact_1.FinalizeArtifactRequest.fromBinary(data); - } - catch (e) { - if (e instanceof Error) { - const msg = "the protobuf request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.FinalizeArtifact(ctx, inputReq); - }); - } - else { - response = yield service.FinalizeArtifact(ctx, request); - } - return Buffer.from(artifact_1.FinalizeArtifactResponse.toBinary(response)); - }); -} -function handleArtifactServiceListArtifactsProtobuf(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - request = artifact_1.ListArtifactsRequest.fromBinary(data); - } - catch (e) { - if (e instanceof Error) { - const msg = "the protobuf request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.ListArtifacts(ctx, inputReq); - }); - } - else { - response = yield service.ListArtifacts(ctx, request); - } - return Buffer.from(artifact_1.ListArtifactsResponse.toBinary(response)); - }); -} -function handleArtifactServiceGetSignedArtifactURLProtobuf(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - request = artifact_1.GetSignedArtifactURLRequest.fromBinary(data); - } - catch (e) { - if (e instanceof Error) { - const msg = "the protobuf request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.GetSignedArtifactURL(ctx, inputReq); - }); - } - else { - response = yield service.GetSignedArtifactURL(ctx, request); - } - return Buffer.from(artifact_1.GetSignedArtifactURLResponse.toBinary(response)); - }); -} -function handleArtifactServiceDeleteArtifactProtobuf(ctx, service, data, interceptors) { - return __awaiter(this, void 0, void 0, function* () { - let request; - let response; - try { - request = artifact_1.DeleteArtifactRequest.fromBinary(data); - } - catch (e) { - if (e instanceof Error) { - const msg = "the protobuf request could not be decoded"; - throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true); - } - } - if (interceptors && interceptors.length > 0) { - const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors); - response = yield interceptor(ctx, request, (ctx, inputReq) => { - return service.DeleteArtifact(ctx, inputReq); - }); - } - else { - response = yield service.DeleteArtifact(ctx, request); - } - return Buffer.from(artifact_1.DeleteArtifactResponse.toBinary(response)); - }); -} -//# sourceMappingURL=artifact.twirp.js.map +//# sourceMappingURL=artifact.twirp-client.js.map /***/ }), @@ -2328,9 +2159,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.downloadArtifactInternal = exports.downloadArtifactPublic = exports.streamExtractExternal = void 0; const promises_1 = __importDefault(__nccwpck_require__(91943)); +const crypto = __importStar(__nccwpck_require__(76982)); const stream = __importStar(__nccwpck_require__(2203)); -const fs_1 = __nccwpck_require__(79896); -const path = __importStar(__nccwpck_require__(16928)); const github = __importStar(__nccwpck_require__(93228)); const core = __importStar(__nccwpck_require__(37484)); const httpClient = __importStar(__nccwpck_require__(54844)); @@ -2367,13 +2197,9 @@ function streamExtract(url, directory) { let retryCount = 0; while (retryCount < 5) { try { - yield streamExtractExternal(url, directory); - return; + return yield streamExtractExternal(url, directory); } catch (error) { - if (error.message.includes('Malformed extraction path')) { - throw new Error(`Artifact download failed with unretryable error: ${error.message}`); - } retryCount++; core.debug(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`); // wait 5 seconds before retrying @@ -2391,14 +2217,18 @@ function streamExtractExternal(url, directory) { throw new Error(`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`); } const timeout = 30 * 1000; // 30 seconds + let sha256Digest = undefined; return new Promise((resolve, reject) => { const timerFn = () => { response.message.destroy(new Error(`Blob storage chunk did not respond in ${timeout}ms`)); }; const timer = setTimeout(timerFn, timeout); - const createdDirectories = new Set(); - createdDirectories.add(directory); - response.message + const hashStream = crypto.createHash('sha256').setEncoding('hex'); + const passThrough = new stream.PassThrough(); + response.message.pipe(passThrough); + passThrough.pipe(hashStream); + const extractStream = passThrough; + extractStream .on('data', () => { timer.refresh(); }) @@ -2407,47 +2237,16 @@ function streamExtractExternal(url, directory) { clearTimeout(timer); reject(error); }) - .pipe(unzip_stream_1.default.Parse()) - .pipe(new stream.Transform({ - objectMode: true, - transform: (entry, _, callback) => __awaiter(this, void 0, void 0, function* () { - const fullPath = path.normalize(path.join(directory, entry.path)); - if (!directory.endsWith(path.sep)) { - directory += path.sep; - } - if (!fullPath.startsWith(directory)) { - reject(new Error(`Malformed extraction path: ${fullPath}`)); - } - core.debug(`Extracting artifact entry: ${fullPath}`); - if (entry.type === 'Directory') { - if (!createdDirectories.has(fullPath)) { - createdDirectories.add(fullPath); - yield resolveOrCreateDirectory(fullPath).then(() => { - entry.autodrain(); - callback(); - }); - } - else { - entry.autodrain(); - callback(); - } - } - else { - if (!createdDirectories.has(path.dirname(fullPath))) { - createdDirectories.add(path.dirname(fullPath)); - yield resolveOrCreateDirectory(path.dirname(fullPath)); - } - const writeStream = (0, fs_1.createWriteStream)(fullPath); - writeStream.on('finish', callback); - writeStream.on('error', reject); - entry.pipe(writeStream); - } - }) - })) - .on('finish', () => __awaiter(this, void 0, void 0, function* () { + .pipe(unzip_stream_1.default.Extract({ path: directory })) + .on('close', () => { clearTimeout(timer); - resolve(); - })) + if (hashStream) { + hashStream.end(); + sha256Digest = hashStream.read(); + core.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); + } + resolve({ sha256Digest: `sha256:${sha256Digest}` }); + }) .on('error', (error) => { reject(error); }); @@ -2459,6 +2258,7 @@ function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, tok return __awaiter(this, void 0, void 0, function* () { const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); const api = github.getOctokit(token); + let digestMismatch = false; core.info(`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`); const { headers, status } = yield api.rest.actions.downloadArtifact({ owner: repositoryOwner, @@ -2479,13 +2279,20 @@ function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, tok core.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); try { core.info(`Starting download of artifact to: ${downloadPath}`); - yield streamExtract(location, downloadPath); + const extractResponse = yield streamExtract(location, downloadPath); core.info(`Artifact download completed successfully.`); + if (options === null || options === void 0 ? void 0 : options.expectedHash) { + if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { + digestMismatch = true; + core.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core.debug(`Expected digest: ${options.expectedHash}`); + } + } } catch (error) { throw new Error(`Unable to download and extract artifact: ${error.message}`); } - return { downloadPath }; + return { downloadPath, digestMismatch }; }); } exports.downloadArtifactPublic = downloadArtifactPublic; @@ -2493,6 +2300,7 @@ function downloadArtifactInternal(artifactId, options) { return __awaiter(this, void 0, void 0, function* () { const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); + let digestMismatch = false; const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); const listReq = { workflowRunBackendId, @@ -2515,13 +2323,20 @@ function downloadArtifactInternal(artifactId, options) { core.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); try { core.info(`Starting download of artifact to: ${downloadPath}`); - yield streamExtract(signedUrl, downloadPath); + const extractResponse = yield streamExtract(signedUrl, downloadPath); core.info(`Artifact download completed successfully.`); + if (options === null || options === void 0 ? void 0 : options.expectedHash) { + if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { + digestMismatch = true; + core.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core.debug(`Expected digest: ${options.expectedHash}`); + } + } } catch (error) { throw new Error(`Unable to download and extract artifact: ${error.message}`); } - return { downloadPath }; + return { downloadPath, digestMismatch }; }); } exports.downloadArtifactInternal = downloadArtifactInternal; @@ -2627,13 +2442,17 @@ function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, reposit name: artifact.name, id: artifact.id, size: artifact.size_in_bytes, - createdAt: artifact.created_at ? new Date(artifact.created_at) : undefined + createdAt: artifact.created_at + ? new Date(artifact.created_at) + : undefined, + digest: artifact.digest } }; }); } exports.getArtifactPublic = getArtifactPublic; function getArtifactInternal(artifactName) { + var _a; return __awaiter(this, void 0, void 0, function* () { const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); @@ -2660,7 +2479,8 @@ function getArtifactInternal(artifactName) { size: Number(artifact.size), createdAt: artifact.createdAt ? generated_1.Timestamp.toDate(artifact.createdAt) - : undefined + : undefined, + digest: (_a = artifact.digest) === null || _a === void 0 ? void 0 : _a.value } }; }); @@ -2714,7 +2534,7 @@ function listArtifactsPublic(workflowRunId, repositoryOwner, repositoryName, tok }; const github = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); let currentPageNumber = 1; - const { data: listArtifactResponse } = yield github.rest.actions.listWorkflowRunArtifacts({ + const { data: listArtifactResponse } = yield github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', { owner: repositoryOwner, repo: repositoryName, run_id: workflowRunId, @@ -2733,14 +2553,18 @@ function listArtifactsPublic(workflowRunId, repositoryOwner, repositoryName, tok name: artifact.name, id: artifact.id, size: artifact.size_in_bytes, - createdAt: artifact.created_at ? new Date(artifact.created_at) : undefined + createdAt: artifact.created_at + ? new Date(artifact.created_at) + : undefined, + digest: artifact.digest }); } + // Move to the next page + currentPageNumber++; // Iterate over any remaining pages for (currentPageNumber; currentPageNumber < numberOfPages; currentPageNumber++) { - currentPageNumber++; (0, core_1.debug)(`Fetching page ${currentPageNumber} of artifact list`); - const { data: listArtifactResponse } = yield github.rest.actions.listWorkflowRunArtifacts({ + const { data: listArtifactResponse } = yield github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', { owner: repositoryOwner, repo: repositoryName, run_id: workflowRunId, @@ -2754,7 +2578,8 @@ function listArtifactsPublic(workflowRunId, repositoryOwner, repositoryName, tok size: artifact.size_in_bytes, createdAt: artifact.created_at ? new Date(artifact.created_at) - : undefined + : undefined, + digest: artifact.digest }); } } @@ -2777,14 +2602,18 @@ function listArtifactsInternal(latest = false) { workflowJobRunBackendId }; const res = yield artifactClient.ListArtifacts(req); - let artifacts = res.artifacts.map(artifact => ({ - name: artifact.name, - id: Number(artifact.databaseId), - size: Number(artifact.size), - createdAt: artifact.createdAt - ? generated_1.Timestamp.toDate(artifact.createdAt) - : undefined - })); + let artifacts = res.artifacts.map(artifact => { + var _a; + return ({ + name: artifact.name, + id: Number(artifact.databaseId), + size: Number(artifact.size), + createdAt: artifact.createdAt + ? generated_1.Timestamp.toDate(artifact.createdAt) + : undefined, + digest: (_a = artifact.digest) === null || _a === void 0 ? void 0 : _a.value + }); + }); if (latest) { artifacts = filterLatest(artifacts); } @@ -2896,6 +2725,7 @@ const generated_1 = __nccwpck_require__(44216); const config_1 = __nccwpck_require__(72938); const user_agent_1 = __nccwpck_require__(89387); const errors_1 = __nccwpck_require__(45655); +const util_1 = __nccwpck_require__(64012); class ArtifactHttpClient { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -2948,6 +2778,7 @@ class ArtifactHttpClient { (0, core_1.debug)(`[Response] - ${response.message.statusCode}`); (0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); const body = JSON.parse(rawBody); + (0, util_1.maskSecretUrls)(body); (0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`); if (this.isSuccessStatusCode(statusCode)) { return { response, body }; @@ -2964,7 +2795,6 @@ class ArtifactHttpClient { catch (error) { if (error instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); - throw error; } if (error instanceof errors_1.UsageError) { throw error; @@ -3042,8 +2872,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getResultsServiceUrl = exports.getRuntimeToken = exports.getUploadChunkSize = void 0; +exports.getUploadChunkTimeout = exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getResultsServiceUrl = exports.getRuntimeToken = exports.getUploadChunkSize = void 0; const os_1 = __importDefault(__nccwpck_require__(70857)); +const core_1 = __nccwpck_require__(37484); // Used for controlling the highWaterMark value of the zip that is being streamed // The same value is used as the chunk size that is use during upload to blob storage function getUploadChunkSize() { @@ -3070,8 +2901,9 @@ function isGhes() { const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com'); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); const isGitHubHost = hostname === 'GITHUB.COM'; - const isGheHost = hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST'); - return !isGitHubHost && !isGheHost; + const isGheHost = hostname.endsWith('.GHE.COM'); + const isLocalHost = hostname.endsWith('.LOCALHOST'); + return !isGitHubHost && !isGheHost && !isLocalHost; } exports.isGhes = isGhes; function getGitHubWorkspaceDir() { @@ -3082,18 +2914,44 @@ function getGitHubWorkspaceDir() { return ghWorkspaceDir; } exports.getGitHubWorkspaceDir = getGitHubWorkspaceDir; -// Mimics behavior of azcopy: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-optimize -// If your machine has fewer than 5 CPUs, then the value of this variable is set to 32. -// Otherwise, the default value is equal to 16 multiplied by the number of CPUs. The maximum value of this variable is 300. +// The maximum value of concurrency is 300. +// This value can be changed with ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY variable. function getConcurrency() { const numCPUs = os_1.default.cpus().length; - if (numCPUs <= 4) { - return 32; + let concurrencyCap = 32; + if (numCPUs > 4) { + const concurrency = 16 * numCPUs; + concurrencyCap = concurrency > 300 ? 300 : concurrency; } - const concurrency = 16 * numCPUs; - return concurrency > 300 ? 300 : concurrency; + const concurrencyOverride = process.env['ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY']; + if (concurrencyOverride) { + const concurrency = parseInt(concurrencyOverride); + if (isNaN(concurrency) || concurrency < 1) { + throw new Error('Invalid value set for ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY env variable'); + } + if (concurrency < concurrencyCap) { + (0, core_1.info)(`Set concurrency based on the value set in ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY.`); + return concurrency; + } + (0, core_1.info)(`ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY is higher than the cap of ${concurrencyCap} based on the number of cpus. Set it to the maximum value allowed.`); + return concurrencyCap; + } + // default concurrency to 5 + return 5; } exports.getConcurrency = getConcurrency; +function getUploadChunkTimeout() { + const timeoutVar = process.env['ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS']; + if (!timeoutVar) { + return 300000; // 5 minutes + } + const timeout = parseInt(timeoutVar); + if (isNaN(timeout)) { + throw new Error('Invalid value set for ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS env variable'); + } + return timeout; +} +exports.getUploadChunkTimeout = getUploadChunkTimeout; //# sourceMappingURL=config.js.map /***/ }), @@ -3237,10 +3095,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getBackendIdsFromToken = void 0; +exports.maskSecretUrls = exports.maskSigUrl = exports.getBackendIdsFromToken = void 0; const core = __importStar(__nccwpck_require__(37484)); const config_1 = __nccwpck_require__(72938); const jwt_decode_1 = __importDefault(__nccwpck_require__(79699)); +const core_1 = __nccwpck_require__(37484); const InvalidJwtError = new Error('Failed to get backend IDs: The provided JWT token is invalid and/or missing claims'); // uses the JWT token claims to get the // workflow run and workflow job run backend ids @@ -3289,6 +3148,74 @@ function getBackendIdsFromToken() { throw InvalidJwtError; } exports.getBackendIdsFromToken = getBackendIdsFromToken; +/** + * Masks the `sig` parameter in a URL and sets it as a secret. + * + * @param url - The URL containing the signature parameter to mask + * @remarks + * This function attempts to parse the provided URL and identify the 'sig' query parameter. + * If found, it registers both the raw and URL-encoded signature values as secrets using + * the Actions `setSecret` API, which prevents them from being displayed in logs. + * + * The function handles errors gracefully if URL parsing fails, logging them as debug messages. + * + * @example + * ```typescript + * // Mask a signature in an Azure SAS token URL + * maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01'); + * ``` + */ +function maskSigUrl(url) { + if (!url) + return; + try { + const parsedUrl = new URL(url); + const signature = parsedUrl.searchParams.get('sig'); + if (signature) { + (0, core_1.setSecret)(signature); + (0, core_1.setSecret)(encodeURIComponent(signature)); + } + } + catch (error) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`); + } +} +exports.maskSigUrl = maskSigUrl; +/** + * Masks sensitive information in URLs containing signature parameters. + * Currently supports masking 'sig' parameters in the 'signed_upload_url' + * and 'signed_download_url' properties of the provided object. + * + * @param body - The object should contain a signature + * @remarks + * This function extracts URLs from the object properties and calls maskSigUrl + * on each one to redact sensitive signature information. The function doesn't + * modify the original object; it only marks the signatures as secrets for + * logging purposes. + * + * @example + * ```typescript + * const responseBody = { + * signed_upload_url: 'https://example.com?sig=abc123', + * signed_download_url: 'https://example.com?sig=def456' + * }; + * maskSecretUrls(responseBody); + * ``` + */ +function maskSecretUrls(body) { + if (typeof body !== 'object' || body === null) { + (0, core_1.debug)('body is not an object or is null'); + return; + } + if ('signed_upload_url' in body && + typeof body.signed_upload_url === 'string') { + maskSigUrl(body.signed_upload_url); + } + if ('signed_url' in body && typeof body.signed_url === 'string') { + maskSigUrl(body.signed_url); + } +} +exports.maskSecretUrls = maskSecretUrls; //# sourceMappingURL=util.js.map /***/ }), @@ -3332,7 +3259,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.uploadZipToBlobStorage = void 0; -const storage_blob_1 = __nccwpck_require__(1012); +const storage_blob_1 = __nccwpck_require__(71400); const config_1 = __nccwpck_require__(72938); const core = __importStar(__nccwpck_require__(37484)); const crypto = __importStar(__nccwpck_require__(76982)); @@ -3341,6 +3268,21 @@ const errors_1 = __nccwpck_require__(45655); function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { return __awaiter(this, void 0, void 0, function* () { let uploadByteCount = 0; + let lastProgressTime = Date.now(); + const abortController = new AbortController(); + const chunkTimer = (interval) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + const timer = setInterval(() => { + if (Date.now() - lastProgressTime > interval) { + reject(new Error('Upload progress stalled.')); + } + }, interval); + abortController.signal.addEventListener('abort', () => { + clearInterval(timer); + resolve(); + }); + }); + }); const maxConcurrency = (0, config_1.getConcurrency)(); const bufferSize = (0, config_1.getUploadChunkSize)(); const blobClient = new storage_blob_1.BlobClient(authenticatedUploadURL); @@ -3349,10 +3291,12 @@ function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { const uploadCallback = (progress) => { core.info(`Uploaded bytes ${progress.loadedBytes}`); uploadByteCount = progress.loadedBytes; + lastProgressTime = Date.now(); }; const options = { blobHTTPHeaders: { blobContentType: 'zip' }, - onProgress: uploadCallback + onProgress: uploadCallback, + abortSignal: abortController.signal }; let sha256Hash = undefined; const uploadStream = new stream.PassThrough(); @@ -3361,7 +3305,10 @@ function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { zipUploadStream.pipe(hashStream).setEncoding('hex'); // This stream is used to compute a hash of the zip content that gets used. Integrity check core.info('Beginning upload of artifact content to blob storage'); try { - yield blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options); + yield Promise.race([ + blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), + chunkTimer((0, config_1.getUploadChunkTimeout)()) + ]); } catch (error) { if (errors_1.NetworkError.isNetworkErrorCode(error === null || error === void 0 ? void 0 : error.code)) { @@ -3369,10 +3316,13 @@ function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { } throw error; } + finally { + abortController.abort(); + } core.info('Finished uploading artifact content to blob storage!'); hashStream.end(); sha256Hash = hashStream.read(); - core.info(`SHA256 hash of uploaded artifact zip is ${sha256Hash}`); + core.info(`SHA256 digest of uploaded artifact zip is ${sha256Hash}`); if (uploadByteCount === 0) { core.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`); } @@ -3623,6 +3573,7 @@ function uploadArtifact(name, files, rootDirectory, options) { core.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); return { size: uploadResult.uploadSize, + digest: uploadResult.sha256Hash, id: Number(artifactId) }; }); @@ -3717,10 +3668,11 @@ function getUploadZipSpecification(filesToZip, rootDirectory) { - file3.txt */ for (let file of filesToZip) { - if (!fs.existsSync(file)) { + const stats = fs.lstatSync(file, { throwIfNoEntry: false }); + if (!stats) { throw new Error(`File ${file} does not exist`); } - if (!fs.statSync(file).isDirectory()) { + if (!stats.isDirectory()) { // Normalize and resolve, this allows for either absolute or relative paths to be used file = (0, path_1.normalize)(file); file = (0, path_1.resolve)(file); @@ -3732,7 +3684,8 @@ function getUploadZipSpecification(filesToZip, rootDirectory) { (0, path_and_artifact_name_validation_1.validateFilePath)(uploadPath); specification.push({ sourcePath: file, - destinationPath: uploadPath + destinationPath: uploadPath, + stats }); } else { @@ -3741,7 +3694,8 @@ function getUploadZipSpecification(filesToZip, rootDirectory) { (0, path_and_artifact_name_validation_1.validateFilePath)(directoryPath); specification.push({ sourcePath: null, - destinationPath: directoryPath + destinationPath: directoryPath, + stats }); } } @@ -3792,9 +3746,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createZipUploadStream = exports.ZipUploadStream = exports.DEFAULT_COMPRESSION_LEVEL = void 0; const stream = __importStar(__nccwpck_require__(2203)); +const promises_1 = __nccwpck_require__(91943); const archiver = __importStar(__nccwpck_require__(99392)); const core = __importStar(__nccwpck_require__(37484)); -const fs_1 = __nccwpck_require__(79896); const config_1 = __nccwpck_require__(72938); exports.DEFAULT_COMPRESSION_LEVEL = 6; // Custom stream transformer so we can set the highWaterMark property @@ -3825,8 +3779,13 @@ function createZipUploadStream(uploadSpecification, compressionLevel = exports.D zip.on('end', zipEndCallback); for (const file of uploadSpecification) { if (file.sourcePath !== null) { - // Add a normal file to the zip - zip.append((0, fs_1.createReadStream)(file.sourcePath), { + // Check if symlink and resolve the source path + let sourcePath = file.sourcePath; + if (file.stats.isSymbolicLink()) { + sourcePath = yield (0, promises_1.realpath)(file.sourcePath); + } + // Add the file to the zip + zip.file(sourcePath, { name: file.destinationPath }); } @@ -3879,7 +3838,11 @@ const zipEndCallback = () => { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + 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]; @@ -3892,7 +3855,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + 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; }; @@ -3954,13 +3917,13 @@ class Command { } } 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') @@ -3978,7 +3941,11 @@ function escapeProperty(s) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + 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]; @@ -3991,7 +3958,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + 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; }; @@ -4005,7 +3972,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.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; +exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.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; const command_1 = __nccwpck_require__(44914); const file_command_1 = __nccwpck_require__(24753); const utils_1 = __nccwpck_require__(30302); @@ -4025,7 +3992,7 @@ var ExitCode; * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +})(ExitCode || (exports.ExitCode = ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- @@ -4036,13 +4003,13 @@ var ExitCode; */ // 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.exportVariable = exportVariable; /** @@ -4050,7 +4017,7 @@ exports.exportVariable = exportVariable; * @param secret value of the secret */ function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); + (0, command_1.issueCommand)('add-mask', {}, secret); } exports.setSecret = setSecret; /** @@ -4060,10 +4027,10 @@ exports.setSecret = setSecret; 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']}`; } @@ -4138,10 +4105,10 @@ exports.getBooleanInput = getBooleanInput; 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.setOutput = setOutput; /** @@ -4150,7 +4117,7 @@ exports.setOutput = setOutput; * */ function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); + (0, command_1.issue)('echo', enabled ? 'on' : 'off'); } exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- @@ -4181,7 +4148,7 @@ exports.isDebug = isDebug; * @param message debug message */ function debug(message) { - command_1.issueCommand('debug', {}, message); + (0, command_1.issueCommand)('debug', {}, message); } exports.debug = debug; /** @@ -4190,7 +4157,7 @@ exports.debug = debug; * @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.error = error; /** @@ -4199,7 +4166,7 @@ exports.error = error; * @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.warning = warning; /** @@ -4208,7 +4175,7 @@ exports.warning = warning; * @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.notice = notice; /** @@ -4227,14 +4194,14 @@ exports.info = info; * @param name The name of the output group */ function startGroup(name) { - command_1.issue('group', name); + (0, command_1.issue)('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { - command_1.issue('endgroup'); + (0, command_1.issue)('endgroup'); } exports.endGroup = endGroup; /** @@ -4272,9 +4239,9 @@ exports.group = group; 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.saveState = saveState; /** @@ -4310,6 +4277,10 @@ var path_utils_1 = __nccwpck_require__(31976); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); +/** + * Platform utilities exports + */ +exports.platform = __importStar(__nccwpck_require__(18968)); //# sourceMappingURL=core.js.map /***/ }), @@ -4322,7 +4293,11 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct // For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + 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]; @@ -4335,7 +4310,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + 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; }; @@ -4343,9 +4318,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ +const crypto = __importStar(__nccwpck_require__(76982)); const fs = __importStar(__nccwpck_require__(79896)); const os = __importStar(__nccwpck_require__(70857)); -const uuid_1 = __nccwpck_require__(12048); const utils_1 = __nccwpck_require__(30302); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -4355,14 +4330,14 @@ function issueFileCommand(command, message) { 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' }); } exports.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. @@ -4447,9 +4422,9 @@ class OidcClient { 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) { @@ -4470,7 +4445,11 @@ exports.OidcClient = OidcClient; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + 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]; @@ -4483,7 +4462,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + 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; }; @@ -4528,6 +4507,107 @@ exports.toPlatformPath = toPlatformPath; /***/ }), +/***/ 18968: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; +const os_1 = __importDefault(__nccwpck_require__(70857)); +const exec = __importStar(__nccwpck_require__(95236)); +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.platform = os_1.default.platform(); +exports.arch = os_1.default.arch(); +exports.isWindows = exports.platform === 'win32'; +exports.isMacOS = exports.platform === 'darwin'; +exports.isLinux = exports.platform === 'linux'; +function getDetails() { + return __awaiter(this, void 0, void 0, function* () { + return Object.assign(Object.assign({}, (yield (exports.isWindows + ? getWindowsInfo() + : exports.isMacOS + ? getMacOsInfo() + : getLinuxInfo()))), { platform: exports.platform, + arch: exports.arch, + isWindows: exports.isWindows, + isMacOS: exports.isMacOS, + isLinux: exports.isLinux }); + }); +} +exports.getDetails = getDetails; +//# sourceMappingURL=platform.js.map + +/***/ }), + /***/ 71847: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -4865,68 +4945,803 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 51648: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 95236: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Context = void 0; -const fs_1 = __nccwpck_require__(79896); -const os_1 = __nccwpck_require__(70857); -class Context { - /** - * Hydrate the context from the environment - */ - constructor() { - var _a, _b, _c; - this.payload = {}; - if (process.env.GITHUB_EVENT_PATH) { - if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { - this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); +exports.getExecOutput = exports.exec = void 0; +const string_decoder_1 = __nccwpck_require__(13193); +const tr = __importStar(__nccwpck_require__(6665)); +/** + * 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(); + }); +} +exports.exec = 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) { + 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); } - else { - const path = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - this.eventName = process.env.GITHUB_EVENT_NAME; - this.sha = process.env.GITHUB_SHA; - this.ref = process.env.GITHUB_REF; - this.workflow = process.env.GITHUB_WORKFLOW; - this.action = process.env.GITHUB_ACTION; - this.actor = process.env.GITHUB_ACTOR; - this.job = process.env.GITHUB_JOB; - this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); - this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; - this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; - this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; - } - get issue() { - const payload = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); - } - get repo() { - if (process.env.GITHUB_REPOSITORY) { - const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); - return { owner, repo }; - } - if (this.payload.repository) { - return { - owner: this.payload.repository.owner.login, - repo: this.payload.repository.name - }; - } - throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); - } + }; + 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 + }; + }); } -exports.Context = Context; -//# sourceMappingURL=context.js.map +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map /***/ }), -/***/ 93228: +/***/ 6665: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.argStringToArray = exports.ToolRunner = void 0; +const os = __importStar(__nccwpck_require__(70857)); +const events = __importStar(__nccwpck_require__(24434)); +const child = __importStar(__nccwpck_require__(35317)); +const path = __importStar(__nccwpck_require__(16928)); +const io = __importStar(__nccwpck_require__(94994)); +const ioUtil = __importStar(__nccwpck_require__(75207)); +const timers_1 = __nccwpck_require__(53557); +/* 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); + } + })); + }); + } +} +exports.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; +} +exports.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(); + } +} +//# sourceMappingURL=toolrunner.js.map + +/***/ }), + +/***/ 51648: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Context = void 0; +const fs_1 = __nccwpck_require__(79896); +const os_1 = __nccwpck_require__(70857); +class Context { + /** + * Hydrate the context from the environment + */ + constructor() { + var _a, _b, _c; + this.payload = {}; + if (process.env.GITHUB_EVENT_PATH) { + if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { + this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); + } + else { + const path = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); + } + } + this.eventName = process.env.GITHUB_EVENT_NAME; + this.sha = process.env.GITHUB_SHA; + this.ref = process.env.GITHUB_REF; + this.workflow = process.env.GITHUB_WORKFLOW; + this.action = process.env.GITHUB_ACTION; + this.actor = process.env.GITHUB_ACTOR; + this.job = process.env.GITHUB_JOB; + this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); + this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); + this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; + this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; + this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; + } + get issue() { + const payload = this.payload; + return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); + } + get repo() { + if (process.env.GITHUB_REPOSITORY) { + const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); + return { owner, repo }; + } + if (this.payload.repository) { + return { + owner: this.payload.repository.owner.login, + repo: this.payload.repository.name + }; + } + throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); + } +} +exports.Context = Context; +//# sourceMappingURL=context.js.map + +/***/ }), + +/***/ 93228: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5864,6 +6679,502 @@ function isLoopbackAddress(host) { /***/ }), +/***/ 75207: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +const fs = __importStar(__nccwpck_require__(79896)); +const path = __importStar(__nccwpck_require__(16928)); +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' +exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); + } + catch (err) { + if (err.code === 'ENOENT') { + return false; + } + throw err; + } + return true; + }); +} +exports.exists = exists; +function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); +} +exports.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.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.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.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.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.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.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.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.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.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.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map + +/***/ }), + +/***/ 94994: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(42613); +const path = __importStar(__nccwpck_require__(16928)); +const ioUtil = __importStar(__nccwpck_require__(75207)); +/** + * 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); + } + }); +} +exports.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); + }); +} +exports.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}`); + } + }); +} +exports.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 }); + }); +} +exports.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 ''; + }); +} +exports.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; + }); +} +exports.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); + } + }); +} +//# sourceMappingURL=io.js.map + +/***/ }), + /***/ 68110: /***/ ((__unused_webpack_module, exports) => { @@ -6111,7 +7422,7 @@ exports.AbortSignal = AbortSignal; /***/ }), -/***/ 73905: +/***/ 15862: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -6119,68437 +7430,29091 @@ exports.AbortSignal = AbortSignal; Object.defineProperty(exports, "__esModule", ({ value: true })); -var coreUtil = __nccwpck_require__(58735); +var logger$1 = __nccwpck_require__(26515); +var abortController = __nccwpck_require__(68110); +var coreUtil = __nccwpck_require__(87779); // Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. /** - * A static-key-based credential that supports updating - * the underlying key value. + * The `@azure/logger` configuration for this package. + * @internal */ -class AzureKeyCredential { - /** - * The value of the key to be used in authentication - */ - get key() { - return this._key; - } - /** - * Create an instance of an AzureKeyCredential for use - * with a service client. - * - * @param key - The initial value of the key to use in authentication - */ - constructor(key) { - if (!key) { - throw new Error("key must be a non-empty string"); - } - this._key = key; - } - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newKey - The new key value to be used - */ - update(newKey) { - this._key = newKey; - } -} +const logger = logger$1.createClientLogger("core-lro"); // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** - * A static name/key-based credential that supports updating - * the underlying name and key values. + * The default time interval to wait before sending the next polling request. */ -class AzureNamedKeyCredential { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; - } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; - } - /** - * Create an instance of an AzureNamedKeyCredential for use - * with a service client. - * - * @param name - The initial value of the name to use in authentication. - * @param key - The initial value of the key to use in authentication. - */ - constructor(name, key) { - if (!name || !key) { - throw new TypeError("name and key must be non-empty strings"); - } - this._name = name; - this._key = key; - } - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newName - The new name value to be used. - * @param newKey - The new key value to be used. - */ - update(newName, newKey) { - if (!newName || !newKey) { - throw new TypeError("newName and newKey must be non-empty strings"); - } - this._name = newName; - this._key = newKey; - } -} +const POLL_INTERVAL_IN_MS = 2000; /** - * Tests an object to determine whether it implements NamedKeyCredential. - * - * @param credential - The assumed NamedKeyCredential to be tested. + * The closed set of terminal states. */ -function isNamedKeyCredential(credential) { - return (coreUtil.isObjectWithProperties(credential, ["name", "key"]) && - typeof credential.key === "string" && - typeof credential.name === "string"); -} +const terminalStates = ["succeeded", "canceled", "failed"]; // Copyright (c) Microsoft Corporation. /** - * A static-signature-based credential that supports updating - * the underlying signature value. + * Deserializes the state */ -class AzureSASCredential { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; - } - /** - * Create an instance of an AzureSASCredential for use - * with a service client. - * - * @param signature - The initial value of the shared access signature to use in authentication - */ - constructor(signature) { - if (!signature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = signature; +function deserializeState(serializedState) { + try { + return JSON.parse(serializedState).state; } - /** - * Change the value of the signature. - * - * Updates will take effect upon the next request after - * updating the signature value. - * - * @param newSignature - The new shared access signature value to be used - */ - update(newSignature) { - if (!newSignature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = newSignature; + catch (e) { + throw new Error(`Unable to deserialize input state: ${serializedState}`); } } -/** - * Tests an object to determine whether it implements SASCredential. - * - * @param credential - The assumed SASCredential to be tested. - */ -function isSASCredential(credential) { - return (coreUtil.isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Tests an object to determine whether it implements TokenCredential. - * - * @param credential - The assumed TokenCredential to be tested. - */ -function isTokenCredential(credential) { - // Check for an object with a 'getToken' function and possibly with - // a 'signRequest' function. We do this check to make sure that - // a ServiceClientCredentials implementor (like TokenClientCredentials - // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if - // it doesn't actually implement TokenCredential also. - const castCredential = credential; - return (castCredential && - typeof castCredential.getToken === "function" && - (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); +function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error) => { + if (isOperationError(error)) { + stateProxy.setError(state, error); + stateProxy.setFailed(state); + } + throw error; + }; } - -exports.AzureKeyCredential = AzureKeyCredential; -exports.AzureNamedKeyCredential = AzureNamedKeyCredential; -exports.AzureSASCredential = AzureSASCredential; -exports.isNamedKeyCredential = isNamedKeyCredential; -exports.isSASCredential = isSASCredential; -exports.isTokenCredential = isTokenCredential; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 89283: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var uuid = __nccwpck_require__(12048); -var util = __nccwpck_require__(39023); -var tslib = __nccwpck_require__(61860); -var xml2js = __nccwpck_require__(758); -var coreUtil = __nccwpck_require__(58735); -var logger$1 = __nccwpck_require__(54505); -var coreAuth = __nccwpck_require__(73905); -var os = __nccwpck_require__(70857); -var http = __nccwpck_require__(58611); -var https = __nccwpck_require__(65692); -var abortController = __nccwpck_require__(68110); -var tunnel = __nccwpck_require__(20770); -var stream = __nccwpck_require__(2203); -var FormData = __nccwpck_require__(96454); -var node_fetch = __nccwpck_require__(26705); -var coreTracing = __nccwpck_require__(15553); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); +function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; } - n["default"] = e; - return Object.freeze(n); + return message + " " + innerMessage; } - -var xml2js__namespace = /*#__PURE__*/_interopNamespace(xml2js); -var os__namespace = /*#__PURE__*/_interopNamespace(os); -var http__namespace = /*#__PURE__*/_interopNamespace(http); -var https__namespace = /*#__PURE__*/_interopNamespace(https); -var tunnel__namespace = /*#__PURE__*/_interopNamespace(tunnel); -var FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData); -var node_fetch__default = /*#__PURE__*/_interopDefaultLegacy(node_fetch); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A collection of HttpHeaders that can be sent with a HTTP request. - */ -function getHeaderKey(headerName) { - return headerName.toLowerCase(); -} -function isHttpHeadersLike(object) { - if (object && typeof object === "object") { - const castObject = object; - if (typeof castObject.rawHeaders === "function" && - typeof castObject.clone === "function" && - typeof castObject.get === "function" && - typeof castObject.set === "function" && - typeof castObject.contains === "function" && - typeof castObject.remove === "function" && - typeof castObject.headersArray === "function" && - typeof castObject.headerValues === "function" && - typeof castObject.headerNames === "function" && - typeof castObject.toJson === "function") { - return true; - } +function simplifyError(err) { + let message = err.message; + let code = err.code; + let curErr = err; + while (curErr.innererror) { + curErr = curErr.innererror; + code = curErr.code; + message = appendReadableErrorMessage(message, curErr.message); } - return false; + return { + code, + message, + }; } -/** - * A collection of HTTP header key/value pairs. - */ -class HttpHeaders { - constructor(rawHeaders) { - this._headersMap = {}; - if (rawHeaders) { - for (const headerName in rawHeaders) { - this.set(headerName, rawHeaders[headerName]); - } +function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; } - } - /** - * Set a header in this collection with the provided name and value. The name is - * case-insensitive. - * @param headerName - The name of the header to set. This value is case-insensitive. - * @param headerValue - The value of the header to set. - */ - set(headerName, headerValue) { - this._headersMap[getHeaderKey(headerName)] = { - name: headerName, - value: headerValue.toString().trim(), - }; - } - /** - * Get the header value for the provided header name, or undefined if no header exists in this - * collection with the provided name. - * @param headerName - The name of the header. - */ - get(headerName) { - const header = this._headersMap[getHeaderKey(headerName)]; - return !header ? undefined : header.value; - } - /** - * Get whether or not this header collection contains a header entry for the provided header name. - */ - contains(headerName) { - return !!this._headersMap[getHeaderKey(headerName)]; - } - /** - * Remove the header with the provided headerName. Return whether or not the header existed and - * was removed. - * @param headerName - The name of the header to remove. - */ - remove(headerName) { - const result = this.contains(headerName); - delete this._headersMap[getHeaderKey(headerName)]; - return result; - } - /** - * Get the headers that are contained this collection as an object. - */ - rawHeaders() { - return this.toJson({ preserveCase: true }); - } - /** - * Get the headers that are contained in this collection as an array. - */ - headersArray() { - const headers = []; - for (const headerKey in this._headersMap) { - headers.push(this._headersMap[headerKey]); + case "failed": { + const err = getError === null || getError === void 0 ? void 0 : getError(response); + let postfix = ""; + if (err) { + const { code, message } = simplifyError(err); + postfix = `. ${code}. ${message}`; + } + const errStr = `The long-running operation has failed${postfix}`; + stateProxy.setError(state, new Error(errStr)); + stateProxy.setFailed(state); + logger.warning(errStr); + break; } - return headers; - } - /** - * Get the header names that are contained in this collection. - */ - headerNames() { - const headerNames = []; - const headers = this.headersArray(); - for (let i = 0; i < headers.length; ++i) { - headerNames.push(headers[i].name); + case "canceled": { + stateProxy.setCanceled(state); + break; } - return headerNames; } - /** - * Get the header values that are contained in this collection. - */ - headerValues() { - const headerValues = []; - const headers = this.headersArray(); - for (let i = 0; i < headers.length; ++i) { - headerValues.push(headers[i].value); - } - return headerValues; + if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || + (isDone === undefined && + ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) { + stateProxy.setResult(state, buildResult({ + response, + state, + processResult, + })); } - /** - * Get the JSON object representation of this HTTP header collection. - */ - toJson(options = {}) { - const result = {}; - if (options.preserveCase) { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[header.name] = header.value; - } - } - else { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[getHeaderKey(header.name)] = header.value; - } +} +function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; +} +/** + * Initiates the long-running operation. + */ +async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + if (operationLocation) + withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); + const config = { + metadata, + operationLocation, + resourceLocation, + }; + logger.verbose(`LRO: Operation description:`, config); + const state = stateProxy.initState(config); + const status = getOperationStatus({ response, state, operationLocation }); + processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); + return state; +} +async function pollOperationHelper(inputs) { + const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs; + const response = await poll(operationLocation, options).catch(setStateError({ + state, + stateProxy, + isOperationError, + })); + const status = getOperationStatus(response, state); + logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); + if (status === "succeeded") { + const resourceLocation = getResourceLocation(response, state); + if (resourceLocation !== undefined) { + return { + response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), + status, + }; } - return result; } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJson({ preserveCase: true })); - } - /** - * Create a deep clone/copy of this HttpHeaders collection. - */ - clone() { - const resultPreservingCasing = {}; - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - resultPreservingCasing[header.name] = header.value; + return { response, status }; +} +/** Polls the long-running operation. */ +async function pollOperation(inputs) { + const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs; + const { operationLocation } = state.config; + if (operationLocation !== undefined) { + const { response, status } = await pollOperationHelper({ + poll, + getOperationStatus, + state, + stateProxy, + operationLocation, + getResourceLocation, + isOperationError, + options, + }); + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult, + }); + if (!terminalStates.includes(status)) { + const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); + if (intervalInMs) + setDelay(intervalInMs); + const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state); + if (location !== undefined) { + const isUpdated = operationLocation !== location; + state.config.operationLocation = location; + withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated); + } + else + withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); } - return new HttpHeaders(resultPreservingCasing); + updateState === null || updateState === void 0 ? void 0 : updateState(state, response); } } // Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Encodes a string in base64 format. - * @param value - The string to encode - */ -function encodeString(value) { - return Buffer.from(value).toString("base64"); +function getOperationLocationPollingUrl(inputs) { + const { azureAsyncOperation, operationLocation } = inputs; + return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; } -/** - * Encodes a byte array in base64 format. - * @param value - The Uint8Aray to encode - */ -function encodeByteArray(value) { - // Buffer.from accepts | -- the TypeScript definition is off here - // https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); +function getLocationHeader(rawResponse) { + return rawResponse.headers["location"]; } -/** - * Decodes a base64 string into a byte array. - * @param value - The base64 string to decode - */ -function decodeString(value) { - return Buffer.from(value, "base64"); +function getOperationLocationHeader(rawResponse) { + return rawResponse.headers["operation-location"]; } - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A set of constants used internally when processing requests. - */ -const Constants = { - /** - * The core-http version - */ - coreHttpVersion: "3.0.4", - /** - * Specifies HTTP. - */ - HTTP: "http:", - /** - * Specifies HTTPS. - */ - HTTPS: "https:", - /** - * Specifies HTTP Proxy. - */ - HTTP_PROXY: "HTTP_PROXY", - /** - * Specifies HTTPS Proxy. - */ - HTTPS_PROXY: "HTTPS_PROXY", - /** - * Specifies NO Proxy. - */ - NO_PROXY: "NO_PROXY", - /** - * Specifies ALL Proxy. - */ - ALL_PROXY: "ALL_PROXY", - HttpConstants: { - /** - * Http Verbs - */ - HttpVerbs: { - PUT: "PUT", - GET: "GET", - DELETE: "DELETE", - POST: "POST", - MERGE: "MERGE", - HEAD: "HEAD", - PATCH: "PATCH", - }, - StatusCodes: { - TooManyRequests: 429, - ServiceUnavailable: 503, - }, - }, - /** - * Defines constants for use with HTTP headers. - */ - HeaderConstants: { - /** - * The Authorization header. - */ - AUTHORIZATION: "authorization", - AUTHORIZATION_SCHEME: "Bearer", - /** - * The Retry-After response-header field can be used with a 503 (Service - * Unavailable) or 349 (Too Many Requests) responses to indicate how long - * the service is expected to be unavailable to the requesting client. - */ - RETRY_AFTER: "Retry-After", - /** - * The UserAgent header. - */ - USER_AGENT: "User-Agent", - }, -}; - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Default key used to access the XML attributes. - */ -const XML_ATTRKEY = "$"; -/** - * Default key used to access the XML value content. - */ -const XML_CHARKEY = "_"; - -// Copyright (c) Microsoft Corporation. -const validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i; -/** - * Encodes an URI. - * - * @param uri - The URI to be encoded. - * @returns The encoded URI. - */ -function encodeUri(uri) { - return encodeURIComponent(uri) - .replace(/!/g, "%21") - .replace(/"/g, "%27") - .replace(/\(/g, "%28") - .replace(/\)/g, "%29") - .replace(/\*/g, "%2A"); +function getAzureAsyncOperationHeader(rawResponse) { + return rawResponse.headers["azure-asyncoperation"]; } -/** - * Returns a stripped version of the Http Response which only contains body, - * headers and the status. - * - * @param response - The Http Response - * @returns The stripped version of Http Response. - */ -function stripResponse(response) { - const strippedResponse = {}; - strippedResponse.body = response.bodyAsText; - strippedResponse.headers = response.headers; - strippedResponse.status = response.status; - return strippedResponse; +function findResourceLocation(inputs) { + var _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return undefined; + } + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); + } + } + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return undefined; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } + } + } } -/** - * Returns a stripped version of the Http Request that does not contain the - * Authorization header. - * - * @param request - The Http Request object - * @returns The stripped version of Http Request. - */ -function stripRequest(request) { - const strippedRequest = request.clone(); - if (strippedRequest.headers) { - strippedRequest.headers.remove("authorization"); +function inferLroMode(inputs) { + const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; + const operationLocation = getOperationLocationHeader(rawResponse); + const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); + const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); + const location = getLocationHeader(rawResponse); + const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase(); + if (pollingUrl !== undefined) { + return { + mode: "OperationLocation", + operationLocation: pollingUrl, + resourceLocation: findResourceLocation({ + requestMethod: normalizedRequestMethod, + location, + requestPath, + resourceLocationConfig, + }), + }; + } + else if (location !== undefined) { + return { + mode: "ResourceLocation", + operationLocation: location, + }; + } + else if (normalizedRequestMethod === "PUT" && requestPath) { + return { + mode: "Body", + operationLocation: requestPath, + }; + } + else { + return undefined; } - return strippedRequest; } -/** - * Validates the given uuid as a string - * - * @param uuid - The uuid as a string that needs to be validated - * @returns True if the uuid is valid; false otherwise. - */ -function isValidUuid(uuid) { - return validUuidRegex.test(uuid); +function transformStatus(inputs) { + const { status, statusCode } = inputs; + if (typeof status !== "string" && status !== undefined) { + throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); + } + switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) { + case undefined: + return toOperationStatus(statusCode); + case "succeeded": + return "succeeded"; + case "failed": + return "failed"; + case "running": + case "accepted": + case "started": + case "canceling": + case "cancelling": + return "running"; + case "canceled": + case "cancelled": + return "canceled"; + default: { + logger.verbose(`LRO: unrecognized operation status: ${status}`); + return status; + } + } } -/** - * Generated UUID - * - * @returns RFC4122 v4 UUID. - */ -function generateUuid() { - return uuid.v4(); +function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); } -/** - * Executes an array of promises sequentially. Inspiration of this method is here: - * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises! - * - * @param promiseFactories - An array of promise factories(A function that return a promise) - * @param kickstart - Input to the first promise that is used to kickstart the promise chain. - * If not provided then the promise chain starts with undefined. - * @returns A chain of resolved or rejected promises - */ -function executePromisesSequentially(promiseFactories, kickstart) { - let result = Promise.resolve(kickstart); - promiseFactories.forEach((promiseFactory) => { - result = result.then(promiseFactory); - }); - return result; +function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; + return transformStatus({ status, statusCode: rawResponse.statusCode }); } -/** - * Converts a Promise to a callback. - * @param promise - The Promise to be converted to a callback - * @returns A function that takes the callback `(cb: Function) => void` - * @deprecated generated code should instead depend on responseToBody - */ -// eslint-disable-next-line @typescript-eslint/ban-types -function promiseToCallback(promise) { - if (typeof promise.then !== "function") { - throw new Error("The provided input is not a Promise."); +function toOperationStatus(statusCode) { + if (statusCode === 202) { + return "running"; + } + else if (statusCode < 300) { + return "succeeded"; + } + else { + return "failed"; } - // eslint-disable-next-line @typescript-eslint/ban-types - return (cb) => { - promise - .then((data) => { - // eslint-disable-next-line promise/no-callback-in-promise - return cb(undefined, data); - }) - .catch((err) => { - // eslint-disable-next-line promise/no-callback-in-promise - cb(err); - }); - }; } -/** - * Converts a Promise to a service callback. - * @param promise - The Promise of HttpOperationResponse to be converted to a service callback - * @returns A function that takes the service callback (cb: ServiceCallback): void - */ -function promiseToServiceCallback(promise) { - if (typeof promise.then !== "function") { - throw new Error("The provided input is not a Promise."); +function parseRetryAfter({ rawResponse }) { + const retryAfter = rawResponse.headers["retry-after"]; + if (retryAfter !== undefined) { + // Retry-After header value is either in HTTP date format, or in seconds + const retryAfterInSeconds = parseInt(retryAfter); + return isNaN(retryAfterInSeconds) + ? calculatePollingIntervalFromDate(new Date(retryAfter)) + : retryAfterInSeconds * 1000; } - return (cb) => { - promise - .then((data) => { - return process.nextTick(cb, undefined, data.parsedBody, data.request, data); - }) - .catch((err) => { - process.nextTick(cb, err); - }); - }; + return undefined; } -function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; +function getErrorFromResponse(response) { + const error = response.flatResponse.error; + if (!error) { + logger.warning(`The long-running operation failed but there is no error property in the response's body`); + return; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (!error.code || !error.message) { + logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); + return; } - const result = { [elementName]: obj }; - result[XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace }; - return result; + return error; } -/** - * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor - * @param targetCtor - The target object on which the properties need to be applied. - * @param sourceCtors - An array of source objects from which the properties need to be taken. - */ -function applyMixins(targetCtorParam, sourceCtors) { - const castTargetCtorParam = targetCtorParam; - sourceCtors.forEach((sourceCtor) => { - Object.getOwnPropertyNames(sourceCtor.prototype).forEach((name) => { - castTargetCtorParam.prototype[name] = sourceCtor.prototype[name]; - }); - }); +function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor(new Date().getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; + } + return undefined; } -const validateISODuration = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; -/** - * Indicates whether the given string is in ISO 8601 format. - * @param value - The value to be validated for ISO 8601 duration format. - * @returns `true` if valid, `false` otherwise. - */ -function isDuration(value) { - return validateISODuration.test(value); +function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case undefined: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } + } + const status = helper(); + return status === "running" && operationLocation === undefined ? "succeeded" : status; } /** - * Replace all of the instances of searchValue in value with the provided replaceValue. - * @param value - The value to search and replace in. - * @param searchValue - The value to search for in the value argument. - * @param replaceValue - The value to replace searchValue with in the value argument. - * @returns The value where each instance of searchValue was replaced with replacedValue. + * Initiates the long-running operation. */ -function replaceAll(value, searchValue, replaceValue) { - return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); +async function initHttpOperation(inputs) { + const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; + return initOperation({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); + }, + stateProxy, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + getOperationStatus: getStatusFromInitialResponse, + setErrorAsResult, + }); } -/** - * Determines whether the given entity is a basic/primitive type - * (string, number, boolean, null, undefined). - * @param value - Any entity - * @returns true is it is primitive type, false otherwise. - */ -function isPrimitiveType(value) { - return (typeof value !== "object" && typeof value !== "function") || value === null; +function getOperationLocation({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse), + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return undefined; + } + } } -function getEnvironmentValue(name) { - if (process.env[name]) { - return process.env[name]; +function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); + } + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); + } + case "Body": { + return getProvisioningState(rawResponse); + } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); } - else if (process.env[name.toLowerCase()]) { - return process.env[name.toLowerCase()]; +} +function getResourceLocation({ flatResponse }, state) { + if (typeof flatResponse === "object") { + const resourceLocation = flatResponse.resourceLocation; + if (resourceLocation !== undefined) { + state.config.resourceLocation = resourceLocation; + } } - return undefined; + return state.config.resourceLocation; } -/** - * @internal - * @returns true when input is an object type that is not null, Array, RegExp, or Date. - */ -function isObject(input) { - return (typeof input === "object" && - input !== null && - !Array.isArray(input) && - !(input instanceof RegExp) && - !(input instanceof Date)); +function isOperationError(e) { + return e.name === "RestError"; +} +/** Polls the long-running operation. */ +async function pollHttpOperation(inputs) { + const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs; + return pollOperation({ + state, + stateProxy, + setDelay, + processResult: processResult + ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) + : ({ flatResponse }) => flatResponse, + getError: getErrorFromResponse, + updateState, + getPollingInterval: parseRetryAfter, + getOperationLocation, + getOperationStatus, + isOperationError, + getResourceLocation, + options, + /** + * The expansion here is intentional because `lro` could be an object that + * references an inner this, so we need to preserve a reference to it. + */ + poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), + setErrorAsResult, + }); } // Copyright (c) Microsoft Corporation. -// This file contains utility code to serialize and deserialize network operations according to `OperationSpec` objects generated by AutoRest.TypeScript from OpenAPI specifications. -/** - * Used to map raw response objects to final shapes. - * Helps packing and unpacking Dates and other encoded types that are not intrinsic to JSON. - * Also allows pulling values from headers, as well as inserting default values and constants. - */ -class Serializer { - constructor( - /** - * The provided model mapper. - */ - modelMappers = {}, - /** - * Whether the contents are XML or not. - */ - isXML) { - this.modelMappers = modelMappers; - this.isXML = isXML; - } +const createStateProxy$1 = () => ({ /** - * Validates constraints, if any. This function will throw if the provided value does not respect those constraints. - * @param mapper - The definition of data models. - * @param value - The value. - * @param objectName - Name of the object. Used in the error messages. - * @deprecated Removing the constraints validation on client side. + * The state at this point is created to be of type OperationState. + * It will be updated later to be of type TState when the + * customer-provided callback, `updateState`, is called during polling. */ - validateConstraints(mapper, value, objectName) { - const failValidation = (constraintName, constraintValue) => { - throw new Error(`"${objectName}" with value "${value}" should satisfy the constraint "${constraintName}": ${constraintValue}.`); - }; - if (mapper.constraints && value != undefined) { - const valueAsNumber = value; - const { ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems, } = mapper.constraints; - if (ExclusiveMaximum != undefined && valueAsNumber >= ExclusiveMaximum) { - failValidation("ExclusiveMaximum", ExclusiveMaximum); - } - if (ExclusiveMinimum != undefined && valueAsNumber <= ExclusiveMinimum) { - failValidation("ExclusiveMinimum", ExclusiveMinimum); - } - if (InclusiveMaximum != undefined && valueAsNumber > InclusiveMaximum) { - failValidation("InclusiveMaximum", InclusiveMaximum); - } - if (InclusiveMinimum != undefined && valueAsNumber < InclusiveMinimum) { - failValidation("InclusiveMinimum", InclusiveMinimum); - } - const valueAsArray = value; - if (MaxItems != undefined && valueAsArray.length > MaxItems) { - failValidation("MaxItems", MaxItems); - } - if (MaxLength != undefined && valueAsArray.length > MaxLength) { - failValidation("MaxLength", MaxLength); - } - if (MinItems != undefined && valueAsArray.length < MinItems) { - failValidation("MinItems", MinItems); - } - if (MinLength != undefined && valueAsArray.length < MinLength) { - failValidation("MinLength", MinLength); - } - if (MultipleOf != undefined && valueAsNumber % MultipleOf !== 0) { - failValidation("MultipleOf", MultipleOf); - } - if (Pattern) { - const pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; - if (typeof value !== "string" || value.match(pattern) === null) { - failValidation("Pattern", Pattern); - } - } - if (UniqueItems && - valueAsArray.some((item, i, ar) => ar.indexOf(item) !== i)) { - failValidation("UniqueItems", UniqueItems); - } - } - } - /** - * Serialize the given object based on its metadata defined in the mapper. - * - * @param mapper - The mapper which defines the metadata of the serializable object. - * @param object - A valid Javascript object to be serialized. - * @param objectName - Name of the serialized object. - * @param options - additional options to deserialization. - * @returns A valid serialized Javascript object. - */ - serialize(mapper, object, objectName, options = {}) { - var _a, _b, _c; - const updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY, - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; - } - if (mapper.isConstant) { - object = mapper.defaultValue; - } - // This table of allowed values should help explain - // the mapper.required and mapper.nullable properties. - // X means "neither undefined or null are allowed". - // || required - // || true | false - // nullable || ========================== - // true || null | undefined/null - // false || X | undefined - // undefined || X | undefined/null - const { required, nullable } = mapper; - if (required && nullable && object === undefined) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && object == undefined) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); - } - if (object == undefined) { - payload = object; - } - else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } - else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } - else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } - else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } - else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } - else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } - else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } - else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } - else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } - } - return payload; - } - /** - * Deserialize the given object based on its metadata defined in the mapper. - * - * @param mapper - The mapper which defines the metadata of the serializable object. - * @param responseBody - A valid Javascript entity to be deserialized. - * @param objectName - Name of the deserialized object. - * @param options - Controls behavior of XML parser and builder. - * @returns A valid deserialized Javascript object. - */ - deserialize(mapper, responseBody, objectName, options = {}) { - var _a, _b, _c; - const updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY, - }; - if (responseBody == undefined) { - if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { - // Edge case for empty XML non-wrapped lists. xml2js can't distinguish - // between the list being empty versus being missing, - // so let's do the more user-friendly thing and return an empty list. - responseBody = []; - } - // specifically check for undefined as default value can be a falsey value `0, "", false, null` - if (mapper.defaultValue !== undefined) { - responseBody = mapper.defaultValue; - } - return responseBody; - } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Composite$/i) !== null) { - payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); - } - else { - if (this.isXML) { - const xmlCharKey = updatedOptions.xmlCharKey; - const castResponseBody = responseBody; - /** - * If the mapper specifies this as a non-composite type value but the responseBody contains - * both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties, - * then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property. - */ - if (castResponseBody[XML_ATTRKEY] != undefined && - castResponseBody[xmlCharKey] != undefined) { - responseBody = castResponseBody[xmlCharKey]; + initState: (config) => ({ status: "running", config }), + setCanceled: (state) => (state.status = "canceled"), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.status = "running"), + setSucceeded: (state) => (state.status = "succeeded"), + setFailed: (state) => (state.status = "failed"), + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => state.status === "canceled", + isFailed: (state) => state.status === "failed", + isRunning: (state) => state.status === "running", + isSucceeded: (state) => state.status === "succeeded", +}); +/** + * Returns a poller factory. + */ +function buildCreatePoller(inputs) { + const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs; + return async ({ init, poll }, options) => { + const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; + const stateProxy = createStateProxy$1(); + const withOperationLocation = withOperationLocationCallback + ? (() => { + let called = false; + return (operationLocation, isUpdated) => { + if (isUpdated) + withOperationLocationCallback(operationLocation); + else if (!called) + withOperationLocationCallback(operationLocation); + called = true; + }; + })() + : undefined; + const state = restoreFrom + ? deserializeState(restoreFrom) + : await initOperation({ + init, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful, + }); + let resultPromise; + const abortController$1 = new abortController.AbortController(); + const handlers = new Map(); + const handleProgressEvents = async () => handlers.forEach((h) => h(state)); + const cancelErrMsg = "Operation was canceled"; + let currentPollIntervalInMs = intervalInMs; + const poller = { + getOperationState: () => state, + getResult: () => state.result, + isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), + isStopped: () => resultPromise === undefined, + stopPolling: () => { + abortController$1.abort(); + }, + toString: () => JSON.stringify({ + state, + }), + onProgress: (callback) => { + const s = Symbol(); + handlers.set(s, callback); + return () => handlers.delete(s); + }, + pollUntilDone: (pollOptions) => (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => { + const { abortSignal: inputAbortSignal } = pollOptions || {}; + const { signal: abortSignal } = inputAbortSignal + ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) + : abortController$1; + if (!poller.isDone()) { + await poller.poll({ abortSignal }); + while (!poller.isDone()) { + await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); + await poller.poll({ abortSignal }); + } } - } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + if (resolveOnUnsuccessful) { + return poller.getResult(); } - } - else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; + else { + switch (state.status) { + case "succeeded": + return poller.getResult(); + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + case "notStarted": + case "running": + throw new Error(`Polling completed without succeeding or failing`); + } } - else if (responseBody === "false") { - payload = false; + })().finally(() => { + resultPromise = undefined; + }))), + async poll(pollOptions) { + if (resolveOnUnsuccessful) { + if (poller.isDone()) + return; } else { - payload = responseBody; + switch (state.status) { + case "succeeded": + return; + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } } - } - else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { - payload = responseBody; - } - else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { - payload = new Date(responseBody); - } - else if (mapperType.match(/^UnixTime$/i) !== null) { - payload = unixTimeToDate(responseBody); - } - else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = decodeString(responseBody); - } - else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = base64UrlToByteArray(responseBody); - } - else if (mapperType.match(/^Sequence$/i) !== null) { - payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); - } - else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); - } - } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } -} -function trimEnd(str, ch) { - let len = str.length; - while (len - 1 >= 0 && str[len - 1] === ch) { - --len; - } - return str.substr(0, len); + await pollOperation({ + poll, + state, + stateProxy, + getOperationLocation, + isOperationError, + withOperationLocation, + getPollingInterval, + getOperationStatus: getStatusFromPollResponse, + getResourceLocation, + processResult, + getError, + updateState, + options: pollOptions, + setDelay: (pollIntervalInMs) => { + currentPollIntervalInMs = pollIntervalInMs; + }, + setErrorAsResult: !resolveOnUnsuccessful, + }); + await handleProgressEvents(); + if (!resolveOnUnsuccessful) { + switch (state.status) { + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + }, + }; + return poller; + }; } -function bufferToBase64Url(buffer) { - if (!buffer) { - return undefined; - } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); - } - // Uint8Array to Base64. - const str = encodeByteArray(buffer); - // Base64 to Base64Url. - return trimEnd(str, "=").replace(/\+/g, "-").replace(/\//g, "_"); + +// Copyright (c) Microsoft Corporation. +/** + * Creates a poller that can be used to poll a long-running operation. + * @param lro - Description of the long-running operation + * @param options - options to configure the poller + * @returns an initialized poller + */ +async function createHttpPoller(lro, options) { + const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {}; + return buildCreatePoller({ + getStatusFromInitialResponse, + getStatusFromPollResponse: getOperationStatus, + isOperationError, + getOperationLocation, + getResourceLocation, + getPollingInterval: parseRetryAfter, + getError: getErrorFromResponse, + resolveOnUnsuccessful, + })({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); + }, + poll: lro.sendPollRequest, + }, { + intervalInMs, + withOperationLocation, + restoreFrom, + updateState, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + }); } -function base64UrlToByteArray(str) { - if (!str) { - return undefined; + +// Copyright (c) Microsoft Corporation. +const createStateProxy = () => ({ + initState: (config) => ({ config, isStarted: true }), + setCanceled: (state) => (state.isCancelled = true), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.isStarted = true), + setSucceeded: (state) => (state.isCompleted = true), + setFailed: () => { + /** empty body */ + }, + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => !!state.isCancelled, + isFailed: (state) => !!state.error, + isRunning: (state) => !!state.isStarted, + isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), +}); +class GenericPollOperation { + constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { + this.state = state; + this.lro = lro; + this.setErrorAsResult = setErrorAsResult; + this.lroResourceLocationConfig = lroResourceLocationConfig; + this.processResult = processResult; + this.updateState = updateState; + this.isDone = isDone; } - if (str && typeof str.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - // Base64Url to Base64. - str = str.replace(/-/g, "+").replace(/_/g, "/"); - // Base64 to Uint8Array. - return decodeString(str); -} -function splitSerializeName(prop) { - const classes = []; - let partialclass = ""; - if (prop) { - const subwords = prop.split("."); - for (const item of subwords) { - if (item.charAt(item.length - 1) === "\\") { - partialclass += item.substr(0, item.length - 1) + "."; - } - else { - partialclass += item; - classes.push(partialclass); - partialclass = ""; - } + async update(options) { + var _a; + const stateProxy = createStateProxy(); + if (!this.state.isStarted) { + this.state = Object.assign(Object.assign({}, this.state), (await initHttpOperation({ + lro: this.lro, + stateProxy, + resourceLocationConfig: this.lroResourceLocationConfig, + processResult: this.processResult, + setErrorAsResult: this.setErrorAsResult, + }))); } + const updateState = this.updateState; + const isDone = this.isDone; + if (!this.state.isCompleted && this.state.error === undefined) { + await pollHttpOperation({ + lro: this.lro, + state: this.state, + stateProxy, + processResult: this.processResult, + updateState: updateState + ? (state, { rawResponse }) => updateState(state, rawResponse) + : undefined, + isDone: isDone + ? ({ flatResponse }, state) => isDone(flatResponse, state) + : undefined, + options, + setDelay: (intervalInMs) => { + this.pollerConfig.intervalInMs = intervalInMs; + }, + setErrorAsResult: this.setErrorAsResult, + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - return classes; -} -function dateToUnixTime(d) { - if (!d) { - return undefined; + async cancel() { + logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } - if (typeof d.valueOf() === "string") { - d = new Date(d); + /** + * Serializes the Poller operation. + */ + toString() { + return JSON.stringify({ + state: this.state, + }); } - return Math.floor(d.getTime() / 1000); } -function unixTimeToDate(n) { - if (!n) { - return undefined; + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * When a poller is manually stopped through the `stopPolling` method, + * the poller will be rejected with an instance of the PollerStoppedError. + */ +class PollerStoppedError extends Error { + constructor(message) { + super(message); + this.name = "PollerStoppedError"; + Object.setPrototypeOf(this, PollerStoppedError.prototype); } - return new Date(n * 1000); } -function serializeBasicTypes(typeName, objectName, value) { - if (value !== null && value !== undefined) { - if (typeName.match(/^Number$/i) !== null) { - if (typeof value !== "number") { - throw new Error(`${objectName} with value ${value} must be of type number.`); - } - } - else if (typeName.match(/^String$/i) !== null) { - if (typeof value.valueOf() !== "string") { - throw new Error(`${objectName} with value "${value}" must be of type string.`); - } - } - else if (typeName.match(/^Uuid$/i) !== null) { - if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { - throw new Error(`${objectName} with value "${value}" must be of type string and a valid uuid.`); - } - } - else if (typeName.match(/^Boolean$/i) !== null) { - if (typeof value !== "boolean") { - throw new Error(`${objectName} with value ${value} must be of type boolean.`); - } - } - else if (typeName.match(/^Stream$/i) !== null) { - const objectType = typeof value; - if (objectType !== "string" && - objectType !== "function" && - !(value instanceof ArrayBuffer) && - !ArrayBuffer.isView(value) && - !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { - throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`); - } - } +/** + * When the operation is cancelled, the poller will be rejected with an instance + * of the PollerCancelledError. + */ +class PollerCancelledError extends Error { + constructor(message) { + super(message); + this.name = "PollerCancelledError"; + Object.setPrototypeOf(this, PollerCancelledError.prototype); } - return value; } -function serializeEnumType(objectName, allowedValues, value) { - if (!allowedValues) { - throw new Error(`Please provide a set of allowedValues to validate ${objectName} as an Enum Type.`); +/** + * A class that represents the definition of a program that polls through consecutive requests + * until it reaches a state of completion. + * + * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed. + * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes. + * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation. + * + * ```ts + * const poller = new MyPoller(); + * + * // Polling just once: + * await poller.poll(); + * + * // We can try to cancel the request here, by calling: + * // + * // await poller.cancelOperation(); + * // + * + * // Getting the final result: + * const result = await poller.pollUntilDone(); + * ``` + * + * The Poller is defined by two types, a type representing the state of the poller, which + * must include a basic set of properties from `PollOperationState`, + * and a return type defined by `TResult`, which can be anything. + * + * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having + * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type. + * + * ```ts + * class Client { + * public async makePoller: PollerLike { + * const poller = new MyPoller({}); + * // It might be preferred to return the poller after the first request is made, + * // so that some information can be obtained right away. + * await poller.poll(); + * return poller; + * } + * } + * + * const poller: PollerLike = myClient.makePoller(); + * ``` + * + * A poller can be created through its constructor, then it can be polled until it's completed. + * At any point in time, the state of the poller can be obtained without delay through the getOperationState method. + * At any point in time, the intermediate forms of the result type can be requested without delay. + * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned. + * + * ```ts + * const poller = myClient.makePoller(); + * const state: MyOperationState = poller.getOperationState(); + * + * // The intermediate result can be obtained at any time. + * const result: MyResult | undefined = poller.getResult(); + * + * // The final result can only be obtained after the poller finishes. + * const result: MyResult = await poller.pollUntilDone(); + * ``` + * + */ +// eslint-disable-next-line no-use-before-define +class Poller { + /** + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. + * + * When writing an implementation of a Poller, this implementation needs to deal with the initialization + * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's + * operation has already been defined, at least its basic properties. The code below shows how to approach + * the definition of the constructor of a new custom poller. + * + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; + * + * const operation = { + * state, + * update, + * cancel, + * toString + * } + * + * // Sending the operation to the parent's constructor. + * super(operation); + * + * // You can assign more local properties here. + * } + * } + * ``` + * + * Inside of this constructor, a new promise is created. This will be used to + * tell the user when the poller finishes (see `pollUntilDone()`). The promise's + * resolve and reject methods are also used internally to control when to resolve + * or reject anyone waiting for the poller to finish. + * + * The constructor of a custom implementation of a poller is where any serialized version of + * a previous poller's operation should be deserialized into the operation sent to the + * base constructor. For example: + * + * ```ts + * export class MyPoller extends Poller { + * constructor( + * baseOperation: string | undefined + * ) { + * let state: MyOperationState = {}; + * if (baseOperation) { + * state = { + * ...JSON.parse(baseOperation).state, + * ...state + * }; + * } + * const operation = { + * state, + * // ... + * } + * super(operation); + * } + * } + * ``` + * + * @param operation - Must contain the basic properties of `PollOperation`. + */ + constructor(operation) { + /** controls whether to throw an error if the operation failed or was canceled. */ + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown. + // The above warning would get thrown if `poller.poll` is called, it returns an error, + // and pullUntilDone did not have a .catch or await try/catch on it's return value. + this.promise.catch(() => { + /* intentionally blank */ + }); } - const isPresent = allowedValues.some((item) => { - if (typeof item.valueOf() === "string") { - return item.toLowerCase() === value.toLowerCase(); + /** + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. + */ + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); } - return item === value; - }); - if (!isPresent) { - throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); } - return value; -} -function serializeByteArrayType(objectName, value) { - let returnValue = ""; - if (value != undefined) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); + /** + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this), + }); } - returnValue = encodeByteArray(value); + this.processUpdatedState(); } - return returnValue; -} -function serializeBase64UrlType(objectName, value) { - let returnValue = ""; - if (value != undefined) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); + /** + * fireProgress calls the functions passed in via onProgress the method of the poller. + * + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. + * + * @param state - The current operation state. + */ + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); } - returnValue = bufferToBase64Url(value) || ""; } - return returnValue; -} -function serializeDateTypes(typeName, value, objectName) { - if (value != undefined) { - if (typeName.match(/^Date$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); - } - value = - value instanceof Date - ? value.toISOString().substring(0, 10) - : new Date(value).toISOString().substring(0, 10); + /** + * Invokes the underlying operation's cancel method. + */ + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); + } + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + poll(options = {}) { + if (!this.pollOncePromise) { + this.pollOncePromise = this.pollOnce(options); + const clearPollOncePromise = () => { + this.pollOncePromise = undefined; + }; + this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); } - else if (typeName.match(/^DateTime$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`); + return this.pollOncePromise; + } + processUpdatedState() { + if (this.operation.state.error) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + this.reject(this.operation.state.error); + throw this.operation.state.error; } - value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); } - else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123 format.`); + if (this.operation.state.isCancelled) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + const error = new PollerCancelledError("Operation was canceled"); + this.reject(error); + throw error; } - value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); } - else if (typeName.match(/^UnixTime$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123/ISO8601 format ` + - `for it to be serialized in UnixTime/Epoch format.`); - } - value = dateToUnixTime(value); + if (this.isDone() && this.resolve) { + // If the poller has finished polling, this means we now have a result. + // However, it can be the case that TResult is instantiated to void, so + // we are not expecting a result anyway. To assert that we might not + // have a result eventually after finishing polling, we cast the result + // to TResult. + this.resolve(this.getResult()); } - else if (typeName.match(/^TimeSpan$/i) !== null) { - if (!isDuration(value)) { - throw new Error(`${objectName} must be a string in ISO 8601 format. Instead was "${value}".`); - } + } + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); } + // This is needed because the state could have been updated by + // `cancelOperation`, e.g. the operation is canceled or an error occurred. + this.processUpdatedState(); + return this.promise; } - return value; -} -function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } - const elementType = mapper.type.element; - if (!elementType || typeof elementType !== "object") { - throw new Error(`element" metadata for an Array must be defined in the ` + - `mapper and it must of type "object" in ${objectName}.`); + /** + * Returns true if the poller has finished polling. + */ + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix - ? `xmlns:${elementType.xmlNamespacePrefix}` - : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; - } - else { - tempArray[i] = {}; - tempArray[i][options.xmlCharKey] = serializedValue; - tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + /** + * Stops the poller from continuing to poll. + */ + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); } } - else { - tempArray[i] = serializedValue; - } } - return tempArray; -} -function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + /** + * Returns true if the poller is stopped. + */ + isStopped() { + return this.stopped; } - const valueType = mapper.type.value; - if (!valueType || typeof valueType !== "object") { - throw new Error(`"value" metadata for a Dictionary must be defined in the ` + - `mapper and it must of type "object" in ${objectName}.`); + /** + * Attempts to cancel the underlying operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * If it's called again before it finishes, it will throw an error. + * + * @param options - Optional properties passed to the operation's update method. + */ + cancelOperation(options = {}) { + if (!this.cancelPromise) { + this.cancelPromise = this.cancelOnce(options); + } + else if (options.abortSignal) { + throw new Error("A cancel request is currently pending"); + } + return this.cancelPromise; } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - // If the element needs an XML namespace we need to add it within the $ property - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + /** + * Returns the state of the operation. + * + * Even though TState will be the same type inside any of the methods of any extension of the Poller class, + * implementations of the pollers can customize what's shared with the public by writing their own + * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller + * and a public type representing a safe to share subset of the properties of the internal state. + * Their definition of getOperationState can then return their public type. + * + * Example: + * + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } + * + * // To allow us to have a true separation of public and private state, we have to define another interface: + * interface PublicState extends PollOperationState { + * publicProperty?: string; + * } + * + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... + * + * public getOperationState(): PublicState { + * const state: PublicState = this.operation.state; + * return { + * // Properties from PollOperationState + * isStarted: state.isStarted, + * isCompleted: state.isCompleted, + * isCancelled: state.isCancelled, + * error: state.error, + * result: state.result, + * + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` + * + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. + */ + getOperationState() { + return this.operation.state; } - // Add the namespace to the root element if needed - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - const result = tempDictionary; - result[XML_ATTRKEY] = { [xmlnsKey]: mapper.xmlNamespace }; - return result; + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult() { + const state = this.operation.state; + return state.result; } - return tempDictionary; -} -/** - * Resolves the additionalProperties property from a referenced mapper. - * @param serializer - The serializer containing the entire set of mappers. - * @param mapper - The composite mapper to resolve. - * @param objectName - Name of the object being serialized. - */ -function resolveAdditionalProperties(serializer, mapper, objectName) { - const additionalProperties = mapper.type.additionalProperties; - if (!additionalProperties && mapper.type.className) { - const modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + /** + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. + */ + toString() { + return this.operation.toString(); } - return additionalProperties; } + +// Copyright (c) Microsoft Corporation. /** - * Finds the mapper referenced by `className`. - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve - * @param objectName - Name of the object being serialized + * The LRO Engine, a class that performs polling. */ -function resolveReferencedMapper(serializer, mapper, objectName) { - const className = mapper.type.className; - if (!className) { - throw new Error(`Class name for model "${objectName}" is not provided in the mapper "${JSON.stringify(mapper, undefined, 2)}".`); +class LroEngine extends Poller { + constructor(lro, options) { + const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {}; + const state = resumeFrom + ? deserializeState(resumeFrom) + : {}; + const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); + super(operation); + this.resolveOnUnsuccessful = resolveOnUnsuccessful; + this.config = { intervalInMs: intervalInMs }; + operation.setPollerConfig(this.config); } - return serializer.modelMappers[className]; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); + } +} + +exports.LroEngine = LroEngine; +exports.Poller = Poller; +exports.PollerCancelledError = PollerCancelledError; +exports.PollerStoppedError = PollerStoppedError; +exports.createHttpPoller = createHttpPoller; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 77864: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const REGEX_IS_INSTALLATION_LEGACY = /^v1\./; +const REGEX_IS_INSTALLATION = /^ghs_/; +const REGEX_IS_USER_TO_SERVER = /^ghu_/; +async function auth(token) { + const isApp = token.split(/\./).length === 3; + const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); + const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); + const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; + return { + type: "token", + token: token, + tokenType + }; } + /** - * Resolves a composite mapper's modelProperties. - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve + * Prefix token for usage in the Authorization header + * + * @param token OAuth token or JSON Web Token */ -function resolveModelProperties(serializer, mapper, objectName) { - let modelProps = mapper.type.modelProperties; - if (!modelProps) { - const modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - if (!modelMapper) { - throw new Error(`mapper() cannot be null or undefined for model "${mapper.type.className}".`); - } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; - if (!modelProps) { - throw new Error(`modelProperties cannot be null or undefined in the ` + - `mapper "${JSON.stringify(modelMapper)}" of type "${mapper.type.className}" for object "${objectName}".`); - } - } - return modelProps; +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } + + return `token ${token}`; } -function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); - } - if (object != undefined) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; - } - let propName; - let parentObject = payload; - if (serializer.isXML) { - if (propertyMapper.xmlIsWrapped) { - propName = propertyMapper.xmlName; - } - else { - propName = propertyMapper.xmlElementName || propertyMapper.xmlName; - } - } - else { - const paths = splitSerializeName(propertyMapper.serializedName); - propName = paths.pop(); - for (const pathName of paths) { - const childObject = parentObject[pathName]; - if (childObject == undefined && - (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } - } - if (parentObject != undefined) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix - ? `xmlns:${mapper.xmlNamespacePrefix}` - : "xmlns"; - parentObject[XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" - ? objectName + "." + propertyMapper.serializedName - : objectName; - let toSerialize = object[key]; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator && - polymorphicDiscriminator.clientName === key && - toSerialize == undefined) { - toSerialize = mapper.serializedName; - } - const serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options); - if (serializedValue !== undefined && propName != undefined) { - const value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); - if (isXml && propertyMapper.xmlIsAttribute) { - // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js. - // This keeps things simple while preventing name collision - // with names in user documents. - parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; - parentObject[XML_ATTRKEY][propName] = serializedValue; - } - else if (isXml && propertyMapper.xmlIsWrapped) { - parentObject[propName] = { [propertyMapper.xmlElementName]: value }; - } - else { - parentObject[propName] = value; - } - } - } - } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } - } - } - return payload; - } - return object; + +async function hook(token, request, route, parameters) { + const endpoint = request.endpoint.merge(route, parameters); + endpoint.headers.authorization = withAuthorizationPrefix(token); + return request(endpoint); } -function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; - } - const xmlnsKey = propertyMapper.xmlNamespacePrefix - ? `xmlns:${propertyMapper.xmlNamespacePrefix}` - : "xmlns"; - const xmlNamespace = { [xmlnsKey]: propertyMapper.xmlNamespace }; - if (["Composite"].includes(propertyMapper.type.name)) { - if (serializedValue[XML_ATTRKEY]) { - return serializedValue; - } - else { - const result = Object.assign({}, serializedValue); - result[XML_ATTRKEY] = xmlNamespace; - return result; - } - } - const result = {}; - result[options.xmlCharKey] = serializedValue; - result[XML_ATTRKEY] = xmlNamespace; - return result; + +const createTokenAuth = function createTokenAuth(token) { + if (!token) { + throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); + } + + if (typeof token !== "string") { + throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); + } + + token = token.replace(/^(token|bearer) +/i, ""); + return Object.assign(auth.bind(null, token), { + hook: hook.bind(null, token) + }); +}; + +exports.createTokenAuth = createTokenAuth; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 61897: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var universalUserAgent = __nccwpck_require__(33843); +var beforeAfterHook = __nccwpck_require__(52732); +var request = __nccwpck_require__(66255); +var graphql = __nccwpck_require__(70007); +var authToken = __nccwpck_require__(77864); + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; } -function isSpecialXmlProperty(propertyName, options) { - return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); + +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; } -function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + +const VERSION = "3.6.0"; + +const _excluded = ["authStrategy"]; +class Octokit { + constructor(options = {}) { + const hook = new beforeAfterHook.Collection(); + const requestDefaults = { + baseUrl: request.request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type + hook: hook.bind(null, "request") + }), + mediaType: { + previews: [], + format: "" + } + }; // prepend default user agent with `options.userAgent` if set + + requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); + + if (options.baseUrl) { + requestDefaults.baseUrl = options.baseUrl; } - const modelProps = resolveModelProperties(serializer, mapper, objectName); - let instance = {}; - const handledPropertyNames = []; - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - const paths = splitSerializeName(modelProps[key].serializedName); - handledPropertyNames.push(paths[0]); - const { serializedName, xmlName, xmlElementName } = propertyMapper; - let propertyObjectName = objectName; - if (serializedName !== "" && serializedName !== undefined) { - propertyObjectName = objectName + "." + serializedName; - } - const headerCollectionPrefix = propertyMapper.headerCollectionPrefix; - if (headerCollectionPrefix) { - const dictionary = {}; - for (const headerKey of Object.keys(responseBody)) { - if (headerKey.startsWith(headerCollectionPrefix)) { - dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); - } - handledPropertyNames.push(headerKey); - } - instance[key] = dictionary; - } - else if (serializer.isXML) { - if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { - instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); - } - else if (propertyMapper.xmlIsMsText) { - if (responseBody[xmlCharKey] !== undefined) { - instance[key] = responseBody[xmlCharKey]; - } - else if (typeof responseBody === "string") { - // The special case where xml parser parses "content" into JSON of - // `{ name: "content"}` instead of `{ name: { "_": "content" }}` - instance[key] = responseBody; - } - } - else { - const propertyName = xmlElementName || xmlName || serializedName; - if (propertyMapper.xmlIsWrapped) { - /* a list of wrapped by - For the xml example below - - ... - ... - - the responseBody has - { - Cors: { - CorsRule: [{...}, {...}] - } - } - xmlName is "Cors" and xmlElementName is"CorsRule". - */ - const wrapped = responseBody[xmlName]; - const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); - handledPropertyNames.push(xmlName); - } - else { - const property = responseBody[propertyName]; - instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); - handledPropertyNames.push(propertyName); - } - } - } - else { - // deserialize the property if it is present in the provided responseBody instance - let propertyInstance; - let res = responseBody; - // traversing the object step by step. - for (const item of paths) { - if (!res) - break; - res = res[item]; - } - propertyInstance = res; - const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; - // checking that the model property name (key)(ex: "fishtype") and the - // clientName of the polymorphicDiscriminator {metadata} (ex: "fishtype") - // instead of the serializedName of the polymorphicDiscriminator (ex: "fish.type") - // is a better approach. The generator is not consistent with escaping '\.' in the - // serializedName of the property (ex: "fish\.type") that is marked as polymorphic discriminator - // and the serializedName of the metadata polymorphicDiscriminator (ex: "fish.type"). However, - // the clientName transformation of the polymorphicDiscriminator (ex: "fishtype") and - // the transformation of model property name (ex: "fishtype") is done consistently. - // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator. - if (polymorphicDiscriminator && - key === polymorphicDiscriminator.clientName && - propertyInstance == undefined) { - propertyInstance = mapper.serializedName; - } - let serializedValue; - // paging - if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { - propertyInstance = responseBody[key]; - const arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - // Copy over any properties that have already been added into the instance, where they do - // not exist on the newly de-serialized array - for (const [k, v] of Object.entries(instance)) { - if (!Object.prototype.hasOwnProperty.call(arrayInstance, k)) { - arrayInstance[k] = v; - } - } - instance = arrayInstance; - } - else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) { - serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - instance[key] = serializedValue; - } - } + + if (options.previews) { + requestDefaults.mediaType.previews = options.previews; } - const additionalPropertiesMapper = mapper.type.additionalProperties; - if (additionalPropertiesMapper) { - const isAdditionalProperty = (responsePropName) => { - for (const clientPropName in modelProps) { - const paths = splitSerializeName(modelProps[clientPropName].serializedName); - if (paths[0] === responsePropName) { - return false; - } - } - return true; - }; - for (const responsePropName in responseBody) { - if (isAdditionalProperty(responsePropName)) { - instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); - } - } + + if (options.timeZone) { + requestDefaults.headers["time-zone"] = options.timeZone; } - else if (responseBody) { - for (const key of Object.keys(responseBody)) { - if (instance[key] === undefined && - !handledPropertyNames.includes(key) && - !isSpecialXmlProperty(key, options)) { - instance[key] = responseBody[key]; - } + + this.request = request.request.defaults(requestDefaults); + this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); + this.log = Object.assign({ + debug: () => {}, + info: () => {}, + warn: console.warn.bind(console), + error: console.error.bind(console) + }, options.log); + this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance + // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. + // (2) If only `options.auth` is set, use the default token authentication strategy. + // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. + // TODO: type `options.auth` based on `options.authStrategy`. + + if (!options.authStrategy) { + if (!options.auth) { + // (1) + this.auth = async () => ({ + type: "unauthenticated" + }); + } else { + // (2) + const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; + } + } else { + const { + authStrategy + } = options, + otherOptions = _objectWithoutProperties(options, _excluded); + + const auth = authStrategy(Object.assign({ + request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions + }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; + } // apply plugins + // https://stackoverflow.com/a/16345172 + + + const classConstructor = this.constructor; + classConstructor.plugins.forEach(plugin => { + Object.assign(this, plugin(this, options)); + }); + } + + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; + + if (typeof defaults === "function") { + super(defaults(options)); + return; } - } - return instance; + + super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { + userAgent: `${options.userAgent} ${defaults.userAgent}` + } : null)); + } + + }; + return OctokitWithDefaults; + } + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ + + + static plugin(...newPlugins) { + var _a; + + const currentPlugins = this.plugins; + const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); + return NewOctokit; + } + } -function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) { - const value = mapper.type.value; - if (!value || typeof value !== "object") { - throw new Error(`"value" metadata for a Dictionary must be defined in the ` + - `mapper and it must of type "object" in ${objectName}`); - } - if (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; - } - return responseBody; +Octokit.VERSION = VERSION; +Octokit.plugins = []; + +exports.Octokit = Octokit; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 54471: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var isPlainObject = __nccwpck_require__(93407); +var universalUserAgent = __nccwpck_require__(33843); + +function lowercaseKeys(object) { + if (!object) { + return {}; + } + + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); } -function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - const element = mapper.type.element; - if (!element || typeof element !== "object") { - throw new Error(`element" metadata for an Array must be defined in the ` + - `mapper and it must of type "object" in ${objectName}`); + +function mergeDeep(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach(key => { + if (isPlainObject.isPlainObject(options[key])) { + if (!(key in defaults)) Object.assign(result, { + [key]: options[key] + });else result[key] = mergeDeep(defaults[key], options[key]); + } else { + Object.assign(result, { + [key]: options[key] + }); } - if (responseBody) { - if (!Array.isArray(responseBody)) { - // xml2js will interpret a single element array as just the element, so force it to be an array - responseBody = [responseBody]; - } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); - } - return tempArray; + }); + return result; +} + +function removeUndefinedProperties(obj) { + for (const key in obj) { + if (obj[key] === undefined) { + delete obj[key]; } - return responseBody; + } + + return obj; } -function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - const discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName != undefined) { - const discriminatorValue = object[discriminatorName]; - if (discriminatorValue != undefined) { - const typeName = mapper.type.uberParent || mapper.type.className; - const indexDiscriminator = discriminatorValue === typeName - ? discriminatorValue - : typeName + "." + discriminatorValue; - const polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator]; - if (polymorphicMapper) { - mapper = polymorphicMapper; - } - } - } + +function merge(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { + method, + url + } : { + url: method + }, options); + } else { + options = Object.assign({}, route); + } // lowercase header names before merging with defaults to avoid duplicates + + + options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging + + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten + + if (defaults && defaults.mediaType.previews.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); + } + + mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); + return mergedOptions; +} + +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + + if (names.length === 0) { + return url; + } + + return url + separator + names.map(name => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); } - return mapper; + + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); } -function getPolymorphicDiscriminatorRecursively(serializer, mapper) { - return (mapper.type.polymorphicDiscriminator || - getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || - getPolymorphicDiscriminatorSafely(serializer, mapper.type.className)); + +const urlVariableRegex = /\{[^}]+\}/g; + +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); } -function getPolymorphicDiscriminatorSafely(serializer, typeName) { - return (typeName && - serializer.modelMappers[typeName] && - serializer.modelMappers[typeName].type.polymorphicDiscriminator); + +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + + if (!matches) { + return []; + } + + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); } -/** - * Utility function that serializes an object that might contain binary information into a plain object, array or a string. - */ -function serializeObject(toSerialize) { - const castToSerialize = toSerialize; - if (toSerialize == undefined) - return undefined; - if (toSerialize instanceof Uint8Array) { - toSerialize = encodeByteArray(toSerialize); - return toSerialize; - } - else if (toSerialize instanceof Date) { - return toSerialize.toISOString(); - } - else if (Array.isArray(toSerialize)) { - const array = []; - for (let i = 0; i < toSerialize.length; i++) { - array.push(serializeObject(toSerialize[i])); - } - return array; - } - else if (typeof toSerialize === "object") { - const dictionary = {}; - for (const property in toSerialize) { - dictionary[property] = serializeObject(castToSerialize[property]); - } - return dictionary; - } - return toSerialize; + +function omit(object, keysToOmit) { + return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { + obj[key] = object[key]; + return obj; + }, {}); } -/** - * Utility function to create a K:V from a list of strings - */ -function strEnum(o) { - const result = {}; - for (const key of o) { - result[key] = key; + +// Based on https://github.com/bramstein/url-template, licensed under BSD +// TODO: create separate package. +// +// Copyright (c) 2012-2014, Bram Stein +// All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* istanbul ignore file */ +function encodeReserved(str) { + return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { + if (!/%[0-9A-Fa-f]/.test(part)) { + part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); } - return result; + + return part; + }).join(""); } -/** - * String enum containing the string types of property mappers. - */ -// eslint-disable-next-line @typescript-eslint/no-redeclare -const MapperType = strEnum([ - "Base64Url", - "Boolean", - "ByteArray", - "Composite", - "Date", - "DateTime", - "DateTimeRfc1123", - "Dictionary", - "Enum", - "Number", - "Object", - "Sequence", - "String", - "Stream", - "TimeSpan", - "UnixTime", -]); -// Copyright (c) Microsoft Corporation. -function isWebResourceLike(object) { - if (object && typeof object === "object") { - const castObject = object; - if (typeof castObject.url === "string" && - typeof castObject.method === "string" && - typeof castObject.headers === "object" && - isHttpHeadersLike(castObject.headers) && - typeof castObject.validateRequestProperties === "function" && - typeof castObject.prepare === "function" && - typeof castObject.clone === "function") { - return true; - } - } - return false; +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); } -/** - * Creates a new WebResource object. - * - * This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary - * properties to initiate a request. - */ -class WebResource { - constructor(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { - this.streamResponseBody = streamResponseBody; - this.streamResponseStatusCodes = streamResponseStatusCodes; - this.url = url || ""; - this.method = method || "GET"; - this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); - this.body = body; - this.query = query; - this.formData = undefined; - this.withCredentials = withCredentials || false; - this.abortSignal = abortSignal; - this.timeout = timeout || 0; - this.onUploadProgress = onUploadProgress; - this.onDownloadProgress = onDownloadProgress; - this.proxySettings = proxySettings; - this.keepAlive = keepAlive; - this.decompressResponse = decompressResponse; - this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); - } - /** - * Validates that the required properties such as method, url, headers["Content-Type"], - * headers["accept-language"] are defined. It will throw an error if one of the above - * mentioned properties are not defined. - */ - validateRequestProperties() { - if (!this.method) { - throw new Error("WebResource.method is required."); - } - if (!this.url) { - throw new Error("WebResource.url is required."); - } - } - /** - * Prepares the request. - * @param options - Options to provide for preparing the request. - * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. - */ - prepare(options) { - if (!options) { - throw new Error("options object is required"); - } - if (options.method === undefined || - options.method === null || - typeof options.method.valueOf() !== "string") { - throw new Error("options.method must be a string."); - } - if (options.url && options.pathTemplate) { - throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); - } - if ((options.pathTemplate === undefined || - options.pathTemplate === null || - typeof options.pathTemplate.valueOf() !== "string") && - (options.url === undefined || - options.url === null || - typeof options.url.valueOf() !== "string")) { - throw new Error("Please provide exactly one of options.pathTemplate or options.url."); - } - // set the url if it is provided. - if (options.url) { - if (typeof options.url !== "string") { - throw new Error('options.url must be of type "string".'); - } - this.url = options.url; - } - // set the method - if (options.method) { - const validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; - if (validMethods.indexOf(options.method.toUpperCase()) === -1) { - throw new Error('The provided method "' + - options.method + - '" is invalid. Supported HTTP methods are: ' + - JSON.stringify(validMethods)); - } - } - this.method = options.method.toUpperCase(); - // construct the url if path template is provided - if (options.pathTemplate) { - const { pathTemplate, pathParameters } = options; - if (typeof pathTemplate !== "string") { - throw new Error('options.pathTemplate must be of type "string".'); - } - if (!options.baseUrl) { - options.baseUrl = "https://management.azure.com"; - } - const baseUrl = options.baseUrl; - let url = baseUrl + - (baseUrl.endsWith("/") ? "" : "/") + - (pathTemplate.startsWith("/") ? pathTemplate.slice(1) : pathTemplate); - const segments = url.match(/({[\w-]*\s*[\w-]*})/gi); - if (segments && segments.length) { - if (!pathParameters) { - throw new Error(`pathTemplate: ${pathTemplate} has been provided. Hence, options.pathParameters must also be provided.`); - } - segments.forEach(function (item) { - const pathParamName = item.slice(1, -1); - const pathParam = pathParameters[pathParamName]; - if (pathParam === null || - pathParam === undefined || - !(typeof pathParam === "string" || typeof pathParam === "object")) { - const stringifiedPathParameters = JSON.stringify(pathParameters, undefined, 2); - throw new Error(`pathTemplate: ${pathTemplate} contains the path parameter ${pathParamName}` + - ` however, it is not present in parameters: ${stringifiedPathParameters}.` + - `The value of the path parameter can either be a "string" of the form { ${pathParamName}: "some sample value" } or ` + - `it can be an "object" of the form { "${pathParamName}": { value: "some sample value", skipUrlEncoding: true } }.`); - } - if (typeof pathParam.valueOf() === "string") { - url = url.replace(item, encodeURIComponent(pathParam)); - } - if (typeof pathParam.valueOf() === "object") { - if (!pathParam.value) { - throw new Error(`options.pathParameters[${pathParamName}] is of type "object" but it does not contain a "value" property.`); - } - if (pathParam.skipUrlEncoding) { - url = url.replace(item, pathParam.value); - } - else { - url = url.replace(item, encodeURIComponent(pathParam.value)); - } - } - }); - } - this.url = url; - } - // append query parameters to the url if they are provided. They can be provided with pathTemplate or url option. - if (options.queryParameters) { - const queryParameters = options.queryParameters; - if (typeof queryParameters !== "object") { - throw new Error(`options.queryParameters must be of type object. It should be a JSON object ` + - `of "query-parameter-name" as the key and the "query-parameter-value" as the value. ` + - `The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.`); - } - // append question mark if it is not present in the url - if (this.url && this.url.indexOf("?") === -1) { - this.url += "?"; - } - // construct queryString - const queryParams = []; - // We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest(). - this.query = {}; - for (const queryParamName in queryParameters) { - const queryParam = queryParameters[queryParamName]; - if (queryParam) { - if (typeof queryParam === "string") { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); - this.query[queryParamName] = encodeURIComponent(queryParam); - } - else if (typeof queryParam === "object") { - if (!queryParam.value) { - throw new Error(`options.queryParameters[${queryParamName}] is of type "object" but it does not contain a "value" property.`); - } - if (queryParam.skipUrlEncoding) { - queryParams.push(queryParamName + "=" + queryParam.value); - this.query[queryParamName] = queryParam.value; - } - else { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); - this.query[queryParamName] = encodeURIComponent(queryParam.value); - } - } - } - } // end-of-for - // append the queryString - this.url += queryParams.join("&"); - } - // add headers to the request if they are provided - if (options.headers) { - const headers = options.headers; - for (const headerName of Object.keys(options.headers)) { - this.headers.set(headerName, headers[headerName]); - } - } - // ensure accept-language is set correctly - if (!this.headers.get("accept-language")) { - this.headers.set("accept-language", "en-US"); - } - // ensure the request-id is set correctly - if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { - this.headers.set("x-ms-client-request-id", this.requestId); - } - // default - if (!this.headers.get("Content-Type")) { - this.headers.set("Content-Type", "application/json; charset=utf-8"); - } - // set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly - this.body = options.body; - if (options.body !== undefined && options.body !== null) { - // body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream. - if (options.bodyIsStream) { - if (!this.headers.get("Transfer-Encoding")) { - this.headers.set("Transfer-Encoding", "chunked"); - } - if (this.headers.get("Content-Type") !== "application/octet-stream") { - this.headers.set("Content-Type", "application/octet-stream"); - } - } - else { - if (options.serializationMapper) { - this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); - } - if (!options.disableJsonStringifyOnBody) { - this.body = JSON.stringify(options.body); - } - } - } - if (options.spanOptions) { - this.spanOptions = options.spanOptions; - } - if (options.tracingContext) { - this.tracingContext = options.tracingContext; - } - this.abortSignal = options.abortSignal; - this.onDownloadProgress = options.onDownloadProgress; - this.onUploadProgress = options.onUploadProgress; - return this; - } - /** - * Clone this WebResource HTTP request object. - * @returns The clone of this WebResource HTTP request object. - */ - clone() { - const result = new WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes); - if (this.formData) { - result.formData = this.formData; - } - if (this.operationSpec) { - result.operationSpec = this.operationSpec; - } - if (this.shouldDeserialize) { - result.shouldDeserialize = this.shouldDeserialize; - } - if (this.operationResponseGetter) { - result.operationResponseGetter = this.operationResponseGetter; - } - return result; - } + +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); + + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; + } } -// Copyright (c) Microsoft Corporation. -/** - * A class that handles the query portion of a URLBuilder. - */ -class URLQuery { - constructor() { - this._rawQuery = {}; - } - /** - * Get whether or not there any query parameters in this URLQuery. - */ - any() { - return Object.keys(this._rawQuery).length > 0; - } - /** - * Get the keys of the query string. - */ - keys() { - return Object.keys(this._rawQuery); - } - /** - * Set a query parameter with the provided name and value. If the parameterValue is undefined or - * empty, then this will attempt to remove an existing query parameter with the provided - * parameterName. - */ - set(parameterName, parameterValue) { - const caseParameterValue = parameterValue; - if (parameterName) { - if (caseParameterValue !== undefined && caseParameterValue !== null) { - const newValue = Array.isArray(caseParameterValue) - ? caseParameterValue - : caseParameterValue.toString(); - this._rawQuery[parameterName] = newValue; - } - else { - delete this._rawQuery[parameterName]; - } - } - } - /** - * Get the value of the query parameter with the provided name. If no parameter exists with the - * provided parameter name, then undefined will be returned. - */ - get(parameterName) { - return parameterName ? this._rawQuery[parameterName] : undefined; - } - /** - * Get the string representation of this query. The return value will not start with a "?". - */ - toString() { - let result = ""; - for (const parameterName in this._rawQuery) { - if (result) { - result += "&"; - } - const parameterValue = this._rawQuery[parameterName]; - if (Array.isArray(parameterValue)) { - const parameterStrings = []; - for (const parameterValueElement of parameterValue) { - parameterStrings.push(`${parameterName}=${parameterValueElement}`); - } - result += parameterStrings.join("&"); - } - else { - result += `${parameterName}=${parameterValue}`; - } - } - return result; - } - /** - * Parse a URLQuery from the provided text. - */ - static parse(text) { - const result = new URLQuery(); - if (text) { - if (text.startsWith("?")) { - text = text.substring(1); - } - let currentState = "ParameterName"; - let parameterName = ""; - let parameterValue = ""; - for (let i = 0; i < text.length; ++i) { - const currentCharacter = text[i]; - switch (currentState) { - case "ParameterName": - switch (currentCharacter) { - case "=": - currentState = "ParameterValue"; - break; - case "&": - parameterName = ""; - parameterValue = ""; - break; - default: - parameterName += currentCharacter; - break; - } - break; - case "ParameterValue": - switch (currentCharacter) { - case "&": - result.set(parameterName, parameterValue); - parameterName = ""; - parameterValue = ""; - currentState = "ParameterName"; - break; - default: - parameterValue += currentCharacter; - break; - } - break; - default: - throw new Error("Unrecognized URLQuery parse state: " + currentState); - } - } - if (currentState === "ParameterValue") { - result.set(parameterName, parameterValue); - } - } - return result; - } +function isDefined(value) { + return value !== undefined && value !== null; } -/** - * A class that handles creating, modifying, and parsing URLs. - */ -class URLBuilder { - /** - * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL - * (such as a host, port, path, or query), those parts will be added to this URL as well. - */ - setScheme(scheme) { - if (!scheme) { - this._scheme = undefined; - } - else { - this.set(scheme, "SCHEME"); - } - } - /** - * Get the scheme that has been set in this URL. - */ - getScheme() { - return this._scheme; - } - /** - * Set the host for this URL. If the provided host contains other parts of a URL (such as a - * port, path, or query), those parts will be added to this URL as well. - */ - setHost(host) { - if (!host) { - this._host = undefined; - } - else { - this.set(host, "SCHEME_OR_HOST"); - } - } - /** - * Get the host that has been set in this URL. - */ - getHost() { - return this._host; - } - /** - * Set the port for this URL. If the provided port contains other parts of a URL (such as a - * path or query), those parts will be added to this URL as well. - */ - setPort(port) { - if (port === undefined || port === null || port === "") { - this._port = undefined; - } - else { - this.set(port.toString(), "PORT"); - } - } - /** - * Get the port that has been set in this URL. - */ - getPort() { - return this._port; - } - /** - * Set the path for this URL. If the provided path contains a query, then it will be added to - * this URL as well. - */ - setPath(path) { - if (!path) { - this._path = undefined; - } - else { - const schemeIndex = path.indexOf("://"); - if (schemeIndex !== -1) { - const schemeStart = path.lastIndexOf("/", schemeIndex); - // Make sure to only grab the URL part of the path before setting the state back to SCHEME - // this will handle cases such as "/a/b/c/https://microsoft.com" => "https://microsoft.com" - this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), "SCHEME"); - } - else { - this.set(path, "PATH"); - } - } - } - /** - * Append the provided path to this URL's existing path. If the provided path contains a query, - * then it will be added to this URL as well. - */ - appendPath(path) { - if (path) { - let currentPath = this.getPath(); - if (currentPath) { - if (!currentPath.endsWith("/")) { - currentPath += "/"; - } - if (path.startsWith("/")) { - path = path.substring(1); - } - path = currentPath + path; + +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} + +function getValues(context, operator, key, modifier) { + var value = context[key], + result = []; + + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); + + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); + } + + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + result.push(encodeValue(operator, value[k], k)); } - this.set(path, "PATH"); - } - } - /** - * Get the path that has been set in this URL. - */ - getPath() { - return this._path; - } - /** - * Set the query in this URL. - */ - setQuery(query) { - if (!query) { - this._query = undefined; - } - else { - this._query = URLQuery.parse(query); + }); } - } - /** - * Set a query parameter with the provided name and value in this URL's query. If the provided - * query parameter value is undefined or empty, then the query parameter will be removed if it - * existed. - */ - setQueryParameter(queryParameterName, queryParameterValue) { - if (queryParameterName) { - if (!this._query) { - this._query = new URLQuery(); + } else { + const tmp = []; + + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + tmp.push(encodeValue(operator, value)); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + tmp.push(encodeUnreserved(k)); + tmp.push(encodeValue(operator, value[k].toString())); } - this._query.set(queryParameterName, queryParameterValue); + }); } - } - /** - * Get the value of the query parameter with the provided query parameter name. If no query - * parameter exists with the provided name, then undefined will be returned. - */ - getQueryParameterValue(queryParameterName) { - return this._query ? this._query.get(queryParameterName) : undefined; - } - /** - * Get the query in this URL. - */ - getQuery() { - return this._query ? this._query.toString() : undefined; - } - /** - * Set the parts of this URL by parsing the provided text using the provided startState. - */ - set(text, startState) { - const tokenizer = new URLTokenizer(text, startState); - while (tokenizer.next()) { - const token = tokenizer.current(); - let tokenPath; - if (token) { - switch (token.type) { - case "SCHEME": - this._scheme = token.text || undefined; - break; - case "HOST": - this._host = token.text || undefined; - break; - case "PORT": - this._port = token.text || undefined; - break; - case "PATH": - tokenPath = token.text || undefined; - if (!this._path || this._path === "/" || tokenPath !== "/") { - this._path = tokenPath; - } - break; - case "QUERY": - this._query = URLQuery.parse(token.text); - break; - default: - throw new Error(`Unrecognized URLTokenType: ${token.type}`); - } - } + + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); } + } } - /** - * Serializes the URL as a string. - * @returns the URL as a string. - */ - toString() { - let result = ""; - if (this._scheme) { - result += `${this._scheme}://`; - } - if (this._host) { - result += this._host; - } - if (this._port) { - result += `:${this._port}`; - } - if (this._path) { - if (!this._path.startsWith("/")) { - result += "/"; - } - result += this._path; - } - if (this._query && this._query.any()) { - result += `?${this._query.toString()}`; - } - return result; + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); + } + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); } - /** - * If the provided searchValue is found in this URLBuilder, then replace it with the provided - * replaceValue. - */ - replaceAll(searchValue, replaceValue) { - if (searchValue) { - this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); - this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); - this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); - this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); - this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); + } + + return result; +} + +function parseUrl(template) { + return { + expand: expand.bind(null, template) + }; +} + +function expand(template, context) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; + + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); + } + + expression.split(/,/g).forEach(function (variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); + + if (operator && operator !== "+") { + var separator = ","; + + if (operator === "?") { + separator = "&"; + } else if (operator !== "#") { + separator = operator; } + + return (values.length !== 0 ? operator : "") + values.join(separator); + } else { + return values.join(","); + } + } else { + return encodeReserved(literal); } - /** - * Parses a given string URL into a new {@link URLBuilder}. - */ - static parse(text) { - const result = new URLBuilder(); - result.set(text, "SCHEME_OR_HOST"); - return result; - } + }); } -class URLToken { - constructor(text, type) { - this.text = text; - this.type = type; - } - static scheme(text) { - return new URLToken(text, "SCHEME"); - } - static host(text) { - return new URLToken(text, "HOST"); - } - static port(text) { - return new URLToken(text, "PORT"); + +function parse(options) { + // https://fetch.spec.whatwg.org/#methods + let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible + + let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); + let headers = Object.assign({}, options.headers); + let body; + let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later + + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + + if (!/^http/.test(url)) { + url = options.baseUrl + url; + } + + const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); + + if (!isBinaryRequest) { + if (options.mediaType.format) { + // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw + headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); } - static path(text) { - return new URLToken(text, "PATH"); + + if (options.mediaType.previews.length) { + const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; + headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { + const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format}`; + }).join(","); } - static query(text) { - return new URLToken(text, "QUERY"); + } // for GET/HEAD requests, set URL query parameters from remaining parameters + // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters + + + if (["GET", "HEAD"].includes(method)) { + url = addQueryParameters(url, remainingParameters); + } else { + if ("data" in remainingParameters) { + body = remainingParameters.data; + } else { + if (Object.keys(remainingParameters).length) { + body = remainingParameters; + } else { + headers["content-length"] = 0; + } } + } // default content-type for JSON if body is set + + + if (!headers["content-type"] && typeof body !== "undefined") { + headers["content-type"] = "application/json; charset=utf-8"; + } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. + // fetch does not allow to set `content-length` header, but we can set body to an empty string + + + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } // Only return body/request keys if present + + + return Object.assign({ + method, + url, + headers + }, typeof body !== "undefined" ? { + body + } : null, options.request ? { + request: options.request + } : null); } -/** - * Get whether or not the provided character (single character string) is an alphanumeric (letter or - * digit) character. - */ -function isAlphaNumericCharacter(character) { - const characterCode = character.charCodeAt(0); - return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ || - (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ || - (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */); + +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); } -/** - * A class that tokenizes URL strings. - */ -class URLTokenizer { - constructor(_text, state) { - this._text = _text; - this._textLength = _text ? _text.length : 0; - this._currentState = state !== undefined && state !== null ? state : "SCHEME_OR_HOST"; - this._currentIndex = 0; - } - /** - * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer - * hasn't started or has finished tokenizing. - */ - current() { - return this._currentToken; - } - /** - * Advance to the next URLToken and return whether or not a URLToken was found. - */ - next() { - if (!hasCurrentCharacter(this)) { - this._currentToken = undefined; - } - else { - switch (this._currentState) { - case "SCHEME": - nextScheme(this); - break; - case "SCHEME_OR_HOST": - nextSchemeOrHost(this); - break; - case "HOST": - nextHost(this); - break; - case "PORT": - nextPort(this); - break; - case "PATH": - nextPath(this); - break; - case "QUERY": - nextQuery(this); - break; - default: - throw new Error(`Unrecognized URLTokenizerState: ${this._currentState}`); - } - } - return !!this._currentToken; - } -} -/** - * Read the remaining characters from this Tokenizer's character stream. - */ -function readRemaining(tokenizer) { - let result = ""; - if (tokenizer._currentIndex < tokenizer._textLength) { - result = tokenizer._text.substring(tokenizer._currentIndex); - tokenizer._currentIndex = tokenizer._textLength; - } - return result; -} -/** - * Whether or not this URLTokenizer has a current character. - */ -function hasCurrentCharacter(tokenizer) { - return tokenizer._currentIndex < tokenizer._textLength; -} -/** - * Get the character in the text string at the current index. - */ -function getCurrentCharacter(tokenizer) { - return tokenizer._text[tokenizer._currentIndex]; -} -/** - * Advance to the character in text that is "step" characters ahead. If no step value is provided, - * then step will default to 1. - */ -function nextCharacter(tokenizer, step) { - if (hasCurrentCharacter(tokenizer)) { - if (!step) { - step = 1; - } - tokenizer._currentIndex += step; - } -} -/** - * Starting with the current character, peek "charactersToPeek" number of characters ahead in this - * Tokenizer's stream of characters. - */ -function peekCharacters(tokenizer, charactersToPeek) { - let endIndex = tokenizer._currentIndex + charactersToPeek; - if (tokenizer._textLength < endIndex) { - endIndex = tokenizer._textLength; - } - return tokenizer._text.substring(tokenizer._currentIndex, endIndex); -} -/** - * Read characters from this Tokenizer until the end of the stream or until the provided condition - * is false when provided the current character. - */ -function readWhile(tokenizer, condition) { - let result = ""; - while (hasCurrentCharacter(tokenizer)) { - const currentCharacter = getCurrentCharacter(tokenizer); - if (!condition(currentCharacter)) { - break; - } - else { - result += currentCharacter; - nextCharacter(tokenizer); - } - } - return result; -} -/** - * Read characters from this Tokenizer until a non-alphanumeric character or the end of the - * character stream is reached. - */ -function readWhileLetterOrDigit(tokenizer) { - return readWhile(tokenizer, (character) => isAlphaNumericCharacter(character)); -} -/** - * Read characters from this Tokenizer until one of the provided terminating characters is read or - * the end of the character stream is reached. - */ -function readUntilCharacter(tokenizer, ...terminatingCharacters) { - return readWhile(tokenizer, (character) => terminatingCharacters.indexOf(character) === -1); + +function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS = merge(oldDefaults, newDefaults); + const endpoint = endpointWithDefaults.bind(null, DEFAULTS); + return Object.assign(endpoint, { + DEFAULTS, + defaults: withDefaults.bind(null, DEFAULTS), + merge: merge.bind(null, DEFAULTS), + parse + }); } -function nextScheme(tokenizer) { - const scheme = readWhileLetterOrDigit(tokenizer); - tokenizer._currentToken = URLToken.scheme(scheme); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else { - tokenizer._currentState = "HOST"; - } + +const VERSION = "6.0.12"; + +const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. +// So we use RequestParameters and add method as additional required property. + +const DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "", + previews: [] + } +}; + +const endpoint = withDefaults(null, DEFAULTS); + +exports.endpoint = endpoint; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 70007: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var request = __nccwpck_require__(66255); +var universalUserAgent = __nccwpck_require__(33843); + +const VERSION = "4.8.0"; + +function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors:\n` + data.errors.map(e => ` - ${e.message}`).join("\n"); } -function nextSchemeOrHost(tokenizer) { - const schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === ":") { - if (peekCharacters(tokenizer, 3) === "://") { - tokenizer._currentToken = URLToken.scheme(schemeOrHost); - tokenizer._currentState = "HOST"; - } - else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "PORT"; - } - } - else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; - } + +class GraphqlResponseError extends Error { + constructor(request, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request; + this.headers = headers; + this.response = response; + this.name = "GraphqlResponseError"; // Expose the errors and response data in their shorthand properties. + + this.errors = response.errors; + this.data = response.data; // Maintains proper stack trace (only available on V8) + + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); } + } + } -function nextHost(tokenizer) { - if (peekCharacters(tokenizer, 3) === "://") { - nextCharacter(tokenizer, 3); - } - const host = readUntilCharacter(tokenizer, ":", "/", "?"); - tokenizer._currentToken = URLToken.host(host); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === ":") { - tokenizer._currentState = "PORT"; - } - else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; + +const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; +const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; +const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request, query, options) { + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); } -} -function nextPort(tokenizer) { - if (getCurrentCharacter(tokenizer) === ":") { - nextCharacter(tokenizer); + + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; + return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); } - const port = readUntilCharacter(tokenizer, "/", "?"); - tokenizer._currentToken = URLToken.port(port); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; + } + + const parsedOptions = typeof query === "string" ? Object.assign({ + query + }, options) : query; + const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { + if (NON_VARIABLE_OPTIONS.includes(key)) { + result[key] = parsedOptions[key]; + return result; } - else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; + + if (!result.variables) { + result.variables = {}; } - else { - tokenizer._currentState = "QUERY"; + + result.variables[key] = parsedOptions[key]; + return result; + }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix + // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 + + const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; + + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + } + + return request(requestOptions).then(response => { + if (response.data.errors) { + const headers = {}; + + for (const key of Object.keys(response.headers)) { + headers[key] = response.headers[key]; + } + + throw new GraphqlResponseError(requestOptions, headers, response.data); } + + return response.data.data; + }); } -function nextPath(tokenizer) { - const path = readUntilCharacter(tokenizer, "?"); - tokenizer._currentToken = URLToken.path(path); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else { - tokenizer._currentState = "QUERY"; - } + +function withDefaults(request$1, newDefaults) { + const newRequest = request$1.defaults(newDefaults); + + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; + + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: request.request.endpoint + }); } -function nextQuery(tokenizer) { - if (getCurrentCharacter(tokenizer) === "?") { - nextCharacter(tokenizer); - } - const query = readRemaining(tokenizer); - tokenizer._currentToken = URLToken.query(query); - tokenizer._currentState = "DONE"; + +const graphql$1 = withDefaults(request.request, { + headers: { + "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` + }, + method: "POST", + url: "/graphql" +}); +function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); } -// Copyright (c) Microsoft Corporation. -function createProxyAgent(requestUrl, proxySettings, headers) { - const host = URLBuilder.parse(proxySettings.host).getHost(); - if (!host) { - throw new Error("Expecting a non-empty host in proxy settings."); - } - if (!isValidPort(proxySettings.port)) { - throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings."); - } - const tunnelOptions = { - proxy: { - host: host, - port: proxySettings.port, - headers: (headers && headers.rawHeaders()) || {}, - }, - }; - if (proxySettings.username && proxySettings.password) { - tunnelOptions.proxy.proxyAuth = `${proxySettings.username}:${proxySettings.password}`; - } - else if (proxySettings.username) { - tunnelOptions.proxy.proxyAuth = `${proxySettings.username}`; - } - const isRequestHttps = isUrlHttps(requestUrl); - const isProxyHttps = isUrlHttps(proxySettings.host); - const proxyAgent = { - isHttps: isRequestHttps, - agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions), - }; - return proxyAgent; +exports.GraphqlResponseError = GraphqlResponseError; +exports.graphql = graphql$1; +exports.withCustomRequest = withCustomRequest; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 38082: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const VERSION = "2.21.3"; + +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + + return keys; } -function isUrlHttps(url) { - const urlScheme = URLBuilder.parse(url).getScheme() || ""; - return urlScheme.toLowerCase() === "https"; + +function _objectSpread2(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; } -function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) { - if (isRequestHttps && isProxyHttps) { - return tunnel__namespace.httpsOverHttps(tunnelOptions); - } - else if (isRequestHttps && !isProxyHttps) { - return tunnel__namespace.httpsOverHttp(tunnelOptions); - } - else if (!isRequestHttps && isProxyHttps) { - return tunnel__namespace.httpOverHttps(tunnelOptions); - } - else { - return tunnel__namespace.httpOverHttp(tunnelOptions); - } + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; } -function isValidPort(port) { - // any port in 0-65535 range is valid (RFC 793) even though almost all implementations - // will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports - return 0 <= port && port <= 65535; + +/** + * Some “list” response that can be paginated have a different response structure + * + * They have a `total_count` key in the response (search also has `incomplete_results`, + * /installation/repositories also has `repository_selection`), as well as a key with + * the list of the items which name varies from endpoint to endpoint. + * + * Octokit normalizes these responses so that paginated results are always returned following + * the same structure. One challenge is that if the list response has only one page, no Link + * header is provided, so this header alone is not sufficient to check wether a response is + * paginated or not. + * + * We check if a "total_count" key is present in the response data, but also make sure that + * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would + * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + */ +function normalizePaginatedListResponse(response) { + // endpoints can respond with 204 if repository is empty + if (!response.data) { + return _objectSpread2(_objectSpread2({}, response), {}, { + data: [] + }); + } + + const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); + if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way + // to retrieve the same information. + + const incompleteResults = response.data.incomplete_results; + const repositorySelection = response.data.repository_selection; + const totalCount = response.data.total_count; + delete response.data.incomplete_results; + delete response.data.repository_selection; + delete response.data.total_count; + const namespaceKey = Object.keys(response.data)[0]; + const data = response.data[namespaceKey]; + response.data = data; + + if (typeof incompleteResults !== "undefined") { + response.data.incomplete_results = incompleteResults; + } + + if (typeof repositorySelection !== "undefined") { + response.data.repository_selection = repositorySelection; + } + + response.data.total_count = totalCount; + return response; } -// Copyright (c) Microsoft Corporation. -const RedactedString = "REDACTED"; -const defaultAllowedHeaderNames = [ - "x-ms-client-request-id", - "x-ms-return-client-request-id", - "x-ms-useragent", - "x-ms-correlation-request-id", - "x-ms-request-id", - "client-request-id", - "ms-cv", - "return-client-request-id", - "traceparent", - "Access-Control-Allow-Credentials", - "Access-Control-Allow-Headers", - "Access-Control-Allow-Methods", - "Access-Control-Allow-Origin", - "Access-Control-Expose-Headers", - "Access-Control-Max-Age", - "Access-Control-Request-Headers", - "Access-Control-Request-Method", - "Origin", - "Accept", - "Accept-Encoding", - "Cache-Control", - "Connection", - "Content-Length", - "Content-Type", - "Date", - "ETag", - "Expires", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Unmodified-Since", - "Last-Modified", - "Pragma", - "Request-Id", - "Retry-After", - "Server", - "Transfer-Encoding", - "User-Agent", - "WWW-Authenticate", -]; -const defaultAllowedQueryParameters = ["api-version"]; -class Sanitizer { - constructor({ allowedHeaderNames = [], allowedQueryParameters = [] } = {}) { - allowedHeaderNames = Array.isArray(allowedHeaderNames) - ? defaultAllowedHeaderNames.concat(allowedHeaderNames) - : defaultAllowedHeaderNames; - allowedQueryParameters = Array.isArray(allowedQueryParameters) - ? defaultAllowedQueryParameters.concat(allowedQueryParameters) - : defaultAllowedQueryParameters; - this.allowedHeaderNames = new Set(allowedHeaderNames.map((n) => n.toLowerCase())); - this.allowedQueryParameters = new Set(allowedQueryParameters.map((p) => p.toLowerCase())); - } - sanitize(obj) { - const seen = new Set(); - return JSON.stringify(obj, (key, value) => { - // Ensure Errors include their interesting non-enumerable members - if (value instanceof Error) { - return Object.assign(Object.assign({}, value), { name: value.name, message: value.message }); - } - if (key === "_headersMap") { - return this.sanitizeHeaders(value); - } - else if (key === "url") { - return this.sanitizeUrl(value); - } - else if (key === "query") { - return this.sanitizeQuery(value); - } - else if (key === "body") { - // Don't log the request body - return undefined; - } - else if (key === "response") { - // Don't log response again - return undefined; - } - else if (key === "operationSpec") { - // When using sendOperationRequest, the request carries a massive - // field with the autorest spec. No need to log it. - return undefined; - } - else if (Array.isArray(value) || isObject(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); - } - sanitizeHeaders(value) { - return this.sanitizeObject(value, this.allowedHeaderNames, (v, k) => v[k].value); - } - sanitizeQuery(value) { - return this.sanitizeObject(value, this.allowedQueryParameters, (v, k) => v[k]); - } - sanitizeObject(value, allowedKeys, accessor) { - if (typeof value !== "object" || value === null) { - return value; - } - const sanitized = {}; - for (const k of Object.keys(value)) { - if (allowedKeys.has(k.toLowerCase())) { - sanitized[k] = accessor(value, k); - } - else { - sanitized[k] = RedactedString; - } - } - return sanitized; - } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null) { - return value; - } - const urlBuilder = URLBuilder.parse(value); - const queryString = urlBuilder.getQuery(); - if (!queryString) { - return value; - } - const query = URLQuery.parse(queryString); - for (const k of query.keys()) { - if (!this.allowedQueryParameters.has(k.toLowerCase())) { - query.set(k, RedactedString); +function iterator(octokit, route, parameters) { + const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); + const requestMethod = typeof route === "function" ? route : octokit.request; + const method = options.method; + const headers = options.headers; + let url = options.url; + return { + [Symbol.asyncIterator]: () => ({ + async next() { + if (!url) return { + done: true + }; + + try { + const response = await requestMethod({ + method, + url, + headers + }); + const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: + // '; rel="next", ; rel="last"' + // sets `url` to undefined if "next" URL is not present or `link` header is not set + + url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + return { + value: normalizedResponse + }; + } catch (error) { + if (error.status !== 409) throw error; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [] } + }; } - urlBuilder.setQuery(query.toString()); - return urlBuilder.toString(); - } + } + + }) + }; } -// Copyright (c) Microsoft Corporation. -const custom = util.inspect.custom; +function paginate(octokit, route, parameters, mapFn) { + if (typeof parameters === "function") { + mapFn = parameters; + parameters = undefined; + } -// Copyright (c) Microsoft Corporation. -const errorSanitizer = new Sanitizer(); -/** - * An error resulting from an HTTP request to a service endpoint. - */ -class RestError extends Error { - constructor(message, code, statusCode, request, response) { - super(message); - this.name = "RestError"; - this.code = code; - this.statusCode = statusCode; - this.request = request; - this.response = response; - Object.setPrototypeOf(this, RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [custom]() { - return `RestError: ${this.message} \n ${errorSanitizer.sanitize(this)}`; - } + return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); } -/** - * A constant string to identify errors that may arise when making an HTTP request that indicates an issue with the transport layer (e.g. the hostname of the URL cannot be resolved via DNS.) - */ -RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; -/** - * A constant string to identify errors that may arise from parsing an incoming HTTP response. Usually indicates a malformed HTTP body, such as an encoded JSON payload that is incomplete. - */ -RestError.PARSE_ERROR = "PARSE_ERROR"; -// Copyright (c) Microsoft Corporation. -const logger = logger$1.createClientLogger("core-http"); +function gather(octokit, results, iterator, mapFn) { + return iterator.next().then(result => { + if (result.done) { + return results; + } -// Copyright (c) Microsoft Corporation. -function getCachedAgent(isHttps, agentCache) { - return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; -} -class ReportTransform extends stream.Transform { - constructor(progressCallback) { - super(); - this.progressCallback = progressCallback; - this.loadedBytes = 0; + let earlyExit = false; + + function done() { + earlyExit = true; } - _transform(chunk, _encoding, callback) { - this.push(chunk); - this.loadedBytes += chunk.length; - this.progressCallback({ loadedBytes: this.loadedBytes }); - callback(undefined); + + results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); + + if (earlyExit) { + return results; } + + return gather(octokit, results, iterator, mapFn); + }); } -function isReadableStream(body) { - return body && typeof body.pipe === "function"; -} -function isStreamComplete(stream, aborter) { - return new Promise((resolve) => { - stream.once("close", () => { - aborter === null || aborter === void 0 ? void 0 : aborter.abort(); - resolve(); - }); - stream.once("end", resolve); - stream.once("error", resolve); - }); + +const composePaginateRest = Object.assign(paginate, { + iterator +}); + +const paginatingEndpoints = ["GET /app/hook/deliveries", "GET /app/installations", "GET /applications/grants", "GET /authorizations", "GET /enterprises/{enterprise}/actions/permissions/organizations", "GET /enterprises/{enterprise}/actions/runner-groups", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "GET /enterprises/{enterprise}/actions/runners", "GET /enterprises/{enterprise}/audit-log", "GET /enterprises/{enterprise}/secret-scanning/alerts", "GET /enterprises/{enterprise}/settings/billing/advanced-security", "GET /events", "GET /gists", "GET /gists/public", "GET /gists/starred", "GET /gists/{gist_id}/comments", "GET /gists/{gist_id}/commits", "GET /gists/{gist_id}/forks", "GET /installation/repositories", "GET /issues", "GET /licenses", "GET /marketplace_listing/plans", "GET /marketplace_listing/plans/{plan_id}/accounts", "GET /marketplace_listing/stubbed/plans", "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", "GET /networks/{owner}/{repo}/events", "GET /notifications", "GET /organizations", "GET /orgs/{org}/actions/cache/usage-by-repository", "GET /orgs/{org}/actions/permissions/repositories", "GET /orgs/{org}/actions/runner-groups", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "GET /orgs/{org}/actions/runners", "GET /orgs/{org}/actions/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/audit-log", "GET /orgs/{org}/blocks", "GET /orgs/{org}/code-scanning/alerts", "GET /orgs/{org}/codespaces", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/dependabot/secrets", "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", "GET /orgs/{org}/events", "GET /orgs/{org}/external-groups", "GET /orgs/{org}/failed_invitations", "GET /orgs/{org}/hooks", "GET /orgs/{org}/hooks/{hook_id}/deliveries", "GET /orgs/{org}/installations", "GET /orgs/{org}/invitations", "GET /orgs/{org}/invitations/{invitation_id}/teams", "GET /orgs/{org}/issues", "GET /orgs/{org}/members", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/secret-scanning/alerts", "GET /orgs/{org}/settings/billing/advanced-security", "GET /orgs/{org}/team-sync/groups", "GET /orgs/{org}/teams", "GET /orgs/{org}/teams/{team_slug}/discussions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/invitations", "GET /orgs/{org}/teams/{team_slug}/members", "GET /orgs/{org}/teams/{team_slug}/projects", "GET /orgs/{org}/teams/{team_slug}/repos", "GET /orgs/{org}/teams/{team_slug}/teams", "GET /projects/columns/{column_id}/cards", "GET /projects/{project_id}/collaborators", "GET /projects/{project_id}/columns", "GET /repos/{owner}/{repo}/actions/artifacts", "GET /repos/{owner}/{repo}/actions/caches", "GET /repos/{owner}/{repo}/actions/runners", "GET /repos/{owner}/{repo}/actions/runs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "GET /repos/{owner}/{repo}/actions/secrets", "GET /repos/{owner}/{repo}/actions/workflows", "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "GET /repos/{owner}/{repo}/assignees", "GET /repos/{owner}/{repo}/branches", "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "GET /repos/{owner}/{repo}/code-scanning/alerts", "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "GET /repos/{owner}/{repo}/code-scanning/analyses", "GET /repos/{owner}/{repo}/codespaces", "GET /repos/{owner}/{repo}/codespaces/devcontainers", "GET /repos/{owner}/{repo}/codespaces/secrets", "GET /repos/{owner}/{repo}/collaborators", "GET /repos/{owner}/{repo}/comments", "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/commits", "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", "GET /repos/{owner}/{repo}/commits/{ref}/status", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/dependabot/secrets", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/environments", "GET /repos/{owner}/{repo}/events", "GET /repos/{owner}/{repo}/forks", "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", "GET /repos/{owner}/{repo}/hooks", "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "GET /repos/{owner}/{repo}/invitations", "GET /repos/{owner}/{repo}/issues", "GET /repos/{owner}/{repo}/issues/comments", "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/issues/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", "GET /repos/{owner}/{repo}/issues/{issue_number}/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", "GET /repos/{owner}/{repo}/keys", "GET /repos/{owner}/{repo}/labels", "GET /repos/{owner}/{repo}/milestones", "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", "GET /repos/{owner}/{repo}/notifications", "GET /repos/{owner}/{repo}/pages/builds", "GET /repos/{owner}/{repo}/projects", "GET /repos/{owner}/{repo}/pulls", "GET /repos/{owner}/{repo}/pulls/comments", "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "GET /repos/{owner}/{repo}/releases", "GET /repos/{owner}/{repo}/releases/{release_id}/assets", "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repos/{owner}/{repo}/topics", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "GET /search/code", "GET /search/commits", "GET /search/issues", "GET /search/labels", "GET /search/repositories", "GET /search/topics", "GET /search/users", "GET /teams/{team_id}/discussions", "GET /teams/{team_id}/discussions/{discussion_number}/comments", "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /teams/{team_id}/discussions/{discussion_number}/reactions", "GET /teams/{team_id}/invitations", "GET /teams/{team_id}/members", "GET /teams/{team_id}/projects", "GET /teams/{team_id}/repos", "GET /teams/{team_id}/teams", "GET /user/blocks", "GET /user/codespaces", "GET /user/codespaces/secrets", "GET /user/emails", "GET /user/followers", "GET /user/following", "GET /user/gpg_keys", "GET /user/installations", "GET /user/installations/{installation_id}/repositories", "GET /user/issues", "GET /user/keys", "GET /user/marketplace_purchases", "GET /user/marketplace_purchases/stubbed", "GET /user/memberships/orgs", "GET /user/migrations", "GET /user/migrations/{migration_id}/repositories", "GET /user/orgs", "GET /user/packages", "GET /user/packages/{package_type}/{package_name}/versions", "GET /user/public_emails", "GET /user/repos", "GET /user/repository_invitations", "GET /user/starred", "GET /user/subscriptions", "GET /user/teams", "GET /users", "GET /users/{username}/events", "GET /users/{username}/events/orgs/{org}", "GET /users/{username}/events/public", "GET /users/{username}/followers", "GET /users/{username}/following", "GET /users/{username}/gists", "GET /users/{username}/gpg_keys", "GET /users/{username}/keys", "GET /users/{username}/orgs", "GET /users/{username}/packages", "GET /users/{username}/projects", "GET /users/{username}/received_events", "GET /users/{username}/received_events/public", "GET /users/{username}/repos", "GET /users/{username}/starred", "GET /users/{username}/subscriptions"]; + +function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } else { + return false; + } } + /** - * Transforms a set of headers into the key/value pair defined by {@link HttpHeadersLike} + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor */ -function parseHeaders(headers) { - const httpHeaders = new HttpHeaders(); - headers.forEach((value, key) => { - httpHeaders.set(key, value); - }); - return httpHeaders; + +function paginateRest(octokit) { + return { + paginate: Object.assign(paginate.bind(null, octokit), { + iterator: iterator.bind(null, octokit) + }) + }; } +paginateRest.VERSION = VERSION; + +exports.composePaginateRest = composePaginateRest; +exports.isPaginatingEndpoint = isPaginatingEndpoint; +exports.paginateRest = paginateRest; +exports.paginatingEndpoints = paginatingEndpoints; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 6966: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const VERSION = "1.0.4"; + /** - * An HTTP client that uses `node-fetch`. + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor */ -class NodeFetchHttpClient { - constructor() { - // a mapping of proxy settings string `${host}:${port}:${username}:${password}` to agent - this.proxyAgentMap = new Map(); - this.keepAliveAgents = {}; - } - /** - * Provides minimum viable error handling and the logic that executes the abstract methods. - * @param httpRequest - Object representing the outgoing HTTP request. - * @returns An object representing the incoming HTTP response. - */ - async sendRequest(httpRequest) { - var _a; - if (!httpRequest && typeof httpRequest !== "object") { - throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object."); - } - const abortController$1 = new abortController.AbortController(); - let abortListener; - if (httpRequest.abortSignal) { - if (httpRequest.abortSignal.aborted) { - throw new abortController.AbortError("The operation was aborted."); - } - abortListener = (event) => { - if (event.type === "abort") { - abortController$1.abort(); - } - }; - httpRequest.abortSignal.addEventListener("abort", abortListener); - } - if (httpRequest.timeout) { - setTimeout(() => { - abortController$1.abort(); - }, httpRequest.timeout); - } - if (httpRequest.formData) { - const formData = httpRequest.formData; - const requestForm = new FormData__default["default"](); - const appendFormValue = (key, value) => { - // value function probably returns a stream so we can provide a fresh stream on each retry - if (typeof value === "function") { - value = value(); - } - if (value && - Object.prototype.hasOwnProperty.call(value, "value") && - Object.prototype.hasOwnProperty.call(value, "options")) { - requestForm.append(key, value.value, value.options); - } - else { - requestForm.append(key, value); - } - }; - for (const formKey of Object.keys(formData)) { - const formValue = formData[formKey]; - if (Array.isArray(formValue)) { - for (let j = 0; j < formValue.length; j++) { - appendFormValue(formKey, formValue[j]); - } - } - else { - appendFormValue(formKey, formValue); - } - } - httpRequest.body = requestForm; - httpRequest.formData = undefined; - const contentType = httpRequest.headers.get("Content-Type"); - if (contentType && contentType.indexOf("multipart/form-data") !== -1) { - if (typeof requestForm.getBoundary === "function") { - httpRequest.headers.set("Content-Type", `multipart/form-data; boundary=${requestForm.getBoundary()}`); - } - else { - // browser will automatically apply a suitable content-type header - httpRequest.headers.remove("Content-Type"); - } - } - } - let body = httpRequest.body - ? typeof httpRequest.body === "function" - ? httpRequest.body() - : httpRequest.body - : undefined; - if (httpRequest.onUploadProgress && httpRequest.body) { - const onUploadProgress = httpRequest.onUploadProgress; - const uploadReportStream = new ReportTransform(onUploadProgress); - if (isReadableStream(body)) { - body.pipe(uploadReportStream); - } - else { - uploadReportStream.end(body); - } - body = uploadReportStream; - } - const platformSpecificRequestInit = await this.prepareRequest(httpRequest); - const requestInit = Object.assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, - // the types for RequestInit are from the browser, which expects AbortSignal to - // have `reason` and `throwIfAborted`, but these don't exist on our polyfill - // for Node. - signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit); - let operationResponse; - try { - const response = await this.fetch(httpRequest.url, requestInit); - const headers = parseHeaders(response.headers); - const streaming = ((_a = httpRequest.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(response.status)) || - httpRequest.streamResponseBody; - operationResponse = { - headers: headers, - request: httpRequest, - status: response.status, - readableStreamBody: streaming - ? response.body - : undefined, - bodyAsText: !streaming ? await response.text() : undefined, - }; - const onDownloadProgress = httpRequest.onDownloadProgress; - if (onDownloadProgress) { - const responseBody = response.body || undefined; - if (isReadableStream(responseBody)) { - const downloadReportStream = new ReportTransform(onDownloadProgress); - responseBody.pipe(downloadReportStream); - operationResponse.readableStreamBody = downloadReportStream; - } - else { - const length = parseInt(headers.get("Content-Length")) || undefined; - if (length) { - // Calling callback for non-stream response for consistency with browser - onDownloadProgress({ loadedBytes: length }); - } - } - } - await this.processRequest(operationResponse); - return operationResponse; - } - catch (error) { - const fetchError = error; - if (fetchError.code === "ENOTFOUND") { - throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest); - } - else if (fetchError.type === "aborted") { - throw new abortController.AbortError("The operation was aborted."); - } - throw fetchError; - } - finally { - // clean up event listener - if (httpRequest.abortSignal && abortListener) { - let uploadStreamDone = Promise.resolve(); - if (isReadableStream(body)) { - uploadStreamDone = isStreamComplete(body); - } - let downloadStreamDone = Promise.resolve(); - if (isReadableStream(operationResponse === null || operationResponse === void 0 ? void 0 : operationResponse.readableStreamBody)) { - downloadStreamDone = isStreamComplete(operationResponse.readableStreamBody, abortController$1); - } - Promise.all([uploadStreamDone, downloadStreamDone]) - .then(() => { - var _a; - (_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener("abort", abortListener); - return; - }) - .catch((e) => { - logger.warning("Error when cleaning up abortListener on httpRequest", e); - }); - } - } - } - getOrCreateAgent(httpRequest) { - var _a; - const isHttps = isUrlHttps(httpRequest.url); - // At the moment, proxy settings and keepAlive are mutually - // exclusive because the 'tunnel' library currently lacks the - // ability to create a proxy with keepAlive turned on. - if (httpRequest.proxySettings) { - const { host, port, username, password } = httpRequest.proxySettings; - const key = `${host}:${port}:${username}:${password}`; - const proxyAgents = (_a = this.proxyAgentMap.get(key)) !== null && _a !== void 0 ? _a : {}; - let agent = getCachedAgent(isHttps, proxyAgents); - if (agent) { - return agent; - } - const tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers); - agent = tunnel.agent; - if (tunnel.isHttps) { - proxyAgents.httpsAgent = tunnel.agent; - } - else { - proxyAgents.httpAgent = tunnel.agent; - } - this.proxyAgentMap.set(key, proxyAgents); - return agent; - } - else if (httpRequest.keepAlive) { - let agent = getCachedAgent(isHttps, this.keepAliveAgents); - if (agent) { - return agent; - } - const agentOptions = { - keepAlive: httpRequest.keepAlive, - }; - if (isHttps) { - agent = this.keepAliveAgents.httpsAgent = new https__namespace.Agent(agentOptions); - } - else { - agent = this.keepAliveAgents.httpAgent = new http__namespace.Agent(agentOptions); - } - return agent; - } - else { - return isHttps ? https__namespace.globalAgent : http__namespace.globalAgent; - } - } - /** - * Uses `node-fetch` to perform the request. - */ - // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs - async fetch(input, init) { - return node_fetch__default["default"](input, init); - } - /** - * Prepares a request based on the provided web resource. - */ - async prepareRequest(httpRequest) { - const requestInit = {}; - // Set the http(s) agent - requestInit.agent = this.getOrCreateAgent(httpRequest); - requestInit.compress = httpRequest.decompressResponse; - return requestInit; - } - /** - * Process an HTTP response. - */ - async processRequest(_operationResponse) { - /* no_op */ - } + +function requestLog(octokit) { + octokit.hook.wrap("request", (request, options) => { + octokit.log.debug("request", options); + const start = Date.now(); + const requestOptions = octokit.request.endpoint.parse(options); + const path = requestOptions.url.replace(options.baseUrl, ""); + return request(options).then(response => { + octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); + return response; + }).catch(error => { + octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); + throw error; + }); + }); } +requestLog.VERSION = VERSION; -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The different levels of logs that can be used with the HttpPipelineLogger. - */ -exports.HttpPipelineLogLevel = void 0; -(function (HttpPipelineLogLevel) { - /** - * A log level that indicates that no logs will be logged. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["OFF"] = 0] = "OFF"; - /** - * An error log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["ERROR"] = 1] = "ERROR"; - /** - * A warning log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["WARNING"] = 2] = "WARNING"; - /** - * An information log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["INFO"] = 3] = "INFO"; -})(exports.HttpPipelineLogLevel || (exports.HttpPipelineLogLevel = {})); +exports.requestLog = requestLog; +//# sourceMappingURL=index.js.map -// Copyright (c) Microsoft Corporation. -/** - * Converts an OperationOptions to a RequestOptionsBase - * - * @param opts - OperationOptions object to convert to RequestOptionsBase - */ -function operationOptionsToRequestOptionsBase(opts) { - const { requestOptions, tracingOptions } = opts, additionalOptions = tslib.__rest(opts, ["requestOptions", "tracingOptions"]); - let result = additionalOptions; - if (requestOptions) { - result = Object.assign(Object.assign({}, result), requestOptions); - } - if (tracingOptions) { - result.tracingContext = tracingOptions.tracingContext; - // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier. - result.spanOptions = tracingOptions === null || tracingOptions === void 0 ? void 0 : tracingOptions.spanOptions; - } - return result; -} -// Copyright (c) Microsoft Corporation. -/** - * The base class from which all request policies derive. - */ -class BaseRequestPolicy { - /** - * The main method to implement that manipulates a request/response. - */ - constructor( - /** - * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline. - */ - _nextPolicy, - /** - * The options that can be passed to a given request policy. - */ - _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; - } - /** - * Get whether or not a log with the provided log level should be logged. - * @param logLevel - The log level of the log that will be logged. - * @returns Whether or not a log with the provided log level should be logged. - */ - shouldLog(logLevel) { - return this._options.shouldLog(logLevel); - } - /** - * Attempt to log the provided message to the provided logger. If no logger was provided or if - * the log level does not meat the logger's threshold, then nothing will be logged. - * @param logLevel - The log level of this log. - * @param message - The message of this log. - */ - log(logLevel, message) { - this._options.log(logLevel, message); - } -} -/** - * Optional properties that can be used when creating a RequestPolicy. - */ -class RequestPolicyOptions { - constructor(_logger) { - this._logger = _logger; - } - /** - * Get whether or not a log with the provided log level should be logged. - * @param logLevel - The log level of the log that will be logged. - * @returns Whether or not a log with the provided log level should be logged. - */ - shouldLog(logLevel) { - return (!!this._logger && - logLevel !== exports.HttpPipelineLogLevel.OFF && - logLevel <= this._logger.minimumLogLevel); - } - /** - * Attempt to log the provided message to the provided logger. If no logger was provided or if - * the log level does not meet the logger's threshold, then nothing will be logged. - * @param logLevel - The log level of this log. - * @param message - The message of this log. - */ - log(logLevel, message) { - if (this._logger && this.shouldLog(logLevel)) { - this._logger.log(logLevel, message); - } - } -} +/***/ }), -// Copyright (c) Microsoft Corporation. -// Note: The reason we re-define all of the xml2js default settings (version 2.0) here is because the default settings object exposed -// by the xm2js library is mutable. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/536 -// By creating a new copy of the settings each time we instantiate the parser, -// we are safeguarding against the possibility of the default settings being mutated elsewhere unintentionally. -const xml2jsDefaultOptionsV2 = { - explicitCharkey: false, - trim: false, - normalize: false, - normalizeTags: false, - attrkey: XML_ATTRKEY, - explicitArray: true, - ignoreAttrs: false, - mergeAttrs: false, - explicitRoot: true, - validator: undefined, - xmlns: false, - explicitChildren: false, - preserveChildrenOrder: false, - childkey: "$$", - charsAsChildren: false, - includeWhiteChars: false, - async: false, - strict: true, - attrNameProcessors: undefined, - attrValueProcessors: undefined, - tagNameProcessors: undefined, - valueProcessors: undefined, - rootName: "root", - xmldec: { - version: "1.0", - encoding: "UTF-8", - standalone: true, - }, - doctype: undefined, - renderOpts: { - pretty: true, - indent: " ", - newline: "\n", - }, - headless: false, - chunkSize: 10000, - emptyTag: "", - cdata: false, -}; -// The xml2js settings for general XML parsing operations. -const xml2jsParserSettings = Object.assign({}, xml2jsDefaultOptionsV2); -xml2jsParserSettings.explicitArray = false; -// The xml2js settings for general XML building operations. -const xml2jsBuilderSettings = Object.assign({}, xml2jsDefaultOptionsV2); -xml2jsBuilderSettings.explicitArray = false; -xml2jsBuilderSettings.renderOpts = { - pretty: false, -}; -/** - * Converts given JSON object to XML string - * @param obj - JSON object to be converted into XML string - * @param opts - Options that govern the parsing of given JSON object - */ -function stringifyXML(obj, opts = {}) { - var _a; - xml2jsBuilderSettings.rootName = opts.rootName; - xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - const builder = new xml2js__namespace.Builder(xml2jsBuilderSettings); - return builder.buildObject(obj); -} -/** - * Converts given XML string into JSON - * @param str - String containing the XML content to be parsed into JSON - * @param opts - Options that govern the parsing of given xml string - */ -function parseXML(str, opts = {}) { - var _a; - xml2jsParserSettings.explicitRoot = !!opts.includeRoot; - xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - const xmlParser = new xml2js__namespace.Parser(xml2jsParserSettings); - return new Promise((resolve, reject) => { - if (!str) { - reject(new Error("Document is empty")); - } - else { - xmlParser.parseString(str, (err, res) => { - if (err) { - reject(err); - } - else { - resolve(res); - } - }); - } - }); -} +/***/ 84935: +/***/ ((__unused_webpack_module, exports) => { -// Copyright (c) Microsoft Corporation. -/** - * Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they - * pass through the HTTP pipeline. - */ -function deserializationPolicy(deserializationContentTypes, parsingOptions) { - return { - create: (nextPolicy, options) => { - return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions); - }, - }; -} -const defaultJsonContentTypes = ["application/json", "text/json"]; -const defaultXmlContentTypes = ["application/xml", "application/atom+xml"]; -const DefaultDeserializationOptions = { - expectedContentTypes: { - json: defaultJsonContentTypes, - xml: defaultXmlContentTypes, - }, -}; -/** - * A RequestPolicy that will deserialize HTTP response bodies and headers as they pass through the - * HTTP pipeline. - */ -class DeserializationPolicy extends BaseRequestPolicy { - constructor(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions = {}) { - var _a; - super(nextPolicy, requestPolicyOptions); - this.jsonContentTypes = - (deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes; - this.xmlContentTypes = - (deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes; - this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - } - async sendRequest(request) { - return this._nextPolicy.sendRequest(request).then((response) => deserializeResponseBody(this.jsonContentTypes, this.xmlContentTypes, response, { - xmlCharKey: this.xmlCharKey, - })); - } -} -function getOperationResponse(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationSpec = request.operationSpec; - if (operationSpec) { - const operationResponseGetter = request.operationResponseGetter; - if (!operationResponseGetter) { - result = operationSpec.responses[parsedResponse.status]; - } - else { - result = operationResponseGetter(operationSpec, parsedResponse); - } - } - return result; -} -function shouldDeserializeResponse(parsedResponse) { - const shouldDeserialize = parsedResponse.request.shouldDeserialize; - let result; - if (shouldDeserialize === undefined) { - result = true; - } - else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } - else { - result = shouldDeserialize(parsedResponse); - } - return result; -} -/** - * Given a particular set of content types to parse as either JSON or XML, consumes the HTTP response to produce the result object defined by the request's {@link OperationSpec}. - * @param jsonContentTypes - Response content types to parse the body as JSON. - * @param xmlContentTypes - Response content types to parse the body as XML. - * @param response - HTTP Response from the pipeline. - * @param options - Options to the serializer, mostly for configuring the XML parser if needed. - * @returns A parsed {@link HttpOperationResponse} object that can be returned by the {@link ServiceClient}. - */ -function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options = {}) { - var _a, _b, _c; - const updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY, - }; - return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then((parsedResponse) => { - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; - } - const operationSpec = parsedResponse.request.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; - } - const responseSpec = getOperationResponse(parsedResponse); - const { error, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec); - if (error) { - throw error; - } - else if (shouldReturnResponse) { - return parsedResponse; - } - // An operation response spec does exist for current status code, so - // use it to deserialize the response. - if (responseSpec) { - if (responseSpec.bodyMapper) { - let valueToDeserialize = parsedResponse.parsedBody; - if (operationSpec.isXML && responseSpec.bodyMapper.type.name === MapperType.Sequence) { - valueToDeserialize = - typeof valueToDeserialize === "object" - ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName] - : []; - } - try { - parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options); - } - catch (innerError) { - const restError = new RestError(`Error ${innerError} occurred in deserializing the responseBody - ${parsedResponse.bodyAsText}`, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); - throw restError; - } - } - else if (operationSpec.httpMethod === "HEAD") { - // head methods never have a body, but we return a boolean to indicate presence/absence of the resource - parsedResponse.parsedBody = response.status >= 200 && response.status < 300; - } - if (responseSpec.headersMapper) { - parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJson(), "operationRes.parsedHeaders", options); - } - } - return parsedResponse; - }); -} -function isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return (expectedStatusCodes.length === 0 || - (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default")); -} -function handleErrorResponse(parsedResponse, operationSpec, responseSpec) { - var _a; - const isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300; - const isExpectedStatusCode = isOperationSpecEmpty(operationSpec) - ? isSuccessByStatus - : !!responseSpec; - if (isExpectedStatusCode) { - if (responseSpec) { - if (!responseSpec.isError) { - return { error: null, shouldReturnResponse: false }; - } - } - else { - return { error: null, shouldReturnResponse: false }; - } - } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const streaming = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) || - parsedResponse.request.streamResponseBody; - const initialErrorMessage = streaming - ? `Unexpected status code: ${parsedResponse.status}` - : parsedResponse.bodyAsText; - const error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); - // If the item failed but there's no error spec or default spec to deserialize the error, - // we should fail so we just throw the parsed response - if (!errorResponseSpec) { - throw error; - } - const defaultBodyMapper = errorResponseSpec.bodyMapper; - const defaultHeadersMapper = errorResponseSpec.headersMapper; - try { - // If error response has a body, try to deserialize it using default body mapper. - // Then try to extract error code & message from it - if (parsedResponse.parsedBody) { - const parsedBody = parsedResponse.parsedBody; - let parsedError; - if (defaultBodyMapper) { - let valueToDeserialize = parsedBody; - if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) { - valueToDeserialize = - typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : []; - } - parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody"); - } - const internalError = parsedBody.error || parsedError || parsedBody; - error.code = internalError.code; - if (internalError.message) { - error.message = internalError.message; - } - if (defaultBodyMapper) { - error.response.parsedBody = parsedError; - } - } - // If error response has headers, try to deserialize it using default header mapper - if (parsedResponse.headers && defaultHeadersMapper) { - error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJson(), "operationRes.parsedHeaders"); - } - } - catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; - } - return { error, shouldReturnResponse: false }; -} -function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) { - var _a; - const errorHandler = (err) => { - const msg = `Error "${err}" occurred while parsing the response body - ${operationResponse.bodyAsText}.`; - const errCode = err.code || RestError.PARSE_ERROR; - const e = new RestError(msg, errCode, operationResponse.status, operationResponse.request, operationResponse); - return Promise.reject(e); - }; - const streaming = ((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) || - operationResponse.request.streamResponseBody; - if (!streaming && operationResponse.bodyAsText) { - const text = operationResponse.bodyAsText; - const contentType = operationResponse.headers.get("Content-Type") || ""; - const contentComponents = !contentType - ? [] - : contentType.split(";").map((component) => component.toLowerCase()); - if (contentComponents.length === 0 || - contentComponents.some((component) => jsonContentTypes.indexOf(component) !== -1)) { - return new Promise((resolve) => { - operationResponse.parsedBody = JSON.parse(text); - resolve(operationResponse); - }).catch(errorHandler); - } - else if (contentComponents.some((component) => xmlContentTypes.indexOf(component) !== -1)) { - return parseXML(text, opts) - .then((body) => { - operationResponse.parsedBody = body; - return operationResponse; - }) - .catch(errorHandler); - } - } - return Promise.resolve(operationResponse); -} +"use strict"; -// Copyright (c) Microsoft Corporation. -/** - * By default, HTTP connections are maintained for future requests. - */ -const DefaultKeepAliveOptions = { - enable: true, -}; -/** - * Creates a policy that controls whether HTTP connections are maintained on future requests. - * @param keepAliveOptions - Keep alive options. By default, HTTP connections are maintained for future requests. - * @returns An instance of the {@link KeepAlivePolicy} - */ -function keepAlivePolicy(keepAliveOptions) { - return { - create: (nextPolicy, options) => { - return new KeepAlivePolicy(nextPolicy, options, keepAliveOptions || DefaultKeepAliveOptions); - }, - }; -} -/** - * KeepAlivePolicy is a policy used to control keep alive settings for every request. - */ -class KeepAlivePolicy extends BaseRequestPolicy { - /** - * Creates an instance of KeepAlivePolicy. - * - * @param nextPolicy - - * @param options - - * @param keepAliveOptions - - */ - constructor(nextPolicy, options, keepAliveOptions) { - super(nextPolicy, options); - this.keepAliveOptions = keepAliveOptions; - } - /** - * Sends out request. - * - * @param request - - * @returns - */ - async sendRequest(request) { - request.keepAlive = this.keepAliveOptions.enable; - return this._nextPolicy.sendRequest(request); - } -} -// Copyright (c) Microsoft Corporation. -/** - * Methods that are allowed to follow redirects 301 and 302 - */ -const allowedRedirect = ["GET", "HEAD"]; -const DefaultRedirectOptions = { - handleRedirects: true, - maxRetries: 20, -}; -/** - * Creates a redirect policy, which sends a repeats the request to a new destination if a response arrives with a "location" header, and a status code between 300 and 307. - * @param maximumRetries - Maximum number of redirects to follow. - * @returns An instance of the {@link RedirectPolicy} - */ -function redirectPolicy(maximumRetries = 20) { - return { - create: (nextPolicy, options) => { - return new RedirectPolicy(nextPolicy, options, maximumRetries); - }, - }; -} -/** - * Resends the request to a new destination if a response arrives with a "location" header, and a status code between 300 and 307. - */ -class RedirectPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, maxRetries = 20) { - super(nextPolicy, options); - this.maxRetries = maxRetries; - } - sendRequest(request) { - return this._nextPolicy - .sendRequest(request) - .then((response) => handleRedirect(this, response, 0)); - } -} -function handleRedirect(policy, response, currentRetries) { - const { request, status } = response; - const locationHeader = response.headers.get("location"); - if (locationHeader && - (status === 300 || - (status === 301 && allowedRedirect.includes(request.method)) || - (status === 302 && allowedRedirect.includes(request.method)) || - (status === 303 && request.method === "POST") || - status === 307) && - (!policy.maxRetries || currentRetries < policy.maxRetries)) { - const builder = URLBuilder.parse(request.url); - builder.setPath(locationHeader); - request.url = builder.toString(); - // POST request with Status code 303 should be converted into a - // redirected GET request if the redirect url is present in the location header - if (status === 303) { - request.method = "GET"; - delete request.body; - } - return policy._nextPolicy - .sendRequest(request) - .then((res) => handleRedirect(policy, res, currentRetries + 1)); - } - return Promise.resolve(response); -} +Object.defineProperty(exports, "__esModule", ({ value: true })); -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const DEFAULT_CLIENT_RETRY_COUNT = 3; -// intervals are in ms -const DEFAULT_CLIENT_RETRY_INTERVAL = 1000 * 30; -const DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 90; -const DEFAULT_CLIENT_MIN_RETRY_INTERVAL = 1000 * 3; -function isNumber(n) { - return typeof n === "number"; -} -/** - * @internal - * Determines if the operation should be retried. - * - * @param retryLimit - Specifies the max number of retries. - * @param predicate - Initial chekck on whether to retry based on given responses or errors - * @param retryData - The retry data. - * @returns True if the operation qualifies for a retry; false otherwise. - */ -function shouldRetry(retryLimit, predicate, retryData, response, error) { - if (!predicate(response, error)) { - return false; - } - return retryData.retryCount < retryLimit; -} -/** - * @internal - * Updates the retry data for the next attempt. - * - * @param retryOptions - specifies retry interval, and its lower bound and upper bound. - * @param retryData - The retry data. - * @param err - The operation"s error, if any. - */ -function updateRetryData(retryOptions, retryData = { retryCount: 0, retryInterval: 0 }, err) { - if (err) { - if (retryData.error) { - err.innerError = retryData.error; - } - retryData.error = err; - } - // Adjust retry count - retryData.retryCount++; - // Adjust retry interval - let incrementDelta = Math.pow(2, retryData.retryCount - 1) - 1; - const boundedRandDelta = retryOptions.retryInterval * 0.8 + - Math.floor(Math.random() * (retryOptions.retryInterval * 0.4)); - incrementDelta *= boundedRandDelta; - retryData.retryInterval = Math.min(retryOptions.minRetryInterval + incrementDelta, retryOptions.maxRetryInterval); - return retryData; -} +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); -// Copyright (c) Microsoft Corporation. -/** - * Policy that retries the request as many times as configured for as long as the max retry time interval specified, each retry waiting longer to begin than the last time. - * @param retryCount - Maximum number of retries. - * @param retryInterval - Base time between retries. - * @param maxRetryInterval - Maximum time to wait between retries. - */ -function exponentialRetryPolicy(retryCount, retryInterval, maxRetryInterval) { - return { - create: (nextPolicy, options) => { - return new ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval); - }, - }; -} -/** - * Describes the Retry Mode type. Currently supporting only Exponential. - */ -exports.RetryMode = void 0; -(function (RetryMode) { - /** - * Currently supported retry mode. - * Each time a retry happens, it will take exponentially more time than the last time. - */ - RetryMode[RetryMode["Exponential"] = 0] = "Exponential"; -})(exports.RetryMode || (exports.RetryMode = {})); -const DefaultRetryOptions = { - maxRetries: DEFAULT_CLIENT_RETRY_COUNT, - retryDelayInMs: DEFAULT_CLIENT_RETRY_INTERVAL, - maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL, -}; -/** - * Instantiates a new "ExponentialRetryPolicyFilter" instance. - */ -class ExponentialRetryPolicy extends BaseRequestPolicy { - /** - * @param nextPolicy - The next RequestPolicy in the pipeline chain. - * @param options - The options for this RequestPolicy. - * @param retryCount - The client retry count. - * @param retryInterval - The client retry interval, in milliseconds. - * @param minRetryInterval - The minimum retry interval, in milliseconds. - * @param maxRetryInterval - The maximum retry interval, in milliseconds. - */ - constructor(nextPolicy, options, retryCount, retryInterval, maxRetryInterval) { - super(nextPolicy, options); - this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; - this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; - this.maxRetryInterval = isNumber(maxRetryInterval) - ? maxRetryInterval - : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - } - sendRequest(request) { - return this._nextPolicy - .sendRequest(request.clone()) - .then((response) => retry$1(this, request, response)) - .catch((error) => retry$1(this, request, error.response, undefined, error)); - } -} -async function retry$1(policy, request, response, retryData, requestError) { - function shouldPolicyRetry(responseParam) { - const statusCode = responseParam === null || responseParam === void 0 ? void 0 : responseParam.status; - if (statusCode === 503 && (response === null || response === void 0 ? void 0 : response.headers.get(Constants.HeaderConstants.RETRY_AFTER))) { - return false; - } - if (statusCode === undefined || - (statusCode < 500 && statusCode !== 408) || - statusCode === 501 || - statusCode === 505) { - return false; - } - return true; - } - retryData = updateRetryData({ - retryInterval: policy.retryInterval, - minRetryInterval: 0, - maxRetryInterval: policy.maxRetryInterval, - }, retryData, requestError); - const isAborted = request.abortSignal && request.abortSignal.aborted; - if (!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response)) { - logger.info(`Retrying request in ${retryData.retryInterval}`); - try { - await coreUtil.delay(retryData.retryInterval); - const res = await policy._nextPolicy.sendRequest(request.clone()); - return retry$1(policy, request, res, retryData); - } - catch (err) { - return retry$1(policy, request, response, retryData, err); - } - } - else if (isAborted || requestError || !response) { - // If the operation failed in the end, return all errors instead of just the last one - const err = retryData.error || - new RestError("Failed to send the request.", RestError.REQUEST_SEND_ERROR, response && response.status, response && response.request, response); - throw err; - } - else { - return response; - } -} + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); -// Copyright (c) Microsoft Corporation. -/** - * Creates a policy that logs information about the outgoing request and the incoming responses. - * @param loggingOptions - Logging options. - * @returns An instance of the {@link LogPolicy} - */ -function logPolicy(loggingOptions = {}) { - return { - create: (nextPolicy, options) => { - return new LogPolicy(nextPolicy, options, loggingOptions); - }, - }; -} -/** - * A policy that logs information about the outgoing request and the incoming responses. - */ -class LogPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, { logger: logger$1 = logger.info, allowedHeaderNames = [], allowedQueryParameters = [], } = {}) { - super(nextPolicy, options); - this.logger = logger$1; - this.sanitizer = new Sanitizer({ allowedHeaderNames, allowedQueryParameters }); - } - /** - * Header names whose values will be logged when logging is enabled. Defaults to - * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers - * specified in this field will be added to that list. Any other values will - * be written to logs as "REDACTED". - * @deprecated Pass these into the constructor instead. - */ - get allowedHeaderNames() { - return this.sanitizer.allowedHeaderNames; - } - /** - * Header names whose values will be logged when logging is enabled. Defaults to - * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers - * specified in this field will be added to that list. Any other values will - * be written to logs as "REDACTED". - * @deprecated Pass these into the constructor instead. - */ - set allowedHeaderNames(allowedHeaderNames) { - this.sanitizer.allowedHeaderNames = allowedHeaderNames; - } - /** - * Query string names whose values will be logged when logging is enabled. By default no - * query string values are logged. - * @deprecated Pass these into the constructor instead. - */ - get allowedQueryParameters() { - return this.sanitizer.allowedQueryParameters; - } - /** - * Query string names whose values will be logged when logging is enabled. By default no - * query string values are logged. - * @deprecated Pass these into the constructor instead. - */ - set allowedQueryParameters(allowedQueryParameters) { - this.sanitizer.allowedQueryParameters = allowedQueryParameters; - } - sendRequest(request) { - if (!this.logger.enabled) - return this._nextPolicy.sendRequest(request); - this.logRequest(request); - return this._nextPolicy.sendRequest(request).then((response) => this.logResponse(response)); - } - logRequest(request) { - this.logger(`Request: ${this.sanitizer.sanitize(request)}`); - } - logResponse(response) { - this.logger(`Response status code: ${response.status}`); - this.logger(`Headers: ${this.sanitizer.sanitize(response.headers)}`); - return response; + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); } -} -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Get the path to this parameter's value as a dotted string (a.b.c). - * @param parameter - The parameter to get the path string for. - * @returns The path to this parameter's value as a dotted string. - */ -function getPathStringFromParameter(parameter) { - return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper); -} -function getPathStringFromParameterPath(parameterPath, mapper) { - let result; - if (typeof parameterPath === "string") { - result = parameterPath; - } - else if (Array.isArray(parameterPath)) { - result = parameterPath.join("."); - } - else { - result = mapper.serializedName; - } - return result; -} + keys.push.apply(keys, symbols); + } -// Copyright (c) Microsoft Corporation. -/** - * Gets the list of status codes for streaming responses. - * @internal - */ -function getStreamResponseStatusCodes(operationSpec) { - const result = new Set(); - for (const statusCode in operationSpec.responses) { - const operationResponse = operationSpec.responses[statusCode]; - if (operationResponse.bodyMapper && - operationResponse.bodyMapper.type.name === MapperType.Stream) { - result.add(Number(statusCode)); - } - } - return result; + return keys; } -// Copyright (c) Microsoft Corporation. -function getDefaultUserAgentKey() { - return Constants.HeaderConstants.USER_AGENT; -} -function getPlatformSpecificData() { - const runtimeInfo = { - key: "Node", - value: process.version, - }; - const osInfo = { - key: "OS", - value: `(${os__namespace.arch()}-${os__namespace.type()}-${os__namespace.release()})`, - }; - return [runtimeInfo, osInfo]; -} +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; -// Copyright (c) Microsoft Corporation. -function getRuntimeInfo() { - const msRestRuntime = { - key: "core-http", - value: Constants.coreHttpVersion, - }; - return [msRestRuntime]; -} -function getUserAgentString(telemetryInfo, keySeparator = " ", valueSeparator = "/") { - return telemetryInfo - .map((info) => { - const value = info.value ? `${valueSeparator}${info.value}` : ""; - return `${info.key}${value}`; - }) - .join(keySeparator); -} -const getDefaultUserAgentHeaderName = getDefaultUserAgentKey; -/** - * The default approach to generate user agents. - * Uses static information from this package, plus system information available from the runtime. - */ -function getDefaultUserAgentValue() { - const runtimeInfo = getRuntimeInfo(); - const platformSpecificData = getPlatformSpecificData(); - const userAgent = getUserAgentString(runtimeInfo.concat(platformSpecificData)); - return userAgent; -} -/** - * Returns a policy that adds the user agent header to outgoing requests based on the given {@link TelemetryInfo}. - * @param userAgentData - Telemetry information. - * @returns A new {@link UserAgentPolicy}. - */ -function userAgentPolicy(userAgentData) { - const key = !userAgentData || userAgentData.key === undefined || userAgentData.key === null - ? getDefaultUserAgentKey() - : userAgentData.key; - const value = !userAgentData || userAgentData.value === undefined || userAgentData.value === null - ? getDefaultUserAgentValue() - : userAgentData.value; - return { - create: (nextPolicy, options) => { - return new UserAgentPolicy(nextPolicy, options, key, value); - }, - }; -} -/** - * A policy that adds the user agent header to outgoing requests based on the given {@link TelemetryInfo}. - */ -class UserAgentPolicy extends BaseRequestPolicy { - constructor(_nextPolicy, _options, headerKey, headerValue) { - super(_nextPolicy, _options); - this._nextPolicy = _nextPolicy; - this._options = _options; - this.headerKey = headerKey; - this.headerValue = headerValue; - } - sendRequest(request) { - this.addUserAgentHeader(request); - return this._nextPolicy.sendRequest(request); - } - /** - * Adds the user agent header to the outgoing request. - */ - addUserAgentHeader(request) { - if (!request.headers) { - request.headers = new HttpHeaders(); - } - if (!request.headers.get(this.headerKey) && this.headerValue) { - request.headers.set(this.headerKey, this.headerValue); - } + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } + } + + return target; } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The format that will be used to join an array of values together for a query parameter value. - */ -exports.QueryCollectionFormat = void 0; -(function (QueryCollectionFormat) { - /** - * CSV: Each pair of segments joined by a single comma. - */ - QueryCollectionFormat["Csv"] = ","; - /** - * SSV: Each pair of segments joined by a single space character. - */ - QueryCollectionFormat["Ssv"] = " "; - /** - * TSV: Each pair of segments joined by a single tab character. - */ - QueryCollectionFormat["Tsv"] = "\t"; - /** - * Pipes: Each pair of segments joined by a single pipe character. - */ - QueryCollectionFormat["Pipes"] = "|"; - /** - * Denotes this is an array of values that should be passed to the server in multiple key/value pairs, e.g. `?queryParam=value1&queryParam=value2` - */ - QueryCollectionFormat["Multi"] = "Multi"; -})(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {})); - -// Copyright (c) Microsoft Corporation. -// Default options for the cycler if none are provided -const DEFAULT_CYCLER_OPTIONS = { - forcedRefreshWindowInMs: 1000, - retryIntervalInMs: 3000, - refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry -}; -/** - * Converts an an unreliable access token getter (which may resolve with null) - * into an AccessTokenGetter by retrying the unreliable getter in a regular - * interval. - * - * @param getAccessToken - a function that produces a promise of an access - * token that may fail by returning null - * @param retryIntervalInMs - the time (in milliseconds) to wait between retry - * attempts - * @param timeoutInMs - the timestamp after which the refresh attempt will fail, - * throwing an exception - * @returns - a promise that, if it resolves, will resolve with an access token - */ -async function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) { - // This wrapper handles exceptions gracefully as long as we haven't exceeded - // the timeout. - async function tryGetAccessToken() { - if (Date.now() < timeoutInMs) { - try { - return await getAccessToken(); - } - catch (_a) { - return null; - } - } - else { - const finalToken = await getAccessToken(); - // Timeout is up, so throw if it's still null - if (finalToken === null) { - throw new Error("Failed to refresh access token."); - } - return finalToken; - } - } - let token = await tryGetAccessToken(); - while (token === null) { - await coreUtil.delay(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; -} -/** - * Creates a token cycler from a credential, scopes, and optional settings. - * - * A token cycler represents a way to reliably retrieve a valid access token - * from a TokenCredential. It will handle initializing the token, refreshing it - * when it nears expiration, and synchronizes refresh attempts to avoid - * concurrency hazards. - * - * @param credential - the underlying TokenCredential that provides the access - * token - * @param scopes - the scopes to request authorization for - * @param tokenCyclerOptions - optionally override default settings for the cycler - * - * @returns - a function that reliably produces a valid access token - */ -function createTokenCycler(credential, scopes, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); - /** - * This little holder defines several predicates that we use to construct - * the rules of refreshing the token. - */ - const cycler = { - /** - * Produces true if a refresh job is currently in progress. - */ - get isRefreshing() { - return refreshWorker !== null; - }, - /** - * Produces true if the cycler SHOULD refresh (we are within the refresh - * window and not already refreshing) - */ - get shouldRefresh() { - var _a; - return (!cycler.isRefreshing && - ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now()); - }, - /** - * Produces true if the cycler MUST refresh (null or nearly-expired - * token). - */ - get mustRefresh() { - return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()); - }, - }; - /** - * Starts a refresh job or returns the existing job if one is already - * running. - */ - function refresh(getTokenOptions) { - var _a; - if (!cycler.isRefreshing) { - // We bind `scopes` here to avoid passing it around a lot - const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions); - // Take advantage of promise chaining to insert an assignment to `token` - // before the refresh can be considered done. - refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, - // If we don't have a token, then we should timeout immediately - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now()) - .then((_token) => { - refreshWorker = null; - token = _token; - return token; - }) - .catch((reason) => { - // We also should reset the refresher if we enter a failed state. All - // existing awaiters will throw, but subsequent requests will start a - // new retry chain. - refreshWorker = null; - token = null; - throw reason; - }); - } - return refreshWorker; - } - return async (tokenOptions) => { - // - // Simple rules: - // - If we MUST refresh, then return the refresh task, blocking - // the pipeline until a token is available. - // - If we SHOULD refresh, then run refresh but don't return it - // (we can still use the cached token). - // - Return the token, since it's fine if we didn't return in - // step 1. - // - if (cycler.mustRefresh) - return refresh(tokenOptions); - if (cycler.shouldRefresh) { - refresh(tokenOptions); - } - return token; - }; -} -// #endregion -/** - * Creates a new factory for a RequestPolicy that applies a bearer token to - * the requests' `Authorization` headers. - * - * @param credential - The TokenCredential implementation that can supply the bearer token. - * @param scopes - The scopes for which the bearer token applies. - */ -function bearerTokenAuthenticationPolicy(credential, scopes) { - // This simple function encapsulates the entire process of reliably retrieving the token - const getToken = createTokenCycler(credential, scopes /* , options */); - class BearerTokenAuthenticationPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - async sendRequest(webResource) { - if (!webResource.url.toLowerCase().startsWith("https://")) { - throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); - } - const { token } = await getToken({ - abortSignal: webResource.abortSignal, - tracingOptions: { - tracingContext: webResource.tracingContext, - }, - }); - webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`); - return this._nextPolicy.sendRequest(webResource); - } - } - return { - create: (nextPolicy, options) => { - return new BearerTokenAuthenticationPolicy(nextPolicy, options); - }, - }; -} - -// Copyright (c) Microsoft Corporation. -/** - * Returns a request policy factory that can be used to create an instance of - * {@link DisableResponseDecompressionPolicy}. - */ -function disableResponseDecompressionPolicy() { - return { - create: (nextPolicy, options) => { - return new DisableResponseDecompressionPolicy(nextPolicy, options); - }, - }; -} -/** - * A policy to disable response decompression according to Accept-Encoding header - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding - */ -class DisableResponseDecompressionPolicy extends BaseRequestPolicy { - /** - * Creates an instance of DisableResponseDecompressionPolicy. - * - * @param nextPolicy - - * @param options - - */ - // The parent constructor is protected. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor */ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - /** - * Sends out request. - * - * @param request - - * @returns - */ - async sendRequest(request) { - request.decompressResponse = false; - return this._nextPolicy.sendRequest(request); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Creates a policy that assigns a unique request id to outgoing requests. - * @param requestIdHeaderName - The name of the header to use when assigning the unique id to the request. - */ -function generateClientRequestIdPolicy(requestIdHeaderName = "x-ms-client-request-id") { - return { - create: (nextPolicy, options) => { - return new GenerateClientRequestIdPolicy(nextPolicy, options, requestIdHeaderName); - }, - }; -} -class GenerateClientRequestIdPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, _requestIdHeaderName) { - super(nextPolicy, options); - this._requestIdHeaderName = _requestIdHeaderName; - } - sendRequest(request) { - if (!request.headers.contains(this._requestIdHeaderName)) { - request.headers.set(this._requestIdHeaderName, request.requestId); - } - return this._nextPolicy.sendRequest(request); - } -} - -// Copyright (c) Microsoft Corporation. -let cachedHttpClient; -function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = new NodeFetchHttpClient(); - } - return cachedHttpClient; -} - -// Copyright (c) Microsoft Corporation. -function ndJsonPolicy() { - return { - create: (nextPolicy, options) => { - return new NdJsonPolicy(nextPolicy, options); - }, - }; -} -/** - * NdJsonPolicy that formats a JSON array as newline-delimited JSON - */ -class NdJsonPolicy extends BaseRequestPolicy { - /** - * Creates an instance of KeepAlivePolicy. - */ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - /** - * Sends a request. - */ - async sendRequest(request) { - // There currently isn't a good way to bypass the serializer - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); - } - } - return this._nextPolicy.sendRequest(request); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Stores the patterns specified in NO_PROXY environment variable. - * @internal - */ -const globalNoProxyList = []; -let noProxyListLoaded = false; -/** A cache of whether a host should bypass the proxy. */ -const globalBypassedMap = new Map(); -function loadEnvironmentProxyValue() { - if (!process) { - return undefined; - } - const httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY); - const allProxy = getEnvironmentValue(Constants.ALL_PROXY); - const httpProxy = getEnvironmentValue(Constants.HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; -} -/** - * Check whether the host of a given `uri` matches any pattern in the no proxy list. - * If there's a match, any request sent to the same host shouldn't have the proxy settings set. - * This implementation is a port of https://github.com/Azure/azure-sdk-for-net/blob/8cca811371159e527159c7eb65602477898683e2/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs#L210 - */ -function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; - } - const host = URLBuilder.parse(uri).getHost(); - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); - } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - // This should match either domain it self or any subdomain or host - // .foo.com will match foo.com it self or *.foo.com - if (host.endsWith(pattern)) { - isBypassedFlag = true; - } - else { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } - else { - if (host === pattern) { - isBypassedFlag = true; - } - } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.set(host, isBypassedFlag); - return isBypassedFlag; -} -/** - * @internal - */ -function loadNoProxy() { - const noProxy = getEnvironmentValue(Constants.NO_PROXY); - noProxyListLoaded = true; - if (noProxy) { - return noProxy - .split(",") - .map((item) => item.trim()) - .filter((item) => item.length); - } - return []; -} -/** - * Converts a given URL of a proxy server into `ProxySettings` or attempts to retrieve `ProxySettings` from the current environment if one is not passed. - * @param proxyUrl - URL of the proxy - * @returns The default proxy settings, or undefined. - */ -function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return undefined; - } - } - const { username, password, urlWithoutAuth } = extractAuthFromUrl(proxyUrl); - const parsedUrl = URLBuilder.parse(urlWithoutAuth); - const schema = parsedUrl.getScheme() ? parsedUrl.getScheme() + "://" : ""; - return { - host: schema + parsedUrl.getHost(), - port: Number.parseInt(parsedUrl.getPort() || "80"), - username, - password, - }; -} -/** - * A policy that allows one to apply proxy settings to all requests. - * If not passed static settings, they will be retrieved from the HTTPS_PROXY - * or HTTP_PROXY environment variables. - * @param proxySettings - ProxySettings to use on each request. - * @param options - additional settings, for example, custom NO_PROXY patterns - */ -function proxyPolicy(proxySettings, options) { - if (!proxySettings) { - proxySettings = getDefaultProxySettings(); - } - if (!noProxyListLoaded) { - globalNoProxyList.push(...loadNoProxy()); - } - return { - create: (nextPolicy, requestPolicyOptions) => { - return new ProxyPolicy(nextPolicy, requestPolicyOptions, proxySettings, options === null || options === void 0 ? void 0 : options.customNoProxyList); - }, - }; -} -function extractAuthFromUrl(url) { - const atIndex = url.indexOf("@"); - if (atIndex === -1) { - return { urlWithoutAuth: url }; - } - const schemeIndex = url.indexOf("://"); - const authStart = schemeIndex !== -1 ? schemeIndex + 3 : 0; - const auth = url.substring(authStart, atIndex); - const colonIndex = auth.indexOf(":"); - const hasPassword = colonIndex !== -1; - const username = hasPassword ? auth.substring(0, colonIndex) : auth; - const password = hasPassword ? auth.substring(colonIndex + 1) : undefined; - const urlWithoutAuth = url.substring(0, authStart) + url.substring(atIndex + 1); - return { - username, - password, - urlWithoutAuth, - }; -} -class ProxyPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, proxySettings, customNoProxyList) { - super(nextPolicy, options); - this.proxySettings = proxySettings; - this.customNoProxyList = customNoProxyList; - } - sendRequest(request) { - var _a; - if (!request.proxySettings && - !isBypassed(request.url, (_a = this.customNoProxyList) !== null && _a !== void 0 ? _a : globalNoProxyList, this.customNoProxyList ? undefined : globalBypassedMap)) { - request.proxySettings = this.proxySettings; - } - return this._nextPolicy.sendRequest(request); - } -} - -// Copyright (c) Microsoft Corporation. -function rpRegistrationPolicy(retryTimeout = 30) { - return { - create: (nextPolicy, options) => { - return new RPRegistrationPolicy(nextPolicy, options, retryTimeout); - }, - }; -} -class RPRegistrationPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, _retryTimeout = 30) { - super(nextPolicy, options); - this._retryTimeout = _retryTimeout; - } - sendRequest(request) { - return this._nextPolicy - .sendRequest(request.clone()) - .then((response) => registerIfNeeded(this, request, response)); - } -} -function registerIfNeeded(policy, request, response) { - if (response.status === 409) { - const rpName = checkRPNotRegisteredError(response.bodyAsText); - if (rpName) { - const urlPrefix = extractSubscriptionUrl(request.url); - return (registerRP(policy, urlPrefix, rpName, request) - // Autoregistration of ${provider} failed for some reason. We will not return this error - // instead will return the initial response with 409 status code back to the user. - // do nothing here as we are returning the original response at the end of this method. - .catch(() => false) - .then((registrationStatus) => { - if (registrationStatus) { - // Retry the original request. We have to change the x-ms-client-request-id - // otherwise Azure endpoint will return the initial 409 (cached) response. - request.headers.set("x-ms-client-request-id", generateUuid()); - return policy._nextPolicy.sendRequest(request.clone()); - } - return response; - })); - } - } - return Promise.resolve(response); -} -/** - * Reuses the headers of the original request and url (if specified). - * @param originalRequest - The original request - * @param reuseUrlToo - Should the url from the original request be reused as well. Default false. - * @returns A new request object with desired headers. - */ -function getRequestEssentials(originalRequest, reuseUrlToo = false) { - const reqOptions = originalRequest.clone(); - if (reuseUrlToo) { - reqOptions.url = originalRequest.url; - } - // We have to change the x-ms-client-request-id otherwise Azure endpoint - // will return the initial 409 (cached) response. - reqOptions.headers.set("x-ms-client-request-id", generateUuid()); - // Set content-type to application/json - reqOptions.headers.set("Content-Type", "application/json; charset=utf-8"); - return reqOptions; -} -/** - * Validates the error code and message associated with 409 response status code. If it matches to that of - * RP not registered then it returns the name of the RP else returns undefined. - * @param body - The response body received after making the original request. - * @returns The name of the RP if condition is satisfied else undefined. - */ -function checkRPNotRegisteredError(body) { - let result, responseBody; - if (body) { - try { - responseBody = JSON.parse(body); - } - catch (err) { - // do nothing; - } - if (responseBody && - responseBody.error && - responseBody.error.message && - responseBody.error.code && - responseBody.error.code === "MissingSubscriptionRegistration") { - const matchRes = responseBody.error.message.match(/.*'(.*)'/i); - if (matchRes) { - result = matchRes.pop(); - } - } - } - return result; -} -/** - * Extracts the first part of the URL, just after subscription: - * https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ - * @param url - The original request url - * @returns The url prefix as explained above. - */ -function extractSubscriptionUrl(url) { - let result; - const matchRes = url.match(/.*\/subscriptions\/[a-f0-9-]+\//gi); - if (matchRes && matchRes[0]) { - result = matchRes[0]; - } - else { - throw new Error(`Unable to extract subscriptionId from the given url - ${url}.`); - } - return result; -} -/** - * Registers the given provider. - * @param policy - The RPRegistrationPolicy this function is being called against. - * @param urlPrefix - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ - * @param provider - The provider name to be registered. - * @param originalRequest - The original request sent by the user that returned a 409 response - * with a message that the provider is not registered. - */ -async function registerRP(policy, urlPrefix, provider, originalRequest) { - const postUrl = `${urlPrefix}providers/${provider}/register?api-version=2016-02-01`; - const getUrl = `${urlPrefix}providers/${provider}?api-version=2016-02-01`; - const reqOptions = getRequestEssentials(originalRequest); - reqOptions.method = "POST"; - reqOptions.url = postUrl; - const response = await policy._nextPolicy.sendRequest(reqOptions); - if (response.status !== 200) { - throw new Error(`Autoregistration of ${provider} failed. Please try registering manually.`); - } - return getRegistrationStatus(policy, getUrl, originalRequest); -} -/** - * Polls the registration status of the provider that was registered. Polling happens at an interval of 30 seconds. - * Polling will happen till the registrationState property of the response body is "Registered". - * @param policy - The RPRegistrationPolicy this function is being called against. - * @param url - The request url for polling - * @param originalRequest - The original request sent by the user that returned a 409 response - * with a message that the provider is not registered. - * @returns True if RP Registration is successful. - */ -async function getRegistrationStatus(policy, url, originalRequest) { - const reqOptions = getRequestEssentials(originalRequest); - reqOptions.url = url; - reqOptions.method = "GET"; - const res = await policy._nextPolicy.sendRequest(reqOptions); - const obj = res.parsedBody; - if (res.parsedBody && obj.registrationState && obj.registrationState === "Registered") { - return true; - } - else { - await coreUtil.delay(policy._retryTimeout * 1000); - return getRegistrationStatus(policy, url, originalRequest); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Creates a policy that signs outgoing requests by calling to the provided `authenticationProvider`'s `signRequest` method. - * @param authenticationProvider - The authentication provider. - * @returns An instance of the {@link SigningPolicy}. - */ -function signingPolicy(authenticationProvider) { - return { - create: (nextPolicy, options) => { - return new SigningPolicy(nextPolicy, options, authenticationProvider); - }, - }; -} -/** - * A policy that signs outgoing requests by calling to the provided `authenticationProvider`'s `signRequest` method. - */ -class SigningPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, authenticationProvider) { - super(nextPolicy, options); - this.authenticationProvider = authenticationProvider; - } - signRequest(request) { - return this.authenticationProvider.signRequest(request); - } - sendRequest(request) { - return this.signRequest(request).then((nextRequest) => this._nextPolicy.sendRequest(nextRequest)); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * A policy that retries when there's a system error, identified by the codes "ETIMEDOUT", "ESOCKETTIMEDOUT", "ECONNREFUSED", "ECONNRESET" or "ENOENT". - * @param retryCount - Maximum number of retries. - * @param retryInterval - The client retry interval, in milliseconds. - * @param minRetryInterval - The minimum retry interval, in milliseconds. - * @param maxRetryInterval - The maximum retry interval, in milliseconds. - * @returns An instance of the {@link SystemErrorRetryPolicy} - */ -function systemErrorRetryPolicy(retryCount, retryInterval, minRetryInterval, maxRetryInterval) { - return { - create: (nextPolicy, options) => { - return new SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval); - }, - }; -} -/** - * A policy that retries when there's a system error, identified by the codes "ETIMEDOUT", "ESOCKETTIMEDOUT", "ECONNREFUSED", "ECONNRESET" or "ENOENT". - * @param retryCount - The client retry count. - * @param retryInterval - The client retry interval, in milliseconds. - * @param minRetryInterval - The minimum retry interval, in milliseconds. - * @param maxRetryInterval - The maximum retry interval, in milliseconds. - */ -class SystemErrorRetryPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval) { - super(nextPolicy, options); - this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; - this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; - this.minRetryInterval = isNumber(minRetryInterval) - ? minRetryInterval - : DEFAULT_CLIENT_MIN_RETRY_INTERVAL; - this.maxRetryInterval = isNumber(maxRetryInterval) - ? maxRetryInterval - : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - } - sendRequest(request) { - return this._nextPolicy - .sendRequest(request.clone()) - .catch((error) => retry(this, request, error.response, error)); - } -} -async function retry(policy, request, operationResponse, err, retryData) { - retryData = updateRetryData(policy, retryData, err); - function shouldPolicyRetry(_response, error) { - if (error && - error.code && - (error.code === "ETIMEDOUT" || - error.code === "ESOCKETTIMEDOUT" || - error.code === "ECONNREFUSED" || - error.code === "ECONNRESET" || - error.code === "ENOENT")) { - return true; - } - return false; - } - if (shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) { - // If previous operation ended with an error and the policy allows a retry, do that - try { - await coreUtil.delay(retryData.retryInterval); - return policy._nextPolicy.sendRequest(request.clone()); - } - catch (nestedErr) { - return retry(policy, request, operationResponse, nestedErr, retryData); - } - } - else { - if (err) { - // If the operation failed in the end, return all errors instead of just the last one - return Promise.reject(retryData.error); - } - return operationResponse; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Maximum number of retries for the throttling retry policy - */ -const DEFAULT_CLIENT_MAX_RETRY_COUNT = 3; - -// Copyright (c) Microsoft Corporation. -const StatusCodes = Constants.HttpConstants.StatusCodes; -/** - * Creates a policy that re-sends the request if the response indicates the request failed because of throttling reasons. - * For example, if the response contains a `Retry-After` header, it will retry sending the request based on the value of that header. - * - * To learn more, please refer to - * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits, - * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and - * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors - * @returns - */ -function throttlingRetryPolicy() { - return { - create: (nextPolicy, options) => { - return new ThrottlingRetryPolicy(nextPolicy, options); - }, - }; -} -const StandardAbortMessage = "The operation was aborted."; -/** - * Creates a policy that re-sends the request if the response indicates the request failed because of throttling reasons. - * For example, if the response contains a `Retry-After` header, it will retry sending the request based on the value of that header. - * - * To learn more, please refer to - * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits, - * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and - * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors - */ -class ThrottlingRetryPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, _handleResponse) { - super(nextPolicy, options); - this.numberOfRetries = 0; - this._handleResponse = _handleResponse || this._defaultResponseHandler; - } - async sendRequest(httpRequest) { - const response = await this._nextPolicy.sendRequest(httpRequest.clone()); - if (response.status !== StatusCodes.TooManyRequests && - response.status !== StatusCodes.ServiceUnavailable) { - return response; - } - else { - return this._handleResponse(httpRequest, response); - } - } - async _defaultResponseHandler(httpRequest, httpResponse) { - var _a; - const retryAfterHeader = httpResponse.headers.get(Constants.HeaderConstants.RETRY_AFTER); - if (retryAfterHeader) { - const delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader); - if (delayInMs) { - this.numberOfRetries += 1; - await coreUtil.delay(delayInMs, { - abortSignal: httpRequest.abortSignal, - abortErrorMsg: StandardAbortMessage, - }); - if ((_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw new abortController.AbortError(StandardAbortMessage); - } - if (this.numberOfRetries < DEFAULT_CLIENT_MAX_RETRY_COUNT) { - return this.sendRequest(httpRequest); - } - else { - return this._nextPolicy.sendRequest(httpRequest); - } - } - } - return httpResponse; - } - static parseRetryAfterHeader(headerValue) { - const retryAfterInSeconds = Number(headerValue); - if (Number.isNaN(retryAfterInSeconds)) { - return ThrottlingRetryPolicy.parseDateRetryAfterHeader(headerValue); - } - else { - return retryAfterInSeconds * 1000; - } - } - static parseDateRetryAfterHeader(headerValue) { - try { - const now = Date.now(); - const date = Date.parse(headerValue); - const diff = date - now; - return Number.isNaN(diff) ? undefined : diff; - } - catch (error) { - return undefined; - } - } -} +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } -// Copyright (c) Microsoft Corporation. -const createSpan = coreTracing.createSpanFunction({ - packagePrefix: "", - namespace: "", -}); -/** - * Creates a policy that wraps outgoing requests with a tracing span. - * @param tracingOptions - Tracing options. - * @returns An instance of the {@link TracingPolicy} class. - */ -function tracingPolicy(tracingOptions = {}) { - return { - create(nextPolicy, options) { - return new TracingPolicy(nextPolicy, options, tracingOptions); - }, - }; -} -/** - * A policy that wraps outgoing requests with a tracing span. - */ -class TracingPolicy extends BaseRequestPolicy { - constructor(nextPolicy, options, tracingOptions) { - super(nextPolicy, options); - this.userAgent = tracingOptions.userAgent; - } - async sendRequest(request) { - if (!request.tracingContext) { - return this._nextPolicy.sendRequest(request); - } - const span = this.tryCreateSpan(request); - if (!span) { - return this._nextPolicy.sendRequest(request); - } - try { - const response = await this._nextPolicy.sendRequest(request); - this.tryProcessResponse(span, response); - return response; - } - catch (err) { - this.tryProcessError(span, err); - throw err; - } - } - tryCreateSpan(request) { - var _a; - try { - // Passing spanOptions as part of tracingOptions to maintain compatibility @azure/core-tracing@preview.13 and earlier. - // We can pass this as a separate parameter once we upgrade to the latest core-tracing. - const { span } = createSpan(`HTTP ${request.method}`, { - tracingOptions: { - spanOptions: Object.assign(Object.assign({}, request.spanOptions), { kind: coreTracing.SpanKind.CLIENT }), - tracingContext: request.tracingContext, - }, - }); - // If the span is not recording, don't do any more work. - if (!span.isRecording()) { - span.end(); - return undefined; - } - const namespaceFromContext = (_a = request.tracingContext) === null || _a === void 0 ? void 0 : _a.getValue(Symbol.for("az.namespace")); - if (typeof namespaceFromContext === "string") { - span.setAttribute("az.namespace", namespaceFromContext); - } - span.setAttributes({ - "http.method": request.method, - "http.url": request.url, - requestId: request.requestId, - }); - if (this.userAgent) { - span.setAttribute("http.user_agent", this.userAgent); - } - // set headers - const spanContext = span.spanContext(); - const traceParentHeader = coreTracing.getTraceParentHeader(spanContext); - if (traceParentHeader && coreTracing.isSpanContextValid(spanContext)) { - request.headers.set("traceparent", traceParentHeader); - const traceState = spanContext.traceState && spanContext.traceState.serialize(); - // if tracestate is set, traceparent MUST be set, so only set tracestate after traceparent - if (traceState) { - request.headers.set("tracestate", traceState); - } - } - return span; - } - catch (error) { - logger.warning(`Skipping creating a tracing span due to an error: ${error.message}`); - return undefined; - } - } - tryProcessError(span, err) { - try { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: err.message, - }); - if (err.statusCode) { - span.setAttribute("http.status_code", err.statusCode); - } - span.end(); - } - catch (error) { - logger.warning(`Skipping tracing span processing due to an error: ${error.message}`); - } - } - tryProcessResponse(span, response) { - try { - span.setAttribute("http.status_code", response.status); - const serviceRequestId = response.headers.get("x-ms-request-id"); - if (serviceRequestId) { - span.setAttribute("serviceRequestId", serviceRequestId); - } - span.setStatus({ - code: coreTracing.SpanStatusCode.OK, - }); - span.end(); - } - catch (error) { - logger.warning(`Skipping tracing span processing due to an error: ${error.message}`); - } - } + return obj; } -// Copyright (c) Microsoft Corporation. -/** - * ServiceClient sends service requests and receives responses. - */ -class ServiceClient { - /** - * The ServiceClient constructor - * @param credentials - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(credentials, - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */ - options) { - if (!options) { - options = {}; - } - this._withCredentials = options.withCredentials || false; - this._httpClient = options.httpClient || getCachedDefaultHttpClient(); - this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger); - let requestPolicyFactories; - if (Array.isArray(options.requestPolicyFactories)) { - logger.info("ServiceClient: using custom request policies"); - requestPolicyFactories = options.requestPolicyFactories; - } - else { - let authPolicyFactory = undefined; - if (coreAuth.isTokenCredential(credentials)) { - logger.info("ServiceClient: creating bearer token authentication policy from provided credentials"); - // Create a wrapped RequestPolicyFactory here so that we can provide the - // correct scope to the BearerTokenAuthenticationPolicy at the first time - // one is requested. This is needed because generated ServiceClient - // implementations do not set baseUri until after ServiceClient's constructor - // is finished, leaving baseUri empty at the time when it is needed to - // build the correct scope name. - const wrappedPolicyFactory = () => { - let bearerTokenPolicyFactory = undefined; - // eslint-disable-next-line @typescript-eslint/no-this-alias - const serviceClient = this; - const serviceClientOptions = options; - return { - create(nextPolicy, createOptions) { - const credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri); - if (!credentialScopes) { - throw new Error(`When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy`); - } - if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) { - bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes); - } - return bearerTokenPolicyFactory.create(nextPolicy, createOptions); - }, - }; - }; - authPolicyFactory = wrappedPolicyFactory(); - } - else if (credentials && typeof credentials.signRequest === "function") { - logger.info("ServiceClient: creating signing policy from provided credentials"); - authPolicyFactory = signingPolicy(credentials); - } - else if (credentials !== undefined && credentials !== null) { - throw new Error("The credentials argument must implement the TokenCredential interface"); - } - logger.info("ServiceClient: using default request policies"); - requestPolicyFactories = createDefaultRequestPolicyFactories(authPolicyFactory, options); - if (options.requestPolicyFactories) { - // options.requestPolicyFactories can also be a function that manipulates - // the default requestPolicyFactories array - const newRequestPolicyFactories = options.requestPolicyFactories(requestPolicyFactories); - if (newRequestPolicyFactories) { - requestPolicyFactories = newRequestPolicyFactories; - } - } - } - this._requestPolicyFactories = requestPolicyFactories; - } - /** - * Send the provided httpRequest. - */ - sendRequest(options) { - if (options === null || options === undefined || typeof options !== "object") { - throw new Error("options cannot be null or undefined and it must be of type object."); - } - let httpRequest; - try { - if (isWebResourceLike(options)) { - options.validateRequestProperties(); - httpRequest = options; - } - else { - httpRequest = new WebResource(); - httpRequest = httpRequest.prepare(options); - } - } - catch (error) { - return Promise.reject(error); - } - let httpPipeline = this._httpClient; - if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) { - for (let i = this._requestPolicyFactories.length - 1; i >= 0; --i) { - httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions); - } - } - return httpPipeline.sendRequest(httpRequest); - } - /** - * Send an HTTP request that is populated using the provided OperationSpec. - * @param operationArguments - The arguments that the HTTP request's templated values will be populated from. - * @param operationSpec - The OperationSpec to use to populate the httpRequest. - * @param callback - The callback to call when the response is received. - */ - async sendOperationRequest(operationArguments, operationSpec, callback) { - var _a; - if (typeof operationArguments.options === "function") { - callback = operationArguments.options; - operationArguments.options = undefined; - } - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const httpRequest = new WebResource(); - let result; - try { - const baseUri = operationSpec.baseUrl || this.baseUri; - if (!baseUri) { - throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use."); - } - httpRequest.method = operationSpec.httpMethod; - httpRequest.operationSpec = operationSpec; - const requestUrl = URLBuilder.parse(baseUri); - if (operationSpec.path) { - requestUrl.appendPath(operationSpec.path); - } - if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) { - for (const urlParameter of operationSpec.urlParameters) { - let urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer); - urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions); - if (!urlParameter.skipEncoding) { - urlParameterValue = encodeURIComponent(urlParameterValue); - } - requestUrl.replaceAll(`{${urlParameter.mapper.serializedName || getPathStringFromParameter(urlParameter)}}`, urlParameterValue); - } - } - if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) { - for (const queryParameter of operationSpec.queryParameters) { - let queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer); - if (queryParameterValue !== undefined && queryParameterValue !== null) { - queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions); - if (queryParameter.collectionFormat !== undefined && - queryParameter.collectionFormat !== null) { - if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) { - if (queryParameterValue.length === 0) { - // The collection is empty, no need to try serializing the current queryParam - continue; - } - else { - for (const index in queryParameterValue) { - const item = queryParameterValue[index]; - queryParameterValue[index] = - item === undefined || item === null ? "" : item.toString(); - } - } - } - else if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Ssv || - queryParameter.collectionFormat === exports.QueryCollectionFormat.Tsv) { - queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); - } - } - if (!queryParameter.skipEncoding) { - if (Array.isArray(queryParameterValue)) { - for (const index in queryParameterValue) { - if (queryParameterValue[index] !== undefined && - queryParameterValue[index] !== null) { - queryParameterValue[index] = encodeURIComponent(queryParameterValue[index]); - } - } - } - else { - queryParameterValue = encodeURIComponent(queryParameterValue); - } - } - if (queryParameter.collectionFormat !== undefined && - queryParameter.collectionFormat !== null && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Multi && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Ssv && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Tsv) { - queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); - } - requestUrl.setQueryParameter(queryParameter.mapper.serializedName || getPathStringFromParameter(queryParameter), queryParameterValue); - } - } - } - httpRequest.url = requestUrl.toString(); - const contentType = operationSpec.contentType || this.requestContentType; - if (contentType && operationSpec.requestBody) { - httpRequest.headers.set("Content-Type", contentType); - } - if (operationSpec.headerParameters) { - for (const headerParameter of operationSpec.headerParameters) { - let headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer); - if (headerValue !== undefined && headerValue !== null) { - headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions); - const headerCollectionPrefix = headerParameter.mapper - .headerCollectionPrefix; - if (headerCollectionPrefix) { - for (const key of Object.keys(headerValue)) { - httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } - else { - httpRequest.headers.set(headerParameter.mapper.serializedName || - getPathStringFromParameter(headerParameter), headerValue); - } - } - } - } - const options = operationArguments.options; - if (options) { - if (options.customHeaders) { - for (const customHeaderName in options.customHeaders) { - httpRequest.headers.set(customHeaderName, options.customHeaders[customHeaderName]); - } - } - if (options.abortSignal) { - httpRequest.abortSignal = options.abortSignal; - } - if (options.timeout) { - httpRequest.timeout = options.timeout; - } - if (options.onUploadProgress) { - httpRequest.onUploadProgress = options.onUploadProgress; - } - if (options.onDownloadProgress) { - httpRequest.onDownloadProgress = options.onDownloadProgress; - } - if (options.spanOptions) { - // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier. - httpRequest.spanOptions = options.spanOptions; - } - if (options.tracingContext) { - httpRequest.tracingContext = options.tracingContext; - } - if (options.shouldDeserialize !== undefined && options.shouldDeserialize !== null) { - httpRequest.shouldDeserialize = options.shouldDeserialize; - } - } - httpRequest.withCredentials = this._withCredentials; - serializeRequestBody(this, httpRequest, operationArguments, operationSpec); - if (httpRequest.streamResponseStatusCodes === undefined) { - httpRequest.streamResponseStatusCodes = getStreamResponseStatusCodes(operationSpec); - } - let rawResponse; - let sendRequestError; - try { - rawResponse = await this.sendRequest(httpRequest); - } - catch (error) { - sendRequestError = error; - } - if (sendRequestError) { - if (sendRequestError.response) { - sendRequestError.details = flattenResponse(sendRequestError.response, operationSpec.responses[sendRequestError.statusCode] || - operationSpec.responses["default"]); - } - result = Promise.reject(sendRequestError); - } - else { - result = Promise.resolve(flattenResponse(rawResponse, operationSpec.responses[rawResponse.status])); - } - } - catch (error) { - result = Promise.reject(error); - } - const cb = callback; - if (cb) { - result - .then((res) => cb(null, res._response.parsedBody, res._response.request, res._response)) - .catch((err) => cb(err)); - } - return result; - } -} -function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) { - var _a, _b, _c, _d, _e, _f; - const serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {}; - const updatedOptions = { - rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "", - includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false, - xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY, - }; - const xmlCharKey = serializerOptions.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer); - const bodyMapper = operationSpec.requestBody.mapper; - const { required, xmlName, xmlElementName, serializedName, xmlNamespace, xmlNamespacePrefix } = bodyMapper; - const typeName = bodyMapper.type.name; - try { - if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { - const requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody); - httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === MapperType.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions); - if (typeName === MapperType.Sequence) { - httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { - rootName: xmlName || serializedName, - xmlCharKey, - }); - } - else if (!isStream) { - httpRequest.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey, - }); - } - } - else if (typeName === MapperType.String && - (((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match("text/plain")) || operationSpec.mediaType === "text")) { - // the String serializer has validated that request body is a string - // so just send the string. - return; - } - else if (!isStream) { - httpRequest.body = JSON.stringify(httpRequest.body); - } - } - } - catch (error) { - throw new Error(`Error "${error.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, undefined, " ")}.`); - } - } - else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - httpRequest.formData = {}; - for (const formDataParameter of operationSpec.formDataParameters) { - const formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer); - if (formDataParameterValue !== undefined && formDataParameterValue !== null) { - const formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter); - httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions); - } - } - } -} -/** - * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself - */ -function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) { - // Composite and Sequence schemas already got their root namespace set during serialization - // We just need to add xmlns to the other schema types - if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { - const result = {}; - result[options.xmlCharKey] = serializedValue; - result[XML_ATTRKEY] = { [xmlnsKey]: xmlNamespace }; - return result; - } - return serializedValue; -} -function getValueOrFunctionResult(value, defaultValueCreator) { - let result; - if (typeof value === "string") { - result = value; - } - else { - result = defaultValueCreator(); - if (typeof value === "function") { - result = value(result); - } - } - return result; -} -function createDefaultRequestPolicyFactories(authPolicyFactory, options) { - const factories = []; - if (options.generateClientRequestIdHeader) { - factories.push(generateClientRequestIdPolicy(options.clientRequestIdHeaderName)); - } - if (authPolicyFactory) { - factories.push(authPolicyFactory); - } - const userAgentHeaderName = getValueOrFunctionResult(options.userAgentHeaderName, getDefaultUserAgentHeaderName); - const userAgentHeaderValue = getValueOrFunctionResult(options.userAgent, getDefaultUserAgentValue); - if (userAgentHeaderName && userAgentHeaderValue) { - factories.push(userAgentPolicy({ key: userAgentHeaderName, value: userAgentHeaderValue })); - } - factories.push(redirectPolicy()); - factories.push(rpRegistrationPolicy(options.rpRegistrationRetryTimeout)); - if (!options.noRetryPolicy) { - factories.push(exponentialRetryPolicy()); - factories.push(systemErrorRetryPolicy()); - factories.push(throttlingRetryPolicy()); - } - factories.push(deserializationPolicy(options.deserializationContentTypes)); - if (coreUtil.isNode) { - factories.push(proxyPolicy(options.proxySettings)); - } - factories.push(logPolicy({ logger: logger.info })); - return factories; -} -/** - * Creates an HTTP pipeline based on the given options. - * @param pipelineOptions - Defines options that are used to configure policies in the HTTP pipeline for an SDK client. - * @param authPolicyFactory - An optional authentication policy factory to use for signing requests. - * @returns A set of options that can be passed to create a new {@link ServiceClient}. - */ -function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { - const requestPolicyFactories = []; - if (pipelineOptions.sendStreamingJson) { - requestPolicyFactories.push(ndJsonPolicy()); - } - let userAgentValue = undefined; - if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) { - const userAgentInfo = []; - userAgentInfo.push(pipelineOptions.userAgentOptions.userAgentPrefix); - // Add the default user agent value if it isn't already specified - // by the userAgentPrefix option. - const defaultUserAgentInfo = getDefaultUserAgentValue(); - if (userAgentInfo.indexOf(defaultUserAgentInfo) === -1) { - userAgentInfo.push(defaultUserAgentInfo); - } - userAgentValue = userAgentInfo.join(" "); - } - const keepAliveOptions = Object.assign(Object.assign({}, DefaultKeepAliveOptions), pipelineOptions.keepAliveOptions); - const retryOptions = Object.assign(Object.assign({}, DefaultRetryOptions), pipelineOptions.retryOptions); - const redirectOptions = Object.assign(Object.assign({}, DefaultRedirectOptions), pipelineOptions.redirectOptions); - if (coreUtil.isNode) { - requestPolicyFactories.push(proxyPolicy(pipelineOptions.proxyOptions)); - } - const deserializationOptions = Object.assign(Object.assign({}, DefaultDeserializationOptions), pipelineOptions.deserializationOptions); - const loggingOptions = Object.assign({}, pipelineOptions.loggingOptions); - requestPolicyFactories.push(tracingPolicy({ userAgent: userAgentValue }), keepAlivePolicy(keepAliveOptions), userAgentPolicy({ value: userAgentValue }), generateClientRequestIdPolicy(), deserializationPolicy(deserializationOptions.expectedContentTypes), throttlingRetryPolicy(), systemErrorRetryPolicy(), exponentialRetryPolicy(retryOptions.maxRetries, retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs)); - if (redirectOptions.handleRedirects) { - requestPolicyFactories.push(redirectPolicy(redirectOptions.maxRetries)); - } - if (authPolicyFactory) { - requestPolicyFactories.push(authPolicyFactory); - } - requestPolicyFactories.push(logPolicy(loggingOptions)); - if (coreUtil.isNode && pipelineOptions.decompressResponse === false) { - requestPolicyFactories.push(disableResponseDecompressionPolicy()); - } - return { - httpClient: pipelineOptions.httpClient, - requestPolicyFactories, - }; -} -function getOperationArgumentValueFromParameter(serviceClient, operationArguments, parameter, serializer) { - return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer); -} -function getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) { - var _a; - let value; - if (typeof parameterPath === "string") { - parameterPath = [parameterPath]; - } - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - if (Array.isArray(parameterPath)) { - if (parameterPath.length > 0) { - if (parameterMapper.isConstant) { - value = parameterMapper.defaultValue; - } - else { - let propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath); - if (!propertySearchResult.propertyFound) { - propertySearchResult = getPropertyFromParameterPath(serviceClient, parameterPath); - } - let useDefaultValue = false; - if (!propertySearchResult.propertyFound) { - useDefaultValue = - parameterMapper.required || - (parameterPath[0] === "options" && parameterPath.length === 2); - } - value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue; - } - // Serialize just for validation purposes. - const parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper); - serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions); - } - } - else { - if (parameterMapper.required) { - value = {}; - } - for (const propertyName in parameterPath) { - const propertyMapper = parameterMapper.type.modelProperties[propertyName]; - const propertyPath = parameterPath[propertyName]; - const propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer); - // Serialize just for validation purposes. - const propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper); - serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions); - if (propertyValue !== undefined && propertyValue !== null) { - if (!value) { - value = {}; - } - value[propertyName] = propertyValue; - } - } - } - return value; -} -function getPropertyFromParameterPath(parent, parameterPath) { - const result = { propertyFound: false }; - let i = 0; - for (; i < parameterPath.length; ++i) { - const parameterPathPart = parameterPath[i]; - // Make sure to check inherited properties too, so don't use hasOwnProperty(). - if (parent !== undefined && parent !== null && parameterPathPart in parent) { - parent = parent[parameterPathPart]; - } - else { - break; - } - } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; -} -/** - * Parses an {@link HttpOperationResponse} into a normalized HTTP response object ({@link RestResponse}). - * @param _response - Wrapper object for http response. - * @param responseSpec - Mappers for how to parse the response properties. - * @returns - A normalized response object. - */ -function flattenResponse(_response, responseSpec) { - const parsedHeaders = _response.parsedHeaders; - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const addOperationResponse = (obj) => { - return Object.defineProperty(obj, "_response", { - value: _response, - }); - }; - if (bodyMapper) { - const typeName = bodyMapper.type.name; - if (typeName === "Stream") { - return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), { blobBody: _response.blobBody, readableStreamBody: _response.readableStreamBody })); - } - const modelProperties = (typeName === "Composite" && bodyMapper.type.modelProperties) || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (typeName === "Sequence" || isPageableResponse) { - const arrayResponse = [...(_response.parsedBody || [])]; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = _response.parsedBody[key]; - } - } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; - } - } - addOperationResponse(arrayResponse); - return arrayResponse; - } - if (typeName === "Composite" || typeName === "Dictionary") { - return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), _response.parsedBody)); - } - } - if (bodyMapper || - _response.request.method === "HEAD" || - isPrimitiveType(_response.parsedBody)) { - // primitive body types and HEAD booleans - return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), { body: _response.parsedBody })); - } - return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), _response.parsedBody)); -} -function getCredentialScopes(options, baseUri) { - if (options === null || options === void 0 ? void 0 : options.credentialScopes) { - return options.credentialScopes; - } - if (baseUri) { - return `${baseUri}/.default`; - } - return undefined; -} - -// Copyright (c) Microsoft Corporation. -/** - * This function is only here for compatibility. Use createSpanFunction in core-tracing. - * - * @deprecated This function is only here for compatibility. Use createSpanFunction in core-tracing. - * @hidden - - * @param spanConfig - The name of the operation being performed. - * @param tracingOptions - The options for the underlying http request. - */ -function createSpanFunction(args) { - return coreTracing.createSpanFunction(args); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Defines the default token refresh buffer duration. - */ -const TokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes -/** - * Provides an {@link AccessTokenCache} implementation which clears - * the cached {@link AccessToken}'s after the expiresOnTimestamp has - * passed. - * - * @deprecated No longer used in the bearer authorization policy. - */ -class ExpiringAccessTokenCache { - /** - * Constructs an instance of {@link ExpiringAccessTokenCache} with - * an optional expiration buffer time. - */ - constructor(tokenRefreshBufferMs = TokenRefreshBufferMs) { - this.cachedToken = undefined; - this.tokenRefreshBufferMs = tokenRefreshBufferMs; - } - /** - * Saves an access token into the internal in-memory cache. - * @param accessToken - Access token or undefined to clear the cache. - */ - setCachedToken(accessToken) { - this.cachedToken = accessToken; - } - /** - * Returns the cached access token, or `undefined` if one is not cached or the cached one is expiring soon. - */ - getCachedToken() { - if (this.cachedToken && - Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) { - this.cachedToken = undefined; - } - return this.cachedToken; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token. - * - * @deprecated No longer used in the bearer authorization policy. - */ -class AccessTokenRefresher { - constructor(credential, scopes, requiredMillisecondsBeforeNewRefresh = 30000) { - this.credential = credential; - this.scopes = scopes; - this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh; - this.lastCalled = 0; - } - /** - * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying - * that we are ready for a new refresh. - */ - isReady() { - // We're only ready for a new refresh if the required milliseconds have passed. - return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh); - } - /** - * Stores the time in which it is called, - * then requests a new token, - * then sets this.promise to undefined, - * then returns the token. - */ - async getToken(options) { - this.lastCalled = Date.now(); - const token = await this.credential.getToken(this.scopes, options); - this.promise = undefined; - return token || undefined; - } - /** - * Requests a new token if we're not currently waiting for a new token. - * Returns null if the required time between each call hasn't been reached. - */ - refresh(options) { - if (!this.promise) { - this.promise = this.getToken(options); - } - return this.promise; - } -} - -// Copyright (c) Microsoft Corporation. -const HeaderConstants = Constants.HeaderConstants; -const DEFAULT_AUTHORIZATION_SCHEME = "Basic"; -/** - * A simple {@link ServiceClientCredential} that authenticates with a username and a password. - */ -class BasicAuthenticationCredentials { - /** - * Creates a new BasicAuthenticationCredentials object. - * - * @param userName - User name. - * @param password - Password. - * @param authorizationScheme - The authorization scheme. - */ - constructor(userName, password, authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME) { - /** - * Authorization scheme. Defaults to "Basic". - * More information about authorization schemes is available here: https://developer.mozilla.org/docs/Web/HTTP/Authentication#authentication_schemes - */ - this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; - if (userName === null || userName === undefined || typeof userName.valueOf() !== "string") { - throw new Error("userName cannot be null or undefined and must be of type string."); - } - if (password === null || password === undefined || typeof password.valueOf() !== "string") { - throw new Error("password cannot be null or undefined and must be of type string."); - } - this.userName = userName; - this.password = password; - this.authorizationScheme = authorizationScheme; - } - /** - * Signs a request with the Authentication header. - * - * @param webResource - The WebResourceLike to be signed. - * @returns The signed request object. - */ - signRequest(webResource) { - const credentials = `${this.userName}:${this.password}`; - const encodedCredentials = `${this.authorizationScheme} ${encodeString(credentials)}`; - if (!webResource.headers) - webResource.headers = new HttpHeaders(); - webResource.headers.set(HeaderConstants.AUTHORIZATION, encodedCredentials); - return Promise.resolve(webResource); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Authenticates to a service using an API key. - */ -class ApiKeyCredentials { - /** - * @param options - Specifies the options to be provided for auth. Either header or query needs to be provided. - */ - constructor(options) { - if (!options || (options && !options.inHeader && !options.inQuery)) { - throw new Error(`options cannot be null or undefined. Either "inHeader" or "inQuery" property of the options object needs to be provided.`); - } - this.inHeader = options.inHeader; - this.inQuery = options.inQuery; - } - /** - * Signs a request with the values provided in the inHeader and inQuery parameter. - * - * @param webResource - The WebResourceLike to be signed. - * @returns The signed request object. - */ - signRequest(webResource) { - if (!webResource) { - return Promise.reject(new Error(`webResource cannot be null or undefined and must be of type "object".`)); - } - if (this.inHeader) { - if (!webResource.headers) { - webResource.headers = new HttpHeaders(); - } - for (const headerName in this.inHeader) { - webResource.headers.set(headerName, this.inHeader[headerName]); - } - } - if (this.inQuery) { - if (!webResource.url) { - return Promise.reject(new Error(`url cannot be null in the request object.`)); - } - if (webResource.url.indexOf("?") < 0) { - webResource.url += "?"; - } - for (const key in this.inQuery) { - if (!webResource.url.endsWith("?")) { - webResource.url += "&"; - } - webResource.url += `${key}=${this.inQuery[key]}`; - } - } - return Promise.resolve(webResource); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * A {@link TopicCredentials} object used for Azure Event Grid. - */ -class TopicCredentials extends ApiKeyCredentials { - /** - * Creates a new EventGrid TopicCredentials object. - * - * @param topicKey - The EventGrid topic key - */ - constructor(topicKey) { - if (!topicKey || (topicKey && typeof topicKey !== "string")) { - throw new Error("topicKey cannot be null or undefined and must be of type string."); - } - const options = { - inHeader: { - "aeg-sas-key": topicKey, - }, - }; - super(options); - } -} - -Object.defineProperty(exports, "delay", ({ - enumerable: true, - get: function () { return coreUtil.delay; } -})); -Object.defineProperty(exports, "isNode", ({ - enumerable: true, - get: function () { return coreUtil.isNode; } -})); -Object.defineProperty(exports, "isTokenCredential", ({ - enumerable: true, - get: function () { return coreAuth.isTokenCredential; } -})); -exports.AccessTokenRefresher = AccessTokenRefresher; -exports.ApiKeyCredentials = ApiKeyCredentials; -exports.BaseRequestPolicy = BaseRequestPolicy; -exports.BasicAuthenticationCredentials = BasicAuthenticationCredentials; -exports.Constants = Constants; -exports.DefaultHttpClient = NodeFetchHttpClient; -exports.ExpiringAccessTokenCache = ExpiringAccessTokenCache; -exports.HttpHeaders = HttpHeaders; -exports.MapperType = MapperType; -exports.RequestPolicyOptions = RequestPolicyOptions; -exports.RestError = RestError; -exports.Serializer = Serializer; -exports.ServiceClient = ServiceClient; -exports.TopicCredentials = TopicCredentials; -exports.URLBuilder = URLBuilder; -exports.URLQuery = URLQuery; -exports.WebResource = WebResource; -exports.XML_ATTRKEY = XML_ATTRKEY; -exports.XML_CHARKEY = XML_CHARKEY; -exports.applyMixins = applyMixins; -exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; -exports.createPipelineFromOptions = createPipelineFromOptions; -exports.createSpanFunction = createSpanFunction; -exports.deserializationPolicy = deserializationPolicy; -exports.deserializeResponseBody = deserializeResponseBody; -exports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy; -exports.encodeUri = encodeUri; -exports.executePromisesSequentially = executePromisesSequentially; -exports.exponentialRetryPolicy = exponentialRetryPolicy; -exports.flattenResponse = flattenResponse; -exports.generateClientRequestIdPolicy = generateClientRequestIdPolicy; -exports.generateUuid = generateUuid; -exports.getDefaultProxySettings = getDefaultProxySettings; -exports.getDefaultUserAgentValue = getDefaultUserAgentValue; -exports.isDuration = isDuration; -exports.isValidUuid = isValidUuid; -exports.keepAlivePolicy = keepAlivePolicy; -exports.logPolicy = logPolicy; -exports.operationOptionsToRequestOptionsBase = operationOptionsToRequestOptionsBase; -exports.parseXML = parseXML; -exports.promiseToCallback = promiseToCallback; -exports.promiseToServiceCallback = promiseToServiceCallback; -exports.proxyPolicy = proxyPolicy; -exports.redirectPolicy = redirectPolicy; -exports.serializeObject = serializeObject; -exports.signingPolicy = signingPolicy; -exports.stringifyXML = stringifyXML; -exports.stripRequest = stripRequest; -exports.stripResponse = stripResponse; -exports.systemErrorRetryPolicy = systemErrorRetryPolicy; -exports.throttlingRetryPolicy = throttlingRetryPolicy; -exports.tracingPolicy = tracingPolicy; -exports.userAgentPolicy = userAgentPolicy; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 15862: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var logger$1 = __nccwpck_require__(54505); -var abortController = __nccwpck_require__(68110); -var coreUtil = __nccwpck_require__(58735); - -// Copyright (c) Microsoft Corporation. -/** - * The `@azure/logger` configuration for this package. - * @internal - */ -const logger = logger$1.createClientLogger("core-lro"); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The default time interval to wait before sending the next polling request. - */ -const POLL_INTERVAL_IN_MS = 2000; -/** - * The closed set of terminal states. - */ -const terminalStates = ["succeeded", "canceled", "failed"]; - -// Copyright (c) Microsoft Corporation. -/** - * Deserializes the state - */ -function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } - catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } -} -function setStateError(inputs) { - const { state, stateProxy, isOperationError } = inputs; - return (error) => { - if (isOperationError(error)) { - stateProxy.setError(state, error); - stateProxy.setFailed(state); - } - throw error; - }; -} -function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; - } - return message + " " + innerMessage; -} -function simplifyError(err) { - let message = err.message; - let code = err.code; - let curErr = err; - while (curErr.innererror) { - curErr = curErr.innererror; - code = curErr.code; - message = appendReadableErrorMessage(message, curErr.message); - } - return { - code, - message, - }; -} -function processOperationStatus(result) { - const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; - switch (status) { - case "succeeded": { - stateProxy.setSucceeded(state); - break; - } - case "failed": { - const err = getError === null || getError === void 0 ? void 0 : getError(response); - let postfix = ""; - if (err) { - const { code, message } = simplifyError(err); - postfix = `. ${code}. ${message}`; - } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - logger.warning(errStr); - break; - } - case "canceled": { - stateProxy.setCanceled(state); - break; - } - } - if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || - (isDone === undefined && - ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) { - stateProxy.setResult(state, buildResult({ - response, - state, - processResult, - })); - } -} -function buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; -} -/** - * Initiates the long-running operation. - */ -async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation, - }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; -} -async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError, - })); - const status = getOperationStatus(response, state); - logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation(response, state); - if (resourceLocation !== undefined) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), - status, - }; - } - } - return { response, status }; -} -/** Polls the long-running operation. */ -async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== undefined) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus, - state, - stateProxy, - operationLocation, - getResourceLocation, - isOperationError, - options, - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult, - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state); - if (location !== undefined) { - const isUpdated = operationLocation !== location; - state.config.operationLocation = location; - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated); - } - else - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - } - updateState === null || updateState === void 0 ? void 0 : updateState(state, response); - } -} - -// Copyright (c) Microsoft Corporation. -function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; -} -function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; -} -function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; -} -function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; -} -function findResourceLocation(inputs) { - var _a; - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return undefined; - } - case "PATCH": { - return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; - } - default: { - return getDefault(); - } - } - function getDefault() { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return undefined; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } - } - } -} -function inferLroMode(inputs) { - const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; - const operationLocation = getOperationLocationHeader(rawResponse); - const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); - const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); - const location = getLocationHeader(rawResponse); - const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase(); - if (pollingUrl !== undefined) { - return { - mode: "OperationLocation", - operationLocation: pollingUrl, - resourceLocation: findResourceLocation({ - requestMethod: normalizedRequestMethod, - location, - requestPath, - resourceLocationConfig, - }), - }; - } - else if (location !== undefined) { - return { - mode: "ResourceLocation", - operationLocation: location, - }; - } - else if (normalizedRequestMethod === "PUT" && requestPath) { - return { - mode: "Body", - operationLocation: requestPath, - }; - } - else { - return undefined; - } -} -function transformStatus(inputs) { - const { status, statusCode } = inputs; - if (typeof status !== "string" && status !== undefined) { - throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); - } - switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) { - case undefined: - return toOperationStatus(statusCode); - case "succeeded": - return "succeeded"; - case "failed": - return "failed"; - case "running": - case "accepted": - case "started": - case "canceling": - case "cancelling": - return "running"; - case "canceled": - case "cancelled": - return "canceled"; - default: { - logger.verbose(`LRO: unrecognized operation status: ${status}`); - return status; - } - } -} -function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); -} -function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; - return transformStatus({ status, statusCode: rawResponse.statusCode }); -} -function toOperationStatus(statusCode) { - if (statusCode === 202) { - return "running"; - } - else if (statusCode < 300) { - return "succeeded"; - } - else { - return "failed"; - } -} -function parseRetryAfter({ rawResponse }) { - const retryAfter = rawResponse.headers["retry-after"]; - if (retryAfter !== undefined) { - // Retry-After header value is either in HTTP date format, or in seconds - const retryAfterInSeconds = parseInt(retryAfter); - return isNaN(retryAfterInSeconds) - ? calculatePollingIntervalFromDate(new Date(retryAfter)) - : retryAfterInSeconds * 1000; - } - return undefined; -} -function getErrorFromResponse(response) { - const error = response.flatResponse.error; - if (!error) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error.code || !error.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error; -} -function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor(new Date().getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; - } - return undefined; -} -function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case undefined: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } - } - const status = helper(); - return status === "running" && operationLocation === undefined ? "succeeded" : status; -} -/** - * Initiates the long-running operation. - */ -async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig, - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); - }, - stateProxy, - processResult: processResult - ? ({ flatResponse }, state) => processResult(flatResponse, state) - : ({ flatResponse }) => flatResponse, - getOperationStatus: getStatusFromInitialResponse, - setErrorAsResult, - }); -} -function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse), - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); - } - case "Body": - default: { - return undefined; - } - } -} -function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); - } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); - } -} -function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== undefined) { - state.config.resourceLocation = resourceLocation; - } - } - return state.config.resourceLocation; -} -function isOperationError(e) { - return e.name === "RestError"; -} -/** Polls the long-running operation. */ -async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs; - return pollOperation({ - state, - stateProxy, - setDelay, - processResult: processResult - ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) - : ({ flatResponse }) => flatResponse, - getError: getErrorFromResponse, - updateState, - getPollingInterval: parseRetryAfter, - getOperationLocation, - getOperationStatus, - isOperationError, - getResourceLocation, - options, - /** - * The expansion here is intentional because `lro` could be an object that - * references an inner this, so we need to preserve a reference to it. - */ - poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), - setErrorAsResult, - }); -} - -// Copyright (c) Microsoft Corporation. -const createStateProxy$1 = () => ({ - /** - * The state at this point is created to be of type OperationState. - * It will be updated later to be of type TState when the - * customer-provided callback, `updateState`, is called during polling. - */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => (state.status = "canceled"), - setError: (state, error) => (state.error = error), - setResult: (state, result) => (state.result = result), - setRunning: (state) => (state.status = "running"), - setSucceeded: (state) => (state.status = "succeeded"), - setFailed: (state) => (state.status = "failed"), - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => state.status === "canceled", - isFailed: (state) => state.status === "failed", - isRunning: (state) => state.status === "running", - isSucceeded: (state) => state.status === "succeeded", -}); -/** - * Returns a poller factory. - */ -function buildCreatePoller(inputs) { - const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; - const stateProxy = createStateProxy$1(); - const withOperationLocation = withOperationLocationCallback - ? (() => { - let called = false; - return (operationLocation, isUpdated) => { - if (isUpdated) - withOperationLocationCallback(operationLocation); - else if (!called) - withOperationLocationCallback(operationLocation); - called = true; - }; - })() - : undefined; - const state = restoreFrom - ? deserializeState(restoreFrom) - : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful, - }); - let resultPromise; - const abortController$1 = new abortController.AbortController(); - const handlers = new Map(); - const handleProgressEvents = async () => handlers.forEach((h) => h(state)); - const cancelErrMsg = "Operation was canceled"; - let currentPollIntervalInMs = intervalInMs; - const poller = { - getOperationState: () => state, - getResult: () => state.result, - isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), - isStopped: () => resultPromise === undefined, - stopPolling: () => { - abortController$1.abort(); - }, - toString: () => JSON.stringify({ - state, - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal - ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) - : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - if (resolveOnUnsuccessful) { - return poller.getResult(); - } - else { - switch (state.status) { - case "succeeded": - return poller.getResult(); - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - case "notStarted": - case "running": - throw new Error(`Polling completed without succeeding or failing`); - } - } - })().finally(() => { - resultPromise = undefined; - }))), - async poll(pollOptions) { - if (resolveOnUnsuccessful) { - if (poller.isDone()) - return; - } - else { - switch (state.status) { - case "succeeded": - return; - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - await pollOperation({ - poll, - state, - stateProxy, - getOperationLocation, - isOperationError, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation, - processResult, - getError, - updateState, - options: pollOptions, - setDelay: (pollIntervalInMs) => { - currentPollIntervalInMs = pollIntervalInMs; - }, - setErrorAsResult: !resolveOnUnsuccessful, - }); - await handleProgressEvents(); - if (!resolveOnUnsuccessful) { - switch (state.status) { - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - }, - }; - return poller; - }; -} - -// Copyright (c) Microsoft Corporation. -/** - * Creates a poller that can be used to poll a long-running operation. - * @param lro - Description of the long-running operation - * @param options - options to configure the poller - * @returns an initialized poller - */ -async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful, - })({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig, - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); - }, - poll: lro.sendPollRequest, - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult - ? ({ flatResponse }, state) => processResult(flatResponse, state) - : ({ flatResponse }) => flatResponse, - }); -} - -// Copyright (c) Microsoft Corporation. -const createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => (state.isCancelled = true), - setError: (state, error) => (state.error = error), - setResult: (state, result) => (state.result = result), - setRunning: (state) => (state.isStarted = true), - setSucceeded: (state) => (state.isCompleted = true), - setFailed: () => { - /** empty body */ - }, - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => !!state.isCancelled, - isFailed: (state) => !!state.error, - isRunning: (state) => !!state.isStarted, - isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), -}); -class GenericPollOperation { - constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { - this.state = state; - this.lro = lro; - this.setErrorAsResult = setErrorAsResult; - this.lroResourceLocationConfig = lroResourceLocationConfig; - this.processResult = processResult; - this.updateState = updateState; - this.isDone = isDone; - } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; - } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), (await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult, - }))); - } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === undefined) { - await pollHttpOperation({ - lro: this.lro, - state: this.state, - stateProxy, - processResult: this.processResult, - updateState: updateState - ? (state, { rawResponse }) => updateState(state, rawResponse) - : undefined, - isDone: isDone - ? ({ flatResponse }, state) => isDone(flatResponse, state) - : undefined, - options, - setDelay: (intervalInMs) => { - this.pollerConfig.intervalInMs = intervalInMs; - }, - setErrorAsResult: this.setErrorAsResult, - }); - } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; - } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; - } - /** - * Serializes the Poller operation. - */ - toString() { - return JSON.stringify({ - state: this.state, - }); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * When a poller is manually stopped through the `stopPolling` method, - * the poller will be rejected with an instance of the PollerStoppedError. - */ -class PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, PollerStoppedError.prototype); - } -} -/** - * When the operation is cancelled, the poller will be rejected with an instance - * of the PollerCancelledError. - */ -class PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, PollerCancelledError.prototype); - } -} -/** - * A class that represents the definition of a program that polls through consecutive requests - * until it reaches a state of completion. - * - * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed. - * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes. - * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation. - * - * ```ts - * const poller = new MyPoller(); - * - * // Polling just once: - * await poller.poll(); - * - * // We can try to cancel the request here, by calling: - * // - * // await poller.cancelOperation(); - * // - * - * // Getting the final result: - * const result = await poller.pollUntilDone(); - * ``` - * - * The Poller is defined by two types, a type representing the state of the poller, which - * must include a basic set of properties from `PollOperationState`, - * and a return type defined by `TResult`, which can be anything. - * - * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having - * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type. - * - * ```ts - * class Client { - * public async makePoller: PollerLike { - * const poller = new MyPoller({}); - * // It might be preferred to return the poller after the first request is made, - * // so that some information can be obtained right away. - * await poller.poll(); - * return poller; - * } - * } - * - * const poller: PollerLike = myClient.makePoller(); - * ``` - * - * A poller can be created through its constructor, then it can be polled until it's completed. - * At any point in time, the state of the poller can be obtained without delay through the getOperationState method. - * At any point in time, the intermediate forms of the result type can be requested without delay. - * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned. - * - * ```ts - * const poller = myClient.makePoller(); - * const state: MyOperationState = poller.getOperationState(); - * - * // The intermediate result can be obtained at any time. - * const result: MyResult | undefined = poller.getResult(); - * - * // The final result can only be obtained after the poller finishes. - * const result: MyResult = await poller.pollUntilDone(); - * ``` - * - */ -// eslint-disable-next-line no-use-before-define -class Poller { - /** - * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. - * - * When writing an implementation of a Poller, this implementation needs to deal with the initialization - * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's - * operation has already been defined, at least its basic properties. The code below shows how to approach - * the definition of the constructor of a new custom poller. - * - * ```ts - * export class MyPoller extends Poller { - * constructor({ - * // Anything you might need outside of the basics - * }) { - * let state: MyOperationState = { - * privateProperty: private, - * publicProperty: public, - * }; - * - * const operation = { - * state, - * update, - * cancel, - * toString - * } - * - * // Sending the operation to the parent's constructor. - * super(operation); - * - * // You can assign more local properties here. - * } - * } - * ``` - * - * Inside of this constructor, a new promise is created. This will be used to - * tell the user when the poller finishes (see `pollUntilDone()`). The promise's - * resolve and reject methods are also used internally to control when to resolve - * or reject anyone waiting for the poller to finish. - * - * The constructor of a custom implementation of a poller is where any serialized version of - * a previous poller's operation should be deserialized into the operation sent to the - * base constructor. For example: - * - * ```ts - * export class MyPoller extends Poller { - * constructor( - * baseOperation: string | undefined - * ) { - * let state: MyOperationState = {}; - * if (baseOperation) { - * state = { - * ...JSON.parse(baseOperation).state, - * ...state - * }; - * } - * const operation = { - * state, - * // ... - * } - * super(operation); - * } - * } - * ``` - * - * @param operation - Must contain the basic properties of `PollOperation`. - */ - constructor(operation) { - /** controls whether to throw an error if the operation failed or was canceled. */ - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown. - // The above warning would get thrown if `poller.poll` is called, it returns an error, - // and pullUntilDone did not have a .catch or await try/catch on it's return value. - this.promise.catch(() => { - /* intentionally blank */ - }); - } - /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. - */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); - } - } - /** - * pollOnce does one polling, by calling to the update method of the underlying - * poll operation to make any relevant change effective. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * @param options - Optional properties passed to the operation's update method. - */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this), - }); - } - this.processUpdatedState(); - } - /** - * fireProgress calls the functions passed in via onProgress the method of the poller. - * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. - * - * @param state - The current operation state. - */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); - } - } - /** - * Invokes the underlying operation's cancel method. - */ - async cancelOnce(options = {}) { - this.operation = await this.operation.cancel(options); - } - /** - * Returns a promise that will resolve once a single polling request finishes. - * It does this by calling the update method of the Poller's operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * @param options - Optional properties passed to the operation's update method. - */ - poll(options = {}) { - if (!this.pollOncePromise) { - this.pollOncePromise = this.pollOnce(options); - const clearPollOncePromise = () => { - this.pollOncePromise = undefined; - }; - this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); - } - return this.pollOncePromise; - } - processUpdatedState() { - if (this.operation.state.error) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - this.reject(this.operation.state.error); - throw this.operation.state.error; - } - } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error = new PollerCancelledError("Operation was canceled"); - this.reject(error); - throw error; - } - } - if (this.isDone() && this.resolve) { - // If the poller has finished polling, this means we now have a result. - // However, it can be the case that TResult is instantiated to void, so - // we are not expecting a result anyway. To assert that we might not - // have a result eventually after finishing polling, we cast the result - // to TResult. - this.resolve(this.getResult()); - } - } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); - } - // This is needed because the state could have been updated by - // `cancelOperation`, e.g. the operation is canceled or an error occurred. - this.processUpdatedState(); - return this.promise; - } - /** - * Invokes the provided callback after each polling is completed, - * sending the current state of the poller's operation. - * - * It returns a method that can be used to stop receiving updates on the given callback function. - */ - onProgress(callback) { - this.pollProgressCallbacks.push(callback); - return () => { - this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); - }; - } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); - } - /** - * Stops the poller from continuing to poll. - */ - stopPolling() { - if (!this.stopped) { - this.stopped = true; - if (this.reject) { - this.reject(new PollerStoppedError("This poller is already stopped")); - } - } - } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; - } - /** - * Attempts to cancel the underlying operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * If it's called again before it finishes, it will throw an error. - * - * @param options - Optional properties passed to the operation's update method. - */ - cancelOperation(options = {}) { - if (!this.cancelPromise) { - this.cancelPromise = this.cancelOnce(options); - } - else if (options.abortSignal) { - throw new Error("A cancel request is currently pending"); - } - return this.cancelPromise; - } - /** - * Returns the state of the operation. - * - * Even though TState will be the same type inside any of the methods of any extension of the Poller class, - * implementations of the pollers can customize what's shared with the public by writing their own - * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller - * and a public type representing a safe to share subset of the properties of the internal state. - * Their definition of getOperationState can then return their public type. - * - * Example: - * - * ```ts - * // Let's say we have our poller's operation state defined as: - * interface MyOperationState extends PollOperationState { - * privateProperty?: string; - * publicProperty?: string; - * } - * - * // To allow us to have a true separation of public and private state, we have to define another interface: - * interface PublicState extends PollOperationState { - * publicProperty?: string; - * } - * - * // Then, we define our Poller as follows: - * export class MyPoller extends Poller { - * // ... More content is needed here ... - * - * public getOperationState(): PublicState { - * const state: PublicState = this.operation.state; - * return { - * // Properties from PollOperationState - * isStarted: state.isStarted, - * isCompleted: state.isCompleted, - * isCancelled: state.isCancelled, - * error: state.error, - * result: state.result, - * - * // The only other property needed by PublicState. - * publicProperty: state.publicProperty - * } - * } - * } - * ``` - * - * You can see this in the tests of this repository, go to the file: - * `../test/utils/testPoller.ts` - * and look for the getOperationState implementation. - */ - getOperationState() { - return this.operation.state; - } - /** - * Returns the result value of the operation, - * regardless of the state of the poller. - * It can return undefined or an incomplete form of the final TResult value - * depending on the implementation. - */ - getResult() { - const state = this.operation.state; - return state.result; - } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * The LRO Engine, a class that performs polling. - */ -class LroEngine extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {}; - const state = resumeFrom - ? deserializeState(resumeFrom) - : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs: intervalInMs }; - operation.setPollerConfig(this.config); - } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); - } -} - -exports.LroEngine = LroEngine; -exports.Poller = Poller; -exports.PollerCancelledError = PollerCancelledError; -exports.PollerStoppedError = PollerStoppedError; -exports.createHttpPoller = createHttpPoller; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 9851: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var tslib = __nccwpck_require__(61860); - -// Copyright (c) Microsoft Corporation. -/** - * returns an async iterator that iterates over results. It also has a `byPage` - * method that returns pages of items at once. - * - * @param pagedResult - an object that specifies how to get pages. - * @returns a paged async iterator that iterates over results. - */ -function getPagedAsyncIterator(pagedResult) { - var _a; - const iter = getItemAsyncIterator(pagedResult); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => { - const { continuationToken, maxPageSize } = settings !== null && settings !== void 0 ? settings : {}; - return getPageAsyncIterator(pagedResult, { - pageLink: continuationToken, - maxPageSize, - }); - }), - }; -} -function getItemAsyncIterator(pagedResult) { - return tslib.__asyncGenerator(this, arguments, function* getItemAsyncIterator_1() { - var e_1, _a, e_2, _b; - const pages = getPageAsyncIterator(pagedResult); - const firstVal = yield tslib.__await(pages.next()); - // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is - if (!Array.isArray(firstVal.value)) { - // can extract elements from this page - const { toElements } = pagedResult; - if (toElements) { - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(toElements(firstVal.value)))); - try { - for (var pages_1 = tslib.__asyncValues(pages), pages_1_1; pages_1_1 = yield tslib.__await(pages_1.next()), !pages_1_1.done;) { - const page = pages_1_1.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(toElements(page)))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (pages_1_1 && !pages_1_1.done && (_a = pages_1.return)) yield tslib.__await(_a.call(pages_1)); - } - finally { if (e_1) throw e_1.error; } - } - } - else { - yield yield tslib.__await(firstVal.value); - // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(pages))); - } - } - else { - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(firstVal.value))); - try { - for (var pages_2 = tslib.__asyncValues(pages), pages_2_1; pages_2_1 = yield tslib.__await(pages_2.next()), !pages_2_1.done;) { - const page = pages_2_1.value; - // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, - // it must be the case that `TPage = TElement[]` - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page))); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (pages_2_1 && !pages_2_1.done && (_b = pages_2.return)) yield tslib.__await(_b.call(pages_2)); - } - finally { if (e_2) throw e_2.error; } - } - } - }); -} -function getPageAsyncIterator(pagedResult, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* getPageAsyncIterator_1() { - const { pageLink, maxPageSize } = options; - let response = yield tslib.__await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink, maxPageSize)); - if (!response) { - return yield tslib.__await(void 0); - } - yield yield tslib.__await(response.page); - while (response.nextPageLink) { - response = yield tslib.__await(pagedResult.getPage(response.nextPageLink, maxPageSize)); - if (!response) { - return yield tslib.__await(void 0); - } - yield yield tslib.__await(response.page); - } - }); -} - -exports.getPagedAsyncIterator = getPagedAsyncIterator; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 15553: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var api = __nccwpck_require__(63914); - -// Copyright (c) Microsoft Corporation. -(function (SpanKind) { - /** Default value. Indicates that the span is used internally. */ - SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; -})(exports.SpanKind || (exports.SpanKind = {})); -/** - * Return the span if one exists - * - * @param context - context to get span from - */ -function getSpan(context) { - return api.trace.getSpan(context); -} -/** - * Set the span on a context - * - * @param context - context to use as parent - * @param span - span to set active - */ -function setSpan(context, span) { - return api.trace.setSpan(context, span); -} -/** - * Wrap span context in a NoopSpan and set as span in a new - * context - * - * @param context - context to set active span on - * @param spanContext - span context to be wrapped - */ -function setSpanContext(context, spanContext) { - return api.trace.setSpanContext(context, spanContext); -} -/** - * Get the span context of the span if it exists. - * - * @param context - context to get values from - */ -function getSpanContext(context) { - return api.trace.getSpanContext(context); -} -/** - * Returns true of the given {@link SpanContext} is valid. - * A valid {@link SpanContext} is one which has a valid trace ID and span ID as per the spec. - * - * @param context - the {@link SpanContext} to validate. - * - * @returns true if the {@link SpanContext} is valid, false otherwise. - */ -function isSpanContextValid(context) { - return api.trace.isSpanContextValid(context); -} -function getTracer(name, version) { - return api.trace.getTracer(name || "azure/core-tracing", version); -} -/** Entrypoint for context API */ -const context = api.context; -(function (SpanStatusCode) { - /** - * The default status. - */ - SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; - /** - * The operation contains an error. - */ - SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; -})(exports.SpanStatusCode || (exports.SpanStatusCode = {})); - -// Copyright (c) Microsoft Corporation. -function isTracingDisabled() { - var _a; - if (typeof process === "undefined") { - // not supported in browser for now without polyfills - return false; - } - const azureTracingDisabledValue = (_a = process.env.AZURE_TRACING_DISABLED) === null || _a === void 0 ? void 0 : _a.toLowerCase(); - if (azureTracingDisabledValue === "false" || azureTracingDisabledValue === "0") { - return false; - } - return Boolean(azureTracingDisabledValue); -} -/** - * Creates a function that can be used to create spans using the global tracer. - * - * Usage: - * - * ```typescript - * // once - * const createSpan = createSpanFunction({ packagePrefix: "Azure.Data.AppConfiguration", namespace: "Microsoft.AppConfiguration" }); - * - * // in each operation - * const span = createSpan("deleteConfigurationSetting", operationOptions); - * // code... - * span.end(); - * ``` - * - * @hidden - * @param args - allows configuration of the prefix for each span as well as the az.namespace field. - */ -function createSpanFunction(args) { - return function (operationName, operationOptions) { - const tracer = getTracer(); - const tracingOptions = (operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) || {}; - const spanOptions = Object.assign({ kind: exports.SpanKind.INTERNAL }, tracingOptions.spanOptions); - const spanName = args.packagePrefix ? `${args.packagePrefix}.${operationName}` : operationName; - let span; - if (isTracingDisabled()) { - span = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); - } - else { - span = tracer.startSpan(spanName, spanOptions, tracingOptions.tracingContext); - } - if (args.namespace) { - span.setAttribute("az.namespace", args.namespace); - } - let newSpanOptions = tracingOptions.spanOptions || {}; - if (span.isRecording() && args.namespace) { - newSpanOptions = Object.assign(Object.assign({}, tracingOptions.spanOptions), { attributes: Object.assign(Object.assign({}, spanOptions.attributes), { "az.namespace": args.namespace }) }); - } - const newTracingOptions = Object.assign(Object.assign({}, tracingOptions), { spanOptions: newSpanOptions, tracingContext: setSpan(tracingOptions.tracingContext || context.active(), span) }); - const newOperationOptions = Object.assign(Object.assign({}, operationOptions), { tracingOptions: newTracingOptions }); - return { - span, - updatedOptions: newOperationOptions - }; - }; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const VERSION = "00"; -/** - * Generates a `SpanContext` given a `traceparent` header value. - * @param traceParent - Serialized span context data as a `traceparent` header value. - * @returns The `SpanContext` generated from the `traceparent` value. - */ -function extractSpanContextFromTraceParentHeader(traceParentHeader) { - const parts = traceParentHeader.split("-"); - if (parts.length !== 4) { - return; - } - const [version, traceId, spanId, traceOptions] = parts; - if (version !== VERSION) { - return; - } - const traceFlags = parseInt(traceOptions, 16); - const spanContext = { - spanId, - traceId, - traceFlags - }; - return spanContext; -} -/** - * Generates a `traceparent` value given a span context. - * @param spanContext - Contains context for a specific span. - * @returns The `spanContext` represented as a `traceparent` value. - */ -function getTraceParentHeader(spanContext) { - const missingFields = []; - if (!spanContext.traceId) { - missingFields.push("traceId"); - } - if (!spanContext.spanId) { - missingFields.push("spanId"); - } - if (missingFields.length) { - return; - } - const flags = spanContext.traceFlags || 0 /* NONE */; - const hexFlags = flags.toString(16); - const traceFlags = hexFlags.length === 1 ? `0${hexFlags}` : hexFlags; - // https://www.w3.org/TR/trace-context/#traceparent-header-field-values - return `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-${traceFlags}`; -} - -exports.context = context; -exports.createSpanFunction = createSpanFunction; -exports.extractSpanContextFromTraceParentHeader = extractSpanContextFromTraceParentHeader; -exports.getSpan = getSpan; -exports.getSpanContext = getSpanContext; -exports.getTraceParentHeader = getTraceParentHeader; -exports.getTracer = getTracer; -exports.isSpanContextValid = isSpanContextValid; -exports.setSpan = setSpan; -exports.setSpanContext = setSpanContext; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 58735: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -var abortController = __nccwpck_require__(68110); -var crypto = __nccwpck_require__(76982); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Creates an abortable promise. - * @param buildPromise - A function that takes the resolve and reject functions as parameters. - * @param options - The options for the abortable promise. - * @returns A promise that can be aborted. - */ -function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve, reject) => { - function rejectOnAbort() { - reject(new abortController.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); - } - try { - buildPromise((x) => { - removeListeners(); - resolve(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } - catch (err) { - reject(err); - } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const StandardAbortMessage = "The delay was aborted."; -/** - * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. - * @param timeInMs - The number of milliseconds to be delayed. - * @param options - The options for delay - currently abort options - * @returns Promise that is resolved after timeInMs - */ -function delay(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return createAbortablePromise((resolve) => { - token = setTimeout(resolve, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage, - }); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * promise.race() wrapper that aborts rest of promises as soon as the first promise settles. - */ -async function cancelablePromiseRace(abortablePromiseBuilders, options) { - var _a, _b; - const aborter = new abortController.AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } - finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Returns a random integer value between a lower and upper bound, - * inclusive of both bounds. - * Note that this uses Math.random and isn't secure. If you need to use - * this for any kind of security purpose, find a better source of random. - * @param min - The smallest integer value allowed. - * @param max - The largest integer value allowed. - */ -function getRandomIntegerInclusive(min, max) { - // Make sure inputs are integers. - min = Math.ceil(min); - max = Math.floor(max); - // Pick a random offset from zero to the size of the range. - // Since Math.random() can never return 1, we have to make the range one larger - // in order to be inclusive of the maximum value after we take the floor. - const offset = Math.floor(Math.random() * (max - min + 1)); - return offset + min; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper to determine when an input is a generic JS object. - * @returns true when input is an object type that is not null, Array, RegExp, or Date. - */ -function isObject(input) { - return (typeof input === "object" && - input !== null && - !Array.isArray(input) && - !(input instanceof RegExp) && - !(input instanceof Date)); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Typeguard for an error object shape (has name and message) - * @param e - Something caught by a catch clause. - */ -function isError(e) { - if (isObject(e)) { - const hasName = typeof e.name === "string"; - const hasMessage = typeof e.message === "string"; - return hasName && hasMessage; - } - return false; -} -/** - * Given what is thought to be an error object, return the message if possible. - * If the message is missing, returns a stringified version of the input. - * @param e - Something thrown from a try block - * @returns The error message or a string of the input - */ -function getErrorMessage(e) { - if (isError(e)) { - return e.message; - } - else { - let stringified; - try { - if (typeof e === "object" && e) { - stringified = JSON.stringify(e); - } - else { - stringified = String(e); - } - } - catch (err) { - stringified = "[unable to stringify input]"; - } - return `Unknown error ${stringified}`; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Generates a SHA-256 HMAC signature. - * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash. - * @param stringToSign - The data to be signed. - * @param encoding - The textual encoding to use for the returned HMAC digest. - */ -async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return crypto.createHmac("sha256", decodedKey).update(stringToSign).digest(encoding); -} -/** - * Generates a SHA-256 hash. - * @param content - The data to be included in the hash. - * @param encoding - The textual encoding to use for the returned hash. - */ -async function computeSha256Hash(content, encoding) { - return crypto.createHash("sha256").update(content).digest(encoding); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper TypeGuard that checks if something is defined or not. - * @param thing - Anything - */ -function isDefined(thing) { - return typeof thing !== "undefined" && thing !== null; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified properties. - * @param thing - Anything. - * @param properties - The name of the properties that should appear in the object. - */ -function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified property. - * @param thing - Any object. - * @param property - The name of the property that should appear in the object. - */ -function objectHasProperty(thing, property) { - return (isDefined(thing) && typeof thing === "object" && property in thing); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/* - * NOTE: When moving this file, please update "react-native" section in package.json. - */ -/** - * Generated Universally Unique Identifier - * - * @returns RFC4122 v4 UUID. - */ -function generateUUID() { - let uuid = ""; - for (let i = 0; i < 32; i++) { - // Generate a random number between 0 and 15 - const randomNumber = Math.floor(Math.random() * 16); - // Set the UUID version to 4 in the 13th position - if (i === 12) { - uuid += "4"; - } - else if (i === 16) { - // Set the UUID variant to "10" in the 17th position - uuid += (randomNumber & 0x3) | 0x8; - } - else { - // Add a random hexadecimal digit to the UUID string - uuid += randomNumber.toString(16); - } - // Add hyphens to the UUID string at the appropriate positions - if (i === 7 || i === 11 || i === 15 || i === 19) { - uuid += "-"; - } - } - return uuid; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var _a$1; -// NOTE: This is a workaround until we can use `globalThis.crypto.randomUUID` in Node.js 19+. -let uuidFunction = typeof ((_a$1 = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a$1 === void 0 ? void 0 : _a$1.randomUUID) === "function" - ? globalThis.crypto.randomUUID.bind(globalThis.crypto) - : crypto.randomUUID; -// Not defined in earlier versions of Node.js 14 -if (!uuidFunction) { - uuidFunction = generateUUID; -} -/** - * Generated Universally Unique Identifier - * - * @returns RFC4122 v4 UUID. - */ -function randomUUID() { - return uuidFunction(); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var _a, _b, _c, _d; -/** - * A constant that indicates whether the environment the code is running is a Web Browser. - */ -// eslint-disable-next-line @azure/azure-sdk/ts-no-window -const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; -/** - * A constant that indicates whether the environment the code is running is a Web Worker. - */ -const isWebWorker = typeof self === "object" && - typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" && - (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || - ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || - ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope"); -/** - * A constant that indicates whether the environment the code is running is Deno. - */ -const isDeno = typeof Deno !== "undefined" && - typeof Deno.version !== "undefined" && - typeof Deno.version.deno !== "undefined"; -/** - * A constant that indicates whether the environment the code is running is Node.JS. - */ -const isNode = typeof process !== "undefined" && - Boolean(process.version) && - Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) && - // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions - !isDeno; -/** - * A constant that indicates whether the environment the code is running is Bun.sh. - */ -const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; -/** - * A constant that indicates whether the environment the code is running is in React-Native. - */ -// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js -const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The helper that transforms bytes with specific character encoding into string - * @param bytes - the uint8array bytes - * @param format - the format we use to encode the byte - * @returns a string of the encoded string - */ -function uint8ArrayToString(bytes, format) { - return Buffer.from(bytes).toString(format); -} -/** - * The helper that transforms string to specific character encoded bytes array. - * @param value - the string to be converted - * @param format - the format we use to decode the value - * @returns a uint8array - */ -function stringToUint8Array(value, format) { - return Buffer.from(value, format); -} - -exports.cancelablePromiseRace = cancelablePromiseRace; -exports.computeSha256Hash = computeSha256Hash; -exports.computeSha256Hmac = computeSha256Hmac; -exports.createAbortablePromise = createAbortablePromise; -exports.delay = delay; -exports.getErrorMessage = getErrorMessage; -exports.getRandomIntegerInclusive = getRandomIntegerInclusive; -exports.isBrowser = isBrowser; -exports.isBun = isBun; -exports.isDefined = isDefined; -exports.isDeno = isDeno; -exports.isError = isError; -exports.isNode = isNode; -exports.isObject = isObject; -exports.isObjectWithProperties = isObjectWithProperties; -exports.isReactNative = isReactNative; -exports.isWebWorker = isWebWorker; -exports.objectHasProperty = objectHasProperty; -exports.randomUUID = randomUUID; -exports.stringToUint8Array = stringToUint8Array; -exports.uint8ArrayToString = uint8ArrayToString; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 54505: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var os = __nccwpck_require__(70857); -var util = __nccwpck_require__(39023); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var util__default = /*#__PURE__*/_interopDefaultLegacy(util); - -// Copyright (c) Microsoft Corporation. -function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os.EOL}`); -} - -// Copyright (c) Microsoft Corporation. -const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined; -let enabledString; -let enabledNamespaces = []; -let skippedNamespaces = []; -const debuggers = []; -if (debugEnvVariable) { - enable(debugEnvVariable); -} -const debugObj = Object.assign((namespace) => { - return createDebugger(namespace); -}, { - enable, - enabled, - disable, - log, -}); -function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } - else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); - } -} -function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; - } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } - } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } - } - return false; -} -function disable() { - const result = enabledString || ""; - enable(""); - return result; -} -function createDebugger(namespace) { - const newDebugger = Object.assign(debug, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend, - }); - function debug(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; -} -function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; -} -function extend(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; -} -var debug = debugObj; - -// Copyright (c) Microsoft Corporation. -const registeredLoggers = new Set(); -const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined; -let azureLogLevel; -/** - * The AzureLogger provides a mechanism for overriding where logs are output to. - * By default, logs are sent to stderr. - * Override the `log` method to redirect logs to another location. - */ -const AzureLogger = debug("azure"); -AzureLogger.log = (...args) => { - debug.log(...args); -}; -const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; -if (logLevelFromEnv) { - // avoid calling setLogLevel because we don't want a mis-set environment variable to crash - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } - else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } -} -/** - * Immediately enables logging at the specified log level. If no level is specified, logging is disabled. - * @param level - The log level to enable for logging. - * Options from most verbose to least verbose are: - * - verbose - * - info - * - warning - * - error - */ -function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); - } - azureLogLevel = level; - const enabledNamespaces = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces.push(logger.namespace); - } - } - debug.enable(enabledNamespaces.join(",")); -} -/** - * Retrieves the currently specified log level. - */ -function getLogLevel() { - return azureLogLevel; -} -const levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100, -}; -/** - * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`. - * @param namespace - The name of the SDK package. - * @hidden - */ -function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose"), - }; -} -function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; -} -function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level, - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces = debug.disable(); - debug.enable(enabledNamespaces + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; -} -function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); -} -function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); -} - -exports.AzureLogger = AzureLogger; -exports.createClientLogger = createClientLogger; -exports.getLogLevel = getLogLevel; -exports.setLogLevel = setLogLevel; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 1012: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var coreHttp = __nccwpck_require__(89283); -var tslib = __nccwpck_require__(61860); -var coreTracing = __nccwpck_require__(15553); -var logger$1 = __nccwpck_require__(54505); -var abortController = __nccwpck_require__(68110); -var os = __nccwpck_require__(70857); -var crypto = __nccwpck_require__(76982); -var stream = __nccwpck_require__(2203); -__nccwpck_require__(9851); -var coreLro = __nccwpck_require__(15862); -var events = __nccwpck_require__(24434); -var fs = __nccwpck_require__(79896); -var util = __nccwpck_require__(39023); - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} - -var coreHttp__namespace = /*#__PURE__*/_interopNamespace(coreHttp); -var os__namespace = /*#__PURE__*/_interopNamespace(os); -var fs__namespace = /*#__PURE__*/_interopNamespace(fs); -var util__namespace = /*#__PURE__*/_interopNamespace(util); - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -const BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", - type: { - name: "Composite", - className: "BlobServiceProperties", - modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", - type: { - name: "Composite", - className: "Logging" - } - }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", - type: { - name: "Composite", - className: "Metrics" - } - }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", - type: { - name: "Composite", - className: "Metrics" - } - }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } - } - }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", - type: { - name: "String" - } - }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite" - } - } - } - } -}; -const Logging = { - serializedName: "Logging", - type: { - name: "Composite", - className: "Logging", - modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", - type: { - name: "String" - } - }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", - type: { - name: "Boolean" - } - }, - read: { - serializedName: "Read", - required: true, - xmlName: "Read", - type: { - name: "Boolean" - } - }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", - type: { - name: "Boolean" - } - }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } -}; -const RetentionPolicy = { - serializedName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy", - modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", - type: { - name: "Number" - } - } - } - } -}; -const Metrics = { - serializedName: "Metrics", - type: { - name: "Composite", - className: "Metrics", - modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", - type: { - name: "String" - } - }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", - type: { - name: "Boolean" - } - }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } -}; -const CorsRule = { - serializedName: "CorsRule", - type: { - name: "Composite", - className: "CorsRule", - modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", - required: true, - xmlName: "AllowedOrigins", - type: { - name: "String" - } - }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", - type: { - name: "String" - } - }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", - type: { - name: "String" - } - }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", - type: { - name: "String" - } - }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", - type: { - name: "Number" - } - } - } - } -}; -const StaticWebsite = { - serializedName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite", - modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", - type: { - name: "String" - } - }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", - type: { - name: "String" - } - }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", - type: { - name: "String" - } - } - } - } -}; -const StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", - type: { - name: "String" - } - }, - code: { - serializedName: "Code", - xmlName: "Code", - type: { - name: "String" - } - } - } - } -}; -const BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", - type: { - name: "Composite", - className: "BlobServiceStatistics", - modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication" - } - } - } - } -}; -const GeoReplication = { - serializedName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication", - modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", - type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] - } - }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListContainersSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", - type: { - name: "String" - } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", - type: { - name: "String" - } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } -}; -const ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", - type: { - name: "Composite", - className: "ContainerItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", - type: { - name: "String" - } - }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", - type: { - name: "Boolean" - } - }, - version: { - serializedName: "Version", - xmlName: "Version", - type: { - name: "String" - } - }, - properties: { - serializedName: "Properties", - xmlName: "Properties", - type: { - name: "Composite", - className: "ContainerProperties" - } - }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; -const ContainerProperties = { - serializedName: "ContainerProperties", - type: { - name: "Composite", - className: "ContainerProperties", - modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", - type: { - name: "String" - } - }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", - type: { - name: "String" - } - }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", - type: { - name: "Boolean" - } - }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", - type: { - name: "Boolean" - } - } - } - } -}; -const KeyInfo = { - serializedName: "KeyInfo", - type: { - name: "Composite", - className: "KeyInfo", - modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", - type: { - name: "String" - } - } - } - } -}; -const UserDelegationKey = { - serializedName: "UserDelegationKey", - type: { - name: "Composite", - className: "UserDelegationKey", - modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", - type: { - name: "String" - } - }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", - type: { - name: "String" - } - }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", - type: { - name: "String" - } - }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", - type: { - name: "String" - } - }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", - type: { - name: "String" - } - }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", - type: { - name: "String" - } - }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", - type: { - name: "String" - } - } - } - } -}; -const FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "FilterBlobSegment", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", - type: { - name: "String" - } - }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } -}; -const FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", - type: { - name: "String" - } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - type: { - name: "String" - } - }, - tags: { - serializedName: "Tags", - xmlName: "Tags", - type: { - name: "Composite", - className: "BlobTags" - } - } - } - } -}; -const BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", - type: { - name: "Composite", - className: "BlobTags", - modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } - } - } - } - } -}; -const BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", - type: { - name: "Composite", - className: "BlobTag", - modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", - type: { - name: "String" - } - }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", - type: { - name: "String" - } - } - } - } -}; -const SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", - type: { - name: "Composite", - className: "SignedIdentifier", - modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", - type: { - name: "String" - } - }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } - } - } - } -}; -const AccessPolicy = { - serializedName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy", - modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", - type: { - name: "String" - } - }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", - type: { - name: "String" - } - } - } - } -}; -const ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListBlobsFlatSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", - type: { - name: "String" - } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", - type: { - name: "String" - } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobFlatListSegment" - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } -}; -const BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobFlatListSegment", - modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } - } - } - } - } -}; -const BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", - type: { - name: "Composite", - className: "BlobItemInternal", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", - type: { - name: "Composite", - className: "BlobName" - } - }, - deleted: { - serializedName: "Deleted", - required: true, - xmlName: "Deleted", - type: { - name: "Boolean" - } - }, - snapshot: { - serializedName: "Snapshot", - required: true, - xmlName: "Snapshot", - type: { - name: "String" - } - }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", - type: { - name: "String" - } - }, - isCurrentVersion: { - serializedName: "IsCurrentVersion", - xmlName: "IsCurrentVersion", - type: { - name: "Boolean" - } - }, - properties: { - serializedName: "Properties", - xmlName: "Properties", - type: { - name: "Composite", - className: "BlobPropertiesInternal" - } - }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", - type: { - name: "Composite", - className: "BlobTags" - } - }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", - type: { - name: "Boolean" - } - } - } - } -}; -const BlobName = { - serializedName: "BlobName", - type: { - name: "Composite", - className: "BlobName", - modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, - type: { - name: "String" - } - } - } - } -}; -const BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", - type: { - name: "Composite", - className: "BlobPropertiesInternal", - modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", - type: { - name: "DateTimeRfc1123" - } - }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", - type: { - name: "String" - } - }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", - type: { - name: "String" - } - }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" - } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", - type: { - name: "String" - } - }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", - type: { - name: "String" - } - }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", - type: { - name: "Boolean" - } - }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", - type: { - name: "Boolean" - } - }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", - type: { - name: "String" - } - }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", - type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] - } - }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", - type: { - name: "Boolean" - } - }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", - type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] - } - }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", - type: { - name: "String" - } - }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", - type: { - name: "DateTimeRfc1123" - } - }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", - type: { - name: "Number" - } - }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", - type: { - name: "DateTimeRfc1123" - } - }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", - type: { - name: "Boolean" - } - }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", - type: { - name: "Boolean" - } - } - } - } -}; -const ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListBlobsHierarchySegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, - type: { - name: "String" - } - }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", - type: { - name: "String" - } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", - type: { - name: "String" - } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", - type: { - name: "String" - } - }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment" - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } -}; -const BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment", - modelProperties: { - blobPrefixes: { - serializedName: "BlobPrefixes", - xmlName: "BlobPrefixes", - xmlElementName: "BlobPrefix", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobPrefix" - } - } - } - }, - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } - } - } - } - } -}; -const BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", - type: { - name: "Composite", - className: "BlobName" - } - } - } - } -}; -const BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; -const BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } - } - }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } - } - } - } - } -}; -const Block = { - serializedName: "Block", - type: { - name: "Composite", - className: "Block", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", - type: { - name: "String" - } - }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", - type: { - name: "Number" - } - } - } - } -}; -const PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } - } - }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } -}; -const PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", - type: { - name: "Number" - } - } - } - } -}; -const ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", - type: { - name: "Composite", - className: "ClearRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", - type: { - name: "Number" - } - } - } - } -}; -const QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", - type: { - name: "String" - } - }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", - type: { - name: "String" - } - }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", - type: { - name: "Composite", - className: "QuerySerialization" - } - }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", - type: { - name: "Composite", - className: "QuerySerialization" - } - } - } - } -}; -const QuerySerialization = { - serializedName: "QuerySerialization", - type: { - name: "Composite", - className: "QuerySerialization", - modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", - type: { - name: "Composite", - className: "QueryFormat" - } - } - } - } -}; -const QueryFormat = { - serializedName: "QueryFormat", - type: { - name: "Composite", - className: "QueryFormat", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] - } - }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration" - } - }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration" - } - }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration" - } - }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", - type: { - name: "any" - } - } - } - } -}; -const DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", - type: { - name: "String" - } - }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", - type: { - name: "String" - } - }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", - type: { - name: "String" - } - }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", - type: { - name: "String" - } - }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", - type: { - name: "Boolean" - } - } - } - } -}; -const JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", - type: { - name: "String" - } - } - } - } -}; -const ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration", - modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } - } - } - } - } -}; -const ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", - type: { - name: "Composite", - className: "ArrowField", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "String" - } - }, - name: { - serializedName: "Name", - xmlName: "Name", - type: { - name: "String" - } - }, - precision: { - serializedName: "Precision", - xmlName: "Precision", - type: { - name: "Number" - } - }, - scale: { - serializedName: "Scale", - xmlName: "Scale", - type: { - name: "Number" - } - } - } - } -}; -const ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", - type: { - name: "Composite", - className: "ServiceSubmitBatchHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerCreateHeaders = { - serializedName: "Container_createHeaders", - type: { - name: "Composite", - className: "ContainerCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", - type: { - name: "Composite", - className: "ContainerCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", - type: { - name: "Composite", - className: "ContainerGetPropertiesHeaders", - modelProperties: { - metadata: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - }, - headerCollectionPrefix: "x-ms-meta-" - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - }, - hasImmutabilityPolicy: { - serializedName: "x-ms-has-immutability-policy", - xmlName: "x-ms-has-immutability-policy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - serializedName: "x-ms-has-legal-hold", - xmlName: "x-ms-has-legal-hold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } - }, - denyEncryptionScopeOverride: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } - }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "x-ms-immutable-storage-with-versioning-enabled", - xmlName: "x-ms-immutable-storage-with-versioning-enabled", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", - type: { - name: "Composite", - className: "ContainerDeleteHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", - type: { - name: "Composite", - className: "ContainerDeleteExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", - type: { - name: "Composite", - className: "ContainerSetMetadataHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", - type: { - name: "Composite", - className: "ContainerGetAccessPolicyHeaders", - modelProperties: { - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", - type: { - name: "Composite", - className: "ContainerSetAccessPolicyHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", - type: { - name: "Composite", - className: "ContainerRestoreHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRestoreExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", - type: { - name: "Composite", - className: "ContainerRenameHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRenameExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - } - } - } -}; -const ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", - type: { - name: "Composite", - className: "ContainerReleaseLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", - type: { - name: "Composite", - className: "ContainerRenewLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", - type: { - name: "Composite", - className: "ContainerBreakLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", - type: { - name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", - type: { - name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", - type: { - name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - } - } - } -}; -const ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", - type: { - name: "Composite", - className: "BlobDownloadHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - createdOn: { - serializedName: "x-ms-creation-time", - xmlName: "x-ms-creation-time", - type: { - name: "DateTimeRfc1123" - } - }, - metadata: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - }, - headerCollectionPrefix: "x-ms-meta-" - }, - objectReplicationPolicyId: { - serializedName: "x-ms-or-policy-id", - xmlName: "x-ms-or-policy-id", - type: { - name: "String" - } - }, - objectReplicationRules: { - serializedName: "x-ms-or", - xmlName: "x-ms-or", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - }, - headerCollectionPrefix: "x-ms-or-" - }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", - type: { - name: "String" - } - }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", - type: { - name: "String" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", - type: { - name: "String" - } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", - type: { - name: "Boolean" - } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } - }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", - type: { - name: "Number" - } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", - type: { - name: "Boolean" - } - }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - } - } - } -}; -const BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", - type: { - name: "Composite", - className: "BlobDownloadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", - type: { - name: "Composite", - className: "BlobGetPropertiesHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - createdOn: { - serializedName: "x-ms-creation-time", - xmlName: "x-ms-creation-time", - type: { - name: "DateTimeRfc1123" - } - }, - metadata: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - }, - headerCollectionPrefix: "x-ms-meta-" - }, - objectReplicationPolicyId: { - serializedName: "x-ms-or-policy-id", - xmlName: "x-ms-or-policy-id", - type: { - name: "String" - } - }, - objectReplicationRules: { - serializedName: "x-ms-or", - xmlName: "x-ms-or", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - }, - headerCollectionPrefix: "x-ms-or-" - }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", - type: { - name: "String" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", - type: { - name: "String" - } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - isIncrementalCopy: { - serializedName: "x-ms-incremental-copy", - xmlName: "x-ms-incremental-copy", - type: { - name: "Boolean" - } - }, - destinationSnapshot: { - serializedName: "x-ms-copy-destination-snapshot", - xmlName: "x-ms-copy-destination-snapshot", - type: { - name: "String" - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", - type: { - name: "String" - } - }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", - type: { - name: "String" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", - type: { - name: "String" - } - }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", - type: { - name: "Boolean" - } - }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", - type: { - name: "String" - } - }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", - type: { - name: "DateTimeRfc1123" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", - type: { - name: "Boolean" - } - }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", - type: { - name: "Number" - } - }, - expiresOn: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "DateTimeRfc1123" - } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", - type: { - name: "Boolean" - } - }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", - type: { - name: "Composite", - className: "BlobDeleteHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", - type: { - name: "Composite", - className: "BlobDeleteExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", - type: { - name: "Composite", - className: "BlobUndeleteHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", - type: { - name: "Composite", - className: "BlobUndeleteExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", - type: { - name: "Composite", - className: "BlobSetExpiryHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetExpiryExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", - type: { - name: "Composite", - className: "BlobSetHttpHeadersHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", - type: { - name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyExpiry: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - } - } - } -}; -const BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", - type: { - name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", - type: { - name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", - type: { - name: "Composite", - className: "BlobSetLegalHoldHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - } - } - } -}; -const BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", - type: { - name: "Composite", - className: "BlobSetMetadataHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetMetadataExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", - type: { - name: "Composite", - className: "BlobAcquireLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", - type: { - name: "Composite", - className: "BlobReleaseLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", - type: { - name: "Composite", - className: "BlobRenewLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", - type: { - name: "Composite", - className: "BlobChangeLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", - type: { - name: "Composite", - className: "BlobBreakLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - } - } - } -}; -const BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", - type: { - name: "Composite", - className: "BlobCreateSnapshotHeaders", - modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", - type: { - name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobAbortCopyFromURLHeaders = { - serializedName: "Blob_abortCopyFromURLHeaders", - type: { - name: "Composite", - className: "BlobAbortCopyFromURLHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobAbortCopyFromURLExceptionHeaders = { - serializedName: "Blob_abortCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobAbortCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetTierHeaders = { - serializedName: "Blob_setTierHeaders", - type: { - name: "Composite", - className: "BlobSetTierHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetTierExceptionHeaders = { - serializedName: "Blob_setTierExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTierExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobGetAccountInfoHeaders = { - serializedName: "Blob_getAccountInfoHeaders", - type: { - name: "Composite", - className: "BlobGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - } - } - } -}; -const BlobGetAccountInfoExceptionHeaders = { - serializedName: "Blob_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetAccountInfoExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobQueryHeaders = { - serializedName: "Blob_queryHeaders", - type: { - name: "Composite", - className: "BlobQueryHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - metadata: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", - type: { - name: "Number" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", - type: { - name: "String" - } - }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", - type: { - name: "String" - } - }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", - type: { - name: "String" - } - }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", - type: { - name: "String" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", - type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] - } - }, - copyCompletionTime: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", - type: { - name: "String" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", - type: { - name: "String" - } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - } - } - } -}; -const BlobQueryExceptionHeaders = { - serializedName: "Blob_queryExceptionHeaders", - type: { - name: "Composite", - className: "BlobQueryExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobGetTagsHeaders = { - serializedName: "Blob_getTagsHeaders", - type: { - name: "Composite", - className: "BlobGetTagsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobGetTagsExceptionHeaders = { - serializedName: "Blob_getTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetTagsHeaders = { - serializedName: "Blob_setTagsHeaders", - type: { - name: "Composite", - className: "BlobSetTagsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobCreateHeaders = { - serializedName: "PageBlob_createHeaders", - type: { - name: "Composite", - className: "PageBlobCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobCreateExceptionHeaders = { - serializedName: "PageBlob_createExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobUploadPagesHeaders = { - serializedName: "PageBlob_uploadPagesHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobUploadPagesExceptionHeaders = { - serializedName: "PageBlob_uploadPagesExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobClearPagesHeaders = { - serializedName: "PageBlob_clearPagesHeaders", - type: { - name: "Composite", - className: "PageBlobClearPagesHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobClearPagesExceptionHeaders = { - serializedName: "PageBlob_clearPagesExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobClearPagesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobUploadPagesFromURLHeaders = { - serializedName: "PageBlob_uploadPagesFromURLHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobGetPageRangesHeaders = { - serializedName: "PageBlob_getPageRangesHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobGetPageRangesExceptionHeaders = { - serializedName: "PageBlob_getPageRangesExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobGetPageRangesDiffHeaders = { - serializedName: "PageBlob_getPageRangesDiffHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesDiffHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobGetPageRangesDiffExceptionHeaders = { - serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobGetPageRangesDiffExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobResizeHeaders = { - serializedName: "PageBlob_resizeHeaders", - type: { - name: "Composite", - className: "PageBlobResizeHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobResizeExceptionHeaders = { - serializedName: "PageBlob_resizeExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobResizeExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobUpdateSequenceNumberHeaders = { - serializedName: "PageBlob_updateSequenceNumberHeaders", - type: { - name: "Composite", - className: "PageBlobUpdateSequenceNumberHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobUpdateSequenceNumberExceptionHeaders = { - serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUpdateSequenceNumberExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobCopyIncrementalHeaders = { - serializedName: "PageBlob_copyIncrementalHeaders", - type: { - name: "Composite", - className: "PageBlobCopyIncrementalHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const PageBlobCopyIncrementalExceptionHeaders = { - serializedName: "PageBlob_copyIncrementalExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobCopyIncrementalExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const AppendBlobCreateHeaders = { - serializedName: "AppendBlob_createHeaders", - type: { - name: "Composite", - className: "AppendBlobCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const AppendBlobCreateExceptionHeaders = { - serializedName: "AppendBlob_createExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const AppendBlobAppendBlockHeaders = { - serializedName: "AppendBlob_appendBlockHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobAppendOffset: { - serializedName: "x-ms-blob-append-offset", - xmlName: "x-ms-blob-append-offset", - type: { - name: "String" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const AppendBlobAppendBlockExceptionHeaders = { - serializedName: "AppendBlob_appendBlockExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const AppendBlobAppendBlockFromUrlHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobAppendOffset: { - serializedName: "x-ms-blob-append-offset", - xmlName: "x-ms-blob-append-offset", - type: { - name: "String" - } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", - type: { - name: "Number" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const AppendBlobSealHeaders = { - serializedName: "AppendBlob_sealHeaders", - type: { - name: "Composite", - className: "AppendBlobSealHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", - type: { - name: "Boolean" - } - } - } - } -}; -const AppendBlobSealExceptionHeaders = { - serializedName: "AppendBlob_sealExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobSealExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobUploadHeaders = { - serializedName: "BlockBlob_uploadHeaders", - type: { - name: "Composite", - className: "BlockBlobUploadHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobUploadExceptionHeaders = { - serializedName: "BlockBlob_uploadExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobUploadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobPutBlobFromUrlHeaders = { - serializedName: "BlockBlob_putBlobFromUrlHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobStageBlockHeaders = { - serializedName: "BlockBlob_stageBlockHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockHeaders", - modelProperties: { - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobStageBlockExceptionHeaders = { - serializedName: "BlockBlob_stageBlockExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobStageBlockFromURLHeaders = { - serializedName: "BlockBlob_stageBlockFromURLHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLHeaders", - modelProperties: { - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobCommitBlockListHeaders = { - serializedName: "BlockBlob_commitBlockListHeaders", - type: { - name: "Composite", - className: "BlockBlobCommitBlockListHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobCommitBlockListExceptionHeaders = { - serializedName: "BlockBlob_commitBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobCommitBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobGetBlockListHeaders = { - serializedName: "BlockBlob_getBlockListHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListHeaders", - modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; -const BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } -}; - -var Mappers = /*#__PURE__*/Object.freeze({ - __proto__: null, - BlobServiceProperties: BlobServiceProperties, - Logging: Logging, - RetentionPolicy: RetentionPolicy, - Metrics: Metrics, - CorsRule: CorsRule, - StaticWebsite: StaticWebsite, - StorageError: StorageError, - BlobServiceStatistics: BlobServiceStatistics, - GeoReplication: GeoReplication, - ListContainersSegmentResponse: ListContainersSegmentResponse, - ContainerItem: ContainerItem, - ContainerProperties: ContainerProperties, - KeyInfo: KeyInfo, - UserDelegationKey: UserDelegationKey, - FilterBlobSegment: FilterBlobSegment, - FilterBlobItem: FilterBlobItem, - BlobTags: BlobTags, - BlobTag: BlobTag, - SignedIdentifier: SignedIdentifier, - AccessPolicy: AccessPolicy, - ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse, - BlobFlatListSegment: BlobFlatListSegment, - BlobItemInternal: BlobItemInternal, - BlobName: BlobName, - BlobPropertiesInternal: BlobPropertiesInternal, - ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse, - BlobHierarchyListSegment: BlobHierarchyListSegment, - BlobPrefix: BlobPrefix, - BlockLookupList: BlockLookupList, - BlockList: BlockList, - Block: Block, - PageList: PageList, - PageRange: PageRange, - ClearRange: ClearRange, - QueryRequest: QueryRequest, - QuerySerialization: QuerySerialization, - QueryFormat: QueryFormat, - DelimitedTextConfiguration: DelimitedTextConfiguration, - JsonTextConfiguration: JsonTextConfiguration, - ArrowConfiguration: ArrowConfiguration, - ArrowField: ArrowField, - ServiceSetPropertiesHeaders: ServiceSetPropertiesHeaders, - ServiceSetPropertiesExceptionHeaders: ServiceSetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders: ServiceGetPropertiesHeaders, - ServiceGetPropertiesExceptionHeaders: ServiceGetPropertiesExceptionHeaders, - ServiceGetStatisticsHeaders: ServiceGetStatisticsHeaders, - ServiceGetStatisticsExceptionHeaders: ServiceGetStatisticsExceptionHeaders, - ServiceListContainersSegmentHeaders: ServiceListContainersSegmentHeaders, - ServiceListContainersSegmentExceptionHeaders: ServiceListContainersSegmentExceptionHeaders, - ServiceGetUserDelegationKeyHeaders: ServiceGetUserDelegationKeyHeaders, - ServiceGetUserDelegationKeyExceptionHeaders: ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders, - ServiceGetAccountInfoExceptionHeaders: ServiceGetAccountInfoExceptionHeaders, - ServiceSubmitBatchHeaders: ServiceSubmitBatchHeaders, - ServiceSubmitBatchExceptionHeaders: ServiceSubmitBatchExceptionHeaders, - ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders, - ServiceFilterBlobsExceptionHeaders: ServiceFilterBlobsExceptionHeaders, - ContainerCreateHeaders: ContainerCreateHeaders, - ContainerCreateExceptionHeaders: ContainerCreateExceptionHeaders, - ContainerGetPropertiesHeaders: ContainerGetPropertiesHeaders, - ContainerGetPropertiesExceptionHeaders: ContainerGetPropertiesExceptionHeaders, - ContainerDeleteHeaders: ContainerDeleteHeaders, - ContainerDeleteExceptionHeaders: ContainerDeleteExceptionHeaders, - ContainerSetMetadataHeaders: ContainerSetMetadataHeaders, - ContainerSetMetadataExceptionHeaders: ContainerSetMetadataExceptionHeaders, - ContainerGetAccessPolicyHeaders: ContainerGetAccessPolicyHeaders, - ContainerGetAccessPolicyExceptionHeaders: ContainerGetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders, - ContainerSetAccessPolicyExceptionHeaders: ContainerSetAccessPolicyExceptionHeaders, - ContainerRestoreHeaders: ContainerRestoreHeaders, - ContainerRestoreExceptionHeaders: ContainerRestoreExceptionHeaders, - ContainerRenameHeaders: ContainerRenameHeaders, - ContainerRenameExceptionHeaders: ContainerRenameExceptionHeaders, - ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders, - ContainerSubmitBatchExceptionHeaders: ContainerSubmitBatchExceptionHeaders, - ContainerFilterBlobsHeaders: ContainerFilterBlobsHeaders, - ContainerFilterBlobsExceptionHeaders: ContainerFilterBlobsExceptionHeaders, - ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders, - ContainerAcquireLeaseExceptionHeaders: ContainerAcquireLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders, - ContainerReleaseLeaseExceptionHeaders: ContainerReleaseLeaseExceptionHeaders, - ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders, - ContainerRenewLeaseExceptionHeaders: ContainerRenewLeaseExceptionHeaders, - ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders, - ContainerBreakLeaseExceptionHeaders: ContainerBreakLeaseExceptionHeaders, - ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders, - ContainerChangeLeaseExceptionHeaders: ContainerChangeLeaseExceptionHeaders, - ContainerListBlobFlatSegmentHeaders: ContainerListBlobFlatSegmentHeaders, - ContainerListBlobFlatSegmentExceptionHeaders: ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders: ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerGetAccountInfoHeaders: ContainerGetAccountInfoHeaders, - ContainerGetAccountInfoExceptionHeaders: ContainerGetAccountInfoExceptionHeaders, - BlobDownloadHeaders: BlobDownloadHeaders, - BlobDownloadExceptionHeaders: BlobDownloadExceptionHeaders, - BlobGetPropertiesHeaders: BlobGetPropertiesHeaders, - BlobGetPropertiesExceptionHeaders: BlobGetPropertiesExceptionHeaders, - BlobDeleteHeaders: BlobDeleteHeaders, - BlobDeleteExceptionHeaders: BlobDeleteExceptionHeaders, - BlobUndeleteHeaders: BlobUndeleteHeaders, - BlobUndeleteExceptionHeaders: BlobUndeleteExceptionHeaders, - BlobSetExpiryHeaders: BlobSetExpiryHeaders, - BlobSetExpiryExceptionHeaders: BlobSetExpiryExceptionHeaders, - BlobSetHttpHeadersHeaders: BlobSetHttpHeadersHeaders, - BlobSetHttpHeadersExceptionHeaders: BlobSetHttpHeadersExceptionHeaders, - BlobSetImmutabilityPolicyHeaders: BlobSetImmutabilityPolicyHeaders, - BlobSetImmutabilityPolicyExceptionHeaders: BlobSetImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders: BlobDeleteImmutabilityPolicyHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders: BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobSetLegalHoldHeaders: BlobSetLegalHoldHeaders, - BlobSetLegalHoldExceptionHeaders: BlobSetLegalHoldExceptionHeaders, - BlobSetMetadataHeaders: BlobSetMetadataHeaders, - BlobSetMetadataExceptionHeaders: BlobSetMetadataExceptionHeaders, - BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders, - BlobAcquireLeaseExceptionHeaders: BlobAcquireLeaseExceptionHeaders, - BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders, - BlobReleaseLeaseExceptionHeaders: BlobReleaseLeaseExceptionHeaders, - BlobRenewLeaseHeaders: BlobRenewLeaseHeaders, - BlobRenewLeaseExceptionHeaders: BlobRenewLeaseExceptionHeaders, - BlobChangeLeaseHeaders: BlobChangeLeaseHeaders, - BlobChangeLeaseExceptionHeaders: BlobChangeLeaseExceptionHeaders, - BlobBreakLeaseHeaders: BlobBreakLeaseHeaders, - BlobBreakLeaseExceptionHeaders: BlobBreakLeaseExceptionHeaders, - BlobCreateSnapshotHeaders: BlobCreateSnapshotHeaders, - BlobCreateSnapshotExceptionHeaders: BlobCreateSnapshotExceptionHeaders, - BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders, - BlobStartCopyFromURLExceptionHeaders: BlobStartCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders: BlobCopyFromURLHeaders, - BlobCopyFromURLExceptionHeaders: BlobCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders, - BlobAbortCopyFromURLExceptionHeaders: BlobAbortCopyFromURLExceptionHeaders, - BlobSetTierHeaders: BlobSetTierHeaders, - BlobSetTierExceptionHeaders: BlobSetTierExceptionHeaders, - BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders, - BlobGetAccountInfoExceptionHeaders: BlobGetAccountInfoExceptionHeaders, - BlobQueryHeaders: BlobQueryHeaders, - BlobQueryExceptionHeaders: BlobQueryExceptionHeaders, - BlobGetTagsHeaders: BlobGetTagsHeaders, - BlobGetTagsExceptionHeaders: BlobGetTagsExceptionHeaders, - BlobSetTagsHeaders: BlobSetTagsHeaders, - BlobSetTagsExceptionHeaders: BlobSetTagsExceptionHeaders, - PageBlobCreateHeaders: PageBlobCreateHeaders, - PageBlobCreateExceptionHeaders: PageBlobCreateExceptionHeaders, - PageBlobUploadPagesHeaders: PageBlobUploadPagesHeaders, - PageBlobUploadPagesExceptionHeaders: PageBlobUploadPagesExceptionHeaders, - PageBlobClearPagesHeaders: PageBlobClearPagesHeaders, - PageBlobClearPagesExceptionHeaders: PageBlobClearPagesExceptionHeaders, - PageBlobUploadPagesFromURLHeaders: PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesFromURLExceptionHeaders: PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobGetPageRangesHeaders: PageBlobGetPageRangesHeaders, - PageBlobGetPageRangesExceptionHeaders: PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesDiffHeaders: PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesDiffExceptionHeaders: PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobResizeHeaders: PageBlobResizeHeaders, - PageBlobResizeExceptionHeaders: PageBlobResizeExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders: PageBlobUpdateSequenceNumberHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders: PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobCopyIncrementalHeaders: PageBlobCopyIncrementalHeaders, - PageBlobCopyIncrementalExceptionHeaders: PageBlobCopyIncrementalExceptionHeaders, - AppendBlobCreateHeaders: AppendBlobCreateHeaders, - AppendBlobCreateExceptionHeaders: AppendBlobCreateExceptionHeaders, - AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders, - AppendBlobAppendBlockExceptionHeaders: AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders: AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobSealHeaders: AppendBlobSealHeaders, - AppendBlobSealExceptionHeaders: AppendBlobSealExceptionHeaders, - BlockBlobUploadHeaders: BlockBlobUploadHeaders, - BlockBlobUploadExceptionHeaders: BlockBlobUploadExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders: BlockBlobPutBlobFromUrlHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders: BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobStageBlockHeaders: BlockBlobStageBlockHeaders, - BlockBlobStageBlockExceptionHeaders: BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLHeaders: BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockFromURLExceptionHeaders: BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobCommitBlockListHeaders: BlockBlobCommitBlockListHeaders, - BlockBlobCommitBlockListExceptionHeaders: BlockBlobCommitBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders: BlockBlobGetBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders: BlockBlobGetBlockListExceptionHeaders -}); - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -const contentType = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } -}; -const blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties -}; -const accept = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } - } -}; -const url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" - } - }, - skipEncoding: true -}; -const restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } - } -}; -const comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" - } - } -}; -const version = { - parameterPath: "version", - mapper: { - defaultValue: "2023-11-03", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" - } - } -}; -const requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" - } - } -}; -const accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } - } -}; -const comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" - } - } -}; -const marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" - } - } -}; -const maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" - } - } -}; -const include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } - } - }, - collectionFormat: coreHttp.QueryCollectionFormat.Csv -}; -const keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo -}; -const comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } - } -}; -const body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } - } -}; -const comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } - } -}; -const multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } - } -}; -const comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } - } -}; -const restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } - } -}; -const metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - }, - headerCollectionPrefix: "x-ms-meta-" - } -}; -const access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } - } -}; -const defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } - } -}; -const preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } - } -}; -const leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - } -}; -const ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } - } -}; -const ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } - } -}; -const comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } - } -}; -const comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } - } -}; -const deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } - } -}; -const comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" - } - } -}; -const sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } - } -}; -const comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } -}; -const duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" - } - } -}; -const proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" - } - } -}; -const action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } -}; -const leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" - } - } -}; -const action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } -}; -const action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } -}; -const breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" - } - } -}; -const action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } - } -}; -const proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" - } - } -}; -const include1 = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListBlobsIncludeItem", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "copy", - "deleted", - "metadata", - "snapshots", - "uncommittedblobs", - "versions", - "tags", - "immutabilitypolicy", - "legalhold", - "deletedwithversions" - ] - } - } - } - }, - collectionFormat: coreHttp.QueryCollectionFormat.Csv -}; -const delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" - } - } -}; -const snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" - } - } -}; -const versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" - } - } -}; -const range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" - } - } -}; -const rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" - } - } -}; -const rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" - } - } -}; -const encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" - } - } -}; -const encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - } -}; -const encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" - } - } -}; -const ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } - } -}; -const ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } - } -}; -const ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } - } -}; -const deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } - } -}; -const blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } - } -}; -const comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } - } -}; -const expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } - } -}; -const blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } - } -}; -const blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } - } -}; -const blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } - } -}; -const blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } - } -}; -const blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } - } -}; -const blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } - } -}; -const comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } - } -}; -const immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - } -}; -const comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - } -}; -const encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } - } -}; -const comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const tier = { - parameterPath: ["options", "tier"], - mapper: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", - type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] - } - } -}; -const rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } - } -}; -const sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } -}; -const sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } - } -}; -const sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } - } -}; -const sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } - } -}; -const sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } - } -}; -const copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - } -}; -const blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } - } -}; -const sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } - } -}; -const legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } - } -}; -const xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" - } - } -}; -const sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } - } -}; -const copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } - } -}; -const copySourceTags = { - parameterPath: ["options", "copySourceTags"], - mapper: { - serializedName: "x-ms-copy-source-tag-option", - xmlName: "x-ms-copy-source-tag-option", - type: { - name: "Enum", - allowedValues: ["REPLACE", "COPY"] - } - } -}; -const comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } - } -}; -const copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" - } - } -}; -const comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const tier1 = { - parameterPath: "tier", - mapper: { - serializedName: "x-ms-access-tier", - required: true, - xmlName: "x-ms-access-tier", - type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] - } - } -}; -const queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest -}; -const comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags -}; -const transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" - } - } -}; -const transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - } -}; -const blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } - } -}; -const blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } - } -}; -const blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - } -}; -const contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } -}; -const body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } - } -}; -const accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } - } -}; -const comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } - } -}; -const ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" - } - } -}; -const ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } - } -}; -const ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" - } - } -}; -const pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } - } -}; -const sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } - } -}; -const sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" - } - } -}; -const sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" - } - } -}; -const range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" - } - } -}; -const comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" - } - } -}; -const prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" - } - } -}; -const sequenceNumberAction = { - parameterPath: "sequenceNumberAction", - mapper: { - serializedName: "x-ms-sequence-number-action", - required: true, - xmlName: "x-ms-sequence-number-action", - type: { - name: "Enum", - allowedValues: ["max", "update", "increment"] - } - } -}; -const comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } - } -}; -const comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" - } - } -}; -const appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" - } - } -}; -const sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" - } - } -}; -const comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } - } -}; -const copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" - } - } -}; -const comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" - } - } -}; -const blocks = { - parameterPath: "blocks", - mapper: BlockLookupList -}; -const comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } - } -}; -const listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] - } - } -}; - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -/** Class representing a Service. */ -class Service { - /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * Sets properties for a storage account's Blob service endpoint, including properties for Storage - * Analytics and CORS (Cross-Origin Resource Sharing) rules - * @param blobServiceProperties The StorageService properties. - * @param options The options parameters. - */ - setProperties(blobServiceProperties, options) { - const operationArguments = { - blobServiceProperties, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec); - } - /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. - * @param options The options parameters. - */ - getProperties(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2); - } - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the - * secondary location endpoint when read-access geo-redundant replication is enabled for the storage - * account. - * @param options The options parameters. - */ - getStatistics(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec); - } - /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. - */ - listContainersSegment(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec); - } - /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information - * @param options The options parameters. - */ - getUserDelegationKey(keyInfo, options) { - const operationArguments = { - keyInfo, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec); - } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2); - } - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch - * boundary. Example header value: multipart/mixed; boundary=batch_ - * @param body Initial data - * @param options The options parameters. - */ - submitBatch(contentLength, multipartContentType, body, options) { - const operationArguments = { - contentLength, - multipartContentType, - body, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1); - } - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a - * given search expression. Filter blobs searches across all containers within a storage account but - * can be scoped within the expression to a single container. - * @param options The options parameters. - */ - filterBlobs(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec$1); - } -} -// Operation Specifications -const xmlSerializer$5 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true); -const setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders - } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 -}; -const getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 -}; -const getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders - } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 -}; -const listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 -}; -const getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders - } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 -}; -const getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders - } - }, - queryParameters: [comp, restype1], - urlParameters: [url], - headerParameters: [version, accept1], - isXML: true, - serializer: xmlSerializer$5 -}; -const submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders - } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 -}; -const filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 -}; - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -/** Class representing a Container. */ -class Container { - /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * creates a new container under the specified account. If the container with the same name already - * exists, the operation fails - * @param options The options parameters. - */ - create(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, createOperationSpec$2); - } - /** - * returns all user-defined metadata and system properties for the specified container. The data - * returned does not include the container's list of blobs - * @param options The options parameters. - */ - getProperties(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$1); - } - /** - * operation marks the specified container for deletion. The container and any blobs contained within - * it are later deleted during garbage collection - * @param options The options parameters. - */ - delete(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1); - } - /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. - */ - setMetadata(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1); - } - /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. - */ - getAccessPolicy(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec); - } - /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. - */ - setAccessPolicy(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec); - } - /** - * Restores a previously-deleted container. - * @param options The options parameters. - */ - restore(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, restoreOperationSpec); - } - /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. - */ - rename(sourceContainerName, options) { - const operationArguments = { - sourceContainerName, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, renameOperationSpec); - } - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch - * boundary. Example header value: multipart/mixed; boundary=batch_ - * @param body Initial data - * @param options The options parameters. - */ - submitBatch(contentLength, multipartContentType, body, options) { - const operationArguments = { - contentLength, - multipartContentType, - body, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec); - } - /** - * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given - * search expression. Filter blobs searches within the given container. - * @param options The options parameters. - */ - filterBlobs(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param options The options parameters. - */ - acquireLease(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - releaseLease(leaseId, options) { - const operationArguments = { - leaseId, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - renewLease(leaseId, options) { - const operationArguments = { - leaseId, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param options The options parameters. - */ - breakLease(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1); - } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can - * be 15 to 60 seconds, or can be infinite - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 - * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor - * (String) for a list of valid GUID string formats. - * @param options The options parameters. - */ - changeLease(leaseId, proposedLeaseId, options) { - const operationArguments = { - leaseId, - proposedLeaseId, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1); - } - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. - */ - listBlobFlatSegment(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec); - } - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix - * element in the response body that acts as a placeholder for all blobs whose names begin with the - * same substring up to the appearance of the delimiter character. The delimiter may be a single - * character or a string. - * @param options The options parameters. - */ - listBlobHierarchySegment(delimiter, options) { - const operationArguments = { - delimiter, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec); - } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1); - } -} -// Operation Specifications -const xmlSerializer$4 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true); -const createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const getAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { name: "Composite", className: "SignedIdentifier" } - } - }, - serializedName: "SignedIdentifiers", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier" - }, - headersMapper: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders - } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 -}; -const restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders - } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 -}; -const filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 -}; -const getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders - } - }, - queryParameters: [comp, restype1], - urlParameters: [url], - headerParameters: [version, accept1], - isXML: true, - serializer: xmlSerializer$4 -}; - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -/** Class representing a Blob. */ -class Blob$1 { - /** - * Initialize a new instance of the class Blob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Download operation reads or downloads a blob from the system, including its metadata and - * properties. You can also call Download to read a snapshot. - * @param options The options parameters. - */ - download(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, downloadOperationSpec); - } - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system - * properties for the blob. It does not return the content of the blob. - * @param options The options parameters. - */ - getProperties(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec); - } - /** - * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is - * permanently removed from the storage account. If the storage account's soft delete feature is - * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible - * immediately. However, the blob service retains the blob or snapshot for the number of days specified - * by the DeleteRetentionPolicy section of [Storage service properties] - * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is - * permanently removed from the storage account. Note that you continue to be charged for the - * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the - * "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You - * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a - * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 - * (ResourceNotFound). - * @param options The options parameters. - */ - delete(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, deleteOperationSpec); - } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec); - } - /** - * Sets the time a blob will expire and be deleted. - * @param expiryOptions Required. Indicates mode of the expiry time - * @param options The options parameters. - */ - setExpiry(expiryOptions, options) { - const operationArguments = { - expiryOptions, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec); - } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec); - } - /** - * The Set Immutability Policy operation sets the immutability policy on the blob - * @param options The options parameters. - */ - setImmutabilityPolicy(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setImmutabilityPolicyOperationSpec); - } - /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob - * @param options The options parameters. - */ - deleteImmutabilityPolicy(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, deleteImmutabilityPolicyOperationSpec); - } - /** - * The Set Legal Hold operation sets a legal hold on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param options The options parameters. - */ - setLegalHold(legalHold, options) { - const operationArguments = { - legalHold, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setLegalHoldOperationSpec); - } - /** - * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more - * name-value pairs - * @param options The options parameters. - */ - setMetadata(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. - */ - acquireLease(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - releaseLease(leaseId, options) { - const operationArguments = { - leaseId, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param options The options parameters. - */ - renewLease(leaseId, options) { - const operationArguments = { - leaseId, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 - * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor - * (String) for a list of valid GUID string formats. - * @param options The options parameters. - */ - changeLease(leaseId, proposedLeaseId, options) { - const operationArguments = { - leaseId, - proposedLeaseId, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec); - } - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. - */ - breakLease(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec); - } - /** - * The Create Snapshot operation creates a read-only snapshot of a blob - * @param options The options parameters. - */ - createSnapshot(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec); - } - /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - startCopyFromURL(copySource, options) { - const operationArguments = { - copySource, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec); - } - /** - * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return - * a response until the copy is complete. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - copyFromURL(copySource, options) { - const operationArguments = { - copySource, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec); - } - /** - * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination - * blob with zero length and full metadata. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob - * operation. - * @param options The options parameters. - */ - abortCopyFromURL(copyId, options) { - const operationArguments = { - copyId, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec); - } - /** - * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium - * storage account and on a block blob in a blob storage account (locally redundant storage only). A - * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block - * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's - * ETag. - * @param tier Indicates the tier to be set on the blob. - * @param options The options parameters. - */ - setTier(tier, options) { - const operationArguments = { - tier, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setTierOperationSpec); - } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec); - } - /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. - */ - query(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, queryOperationSpec); - } - /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. - */ - getTags(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec); - } - /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. - */ - setTags(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec); - } -} -// Operation Specifications -const xmlSerializer$3 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true); -const downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders - } - }, - queryParameters: [comp, restype1], - urlParameters: [url], - headerParameters: [version, accept1], - isXML: true, - serializer: xmlSerializer$3 -}; -const queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders - } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 -}; -const getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 -}; -const setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders - } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 -}; - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -/** Class representing a PageBlob. */ -class PageBlob { - /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Create operation creates a new page blob. - * @param contentLength The length of the request. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The - * page blob size must be aligned to a 512-byte boundary. - * @param options The options parameters. - */ - create(contentLength, blobContentLength, options) { - const operationArguments = { - contentLength, - blobContentLength, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, createOperationSpec$1); - } - /** - * The Upload Pages operation writes a range of pages to a page blob - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - uploadPages(contentLength, body, options) { - const operationArguments = { - contentLength, - body, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec); - } - /** - * The Clear Pages operation clears a set of pages from a page blob - * @param contentLength The length of the request. - * @param options The options parameters. - */ - clearPages(contentLength, options) { - const operationArguments = { - contentLength, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec); - } - /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a - * URL - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should - * match the ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 - * aligned and range-end is required. - * @param options The options parameters. - */ - uploadPagesFromURL(sourceUrl, sourceRange, contentLength, range, options) { - const operationArguments = { - sourceUrl, - sourceRange, - contentLength, - range, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec); - } - /** - * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a - * page blob - * @param options The options parameters. - */ - getPageRanges(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec); - } - /** - * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were - * changed between target blob and previous snapshot. - * @param options The options parameters. - */ - getPageRangesDiff(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec); - } - /** - * Resize the Blob - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The - * page blob size must be aligned to a 512-byte boundary. - * @param options The options parameters. - */ - resize(blobContentLength, options) { - const operationArguments = { - blobContentLength, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, resizeOperationSpec); - } - /** - * Update the sequence number of the blob - * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. - * This property applies to page blobs only. This property indicates how the service should modify the - * blob's sequence number - * @param options The options parameters. - */ - updateSequenceNumber(sequenceNumberAction, options) { - const operationArguments = { - sequenceNumberAction, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec); - } - /** - * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. - * The snapshot is copied such that only the differential changes between the previously copied - * snapshot are transferred to the destination. The copied snapshots are complete copies of the - * original snapshot and can be read or copied from as usual. This API is supported since REST version - * 2016-05-31. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - copyIncremental(copySource, options) { - const operationArguments = { - copySource, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec); - } -} -// Operation Specifications -const xmlSerializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true); -const serializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false); -const createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 -}; -const uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - mediaType: "binary", - serializer: serializer$2 -}; -const clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 -}; -const uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 -}; -const getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 -}; -const getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 -}; -const resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 -}; -const updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 -}; -const copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 -}; - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -/** Class representing a AppendBlob. */ -class AppendBlob { - /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. - */ - create(contentLength, options) { - const operationArguments = { - contentLength, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, createOperationSpec); - } - /** - * The Append Block operation commits a new block of data to the end of an existing append blob. The - * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to - * AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - appendBlock(contentLength, body, options) { - const operationArguments = { - contentLength, - body, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec); - } - /** - * The Append Block operation commits a new block of data to the end of an existing append blob where - * the contents are read from a source url. The Append Block operation is permitted only if the blob - * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version - * 2015-02-21 version or later. - * @param sourceUrl Specify a URL to the copy source. - * @param contentLength The length of the request. - * @param options The options parameters. - */ - appendBlockFromUrl(sourceUrl, contentLength, options) { - const operationArguments = { - sourceUrl, - contentLength, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec); - } - /** - * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version - * 2019-12-12 version or later. - * @param options The options parameters. - */ - seal(options) { - const operationArguments = { - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, sealOperationSpec); - } -} -// Operation Specifications -const xmlSerializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true); -const serializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false); -const createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 -}; -const appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - mediaType: "binary", - serializer: serializer$1 -}; -const appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 -}; -const sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 -}; - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -/** Class representing a BlockBlob. */ -class BlockBlob { - /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; - } - /** - * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing - * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put - * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a - * partial update of the content of a block blob, use the Put Block List operation. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - upload(contentLength, body, options) { - const operationArguments = { - contentLength, - body, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, uploadOperationSpec); - } - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read - * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are - * not supported with Put Blob from URL; the content of an existing blob is overwritten with the - * content of the new blob. To perform partial updates to a block blob’s contents using a source URL, - * use the Put Block from URL API in conjunction with Put Block List. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to - * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would - * appear in a request URI. The source blob must either be public or must be authenticated via a shared - * access signature. - * @param options The options parameters. - */ - putBlobFromUrl(contentLength, copySource, options) { - const operationArguments = { - contentLength, - copySource, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec); - } - /** - * The Stage Block operation creates a new block to be committed as part of a blob - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string - * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified - * for the blockid parameter must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data - * @param options The options parameters. - */ - stageBlock(blockId, contentLength, body, options) { - const operationArguments = { - blockId, - contentLength, - body, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec); - } - /** - * The Stage Block operation creates a new block to be committed as part of a blob where the contents - * are read from a URL. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string - * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified - * for the blockid parameter must be the same size for each block. - * @param contentLength The length of the request. - * @param sourceUrl Specify a URL to the copy source. - * @param options The options parameters. - */ - stageBlockFromURL(blockId, contentLength, sourceUrl, options) { - const operationArguments = { - blockId, - contentLength, - sourceUrl, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec); - } - /** - * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the - * blob. In order to be written as part of a blob, a block must have been successfully written to the - * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading - * only those blocks that have changed, then committing the new and existing blocks together. You can - * do this by specifying whether to commit a block from the committed block list or from the - * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list - * it may belong to. - * @param blocks Blob Blocks. - * @param options The options parameters. - */ - commitBlockList(blocks, options) { - const operationArguments = { - blocks, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec); - } - /** - * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block - * blob - * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted - * blocks, or both lists together. - * @param options The options parameters. - */ - getBlockList(listType, options) { - const operationArguments = { - listType, - options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec); - } -} -// Operation Specifications -const xmlSerializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true); -const serializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false); -const uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - mediaType: "binary", - serializer -}; -const putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer -}; -const stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - mediaType: "binary", - serializer -}; -const stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer -}; -const commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer -}; -const getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer -}; - -// Copyright (c) Microsoft Corporation. -/** - * The `@azure/logger` configuration for this package. - */ -const logger = logger$1.createClientLogger("storage-blob"); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const SDK_VERSION = "12.17.0"; -const SERVICE_VERSION = "2023-11-03"; -const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB -const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB -const BLOCK_BLOB_MAX_BLOCKS = 50000; -const DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; // 8MB -const DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB -const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; -const REQUEST_TIMEOUT = 100 * 1000; // In ms -/** - * The OAuth scope to use with Azure Storage. - */ -const StorageOAuthScopes = "https://storage.azure.com/.default"; -const URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout", - }, -}; -const HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416, -}; -const HeaderConstants = { - AUTHORIZATION: "Authorization", - AUTHORIZATION_SCHEME: "Bearer", - CONTENT_ENCODING: "Content-Encoding", - CONTENT_ID: "Content-ID", - CONTENT_LANGUAGE: "Content-Language", - CONTENT_LENGTH: "Content-Length", - CONTENT_MD5: "Content-Md5", - CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding", - CONTENT_TYPE: "Content-Type", - COOKIE: "Cookie", - DATE: "date", - IF_MATCH: "if-match", - IF_MODIFIED_SINCE: "if-modified-since", - IF_NONE_MATCH: "if-none-match", - IF_UNMODIFIED_SINCE: "if-unmodified-since", - PREFIX_FOR_STORAGE: "x-ms-", - RANGE: "Range", - USER_AGENT: "User-Agent", - X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id", - X_MS_COPY_SOURCE: "x-ms-copy-source", - X_MS_DATE: "x-ms-date", - X_MS_ERROR_CODE: "x-ms-error-code", - X_MS_VERSION: "x-ms-version", -}; -const ETagNone = ""; -const ETagAny = "*"; -const SIZE_1_MB = 1 * 1024 * 1024; -const BATCH_MAX_REQUEST = 256; -const BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; -const HTTP_LINE_ENDING = "\r\n"; -const HTTP_VERSION_1_1 = "HTTP/1.1"; -const EncryptionAlgorithmAES25 = "AES256"; -const DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; -const StorageBlobLoggingAllowedHeaderNames = [ - "Access-Control-Allow-Origin", - "Cache-Control", - "Content-Length", - "Content-Type", - "Date", - "Request-Id", - "traceparent", - "Transfer-Encoding", - "User-Agent", - "x-ms-client-request-id", - "x-ms-date", - "x-ms-error-code", - "x-ms-request-id", - "x-ms-return-client-request-id", - "x-ms-version", - "Accept-Ranges", - "Content-Disposition", - "Content-Encoding", - "Content-Language", - "Content-MD5", - "Content-Range", - "ETag", - "Last-Modified", - "Server", - "Vary", - "x-ms-content-crc64", - "x-ms-copy-action", - "x-ms-copy-completion-time", - "x-ms-copy-id", - "x-ms-copy-progress", - "x-ms-copy-status", - "x-ms-has-immutability-policy", - "x-ms-has-legal-hold", - "x-ms-lease-state", - "x-ms-lease-status", - "x-ms-range", - "x-ms-request-server-encrypted", - "x-ms-server-encrypted", - "x-ms-snapshot", - "x-ms-source-range", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Unmodified-Since", - "x-ms-access-tier", - "x-ms-access-tier-change-time", - "x-ms-access-tier-inferred", - "x-ms-account-kind", - "x-ms-archive-status", - "x-ms-blob-append-offset", - "x-ms-blob-cache-control", - "x-ms-blob-committed-block-count", - "x-ms-blob-condition-appendpos", - "x-ms-blob-condition-maxsize", - "x-ms-blob-content-disposition", - "x-ms-blob-content-encoding", - "x-ms-blob-content-language", - "x-ms-blob-content-length", - "x-ms-blob-content-md5", - "x-ms-blob-content-type", - "x-ms-blob-public-access", - "x-ms-blob-sequence-number", - "x-ms-blob-type", - "x-ms-copy-destination-snapshot", - "x-ms-creation-time", - "x-ms-default-encryption-scope", - "x-ms-delete-snapshots", - "x-ms-delete-type-permanent", - "x-ms-deny-encryption-scope-override", - "x-ms-encryption-algorithm", - "x-ms-if-sequence-number-eq", - "x-ms-if-sequence-number-le", - "x-ms-if-sequence-number-lt", - "x-ms-incremental-copy", - "x-ms-lease-action", - "x-ms-lease-break-period", - "x-ms-lease-duration", - "x-ms-lease-id", - "x-ms-lease-time", - "x-ms-page-write", - "x-ms-proposed-lease-id", - "x-ms-range-get-content-md5", - "x-ms-rehydrate-priority", - "x-ms-sequence-number-action", - "x-ms-sku-name", - "x-ms-source-content-md5", - "x-ms-source-if-match", - "x-ms-source-if-modified-since", - "x-ms-source-if-none-match", - "x-ms-source-if-unmodified-since", - "x-ms-tag-count", - "x-ms-encryption-key-sha256", - "x-ms-if-tags", - "x-ms-source-if-tags", -]; -const StorageBlobLoggingAllowedQueryParameters = [ - "comp", - "maxresults", - "rscc", - "rscd", - "rsce", - "rscl", - "rsct", - "se", - "si", - "sip", - "sp", - "spr", - "sr", - "srt", - "ss", - "st", - "sv", - "include", - "marker", - "prefix", - "copyid", - "restype", - "blockid", - "blocklisttype", - "delimiter", - "prevsnapshot", - "ske", - "skoid", - "sks", - "skt", - "sktid", - "skv", - "snapshot", -]; -const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; -const BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; -/// List of ports used for path style addressing. -/// Path style addressing means that storage account is put in URI's Path segment in instead of in host. -const PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104", -]; - -// Copyright (c) Microsoft Corporation. -/** - * Reserved URL characters must be properly escaped for Storage services like Blob or File. - * - * ## URL encode and escape strategy for JS SDKs - * - * When customers pass a URL string into XxxClient classes constructor, the URL string may already be URL encoded or not. - * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL - * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors. - * - * ### Strategy One: Assume the customer URL string is not encoded, and always encode URL string in SDK. - * - * This is what legacy V2 SDK does, simple and works for most of the cases. - * - When customer URL string is "http://account.blob.core.windows.net/con/b:", - * SDK will encode it to "http://account.blob.core.windows.net/con/b%3A" and send to server. A blob named "b:" will be created. - * - When customer URL string is "http://account.blob.core.windows.net/con/b%3A", - * SDK will encode it to "http://account.blob.core.windows.net/con/b%253A" and send to server. A blob named "b%3A" will be created. - * - * But this strategy will make it not possible to create a blob with "?" in it's name. Because when customer URL string is - * "http://account.blob.core.windows.net/con/blob?name", the "?name" will be treated as URL paramter instead of blob name. - * If customer URL string is "http://account.blob.core.windows.net/con/blob%3Fname", a blob named "blob%3Fname" will be created. - * V2 SDK doesn't have this issue because it doesn't allow customer pass in a full URL, it accepts a separate blob name and encodeURIComponent for it. - * We cannot accept a SDK cannot create a blob name with "?". So we implement strategy two: - * - * ### Strategy Two: SDK doesn't assume the URL has been encoded or not. It will just escape the special characters. - * - * This is what V10 Blob Go SDK does. It accepts a URL type in Go, and call url.EscapedPath() to escape the special chars unescaped. - * - When customer URL string is "http://account.blob.core.windows.net/con/b:", - * SDK will escape ":" like "http://account.blob.core.windows.net/con/b%3A" and send to server. A blob named "b:" will be created. - * - When customer URL string is "http://account.blob.core.windows.net/con/b%3A", - * There is no special characters, so send "http://account.blob.core.windows.net/con/b%3A" to server. A blob named "b:" will be created. - * - When customer URL string is "http://account.blob.core.windows.net/con/b%253A", - * There is no special characters, so send "http://account.blob.core.windows.net/con/b%253A" to server. A blob named "b%3A" will be created. - * - * This strategy gives us flexibility to create with any special characters. But "%" will be treated as a special characters, if the URL string - * is not encoded, there shouldn't a "%" in the URL string, otherwise the URL is not a valid URL. - * If customer needs to create a blob with "%" in it's blob name, use "%25" instead of "%". Just like above 3rd sample. - * And following URL strings are invalid: - * - "http://account.blob.core.windows.net/con/b%" - * - "http://account.blob.core.windows.net/con/b%2" - * - "http://account.blob.core.windows.net/con/b%G" - * - * Another special character is "?", use "%2F" to represent a blob name with "?" in a URL string. - * - * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `containerClient.getBlobClient(blobName)` - * - * We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata - * - * @param url - - */ -function escapeURLPath(url) { - const urlParsed = coreHttp.URLBuilder.parse(url); - let path = urlParsed.getPath(); - path = path || "/"; - path = escape(path); - urlParsed.setPath(path); - return urlParsed.toString(); -} -function getProxyUriFromDevConnString(connectionString) { - // Development Connection String - // https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key - let proxyUri = ""; - if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) { - // CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri - const matchCredentials = connectionString.split(";"); - for (const element of matchCredentials) { - if (element.trim().startsWith("DevelopmentStorageProxyUri=")) { - proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1]; - } - } - } - return proxyUri; -} -function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; - } - } - return ""; -} -/** - * Extracts the parts of an Azure Storage account connection string. - * - * @param connectionString - Connection string. - * @returns String key value pairs of the storage account's url and credentials. - */ -function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - // Development connection string - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; - } - // Matching BlobEndpoint in the Account connection string - let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); - // Slicing off '/' at the end if exists - // (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end) - blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; - if (connectionString.search("DefaultEndpointsProtocol=") !== -1 && - connectionString.search("AccountKey=") !== -1) { - // Account connection string - let defaultEndpointsProtocol = ""; - let accountName = ""; - let accountKey = Buffer.from("accountKey", "base64"); - let endpointSuffix = ""; - // Get account name and key - accountName = getValueInConnString(connectionString, "AccountName"); - accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64"); - if (!blobEndpoint) { - // BlobEndpoint is not present in the Account connection string - // Can be obtained from `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}` - defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol"); - const protocol = defaultEndpointsProtocol.toLowerCase(); - if (protocol !== "https" && protocol !== "http") { - throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"); - } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); - } - blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; - } - if (!accountName) { - throw new Error("Invalid AccountName in the provided Connection String"); - } - else if (accountKey.length === 0) { - throw new Error("Invalid AccountKey in the provided Connection String"); - } - return { - kind: "AccountConnString", - url: blobEndpoint, - accountName, - accountKey, - proxyUri, - }; - } - else { - // SAS connection string - const accountSas = getValueInConnString(connectionString, "SharedAccessSignature"); - let accountName = getValueInConnString(connectionString, "AccountName"); - // if accountName is empty, try to read it from BlobEndpoint - if (!accountName) { - accountName = getAccountNameFromUrl(blobEndpoint); - } - if (!blobEndpoint) { - throw new Error("Invalid BlobEndpoint in the provided SAS Connection String"); - } - else if (!accountSas) { - throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String"); - } - return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; - } -} -/** - * Internal escape method implemented Strategy Two mentioned in escapeURL() description. - * - * @param text - - */ -function escape(text) { - return encodeURIComponent(text) - .replace(/%2F/g, "/") // Don't escape for "/" - .replace(/'/g, "%27") // Escape for "'" - .replace(/\+/g, "%20") - .replace(/%25/g, "%"); // Revert encoded "%" -} -/** - * Append a string to URL path. Will remove duplicated "/" in front of the string - * when URL path ends with a "/". - * - * @param url - Source URL string - * @param name - String to be appended to URL - * @returns An updated URL string - */ -function appendToURLPath(url, name) { - const urlParsed = coreHttp.URLBuilder.parse(url); - let path = urlParsed.getPath(); - path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name; - urlParsed.setPath(path); - const normalizedUrl = new URL(urlParsed.toString()); - return normalizedUrl.toString(); -} -/** - * Set URL parameter name and value. If name exists in URL parameters, old value - * will be replaced by name key. If not provide value, the parameter will be deleted. - * - * @param url - Source URL string - * @param name - Parameter name - * @param value - Parameter value - * @returns An updated URL string - */ -function setURLParameter(url, name, value) { - const urlParsed = coreHttp.URLBuilder.parse(url); - urlParsed.setQueryParameter(name, value); - return urlParsed.toString(); -} -/** - * Get URL parameter by name. - * - * @param url - - * @param name - - */ -function getURLParameter(url, name) { - const urlParsed = coreHttp.URLBuilder.parse(url); - return urlParsed.getQueryParameterValue(name); -} -/** - * Set URL host. - * - * @param url - Source URL string - * @param host - New host string - * @returns An updated URL string - */ -function setURLHost(url, host) { - const urlParsed = coreHttp.URLBuilder.parse(url); - urlParsed.setHost(host); - return urlParsed.toString(); -} -/** - * Get URL path from an URL string. - * - * @param url - Source URL string - */ -function getURLPath(url) { - const urlParsed = coreHttp.URLBuilder.parse(url); - return urlParsed.getPath(); -} -/** - * Get URL scheme from an URL string. - * - * @param url - Source URL string - */ -function getURLScheme(url) { - const urlParsed = coreHttp.URLBuilder.parse(url); - return urlParsed.getScheme(); -} -/** - * Get URL path and query from an URL string. - * - * @param url - Source URL string - */ -function getURLPathAndQuery(url) { - const urlParsed = coreHttp.URLBuilder.parse(url); - const pathString = urlParsed.getPath(); - if (!pathString) { - throw new RangeError("Invalid url without valid path."); - } - let queryString = urlParsed.getQuery() || ""; - queryString = queryString.trim(); - if (queryString !== "") { - queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; // Ensure query string start with '?' - } - return `${pathString}${queryString}`; -} -/** - * Get URL query key value pairs from an URL string. - * - * @param url - - */ -function getURLQueries(url) { - let queryString = coreHttp.URLBuilder.parse(url).getQuery(); - if (!queryString) { - return {}; - } - queryString = queryString.trim(); - queryString = queryString.startsWith("?") ? queryString.substr(1) : queryString; - let querySubStrings = queryString.split("&"); - querySubStrings = querySubStrings.filter((value) => { - const indexOfEqual = value.indexOf("="); - const lastIndexOfEqual = value.lastIndexOf("="); - return (indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1); - }); - const queries = {}; - for (const querySubString of querySubStrings) { - const splitResults = querySubString.split("="); - const key = splitResults[0]; - const value = splitResults[1]; - queries[key] = value; - } - return queries; -} -/** - * Append a string to URL query. - * - * @param url - Source URL string. - * @param queryParts - String to be appended to the URL query. - * @returns An updated URL string. - */ -function appendToURLQuery(url, queryParts) { - const urlParsed = coreHttp.URLBuilder.parse(url); - let query = urlParsed.getQuery(); - if (query) { - query += "&" + queryParts; - } - else { - query = queryParts; - } - urlParsed.setQuery(query); - return urlParsed.toString(); -} -/** - * Rounds a date off to seconds. - * - * @param date - - * @param withMilliseconds - If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned; - * If false, YYYY-MM-DDThh:mm:ssZ will be returned. - * @returns Date string in ISO8061 format, with or without 7 milliseconds component - */ -function truncatedISO8061Date(date, withMilliseconds = true) { - // Date.toISOString() will return like "2018-10-29T06:34:36.139Z" - const dateString = date.toISOString(); - return withMilliseconds - ? dateString.substring(0, dateString.length - 1) + "0000" + "Z" - : dateString.substring(0, dateString.length - 5) + "Z"; -} -/** - * Base64 encode. - * - * @param content - - */ -function base64encode(content) { - return !coreHttp.isNode ? btoa(content) : Buffer.from(content).toString("base64"); -} -/** - * Generate a 64 bytes base64 block ID string. - * - * @param blockIndex - - */ -function generateBlockID(blockIDPrefix, blockIndex) { - // To generate a 64 bytes base64 string, source string should be 48 - const maxSourceStringLength = 48; - // A blob can have a maximum of 100,000 uncommitted blocks at any given time - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); - } - const res = blockIDPrefix + - padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); -} -/** - * Delay specified time interval. - * - * @param timeInMs - - * @param aborter - - * @param abortError - - */ -async function delay(timeInMs, aborter, abortError) { - return new Promise((resolve, reject) => { - /* eslint-disable-next-line prefer-const */ - let timeout; - const abortHandler = () => { - if (timeout !== undefined) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== undefined) { - aborter.removeEventListener("abort", abortHandler); - } - resolve(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== undefined) { - aborter.addEventListener("abort", abortHandler); - } - }); -} -/** - * String.prototype.padStart() - * - * @param currentString - - * @param targetLength - - * @param padString - - */ -function padStart(currentString, targetLength, padString = " ") { - // @ts-expect-error: TS doesn't know this code needs to run downlevel sometimes - if (String.prototype.padStart) { - return currentString.padStart(targetLength, padString); - } - padString = padString || " "; - if (currentString.length > targetLength) { - return currentString; - } - else { - targetLength = targetLength - currentString.length; - if (targetLength > padString.length) { - padString += padString.repeat(targetLength / padString.length); - } - return padString.slice(0, targetLength) + currentString; - } -} -/** - * If two strings are equal when compared case insensitive. - * - * @param str1 - - * @param str2 - - */ -function iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); -} -/** - * Extracts account name from the url - * @param url - url to extract the account name from - * @returns with the account name - */ -function getAccountNameFromUrl(url) { - const parsedUrl = coreHttp.URLBuilder.parse(url); - let accountName; - try { - if (parsedUrl.getHost().split(".")[1] === "blob") { - // `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; - accountName = parsedUrl.getHost().split(".")[0]; - } - else if (isIpEndpointStyle(parsedUrl)) { - // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/ - // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/ - // .getPath() -> /devstoreaccount1/ - accountName = parsedUrl.getPath().split("/")[1]; - } - else { - // Custom domain case: "https://customdomain.com/containername/blob". - accountName = ""; - } - return accountName; - } - catch (error) { - throw new Error("Unable to extract accountName with provided information."); - } -} -function isIpEndpointStyle(parsedUrl) { - if (parsedUrl.getHost() === undefined) { - return false; - } - const host = parsedUrl.getHost() + (parsedUrl.getPort() === undefined ? "" : ":" + parsedUrl.getPort()); - // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'. - // Case 2: localhost(:port) or host.docker.internal, use broad regex to match port part. - // Case 3: Ipv4, use broad regex which just check if host contains Ipv4. - // For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html. - return (/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) || - (parsedUrl.getPort() !== undefined && PathStylePorts.includes(parsedUrl.getPort()))); -} -/** - * Convert Tags to encoded string. - * - * @param tags - - */ -function toBlobTagsString(tags) { - if (tags === undefined) { - return undefined; - } - const tagPairs = []; - for (const key in tags) { - if (Object.prototype.hasOwnProperty.call(tags, key)) { - const value = tags[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); - } - } - return tagPairs.join("&"); -} -/** - * Convert Tags type to BlobTags. - * - * @param tags - - */ -function toBlobTags(tags) { - if (tags === undefined) { - return undefined; - } - const res = { - blobTagSet: [], - }; - for (const key in tags) { - if (Object.prototype.hasOwnProperty.call(tags, key)) { - const value = tags[key]; - res.blobTagSet.push({ - key, - value, - }); - } - } - return res; -} -/** - * Covert BlobTags to Tags type. - * - * @param tags - - */ -function toTags(tags) { - if (tags === undefined) { - return undefined; - } - const res = {}; - for (const blobTag of tags.blobTagSet) { - res[blobTag.key] = blobTag.value; - } - return res; -} -/** - * Convert BlobQueryTextConfiguration to QuerySerialization type. - * - * @param textConfiguration - - */ -function toQuerySerialization(textConfiguration) { - if (textConfiguration === undefined) { - return undefined; - } - switch (textConfiguration.kind) { - case "csv": - return { - format: { - type: "delimited", - delimitedTextConfiguration: { - columnSeparator: textConfiguration.columnSeparator || ",", - fieldQuote: textConfiguration.fieldQuote || "", - recordSeparator: textConfiguration.recordSeparator, - escapeChar: textConfiguration.escapeCharacter || "", - headersPresent: textConfiguration.hasHeaders || false, - }, - }, - }; - case "json": - return { - format: { - type: "json", - jsonTextConfiguration: { - recordSeparator: textConfiguration.recordSeparator, - }, - }, - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema, - }, - }, - }; - case "parquet": - return { - format: { - type: "parquet", - }, - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); - } -} -function parseObjectReplicationRecord(objectReplicationRecord) { - if (!objectReplicationRecord) { - return undefined; - } - if ("policy-id" in objectReplicationRecord) { - // If the dictionary contains a key with policy id, we are not required to do any parsing since - // the policy id should already be stored in the ObjectReplicationDestinationPolicyId. - return undefined; - } - const orProperties = []; - for (const key in objectReplicationRecord) { - const ids = key.split("_"); - const policyPrefix = "or-"; - if (ids[0].startsWith(policyPrefix)) { - ids[0] = ids[0].substring(policyPrefix.length); - } - const rule = { - ruleId: ids[1], - replicationStatus: objectReplicationRecord[key], - }; - const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]); - if (policyIndex > -1) { - orProperties[policyIndex].rules.push(rule); - } - else { - orProperties.push({ - policyId: ids[0], - rules: [rule], - }); - } - } - return orProperties; -} -/** - * Attach a TokenCredential to an object. - * - * @param thing - - * @param credential - - */ -function attachCredential(thing, credential) { - thing.credential = credential; - return thing; -} -function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined; -} -function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } - else { - return name.content; - } -} -function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }), - } }); -} -function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }), - } }); -} -function* ExtractPageRangeInfoItems(getPageRangesSegment) { - let pageRange = []; - let clearRange = []; - if (getPageRangesSegment.pageRange) - pageRange = getPageRangesSegment.pageRange; - if (getPageRangesSegment.clearRange) - clearRange = getPageRangesSegment.clearRange; - let pageRangeIndex = 0; - let clearRangeIndex = 0; - while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) { - if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) { - yield { - start: pageRange[pageRangeIndex].start, - end: pageRange[pageRangeIndex].end, - isClear: false, - }; - ++pageRangeIndex; - } - else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true, - }; - ++clearRangeIndex; - } - } - for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) { - yield { - start: pageRange[pageRangeIndex].start, - end: pageRange[pageRangeIndex].end, - isClear: false, - }; - } - for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true, - }; - } -} -/** - * Escape the blobName but keep path separator ('/'). - */ -function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); - } - return split.join("/"); -} - -// Copyright (c) Microsoft Corporation. -/** - * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including: - * - * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'. - * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL - * thus avoid the browser cache. - * - * 2. Remove cookie header for security - * - * 3. Remove content-length header to avoid browsers warning - */ -class StorageBrowserPolicy extends coreHttp.BaseRequestPolicy { - /** - * Creates an instance of StorageBrowserPolicy. - * @param nextPolicy - - * @param options - - */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - /** - * Sends out request. - * - * @param request - - */ - async sendRequest(request) { - if (coreHttp.isNode) { - return this._nextPolicy.sendRequest(request); - } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - // According to XHR standards, content-length should be fully controlled by browsers - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * StorageBrowserPolicyFactory is a factory class helping generating StorageBrowserPolicy objects. - */ -class StorageBrowserPolicyFactory { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * RetryPolicy types. - */ -exports.StorageRetryPolicyType = void 0; -(function (StorageRetryPolicyType) { - /** - * Exponential retry. Retry time delay grows exponentially. - */ - StorageRetryPolicyType[StorageRetryPolicyType["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - /** - * Linear retry. Retry time delay grows linearly. - */ - StorageRetryPolicyType[StorageRetryPolicyType["FIXED"] = 1] = "FIXED"; -})(exports.StorageRetryPolicyType || (exports.StorageRetryPolicyType = {})); -// Default values of StorageRetryOptions -const DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1000, - maxTries: 4, - retryDelayInMs: 4 * 1000, - retryPolicyType: exports.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: undefined, // Use server side default timeout strategy -}; -const RETRY_ABORT_ERROR = new abortController.AbortError("The operation was aborted."); -/** - * Retry policy with exponential retry and linear retry implemented. - */ -class StorageRetryPolicy extends coreHttp.BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { - super(nextPolicy, options); - // Initialize retry options - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType - ? retryOptions.retryPolicyType - : DEFAULT_RETRY_OPTIONS.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 - ? Math.floor(retryOptions.maxTries) - : DEFAULT_RETRY_OPTIONS.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 - ? retryOptions.tryTimeoutInMs - : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 - ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs - ? retryOptions.maxRetryDelayInMs - : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs) - : DEFAULT_RETRY_OPTIONS.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 - ? retryOptions.maxRetryDelayInMs - : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost - ? retryOptions.secondaryHost - : DEFAULT_RETRY_OPTIONS.secondaryHost, - }; - } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); - } - /** - * Decide and perform next retry. Won't mutate request parameter. - * - * @param request - - * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then - * the resource was not found. This may be due to replication delay. So, in this - * case, we'll never try the secondary again for this operation. - * @param attempt - How many retries has been attempted to performed, starting from 1, which includes - * the attempt will be performed by this method call. - */ - async attemptSendRequest(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || - !this.retryOptions.secondaryHost || - !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || - attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); - } - // Set the server-side timeout query parameter "timeout=[seconds]" - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString()); - } - let response; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; - } - secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404); - } - catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw err; - } - } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, secondaryHas404, ++attempt); - } - /** - * Decide whether to retry according to last HTTP response and retry counters. - * - * @param isPrimaryRetry - - * @param attempt - - * @param response - - * @param err - - */ - shouldRetry(isPrimaryRetry, attempt, response, err) { - if (attempt >= this.retryOptions.maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions - .maxTries}, no further try.`); - return false; - } - // Handle network failures, you may need to customize the list when you implement - // your own http client - const retriableErrors = [ - "ETIMEDOUT", - "ESOCKETTIMEDOUT", - "ECONNREFUSED", - "ECONNRESET", - "ENOENT", - "ENOTFOUND", - "TIMEOUT", - "EPIPE", - "REQUEST_SEND_ERROR", // For default xhr based http client provided in ms-rest-js - ]; - if (err) { - for (const retriableError of retriableErrors) { - if (err.name.toUpperCase().includes(retriableError) || - err.message.toUpperCase().includes(retriableError) || - (err.code && err.code.toString().toUpperCase() === retriableError)) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; - } - } - } - // If attempt was against the secondary & it returned a StatusNotFound (404), then - // the resource was not found. This may be due to replication delay. So, in this - // case, we'll never try the secondary again for this operation. - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - // Server internal error or server timeout - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - return false; - } - /** - * Delay a calculated time between retries. - * - * @param isPrimaryRetry - - * @param attempt - - * @param abortSignal - - */ - async delay(isPrimaryRetry, attempt, abortSignal) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (this.retryOptions.retryPolicyType) { - case exports.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; - } - } - else { - delayTimeInMs = Math.random() * 1000; - } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects. - */ -class StorageRetryPolicyFactory { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; - } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Credential policy used to sign HTTP(S) requests before sending. This is an - * abstract class. - */ -class CredentialPolicy extends coreHttp.BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); - } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - // Child classes must override this method with request signing. This method - // will be executed in sendRequest(). - return request; - } -} - -// Copyright (c) Microsoft Corporation. -/** - * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources - * or for use with Shared Access Signatures (SAS). - */ -class AnonymousCredentialPolicy extends CredentialPolicy { - /** - * Creates an instance of AnonymousCredentialPolicy. - * @param nextPolicy - - * @param options - - */ - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Credential is an abstract class for Azure Storage HTTP requests signing. This - * class will host an credentialPolicyCreator factory which generates CredentialPolicy. - */ -class Credential { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * AnonymousCredential provides a credentialPolicyCreator member used to create - * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with - * HTTP(S) requests that read public resources or for use with Shared Access - * Signatures (SAS). - */ -class AnonymousCredential extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * TelemetryPolicy is a policy used to tag user-agent header for every requests. - */ -class TelemetryPolicy extends coreHttp.BaseRequestPolicy { - /** - * Creates an instance of TelemetryPolicy. - * @param nextPolicy - - * @param options - - * @param telemetry - - */ - constructor(nextPolicy, options, telemetry) { - super(nextPolicy, options); - this.telemetry = telemetry; - } - /** - * Sends out request. - * - * @param request - - */ - async sendRequest(request) { - if (coreHttp.isNode) { - if (!request.headers) { - request.headers = new coreHttp.HttpHeaders(); - } - if (!request.headers.get(HeaderConstants.USER_AGENT)) { - request.headers.set(HeaderConstants.USER_AGENT, this.telemetry); - } - } - return this._nextPolicy.sendRequest(request); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * TelemetryPolicyFactory is a factory class helping generating {@link TelemetryPolicy} objects. - */ -class TelemetryPolicyFactory { - /** - * Creates an instance of TelemetryPolicyFactory. - * @param telemetry - - */ - constructor(telemetry) { - const userAgentInfo = []; - if (coreHttp.isNode) { - if (telemetry) { - const telemetryString = telemetry.userAgentPrefix || ""; - if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { - userAgentInfo.push(telemetryString); - } - } - // e.g. azsdk-js-storageblob/10.0.0 - const libInfo = `azsdk-js-storageblob/${SDK_VERSION}`; - if (userAgentInfo.indexOf(libInfo) === -1) { - userAgentInfo.push(libInfo); - } - // e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299) - let runtimeInfo = `(NODE-VERSION ${process.version})`; - if (os__namespace) { - runtimeInfo = `(NODE-VERSION ${process.version}; ${os__namespace.type()} ${os__namespace.release()})`; - } - if (userAgentInfo.indexOf(runtimeInfo) === -1) { - userAgentInfo.push(runtimeInfo); - } - } - this.telemetryString = userAgentInfo.join(" "); - } - /** - * Creates a TelemetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new TelemetryPolicy(nextPolicy, options, this.telemetryString); - } -} - -// Copyright (c) Microsoft Corporation. -const _defaultHttpClient = new coreHttp.DefaultHttpClient(); -function getCachedDefaultHttpClient() { - return _defaultHttpClient; -} - -// Copyright (c) Microsoft Corporation. -/** - * A set of constants used internally when processing requests. - */ -const Constants = { - DefaultScope: "/.default", - /** - * Defines constants for use with HTTP headers. - */ - HeaderConstants: { - /** - * The Authorization header. - */ - AUTHORIZATION: "authorization", - }, -}; -// Default options for the cycler if none are provided -const DEFAULT_CYCLER_OPTIONS = { - forcedRefreshWindowInMs: 1000, - retryIntervalInMs: 3000, - refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry -}; -/** - * Converts an an unreliable access token getter (which may resolve with null) - * into an AccessTokenGetter by retrying the unreliable getter in a regular - * interval. - * - * @param getAccessToken - a function that produces a promise of an access - * token that may fail by returning null - * @param retryIntervalInMs - the time (in milliseconds) to wait between retry - * attempts - * @param timeoutInMs - the timestamp after which the refresh attempt will fail, - * throwing an exception - * @returns - a promise that, if it resolves, will resolve with an access token - */ -async function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) { - // This wrapper handles exceptions gracefully as long as we haven't exceeded - // the timeout. - async function tryGetAccessToken() { - if (Date.now() < timeoutInMs) { - try { - return await getAccessToken(); - } - catch (_a) { - return null; - } - } - else { - const finalToken = await getAccessToken(); - // Timeout is up, so throw if it's still null - if (finalToken === null) { - throw new Error("Failed to refresh access token."); - } - return finalToken; - } - } - let token = await tryGetAccessToken(); - while (token === null) { - await coreHttp.delay(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; -} -/** - * Creates a token cycler from a credential, scopes, and optional settings. - * - * A token cycler represents a way to reliably retrieve a valid access token - * from a TokenCredential. It will handle initializing the token, refreshing it - * when it nears expiration, and synchronizes refresh attempts to avoid - * concurrency hazards. - * - * @param credential - the underlying TokenCredential that provides the access - * token - * @param scopes - the scopes to request authorization for - * @param tokenCyclerOptions - optionally override default settings for the cycler - * - * @returns - a function that reliably produces a valid access token - */ -function createTokenCycler(credential, scopes, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); - /** - * This little holder defines several predicates that we use to construct - * the rules of refreshing the token. - */ - const cycler = { - /** - * Produces true if a refresh job is currently in progress. - */ - get isRefreshing() { - return refreshWorker !== null; - }, - /** - * Produces true if the cycler SHOULD refresh (we are within the refresh - * window and not already refreshing) - */ - get shouldRefresh() { - var _a; - return (!cycler.isRefreshing && - ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now()); - }, - /** - * Produces true if the cycler MUST refresh (null or nearly-expired - * token). - */ - get mustRefresh() { - return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()); - }, - }; - /** - * Starts a refresh job or returns the existing job if one is already - * running. - */ - function refresh(getTokenOptions) { - var _a; - if (!cycler.isRefreshing) { - // We bind `scopes` here to avoid passing it around a lot - const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions); - // Take advantage of promise chaining to insert an assignment to `token` - // before the refresh can be considered done. - refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, - // If we don't have a token, then we should timeout immediately - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now()) - .then((_token) => { - refreshWorker = null; - token = _token; - return token; - }) - .catch((reason) => { - // We also should reset the refresher if we enter a failed state. All - // existing awaiters will throw, but subsequent requests will start a - // new retry chain. - refreshWorker = null; - token = null; - throw reason; - }); - } - return refreshWorker; - } - return async (tokenOptions) => { - // - // Simple rules: - // - If we MUST refresh, then return the refresh task, blocking - // the pipeline until a token is available. - // - If we SHOULD refresh, then run refresh but don't return it - // (we can still use the cached token). - // - Return the token, since it's fine if we didn't return in - // step 1. - // - if (cycler.mustRefresh) - return refresh(tokenOptions); - if (cycler.shouldRefresh) { - refresh(tokenOptions); - } - return token; - }; -} -/** - * We will retrieve the challenge only if the response status code was 401, - * and if the response contained the header "WWW-Authenticate" with a non-empty value. - */ -function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; -} -/** - * Converts: `Bearer a="b" c="d"`. - * Into: `[ { a: 'b', c: 'd' }]`. - * - * @internal - */ -function parseChallenge(challenge) { - const bearerChallenge = challenge.slice("Bearer ".length); - const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x) => x); - const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("="))); - // Key-value pairs to plain object: - return keyValuePairs.reduce((a, b) => (Object.assign(Object.assign({}, a), b)), {}); -} -// #endregion -/** - * Creates a new factory for a RequestPolicy that applies a bearer token to - * the requests' `Authorization` headers. - * - * @param credential - The TokenCredential implementation that can supply the bearer token. - * @param scopes - The scopes for which the bearer token applies. - */ -function storageBearerTokenChallengeAuthenticationPolicy(credential, scopes) { - // This simple function encapsulates the entire process of reliably retrieving the token - let getToken = createTokenCycler(credential, scopes); - class StorageBearerTokenChallengeAuthenticationPolicy extends coreHttp.BaseRequestPolicy { - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - async sendRequest(webResource) { - if (!webResource.url.toLowerCase().startsWith("https://")) { - throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); - } - const getTokenInternal = getToken; - const token = (await getTokenInternal({ - abortSignal: webResource.abortSignal, - tracingOptions: { - tracingContext: webResource.tracingContext, - }, - })).token; - webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`); - const response = await this._nextPolicy.sendRequest(webResource); - if ((response === null || response === void 0 ? void 0 : response.status) === 401) { - const challenge = getChallenge(response); - if (challenge) { - const challengeInfo = parseChallenge(challenge); - const challengeScopes = challengeInfo.resource_id + Constants.DefaultScope; - const parsedAuthUri = coreHttp.URLBuilder.parse(challengeInfo.authorization_uri); - const pathSegments = parsedAuthUri.getPath().split("/"); - const tenantId = pathSegments[1]; - const getTokenForChallenge = createTokenCycler(credential, challengeScopes); - const tokenForChallenge = (await getTokenForChallenge({ - abortSignal: webResource.abortSignal, - tracingOptions: { - tracingContext: webResource.tracingContext, - }, - tenantId: tenantId, - })).token; - getToken = getTokenForChallenge; - webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${tokenForChallenge}`); - return this._nextPolicy.sendRequest(webResource); - } - } - return response; - } - } - return { - create: (nextPolicy, options) => { - return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options); - }, - }; -} - -// Copyright (c) Microsoft Corporation. -/** - * A helper to decide if a given argument satisfies the Pipeline contract - * @param pipeline - An argument that may be a Pipeline - * @returns true when the argument satisfies the Pipeline contract - */ -function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return (Array.isArray(castPipeline.factories) && - typeof castPipeline.options === "object" && - typeof castPipeline.toServiceClientOptions === "function"); -} -/** - * A Pipeline class containing HTTP request policies. - * You can create a default Pipeline by calling {@link newPipeline}. - * Or you can create a Pipeline with your own policies by the constructor of Pipeline. - * - * Refer to {@link newPipeline} and provided policies before implementing your - * customized Pipeline. - */ -class Pipeline { - /** - * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. - * - * @param factories - - * @param options - - */ - constructor(factories, options = {}) { - this.factories = factories; - // when options.httpClient is not specified, passing in a DefaultHttpClient instance to - // avoid each client creating its own http client. - this.options = Object.assign(Object.assign({}, options), { httpClient: options.httpClient || getCachedDefaultHttpClient() }); - } - /** - * Transfer Pipeline object to ServiceClientOptions object which is required by - * ServiceClient constructor. - * - * @returns The ServiceClientOptions object from this Pipeline. - */ - toServiceClientOptions() { - return { - httpClient: this.options.httpClient, - requestPolicyFactories: this.factories, - }; - } -} -/** - * Creates a new Pipeline object with Credential provided. - * - * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used. - * @param pipelineOptions - Optional. Options. - * @returns A new Pipeline object. - */ -function newPipeline(credential, pipelineOptions = {}) { - var _a; - if (credential === undefined) { - credential = new AnonymousCredential(); - } - // Order is important. Closer to the API at the top & closer to the network at the bottom. - // The credential's policy factory must appear close to the wire so it can sign any - // changes made by other factories (like UniqueRequestIDPolicyFactory) - const telemetryPolicy = new TelemetryPolicyFactory(pipelineOptions.userAgentOptions); - const factories = [ - coreHttp.tracingPolicy({ userAgent: telemetryPolicy.telemetryString }), - coreHttp.keepAlivePolicy(pipelineOptions.keepAliveOptions), - telemetryPolicy, - coreHttp.generateClientRequestIdPolicy(), - new StorageBrowserPolicyFactory(), - new StorageRetryPolicyFactory(pipelineOptions.retryOptions), - // Default deserializationPolicy is provided by protocol layer - // Use customized XML char key of "#" so we could deserialize metadata - // with "_" key - coreHttp.deserializationPolicy(undefined, { xmlCharKey: "#" }), - coreHttp.logPolicy({ - logger: logger.info, - allowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - }), - ]; - if (coreHttp.isNode) { - // policies only available in Node.js runtime, not in browsers - factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions)); - factories.push(coreHttp.disableResponseDecompressionPolicy()); - } - factories.push(coreHttp.isTokenCredential(credential) - ? attachCredential(storageBearerTokenChallengeAuthenticationPolicy(credential, (_a = pipelineOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes), credential) - : credential); - return new Pipeline(factories, pipelineOptions); -} - -// Copyright (c) Microsoft Corporation. -/** - * StorageSharedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key. - */ -class StorageSharedKeyCredentialPolicy extends CredentialPolicy { - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; - } - /** - * Signs request. - * - * @param request - - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString()); - if (request.body && - (typeof request.body === "string" || request.body !== undefined) && - request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE), - ].join("\n") + - "\n" + - this.getCanonicalizedHeadersString(request) + - this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - // console.log(`[URL]:${request.url}`); - // console.log(`[HEADERS]:${request.headers.toString()}`); - // console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`); - // console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`); - return request; - } - /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - // When using version 2015-02-21 or later, if Content-Length is zero, then - // set the Content-Length part of the StringToSign to an empty string. - // https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; - } - /** - * To construct the CanonicalizedHeaders portion of the signature string, follow these steps: - * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header. - * 2. Convert each HTTP header name to lowercase. - * 3. Sort the headers lexicographically by header name, in ascending order. - * Each header may appear only once in the string. - * 4. Replace any linear whitespace in the header value with a single space. - * 5. Trim any whitespace around the colon in the header. - * 6. Finally, append a new-line character to each canonicalized header in the resulting list. - * Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string. - * - * @param request - - */ - getCanonicalizedHeadersString(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return a.name.toLowerCase().localeCompare(b.name.toLowerCase()); - }); - // Remove duplicate headers - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name - .toLowerCase() - .trimRight()}:${header.value.trimLeft()}\n`; - }); - return canonicalizedHeadersStringToSign; - } - /** - * Retrieves the webResource canonicalized resource string. - * - * @param request - - */ - getCanonicalizedResourceString(request) { - const path = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path}`; - const queries = getURLQueries(request.url); - const lowercaseQueries = {}; - if (queries) { - const queryKeys = []; - for (const key in queries) { - if (Object.prototype.hasOwnProperty.call(queries, key)) { - const lowercaseKey = key.toLowerCase(); - lowercaseQueries[lowercaseKey] = queries[key]; - queryKeys.push(lowercaseKey); - } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } -} - -// Copyright (c) Microsoft Corporation. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * StorageSharedKeyCredential for account key authorization of Azure Storage service. - */ -class StorageSharedKeyCredential extends Credential { - /** - * Creates an instance of StorageSharedKeyCredential. - * @param accountName - - * @param accountKey - - */ - constructor(accountName, accountKey) { - super(); - this.accountName = accountName; - this.accountKey = Buffer.from(accountKey, "base64"); - } - /** - * Creates a StorageSharedKeyCredentialPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); - } -} - -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -const packageName = "azure-storage-blob"; -const packageVersion = "12.17.0"; -class StorageClientContext extends coreHttp__namespace.ServiceClient { - /** - * Initializes a new instance of the StorageClientContext class. - * @param url The URL of the service account, container, or blob that is the target of the desired - * operation. - * @param options The parameter options - */ - constructor(url, options) { - if (url === undefined) { - throw new Error("'url' cannot be null"); - } - // Initializing default values for options - if (!options) { - options = {}; - } - if (!options.userAgent) { - const defaultUserAgent = coreHttp__namespace.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - super(undefined, options); - this.requestContentType = "application/json; charset=utf-8"; - this.baseUri = options.endpoint || "{url}"; - // Parameter assignments - this.url = url; - // Assigning values to Constant parameters - this.version = options.version || "2023-11-03"; - } -} - -// Copyright (c) Microsoft Corporation. -/** - * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient} - * and etc. - */ -class StorageClient { - /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. - */ - constructor(url, pipeline) { - // URL should be encoded and only once, protocol layer shouldn't encode URL again - this.url = escapeURLPath(url); - this.accountName = getAccountNameFromUrl(url); - this.pipeline = pipeline; - this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions()); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = new AnonymousCredential(); - for (const factory of this.pipeline.factories) { - if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) || - factory instanceof AnonymousCredential) { - this.credential = factory; - } - else if (coreHttp.isTokenCredential(factory.credential)) { - // Only works if the factory has been attached a "credential" property. - // We do that in newPipeline() when using TokenCredential. - this.credential = factory.credential; - } - } - // Override protocol layer's default content-type - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = undefined; - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Creates a span using the global tracer. - * @internal - */ -const createSpan = coreTracing.createSpanFunction({ - packagePrefix: "Azure.Storage.Blob", - namespace: "Microsoft.Storage", -}); -/** - * @internal - * - * Adapt the tracing options from OperationOptions to what they need to be for - * RequestOptionsBase (when we update to later OpenTelemetry versions this is now - * two separate fields, not just one). - */ -function convertTracingToRequestOptionsBase(options) { - var _a, _b; - return { - // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier. - spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions, - tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext, - }; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a blob. Setting - * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all - * the values are set, this should be serialized with toString and set as the permissions field on a - * {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but - * the order of the permissions is particular and this class guarantees correctness. - */ -class BlobSASPermissions { - constructor() { - /** - * Specifies Read access granted. - */ - this.read = false; - /** - * Specifies Add access granted. - */ - this.add = false; - /** - * Specifies Create access granted. - */ - this.create = false; - /** - * Specifies Write access granted. - */ - this.write = false; - /** - * Specifies Delete access granted. - */ - this.delete = false; - /** - * Specifies Delete version access granted. - */ - this.deleteVersion = false; - /** - * Specfies Tag access granted. - */ - this.tag = false; - /** - * Specifies Move access granted. - */ - this.move = false; - /** - * Specifies Execute access granted. - */ - this.execute = false; - /** - * Specifies SetImmutabilityPolicy access granted. - */ - this.setImmutabilityPolicy = false; - /** - * Specifies that Permanent Delete is permitted. - */ - this.permanentDelete = false; - } - /** - * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an - * Error if it encounters a character that does not correspond to a valid permission. - * - * @param permissions - - */ - static parse(permissions) { - const blobSASPermissions = new BlobSASPermissions(); - for (const char of permissions) { - switch (char) { - case "r": - blobSASPermissions.read = true; - break; - case "a": - blobSASPermissions.add = true; - break; - case "c": - blobSASPermissions.create = true; - break; - case "w": - blobSASPermissions.write = true; - break; - case "d": - blobSASPermissions.delete = true; - break; - case "x": - blobSASPermissions.deleteVersion = true; - break; - case "t": - blobSASPermissions.tag = true; - break; - case "m": - blobSASPermissions.move = true; - break; - case "e": - blobSASPermissions.execute = true; - break; - case "i": - blobSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - blobSASPermissions.permanentDelete = true; - break; - default: - throw new RangeError(`Invalid permission: ${char}`); - } - } - return blobSASPermissions; - } - /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. - * - * @param permissionLike - - */ - static from(permissionLike) { - const blobSASPermissions = new BlobSASPermissions(); - if (permissionLike.read) { - blobSASPermissions.read = true; - } - if (permissionLike.add) { - blobSASPermissions.add = true; - } - if (permissionLike.create) { - blobSASPermissions.create = true; - } - if (permissionLike.write) { - blobSASPermissions.write = true; - } - if (permissionLike.delete) { - blobSASPermissions.delete = true; - } - if (permissionLike.deleteVersion) { - blobSASPermissions.deleteVersion = true; - } - if (permissionLike.tag) { - blobSASPermissions.tag = true; - } - if (permissionLike.move) { - blobSASPermissions.move = true; - } - if (permissionLike.execute) { - blobSASPermissions.execute = true; - } - if (permissionLike.setImmutabilityPolicy) { - blobSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - blobSASPermissions.permanentDelete = true; - } - return blobSASPermissions; - } - /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. - * - * @returns A string which represents the BlobSASPermissions - */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.move) { - permissions.push("m"); - } - if (this.execute) { - permissions.push("e"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - return permissions.join(""); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a container. - * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. - * Once all the values are set, this should be serialized with toString and set as the permissions field on a - * {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but - * the order of the permissions is particular and this class guarantees correctness. - */ -class ContainerSASPermissions { - constructor() { - /** - * Specifies Read access granted. - */ - this.read = false; - /** - * Specifies Add access granted. - */ - this.add = false; - /** - * Specifies Create access granted. - */ - this.create = false; - /** - * Specifies Write access granted. - */ - this.write = false; - /** - * Specifies Delete access granted. - */ - this.delete = false; - /** - * Specifies Delete version access granted. - */ - this.deleteVersion = false; - /** - * Specifies List access granted. - */ - this.list = false; - /** - * Specfies Tag access granted. - */ - this.tag = false; - /** - * Specifies Move access granted. - */ - this.move = false; - /** - * Specifies Execute access granted. - */ - this.execute = false; - /** - * Specifies SetImmutabilityPolicy access granted. - */ - this.setImmutabilityPolicy = false; - /** - * Specifies that Permanent Delete is permitted. - */ - this.permanentDelete = false; - /** - * Specifies that Filter Blobs by Tags is permitted. - */ - this.filterByTags = false; - } - /** - * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an - * Error if it encounters a character that does not correspond to a valid permission. - * - * @param permissions - - */ - static parse(permissions) { - const containerSASPermissions = new ContainerSASPermissions(); - for (const char of permissions) { - switch (char) { - case "r": - containerSASPermissions.read = true; - break; - case "a": - containerSASPermissions.add = true; - break; - case "c": - containerSASPermissions.create = true; - break; - case "w": - containerSASPermissions.write = true; - break; - case "d": - containerSASPermissions.delete = true; - break; - case "l": - containerSASPermissions.list = true; - break; - case "t": - containerSASPermissions.tag = true; - break; - case "x": - containerSASPermissions.deleteVersion = true; - break; - case "m": - containerSASPermissions.move = true; - break; - case "e": - containerSASPermissions.execute = true; - break; - case "i": - containerSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - containerSASPermissions.permanentDelete = true; - break; - case "f": - containerSASPermissions.filterByTags = true; - break; - default: - throw new RangeError(`Invalid permission ${char}`); - } - } - return containerSASPermissions; - } - /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. - * - * @param permissionLike - - */ - static from(permissionLike) { - const containerSASPermissions = new ContainerSASPermissions(); - if (permissionLike.read) { - containerSASPermissions.read = true; - } - if (permissionLike.add) { - containerSASPermissions.add = true; - } - if (permissionLike.create) { - containerSASPermissions.create = true; - } - if (permissionLike.write) { - containerSASPermissions.write = true; - } - if (permissionLike.delete) { - containerSASPermissions.delete = true; - } - if (permissionLike.list) { - containerSASPermissions.list = true; - } - if (permissionLike.deleteVersion) { - containerSASPermissions.deleteVersion = true; - } - if (permissionLike.tag) { - containerSASPermissions.tag = true; - } - if (permissionLike.move) { - containerSASPermissions.move = true; - } - if (permissionLike.execute) { - containerSASPermissions.execute = true; - } - if (permissionLike.setImmutabilityPolicy) { - containerSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - containerSASPermissions.permanentDelete = true; - } - if (permissionLike.filterByTags) { - containerSASPermissions.filterByTags = true; - } - return containerSASPermissions; - } - /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. - * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas - * - */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.list) { - permissions.push("l"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.move) { - permissions.push("m"); - } - if (this.execute) { - permissions.push("e"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - if (this.filterByTags) { - permissions.push("f"); - } - return permissions.join(""); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * UserDelegationKeyCredential is only used for generation of user delegation SAS. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas - */ -class UserDelegationKeyCredential { - /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - - */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - // console.log(`stringToSign: ${JSON.stringify(stringToSign)}`); - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Generate SasIPRange format string. For example: - * - * "8.8.8.8" or "1.1.1.1-255.255.255.255" - * - * @param ipRange - - */ -function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; -} - -// Copyright (c) Microsoft Corporation. -/** - * Protocols for generated SAS. - */ -exports.SASProtocol = void 0; -(function (SASProtocol) { - /** - * Protocol that allows HTTPS only - */ - SASProtocol["Https"] = "https"; - /** - * Protocol that allows both HTTPS and HTTP - */ - SASProtocol["HttpsAndHttp"] = "https,http"; -})(exports.SASProtocol || (exports.SASProtocol = {})); -/** - * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly - * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link BlobSASSignatureValues} - * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should - * be taken here in case there are existing query parameters, which might affect the appropriate means of appending - * these query parameters). - * - * NOTE: Instances of this class are immutable. - */ -class SASQueryParameters { - constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) { - this.version = version; - this.signature = signature; - if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") { - // SASQueryParametersOptions - this.permissions = permissionsOrOptions.permissions; - this.services = permissionsOrOptions.services; - this.resourceTypes = permissionsOrOptions.resourceTypes; - this.protocol = permissionsOrOptions.protocol; - this.startsOn = permissionsOrOptions.startsOn; - this.expiresOn = permissionsOrOptions.expiresOn; - this.ipRangeInner = permissionsOrOptions.ipRange; - this.identifier = permissionsOrOptions.identifier; - this.encryptionScope = permissionsOrOptions.encryptionScope; - this.resource = permissionsOrOptions.resource; - this.cacheControl = permissionsOrOptions.cacheControl; - this.contentDisposition = permissionsOrOptions.contentDisposition; - this.contentEncoding = permissionsOrOptions.contentEncoding; - this.contentLanguage = permissionsOrOptions.contentLanguage; - this.contentType = permissionsOrOptions.contentType; - if (permissionsOrOptions.userDelegationKey) { - this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId; - this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId; - this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn; - this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn; - this.signedService = permissionsOrOptions.userDelegationKey.signedService; - this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion; - this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId; - this.correlationId = permissionsOrOptions.correlationId; - } - } - else { - this.services = services; - this.resourceTypes = resourceTypes; - this.expiresOn = expiresOn; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType; - if (userDelegationKey) { - this.signedOid = userDelegationKey.signedObjectId; - this.signedTenantId = userDelegationKey.signedTenantId; - this.signedStartsOn = userDelegationKey.signedStartsOn; - this.signedExpiresOn = userDelegationKey.signedExpiresOn; - this.signedService = userDelegationKey.signedService; - this.signedVersion = userDelegationKey.signedVersion; - this.preauthorizedAgentObjectId = preauthorizedAgentObjectId; - this.correlationId = correlationId; - } - } - } - /** - * Optional. IP range allowed for this SAS. - * - * @readonly - */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start, - }; - } - return undefined; - } - /** - * Encodes all SAS query parameters into a string that can be appended to a URL. - * - */ - toString() { - const params = [ - "sv", - "ss", - "srt", - "spr", - "st", - "se", - "sip", - "si", - "ses", - "skoid", - "sktid", - "skt", - "ske", - "sks", - "skv", - "sr", - "sp", - "sig", - "rscc", - "rscd", - "rsce", - "rscl", - "rsct", - "saoid", - "scid", - ]; - const queries = []; - for (const param of params) { - switch (param) { - case "sv": - this.tryAppendQueryParameter(queries, param, this.version); - break; - case "ss": - this.tryAppendQueryParameter(queries, param, this.services); - break; - case "srt": - this.tryAppendQueryParameter(queries, param, this.resourceTypes); - break; - case "spr": - this.tryAppendQueryParameter(queries, param, this.protocol); - break; - case "st": - this.tryAppendQueryParameter(queries, param, this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? ipRangeToString(this.ipRange) : undefined); - break; - case "si": - this.tryAppendQueryParameter(queries, param, this.identifier); - break; - case "ses": - this.tryAppendQueryParameter(queries, param, this.encryptionScope); - break; - case "skoid": // Signed object ID - this.tryAppendQueryParameter(queries, param, this.signedOid); - break; - case "sktid": // Signed tenant ID - this.tryAppendQueryParameter(queries, param, this.signedTenantId); - break; - case "skt": // Signed key start time - this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined); - break; - case "ske": // Signed key expiry time - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : undefined); - break; - case "sks": // Signed key service - this.tryAppendQueryParameter(queries, param, this.signedService); - break; - case "skv": // Signed key version - this.tryAppendQueryParameter(queries, param, this.signedVersion); - break; - case "sr": - this.tryAppendQueryParameter(queries, param, this.resource); - break; - case "sp": - this.tryAppendQueryParameter(queries, param, this.permissions); - break; - case "sig": - this.tryAppendQueryParameter(queries, param, this.signature); - break; - case "rscc": - this.tryAppendQueryParameter(queries, param, this.cacheControl); - break; - case "rscd": - this.tryAppendQueryParameter(queries, param, this.contentDisposition); - break; - case "rsce": - this.tryAppendQueryParameter(queries, param, this.contentEncoding); - break; - case "rscl": - this.tryAppendQueryParameter(queries, param, this.contentLanguage); - break; - case "rsct": - this.tryAppendQueryParameter(queries, param, this.contentType); - break; - case "saoid": - this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId); - break; - case "scid": - this.tryAppendQueryParameter(queries, param, this.correlationId); - break; - } - } - return queries.join("&"); - } - /** - * A private helper method used to filter and append query key/value pairs into an array. - * - * @param queries - - * @param key - - * @param value - - */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } -} - -// Copyright (c) Microsoft Corporation. -function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential - ? sharedKeyCredentialOrUserDelegationKey - : undefined; - let userDelegationKeyCredential; - if (sharedKeyCredential === undefined && accountName !== undefined) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - // Version 2020-12-06 adds support for encryptionscope in SAS. - if (version >= "2020-12-06") { - if (sharedKeyCredential !== undefined) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } - else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - // Version 2019-12-12 adds support for the blob tags permission. - // Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields. - // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string - if (version >= "2018-11-09") { - if (sharedKeyCredential !== undefined) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } - else { - // Version 2020-02-10 delegation SAS signature construction includes preauthorizedAgentObjectId, agentObjectId, correlationId. - if (version >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } - else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version >= "2015-04-05") { - if (sharedKeyCredential !== undefined) { - return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); - } - else { - throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key."); - } - } - throw new RangeError("'version' must be >= '2015-04-05'."); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * IMPLEMENTATION FOR API VERSION FROM 2015-04-05 AND BEFORE 2018-11-09. - * - * Creates an instance of SASQueryParameters. - * - * Only accepts required settings needed to create a SAS. For optional settings please - * set corresponding properties directly, such as permissions, startsOn and identifier. - * - * WARNING: When identifier is not provided, permissions and expiresOn are required. - * You MUST assign value to identifier or expiresOn & permissions manually if you initial with - * this constructor. - * - * @param blobSASSignatureValues - - * @param sharedKeyCredential - - */ -function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && - !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; - } - // Calling parse and toString guarantees the proper ordering and throws on invalid characters. - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - // Signature is generated on the un-url-encoded values. - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn - ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) - : "", - blobSASSignatureValues.expiresOn - ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) - : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "", - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * IMPLEMENTATION FOR API VERSION FROM 2018-11-09. - * - * Creates an instance of SASQueryParameters. - * - * Only accepts required settings needed to create a SAS. For optional settings please - * set corresponding properties directly, such as permissions, startsOn and identifier. - * - * WARNING: When identifier is not provided, permissions and expiresOn are required. - * You MUST assign value to identifier or expiresOn & permissions manually if you initial with - * this constructor. - * - * @param blobSASSignatureValues - - * @param sharedKeyCredential - - */ -function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && - !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } - else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - // Calling parse and toString guarantees the proper ordering and throws on invalid characters. - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - // Signature is generated on the un-url-encoded values. - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn - ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) - : "", - blobSASSignatureValues.expiresOn - ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) - : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "", - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * IMPLEMENTATION FOR API VERSION FROM 2020-12-06. - * - * Creates an instance of SASQueryParameters. - * - * Only accepts required settings needed to create a SAS. For optional settings please - * set corresponding properties directly, such as permissions, startsOn and identifier. - * - * WARNING: When identifier is not provided, permissions and expiresOn are required. - * You MUST assign value to identifier or expiresOn & permissions manually if you initial with - * this constructor. - * - * @param blobSASSignatureValues - - * @param sharedKeyCredential - - */ -function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - if (!blobSASSignatureValues.identifier && - !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } - else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - // Calling parse and toString guarantees the proper ordering and throws on invalid characters. - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - // Signature is generated on the un-url-encoded values. - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn - ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) - : "", - blobSASSignatureValues.expiresOn - ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) - : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", - blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", - blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", - blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", - blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "", - ].join("\n"); - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, undefined, undefined, undefined, blobSASSignatureValues.encryptionScope); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * IMPLEMENTATION FOR API VERSION FROM 2018-11-09. - * - * Creates an instance of SASQueryParameters. - * - * Only accepts required settings needed to create a SAS. For optional settings please - * set corresponding properties directly, such as permissions, startsOn. - * - * WARNING: identifier will be ignored, permissions and expiresOn are required. - * - * @param blobSASSignatureValues - - * @param userDelegationKeyCredential - - */ -function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - // Stored access policies are not supported for a user delegation SAS. - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } - else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - // Calling parse and toString guarantees the proper ordering and throws on invalid characters. - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - // Signature is generated on the un-url-encoded values. - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn - ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) - : "", - blobSASSignatureValues.expiresOn - ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) - : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn - ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) - : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn - ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) - : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType, - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * IMPLEMENTATION FOR API VERSION FROM 2020-02-10. - * - * Creates an instance of SASQueryParameters. - * - * Only accepts required settings needed to create a SAS. For optional settings please - * set corresponding properties directly, such as permissions, startsOn. - * - * WARNING: identifier will be ignored, permissions and expiresOn are required. - * - * @param blobSASSignatureValues - - * @param userDelegationKeyCredential - - */ -function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - // Stored access policies are not supported for a user delegation SAS. - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } - else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - // Calling parse and toString guarantees the proper ordering and throws on invalid characters. - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - // Signature is generated on the un-url-encoded values. - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn - ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) - : "", - blobSASSignatureValues.expiresOn - ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) - : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn - ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) - : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn - ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) - : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - undefined, - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType, - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * IMPLEMENTATION FOR API VERSION FROM 2020-12-06. - * - * Creates an instance of SASQueryParameters. - * - * Only accepts required settings needed to create a SAS. For optional settings please - * set corresponding properties directly, such as permissions, startsOn. - * - * WARNING: identifier will be ignored, permissions and expiresOn are required. - * - * @param blobSASSignatureValues - - * @param userDelegationKeyCredential - - */ -function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) { - blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues); - // Stored access policies are not supported for a user delegation SAS. - if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) { - throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS."); - } - let resource = "c"; - let timestamp = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } - else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp = blobSASSignatureValues.versionId; - } - } - // Calling parse and toString guarantees the proper ordering and throws on invalid characters. - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - // Signature is generated on the un-url-encoded values. - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn - ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) - : "", - blobSASSignatureValues.expiresOn - ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) - : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn - ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) - : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn - ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) - : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - undefined, - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType, - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope); -} -function getCanonicalName(accountName, containerName, blobName) { - // Container: "/blob/account/containerName" - // Blob: "/blob/account/containerName/blobName" - const elements = [`/blob/${accountName}/${containerName}`]; - if (blobName) { - elements.push(`/${blobName}`); - } - return elements.join(""); -} -function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); - } - if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); - } - if (blobSASSignatureValues.versionId && version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); - } - if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); - } - if (blobSASSignatureValues.permissions && - blobSASSignatureValues.permissions.setImmutabilityPolicy && - version < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (blobSASSignatureValues.permissions && - blobSASSignatureValues.permissions.deleteVersion && - version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); - } - if (blobSASSignatureValues.permissions && - blobSASSignatureValues.permissions.permanentDelete && - version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); - } - if (blobSASSignatureValues.permissions && - blobSASSignatureValues.permissions.tag && - version < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); - } - if (version < "2020-02-10" && - blobSASSignatureValues.permissions && - (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { - throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission."); - } - if (version < "2021-04-10" && - blobSASSignatureValues.permissions && - blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); - } - if (version < "2020-02-10" && - (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); - } - if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); - } - blobSASSignatureValues.version = version; - return blobSASSignatureValues; -} - -// Copyright (c) Microsoft Corporation. -/** - * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}. - */ -class BlobLeaseClient { - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId) { - const clientContext = new StorageClientContext(client.url, client.pipeline.toServiceClientOptions()); - this._url = client.url; - if (client.name === undefined) { - this._isContainer = true; - this._containerOrBlobOperation = new Container(clientContext); - } - else { - this._isContainer = false; - this._containerOrBlobOperation = new Blob$1(clientContext); - } - if (!leaseId) { - leaseId = coreHttp.generateUuid(); - } - this._leaseId = leaseId; - } - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; - } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; - } - /** - * Establishes and manages a lock on a container for delete operations, or on a blob - * for write and delete operations. - * The lock duration can be 15 to 60 seconds, or can be infinite. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param duration - Must be between 15 to 60 seconds, or infinite (-1) - * @param options - option to configure lease management operations. - * @returns Response data for acquire lease operation. - */ - async acquireLease(duration, options = {}) { - var _a, _b, _c, _d, _e, _f; - const { span, updatedOptions } = createSpan("BlobLeaseClient-acquireLease", options); - if (this._isContainer && - ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || - (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || - ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - try { - return await this._containerOrBlobOperation.acquireLease(Object.assign({ abortSignal: options.abortSignal, duration, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), proposedLeaseId: this._leaseId }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param proposedLeaseId - the proposed new lease Id. - * @param options - option to configure lease management operations. - * @returns Response data for change lease operation. - */ - async changeLease(proposedLeaseId, options = {}) { - var _a, _b, _c, _d, _e, _f; - const { span, updatedOptions } = createSpan("BlobLeaseClient-changeLease", options); - if (this._isContainer && - ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || - (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || - ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - try { - const response = await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - this._leaseId = proposedLeaseId; - return response; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * To free the lease if it is no longer needed so that another client may - * immediately acquire a lease against the container or the blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e, _f; - const { span, updatedOptions } = createSpan("BlobLeaseClient-releaseLease", options); - if (this._isContainer && - ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || - (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || - ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - try { - return await this._containerOrBlobOperation.releaseLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e, _f; - const { span, updatedOptions } = createSpan("BlobLeaseClient-renewLease", options); - if (this._isContainer && - ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || - (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || - ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - try { - return await this._containerOrBlobOperation.renewLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param breakPeriod - Break period - * @param options - Optional options to configure lease management operations. - * @returns Response data for break lease operation. - */ - async breakLease(breakPeriod, options = {}) { - var _a, _b, _c, _d, _e, _f; - const { span, updatedOptions } = createSpan("BlobLeaseClient-breakLease", options); - if (this._isContainer && - ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) || - (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) || - ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { - throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); - } - try { - const operationOptions = Object.assign({ abortSignal: options.abortSignal, breakPeriod, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)); - return await this._containerOrBlobOperation.breakLease(operationOptions); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } -} - -// Copyright (c) Microsoft Corporation. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * A Node.js ReadableStream will internally retry when internal ReadableStream unexpected ends. - */ -class RetriableReadableStream extends stream.Readable { - /** - * Creates an instance of RetriableReadableStream. - * - * @param source - The current ReadableStream returned from getter - * @param getter - A method calling downloading request returning - * a new ReadableStream from specified offset - * @param offset - Offset position in original data source to read - * @param count - How much data in original data source to read - * @param options - - */ - constructor(source, getter, offset, count, options = {}) { - super({ highWaterMark: options.highWaterMark }); - this.retries = 0; - this.sourceDataHandler = (data) => { - if (this.options.doInjectErrorOnce) { - this.options.doInjectErrorOnce = undefined; - this.source.pause(); - this.source.removeAllListeners("data"); - this.source.emit("end"); - return; - } - // console.log( - // `Offset: ${this.offset}, Received ${data.length} from internal stream` - // ); - this.offset += data.length; - if (this.onProgress) { - this.onProgress({ loadedBytes: this.offset - this.start }); - } - if (!this.push(data)) { - this.source.pause(); - } - }; - this.sourceErrorOrEndHandler = (err) => { - if (err && err.name === "AbortError") { - this.destroy(err); - return; - } - // console.log( - // `Source stream emits end or error, offset: ${ - // this.offset - // }, dest end : ${this.end}` - // ); - this.removeSourceEventHandlers(); - if (this.offset - 1 === this.end) { - this.push(null); - } - else if (this.offset <= this.end) { - // console.log( - // `retries: ${this.retries}, max retries: ${this.maxRetries}` - // ); - if (this.retries < this.maxRetryRequests) { - this.retries += 1; - this.getter(this.offset) - .then((newSource) => { - this.source = newSource; - this.setSourceEventHandlers(); - return; - }) - .catch((error) => { - this.destroy(error); - }); - } - else { - this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)); - } - } - else { - this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset - 1}`)); - } - }; - this.getter = getter; - this.source = source; - this.start = offset; - this.offset = offset; - this.end = offset + count - 1; - this.maxRetryRequests = - options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0; - this.onProgress = options.onProgress; - this.options = options; - this.setSourceEventHandlers(); - } - _read() { - this.source.resume(); - } - setSourceEventHandlers() { - this.source.on("data", this.sourceDataHandler); - this.source.on("end", this.sourceErrorOrEndHandler); - this.source.on("error", this.sourceErrorOrEndHandler); - } - removeSourceEventHandlers() { - this.source.removeListener("data", this.sourceDataHandler); - this.source.removeListener("end", this.sourceErrorOrEndHandler); - this.source.removeListener("error", this.sourceErrorOrEndHandler); - } - _destroy(error, callback) { - // remove listener from source and release source - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error === null ? undefined : error); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * BlobDownloadResponse implements BlobDownloadResponseParsed interface, and in Node.js runtime it will - * automatically retry when internal read stream unexpected ends. (This kind of unexpected ends cannot - * trigger retries defined in pipeline retry policy.) - * - * The {@link readableStreamBody} stream will retry underlayer, you can just use it as a normal Node.js - * Readable stream. - */ -class BlobDownloadResponse { - /** - * Creates an instance of BlobDownloadResponse. - * - * @param originalResponse - - * @param getter - - * @param offset - - * @param count - - * @param options - - */ - constructor(originalResponse, getter, offset, count, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); - } - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; - } - /** - * Returns if it was previously specified - * for the file. - * - * @readonly - */ - get cacheControl() { - return this.originalResponse.cacheControl; - } - /** - * Returns the value that was specified - * for the 'x-ms-content-disposition' header and specifies how to process the - * response. - * - * @readonly - */ - get contentDisposition() { - return this.originalResponse.contentDisposition; - } - /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; - } - /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. - * - * @readonly - */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; - } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. - * - * @readonly - */ - get contentLength() { - return this.originalResponse.contentLength; - } - /** - * If the file has an MD5 hash and the - * request is to read the full file, this response header is returned so that - * the client can check for message content integrity. If the request is to - * read a specified range and the 'x-ms-range-get-content-md5' is set to - * true, then the request returns an MD5 hash for the range, as long as the - * range size is less than or equal to 4 MB. If neither of these sets of - * conditions is true, then no value is returned for the 'Content-MD5' - * header. - * - * @readonly - */ - get contentMD5() { - return this.originalResponse.contentMD5; - } - /** - * Indicates the range of bytes returned if - * the client requested a subset of the file by setting the Range request - * header. - * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly - */ - get contentType() { - return this.originalResponse.contentType; - } - /** - * Conclusion time of the last attempted - * Copy File operation where this file was the destination file. This value - * can specify the time of a completed, aborted, or failed copy attempt. - * - * @readonly - */ - get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly - */ - get copyId() { - return this.originalResponse.copyId; - } - /** - * Contains the number of bytes copied and - * the total bytes in the source in the last attempted Copy File operation - * where this file was the destination file. Can show between 0 and - * Content-Length bytes copied. - * - * @readonly - */ - get copyProgress() { - return this.originalResponse.copyProgress; - } - /** - * URL up to 2KB in length that specifies the - * source file used in the last attempted Copy File operation where this file - * was the destination file. - * - * @readonly - */ - get copySource() { - return this.originalResponse.copySource; - } - /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' - * - * @readonly - */ - get copyStatus() { - return this.originalResponse.copyStatus; - } - /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. - * - * @readonly - */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; - } - /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; - } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; - } - /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. - * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } - /** - * The error code. - * - * @readonly - */ - get errorCode() { - return this.originalResponse.errorCode; - } - /** - * The value of this header is set to - * true if the file data and application metadata are completely encrypted - * using the specified algorithm. Otherwise, the value is set to false (when - * the file is unencrypted, or if only parts of the file/application metadata - * are encrypted). - * - * @readonly - */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; - } - /** - * If the blob has a MD5 hash, and if - * request contains range header (Range or x-ms-range), this response header - * is returned with the value of the whole blob's MD5 value. This value may - * or may not be equal to the value returned in Content-MD5 header, with the - * latter calculated from the requested range. - * - * @readonly - */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; - } - /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. - * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * Returns the UTC date and time generated by the service that indicates the time at which the blob was - * last read or written to. - * - * @readonly - */ - get lastAccessed() { - return this.originalResponse.lastAccessed; - } - /** - * Returns the date and time the blob was created. - * - * @readonly - */ - get createdOn() { - return this.originalResponse.createdOn; - } - /** - * A name-value pair - * to associate with a file storage object. - * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. - * - * @readonly - */ - get requestId() { - return this.originalResponse.requestId; - } - /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. - * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the Blob service used - * to execute the request. - * - * @readonly - */ - get version() { - return this.originalResponse.version; - } - /** - * Indicates the versionId of the downloaded blob version. - * - * @readonly - */ - get versionId() { - return this.originalResponse.versionId; - } - /** - * Indicates whether version of this blob is a current version. - * - * @readonly - */ - get isCurrentVersion() { - return this.originalResponse.isCurrentVersion; - } - /** - * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned - * when the blob was encrypted with a customer-provided key. - * - * @readonly - */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; - } - /** - * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to - * true, then the request returns a crc64 for the range, as long as the range size is less than - * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is - * specified in the same request, it will fail with 400(Bad Request) - */ - get contentCrc64() { - return this.originalResponse.contentCrc64; - } - /** - * Object Replication Policy Id of the destination blob. - * - * @readonly - */ - get objectReplicationDestinationPolicyId() { - return this.originalResponse.objectReplicationDestinationPolicyId; - } - /** - * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. - * - * @readonly - */ - get objectReplicationSourceProperties() { - return this.originalResponse.objectReplicationSourceProperties; - } - /** - * If this blob has been sealed. - * - * @readonly - */ - get isSealed() { - return this.originalResponse.isSealed; - } - /** - * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. - * - * @readonly - */ - get immutabilityPolicyExpiresOn() { - return this.originalResponse.immutabilityPolicyExpiresOn; - } - /** - * Indicates immutability policy mode. - * - * @readonly - */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; - } - /** - * Indicates if a legal hold is present on the blob. - * - * @readonly - */ - get legalHold() { - return this.originalResponse.legalHold; - } - /** - * The response body as a browser Blob. - * Always undefined in node.js. - * - * @readonly - */ - get contentAsBlob() { - return this.originalResponse.blobBody; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. - * - * It will automatically retry when internal read stream unexpected ends. - * - * @readonly - */ - get readableStreamBody() { - return coreHttp.isNode ? this.blobDownloadStream : undefined; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const AVRO_SYNC_MARKER_SIZE = 16; -const AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); -const AVRO_CODEC_KEY = "avro.codec"; -const AVRO_SCHEMA_KEY = "avro.schema"; - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -class AvroParser { - /** - * Reads a fixed number of bytes from the stream. - * - * @param stream - - * @param length - - * @param options - - */ - static async readFixedBytes(stream, length, options = {}) { - const bytes = await stream.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { - throw new Error("Hit stream end."); - } - return bytes; - } - /** - * Reads a single byte from the stream. - * - * @param stream - - * @param options - - */ - static async readByte(stream, options = {}) { - const buf = await AvroParser.readFixedBytes(stream, 1, options); - return buf[0]; - } - // int and long are stored in variable-length zig-zag coding. - // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt - // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types - static async readZigZagLong(stream, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await AvroParser.readByte(stream, options); - haveMoreByte = byte & 0x80; - zigZagEncoded |= (byte & 0x7f) << significanceInBit; - significanceInBit += 7; - } while (haveMoreByte && significanceInBit < 28); // bitwise operation only works for 32-bit integers - if (haveMoreByte) { - // Switch to float arithmetic - // eslint-disable-next-line no-self-assign - zigZagEncoded = zigZagEncoded; - significanceInFloat = 268435456; // 2 ** 28. - do { - byte = await AvroParser.readByte(stream, options); - zigZagEncoded += (byte & 0x7f) * significanceInFloat; - significanceInFloat *= 128; // 2 ** 7 - } while (byte & 0x80); - const res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2; - if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) { - throw new Error("Integer overflow."); - } - return res; - } - return (zigZagEncoded >> 1) ^ -(zigZagEncoded & 1); - } - static async readLong(stream, options = {}) { - return AvroParser.readZigZagLong(stream, options); - } - static async readInt(stream, options = {}) { - return AvroParser.readZigZagLong(stream, options); - } - static async readNull() { - return null; - } - static async readBoolean(stream, options = {}) { - const b = await AvroParser.readByte(stream, options); - if (b === 1) { - return true; - } - else if (b === 0) { - return false; - } - else { - throw new Error("Byte was not a boolean."); - } - } - static async readFloat(stream, options = {}) { - const u8arr = await AvroParser.readFixedBytes(stream, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); // littleEndian = true - } - static async readDouble(stream, options = {}) { - const u8arr = await AvroParser.readFixedBytes(stream, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); // littleEndian = true - } - static async readBytes(stream, options = {}) { - const size = await AvroParser.readLong(stream, options); - if (size < 0) { - throw new Error("Bytes size was negative."); - } - return stream.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream, options = {}) { - const u8arr = await AvroParser.readBytes(stream, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); - } - static async readMapPair(stream, readItemMethod, options = {}) { - const key = await AvroParser.readString(stream, options); - // FUTURE: this won't work with readFixed (currently not supported) which needs a length as the parameter. - const value = await readItemMethod(stream, options); - return { key, value }; - } - static async readMap(stream, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs = await AvroParser.readArray(stream, readPairMethod, options); - const dict = {}; - for (const pair of pairs) { - dict[pair.key] = pair.value; - } - return dict; - } - static async readArray(stream, readItemMethod, options = {}) { - const items = []; - for (let count = await AvroParser.readLong(stream, options); count !== 0; count = await AvroParser.readLong(stream, options)) { - if (count < 0) { - // Ignore block sizes - await AvroParser.readLong(stream, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream, options); - items.push(item); - } - } - return items; - } -} -var AvroComplex; -(function (AvroComplex) { - AvroComplex["RECORD"] = "record"; - AvroComplex["ENUM"] = "enum"; - AvroComplex["ARRAY"] = "array"; - AvroComplex["MAP"] = "map"; - AvroComplex["UNION"] = "union"; - AvroComplex["FIXED"] = "fixed"; -})(AvroComplex || (AvroComplex = {})); -var AvroPrimitive; -(function (AvroPrimitive) { - AvroPrimitive["NULL"] = "null"; - AvroPrimitive["BOOLEAN"] = "boolean"; - AvroPrimitive["INT"] = "int"; - AvroPrimitive["LONG"] = "long"; - AvroPrimitive["FLOAT"] = "float"; - AvroPrimitive["DOUBLE"] = "double"; - AvroPrimitive["BYTES"] = "bytes"; - AvroPrimitive["STRING"] = "string"; -})(AvroPrimitive || (AvroPrimitive = {})); -class AvroType { - /** - * Determines the AvroType from the Avro Schema. - */ - static fromSchema(schema) { - if (typeof schema === "string") { - return AvroType.fromStringSchema(schema); - } - else if (Array.isArray(schema)) { - return AvroType.fromArraySchema(schema); - } - else { - return AvroType.fromObjectSchema(schema); - } - } - static fromStringSchema(schema) { - switch (schema) { - case AvroPrimitive.NULL: - case AvroPrimitive.BOOLEAN: - case AvroPrimitive.INT: - case AvroPrimitive.LONG: - case AvroPrimitive.FLOAT: - case AvroPrimitive.DOUBLE: - case AvroPrimitive.BYTES: - case AvroPrimitive.STRING: - return new AvroPrimitiveType(schema); - default: - throw new Error(`Unexpected Avro type ${schema}`); - } - } - static fromArraySchema(schema) { - return new AvroUnionType(schema.map(AvroType.fromSchema)); - } - static fromObjectSchema(schema) { - const type = schema.type; - // Primitives can be defined as strings or objects - try { - return AvroType.fromStringSchema(type); - } - catch (err) { - // eslint-disable-line no-empty - } - switch (type) { - case AvroComplex.RECORD: - if (schema.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema}`); - } - if (!schema.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`); - } - // eslint-disable-next-line no-case-declarations - const fields = {}; - if (!schema.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`); - } - for (const field of schema.fields) { - fields[field.name] = AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema.name); - case AvroComplex.ENUM: - if (schema.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema}`); - } - if (!schema.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema}`); - } - return new AvroEnumType(schema.symbols); - case AvroComplex.MAP: - if (!schema.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema}`); - } - return new AvroMapType(AvroType.fromSchema(schema.values)); - case AvroComplex.ARRAY: // Unused today - case AvroComplex.FIXED: // Unused today - default: - throw new Error(`Unexpected Avro type ${type} in ${schema}`); - } - } -} -class AvroPrimitiveType extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; - } - read(stream, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream, options); - default: - throw new Error("Unknown Avro Primitive"); - } - } -} -class AvroEnumType extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; - } - async read(stream, options = {}) { - const value = await AvroParser.readInt(stream, options); - return this._symbols[value]; - } -} -class AvroUnionType extends AvroType { - constructor(types) { - super(); - this._types = types; - } - async read(stream, options = {}) { - // eslint-disable-line @typescript-eslint/ban-types - const typeIndex = await AvroParser.readInt(stream, options); - return this._types[typeIndex].read(stream, options); - } -} -class AvroMapType extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; - } - read(stream, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream, readItemMethod, options); - } -} -class AvroRecordType extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; - } - async read(stream, options = {}) { - const record = {}; - record["$schema"] = this._name; - for (const key in this._fields) { - if (Object.prototype.hasOwnProperty.call(this._fields, key)) { - record[key] = await this._fields[key].read(stream, options); - } - } - return record; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -function arraysEqual(a, b) { - if (a === b) - return true; - // eslint-disable-next-line eqeqeq - if (a == null || b == null) - return false; - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; ++i) { - if (a[i] !== b[i]) - return false; - } - return true; -} - -// Copyright (c) Microsoft Corporation. -class AvroReader { - constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) { - this._dataStream = dataStream; - this._headerStream = headerStream || dataStream; - this._initialized = false; - this._blockOffset = currentBlockOffset || 0; - this._objectIndex = indexWithinCurrentBlock || 0; - this._initialBlockOffset = currentBlockOffset || 0; - } - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; - } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal, - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - // File metadata is written as if defined by the following map schema: - // { "type": "map", "values": "bytes"} - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal, - }); - // Validate codec - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === undefined || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); - } - // The 16-byte, randomly-generated sync marker for this file. - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal, - }); - // Parse the schema - const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal, - }); - // skip block length - await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }); - this._initialized = true; - if (this._objectIndex && this._objectIndex > 0) { - for (let i = 0; i < this._objectIndex; i++) { - await this._itemType.read(this._dataStream, { abortSignal: options.abortSignal }); - this._itemsRemainingInBlock--; - } - } - } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; - } - parseObjects(options = {}) { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1() { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal, - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal, - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal, - })); - } - catch (err) { - // We hit the end of the stream. - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - // Ignore block size - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); - } - }); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -class AvroReadable { -} - -// Copyright (c) Microsoft Corporation. -const ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); -class AvroReadableFromStream extends AvroReadable { - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; - } - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; - } - get position() { - return this._position; - } - async read(size, options = {}) { - var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw ABORT_ERROR; - } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); - } - if (size === 0) { - return new Uint8Array(); - } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); - } - // See if there is already enough data. - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - // chunk.length maybe less than desired size if the stream ends. - return this.toUint8Array(chunk); - } - else { - // register callback to wait for enough data to read - return new Promise((resolve, reject) => { - /* eslint-disable @typescript-eslint/no-use-before-define */ - const cleanUp = () => { - this._readable.removeListener("readable", readableCallback); - this._readable.removeListener("error", rejectCallback); - this._readable.removeListener("end", rejectCallback); - this._readable.removeListener("close", rejectCallback); - if (options.abortSignal) { - options.abortSignal.removeEventListener("abort", abortHandler); - } - }; - const readableCallback = () => { - const callbackChunk = this._readable.read(size); - if (callbackChunk) { - this._position += callbackChunk.length; - cleanUp(); - // callbackChunk.length maybe less than desired size if the stream ends. - resolve(this.toUint8Array(callbackChunk)); - } - }; - const rejectCallback = () => { - cleanUp(); - reject(); - }; - const abortHandler = () => { - cleanUp(); - reject(ABORT_ERROR); - }; - this._readable.on("readable", readableCallback); - this._readable.once("error", rejectCallback); - this._readable.once("end", rejectCallback); - this._readable.once("close", rejectCallback); - if (options.abortSignal) { - options.abortSignal.addEventListener("abort", abortHandler); - } - /* eslint-enable @typescript-eslint/no-use-before-define */ - }); - } - } -} - -// Copyright (c) Microsoft Corporation. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * A Node.js BlobQuickQueryStream will internally parse avro data stream for blob query. - */ -class BlobQuickQueryStream extends stream.Readable { - /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - - */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); - } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); - } - } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema = obj.$schema; - if (typeof schema !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema) { - case "com.microsoft.azure.storage.queryBlobContents.resultData": - { - const data = obj.data; - if (data instanceof Uint8Array === false) { - throw Error("Invalid data in avro result record."); - } - if (!this.push(Buffer.from(data))) { - this.avroPaused = true; - } - } - break; - case "com.microsoft.azure.storage.queryBlobContents.progress": - { - const bytesScanned = obj.bytesScanned; - if (typeof bytesScanned !== "number") { - throw Error("Invalid bytesScanned in avro progress record."); - } - if (this.onProgress) { - this.onProgress({ loadedBytes: bytesScanned }); - } - } - break; - case "com.microsoft.azure.storage.queryBlobContents.end": - if (this.onProgress) { - const totalBytes = obj.totalBytes; - if (typeof totalBytes !== "number") { - throw Error("Invalid totalBytes in avro end record."); - } - this.onProgress({ loadedBytes: totalBytes }); - } - this.push(null); - break; - case "com.microsoft.azure.storage.queryBlobContents.error": - if (this.onError) { - const fatal = obj.fatal; - if (typeof fatal !== "boolean") { - throw Error("Invalid fatal in avro error record."); - } - const name = obj.name; - if (typeof name !== "string") { - throw Error("Invalid name in avro error record."); - } - const description = obj.description; - if (typeof description !== "string") { - throw Error("Invalid description in avro error record."); - } - const position = obj.position; - if (typeof position !== "number") { - throw Error("Invalid position in avro error record."); - } - this.onError({ - position, - name, - isFatal: fatal, - description, - }); - } - break; - default: - throw Error(`Unknown schema ${schema} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * BlobQueryResponse implements BlobDownloadResponseModel interface, and in Node.js runtime it will - * parse avor data returned by blob query. - */ -class BlobQueryResponse { - /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - - */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; - } - /** - * Returns if it was previously specified - * for the file. - * - * @readonly - */ - get cacheControl() { - return this.originalResponse.cacheControl; - } - /** - * Returns the value that was specified - * for the 'x-ms-content-disposition' header and specifies how to process the - * response. - * - * @readonly - */ - get contentDisposition() { - return this.originalResponse.contentDisposition; - } - /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; - } - /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. - * - * @readonly - */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; - } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. - * - * @readonly - */ - get contentLength() { - return this.originalResponse.contentLength; - } - /** - * If the file has an MD5 hash and the - * request is to read the full file, this response header is returned so that - * the client can check for message content integrity. If the request is to - * read a specified range and the 'x-ms-range-get-content-md5' is set to - * true, then the request returns an MD5 hash for the range, as long as the - * range size is less than or equal to 4 MB. If neither of these sets of - * conditions is true, then no value is returned for the 'Content-MD5' - * header. - * - * @readonly - */ - get contentMD5() { - return this.originalResponse.contentMD5; - } - /** - * Indicates the range of bytes returned if - * the client requested a subset of the file by setting the Range request - * header. - * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly - */ - get contentType() { - return this.originalResponse.contentType; - } - /** - * Conclusion time of the last attempted - * Copy File operation where this file was the destination file. This value - * can specify the time of a completed, aborted, or failed copy attempt. - * - * @readonly - */ - get copyCompletedOn() { - return undefined; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly - */ - get copyId() { - return this.originalResponse.copyId; - } - /** - * Contains the number of bytes copied and - * the total bytes in the source in the last attempted Copy File operation - * where this file was the destination file. Can show between 0 and - * Content-Length bytes copied. - * - * @readonly - */ - get copyProgress() { - return this.originalResponse.copyProgress; - } - /** - * URL up to 2KB in length that specifies the - * source file used in the last attempted Copy File operation where this file - * was the destination file. - * - * @readonly - */ - get copySource() { - return this.originalResponse.copySource; - } - /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' - * - * @readonly - */ - get copyStatus() { - return this.originalResponse.copyStatus; - } - /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. - * - * @readonly - */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; - } - /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; - } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; - } - /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. - * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. - * - * @readonly - */ - get errorCode() { - return this.originalResponse.errorCode; - } - /** - * The value of this header is set to - * true if the file data and application metadata are completely encrypted - * using the specified algorithm. Otherwise, the value is set to false (when - * the file is unencrypted, or if only parts of the file/application metadata - * are encrypted). - * - * @readonly - */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; - } - /** - * If the blob has a MD5 hash, and if - * request contains range header (Range or x-ms-range), this response header - * is returned with the value of the whole blob's MD5 value. This value may - * or may not be equal to the value returned in Content-MD5 header, with the - * latter calculated from the requested range. - * - * @readonly - */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; - } - /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. - * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * A name-value pair - * to associate with a file storage object. - * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. - * - * @readonly - */ - get requestId() { - return this.originalResponse.requestId; - } - /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. - * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. - * - * @readonly - */ - get version() { - return this.originalResponse.version; - } - /** - * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned - * when the blob was encrypted with a customer-provided key. - * - * @readonly - */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; - } - /** - * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to - * true, then the request returns a crc64 for the range, as long as the range size is less than - * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is - * specified in the same request, it will fail with 400(Bad Request) - */ - get contentCrc64() { - return this.originalResponse.contentCrc64; - } - /** - * The response body as a browser Blob. - * Always undefined in node.js. - * - * @readonly - */ - get blobBody() { - return undefined; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. - * - * It will parse avor data returned by blob query. - * - * @readonly - */ - get readableStreamBody() { - return coreHttp.isNode ? this.blobDownloadStream : undefined; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Represents the access tier on a blob. - * For detailed information about block blob level tiering see {@link https://docs.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.} - */ -exports.BlockBlobTier = void 0; -(function (BlockBlobTier) { - /** - * Optimized for storing data that is accessed frequently. - */ - BlockBlobTier["Hot"] = "Hot"; - /** - * Optimized for storing data that is infrequently accessed and stored for at least 30 days. - */ - BlockBlobTier["Cool"] = "Cool"; - /** - * Optimized for storing data that is rarely accessed. - */ - BlockBlobTier["Cold"] = "Cold"; - /** - * Optimized for storing data that is rarely accessed and stored for at least 180 days - * with flexible latency requirements (on the order of hours). - */ - BlockBlobTier["Archive"] = "Archive"; -})(exports.BlockBlobTier || (exports.BlockBlobTier = {})); -/** - * Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts. - * Please see {@link https://docs.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here} - * for detailed information on the corresponding IOPS and throughput per PageBlobTier. - */ -exports.PremiumPageBlobTier = void 0; -(function (PremiumPageBlobTier) { - /** - * P4 Tier. - */ - PremiumPageBlobTier["P4"] = "P4"; - /** - * P6 Tier. - */ - PremiumPageBlobTier["P6"] = "P6"; - /** - * P10 Tier. - */ - PremiumPageBlobTier["P10"] = "P10"; - /** - * P15 Tier. - */ - PremiumPageBlobTier["P15"] = "P15"; - /** - * P20 Tier. - */ - PremiumPageBlobTier["P20"] = "P20"; - /** - * P30 Tier. - */ - PremiumPageBlobTier["P30"] = "P30"; - /** - * P40 Tier. - */ - PremiumPageBlobTier["P40"] = "P40"; - /** - * P50 Tier. - */ - PremiumPageBlobTier["P50"] = "P50"; - /** - * P60 Tier. - */ - PremiumPageBlobTier["P60"] = "P60"; - /** - * P70 Tier. - */ - PremiumPageBlobTier["P70"] = "P70"; - /** - * P80 Tier. - */ - PremiumPageBlobTier["P80"] = "P80"; -})(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {})); -function toAccessTier(tier) { - if (tier === undefined) { - return undefined; - } - return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service). -} -function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); - } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; - } -} -/** - * Defines the known cloud audiences for Storage. - */ -exports.StorageBlobAudience = void 0; -(function (StorageBlobAudience) { - /** - * The OAuth scope to use to retrieve an AAD token for Azure Storage. - */ - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - /** - * The OAuth scope to use to retrieve an AAD token for Azure Disk. - */ - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; -})(exports.StorageBlobAudience || (exports.StorageBlobAudience = {})); -function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Function that converts PageRange and ClearRange to a common Range object. - * PageRange and ClearRange have start and end while Range offset and count - * this function normalizes to Range. - * @param response - Model PageBlob Range response - */ -function rangeResponseFromModel(response) { - const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({ - offset: x.start, - count: x.end - x.start, - })); - const clearRange = (response._response.parsedBody.clearRange || []).map((x) => ({ - offset: x.start, - count: x.end - x.start, - })); - return Object.assign(Object.assign({}, response), { pageRange, - clearRange, _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange, - } }) }); -} - -// Copyright (c) Microsoft Corporation. -/** - * This is the poller returned by {@link BlobClient.beginCopyFromURL}. - * This can not be instantiated directly outside of this package. - * - * @hidden - */ -class BlobBeginCopyFromUrlPoller extends coreLro.Poller { - constructor(options) { - const { blobClient, copySource, intervalInMs = 15000, onProgress, resumeFrom, startCopyFromURLOptions, } = options; - let state; - if (resumeFrom) { - state = JSON.parse(resumeFrom).state; - } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { blobClient, - copySource, - startCopyFromURLOptions })); - super(operation); - if (typeof onProgress === "function") { - this.onProgress(onProgress); - } - this.intervalInMs = intervalInMs; - } - delay() { - return coreHttp.delay(this.intervalInMs); - } -} -/** - * Note: Intentionally using function expression over arrow function expression - * so that the function can be invoked with a different context. - * This affects what `this` refers to. - * @hidden - */ -const cancel = async function cancel(options = {}) { - const state = this.state; - const { copyId } = state; - if (state.isCompleted) { - return makeBlobBeginCopyFromURLPollOperation(state); - } - if (!copyId) { - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - } - // if abortCopyFromURL throws, it will bubble up to user's poller.cancelOperation call - await state.blobClient.abortCopyFromURL(copyId, { - abortSignal: options.abortSignal, - }); - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); -}; -/** - * Note: Intentionally using function expression over arrow function expression - * so that the function can be invoked with a different context. - * This affects what `this` refers to. - * @hidden - */ -const update = async function update(options = {}) { - const state = this.state; - const { blobClient, copySource, startCopyFromURLOptions } = state; - if (!state.isStarted) { - state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); - // copyId is needed to abort - state.copyId = result.copyId; - if (result.copyStatus === "success") { - state.result = result; - state.isCompleted = true; - } - } - else if (!state.isCompleted) { - try { - const result = await state.blobClient.getProperties({ abortSignal: options.abortSignal }); - const { copyStatus, copyProgress } = result; - const prevCopyProgress = state.copyProgress; - if (copyProgress) { - state.copyProgress = copyProgress; - } - if (copyStatus === "pending" && - copyProgress !== prevCopyProgress && - typeof options.fireProgress === "function") { - // trigger in setTimeout, or swallow error? - options.fireProgress(state); - } - else if (copyStatus === "success") { - state.result = result; - state.isCompleted = true; - } - else if (copyStatus === "failed") { - state.error = new Error(`Blob copy failed with reason: "${result.copyStatusDescription || "unknown"}"`); - state.isCompleted = true; - } - } - catch (err) { - state.error = err; - state.isCompleted = true; - } - } - return makeBlobBeginCopyFromURLPollOperation(state); -}; -/** - * Note: Intentionally using function expression over arrow function expression - * so that the function can be invoked with a different context. - * This affects what `this` refers to. - * @hidden - */ -const toString = function toString() { - return JSON.stringify({ state: this.state }, (key, value) => { - // remove blobClient from serialized state since a client can't be hydrated from this info. - if (key === "blobClient") { - return undefined; - } - return value; - }); -}; -/** - * Creates a poll operation given the provided state. - * @hidden - */ -function makeBlobBeginCopyFromURLPollOperation(state) { - return { - state: Object.assign({}, state), - cancel, - toString, - update, - }; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Generate a range string. For example: - * - * "bytes=255-" or "bytes=0-511" - * - * @param iRange - - */ -function rangeToString(iRange) { - if (iRange.offset < 0) { - throw new RangeError(`Range.offset cannot be smaller than 0.`); - } - if (iRange.count && iRange.count <= 0) { - throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`); - } - return iRange.count - ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` - : `bytes=${iRange.offset}-`; -} - -// Copyright (c) Microsoft Corporation. -/** - * States for Batch. - */ -var BatchStates; -(function (BatchStates) { - BatchStates[BatchStates["Good"] = 0] = "Good"; - BatchStates[BatchStates["Error"] = 1] = "Error"; -})(BatchStates || (BatchStates = {})); -/** - * Batch provides basic parallel execution with concurrency limits. - * Will stop execute left operations when one of the executed operation throws an error. - * But Batch cannot cancel ongoing operations, you need to cancel them by yourself. - */ -class Batch { - /** - * Creates an instance of Batch. - * @param concurrency - - */ - constructor(concurrency = 5) { - /** - * Number of active operations under execution. - */ - this.actives = 0; - /** - * Number of completed operations under execution. - */ - this.completed = 0; - /** - * Offset of next operation to be executed. - */ - this.offset = 0; - /** - * Operation array to be executed. - */ - this.operations = []; - /** - * States of Batch. When an error happens, state will turn into error. - * Batch will stop execute left operations. - */ - this.state = BatchStates.Good; - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); - } - this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); - } - /** - * Add a operation into queue. - * - * @param operation - - */ - addOperation(operation) { - this.operations.push(async () => { - try { - this.actives++; - await operation(); - this.actives--; - this.completed++; - this.parallelExecute(); - } - catch (error) { - this.emitter.emit("error", error); - } - }); - } - /** - * Start execute operations in the queue. - * - */ - async do() { - if (this.operations.length === 0) { - return Promise.resolve(); - } - this.parallelExecute(); - return new Promise((resolve, reject) => { - this.emitter.on("finish", resolve); - this.emitter.on("error", (error) => { - this.state = BatchStates.Error; - reject(error); - }); - }); - } - /** - * Get next operation to be executed. Return null when reaching ends. - * - */ - nextOperation() { - if (this.offset < this.operations.length) { - return this.operations[this.offset++]; - } - return null; - } - /** - * Start execute operations. One one the most important difference between - * this method with do() is that do() wraps as an sync method. - * - */ - parallelExecute() { - if (this.state === BatchStates.Error) { - return; - } - if (this.completed >= this.operations.length) { - this.emitter.emit("finish"); - return; - } - while (this.actives < this.concurrency) { - const operation = this.nextOperation(); - if (operation) { - operation(); - } - else { - return; - } - } - } -} - -// Copyright (c) Microsoft Corporation. -/** - * This class generates a readable stream from the data in an array of buffers. - */ -class BuffersStream extends stream.Readable { - /** - * Creates an instance of BuffersStream that will emit the data - * contained in the array of buffers. - * - * @param buffers - Array of buffers containing the data - * @param byteLength - The total length of data contained in the buffers - */ - constructor(buffers, byteLength, options) { - super(options); - this.buffers = buffers; - this.byteLength = byteLength; - this.byteOffsetInCurrentBuffer = 0; - this.bufferIndex = 0; - this.pushedBytesLength = 0; - // check byteLength is no larger than buffers[] total length - let buffersLength = 0; - for (const buf of this.buffers) { - buffersLength += buf.byteLength; - } - if (buffersLength < this.byteLength) { - throw new Error("Data size shouldn't be larger than the total length of buffers."); - } - } - /** - * Internal _read() that will be called when the stream wants to pull more data in. - * - * @param size - Optional. The size of data to be read - */ - _read(size) { - if (this.pushedBytesLength >= this.byteLength) { - this.push(null); - } - if (!size) { - size = this.readableHighWaterMark; - } - const outBuffers = []; - let i = 0; - while (i < size && this.pushedBytesLength < this.byteLength) { - // The last buffer may be longer than the data it contains. - const remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength; - const remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer; - const remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers); - if (remaining > size - i) { - // chunkSize = size - i - const end = this.byteOffsetInCurrentBuffer + size - i; - outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); - this.pushedBytesLength += size - i; - this.byteOffsetInCurrentBuffer = end; - i = size; - break; - } - else { - // chunkSize = remaining - const end = this.byteOffsetInCurrentBuffer + remaining; - outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); - if (remaining === remainingCapacityInThisBuffer) { - // this.buffers[this.bufferIndex] used up, shift to next one - this.byteOffsetInCurrentBuffer = 0; - this.bufferIndex++; - } - else { - this.byteOffsetInCurrentBuffer = end; - } - this.pushedBytesLength += remaining; - i += remaining; - } - } - if (outBuffers.length > 1) { - this.push(Buffer.concat(outBuffers)); - } - else if (outBuffers.length === 1) { - this.push(outBuffers[0]); - } - } -} - -// Copyright (c) Microsoft Corporation. -/** - * maxBufferLength is max size of each buffer in the pooled buffers. - */ -// Can't use import as Typescript doesn't recognize "buffer". -const maxBufferLength = (__nccwpck_require__(20181).constants).MAX_LENGTH; -/** - * This class provides a buffer container which conceptually has no hard size limit. - * It accepts a capacity, an array of input buffers and the total length of input data. - * It will allocate an internal "buffer" of the capacity and fill the data in the input buffers - * into the internal "buffer" serially with respect to the total length. - * Then by calling PooledBuffer.getReadableStream(), you can get a readable stream - * assembled from all the data in the internal "buffer". - */ -class PooledBuffer { - constructor(capacity, buffers, totalLength) { - /** - * Internal buffers used to keep the data. - * Each buffer has a length of the maxBufferLength except last one. - */ - this.buffers = []; - this.capacity = capacity; - this._size = 0; - // allocate - const bufferNum = Math.ceil(capacity / maxBufferLength); - for (let i = 0; i < bufferNum; i++) { - let len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength; - if (len === 0) { - len = maxBufferLength; - } - this.buffers.push(Buffer.allocUnsafe(len)); - } - if (buffers) { - this.fill(buffers, totalLength); - } - } - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - /** - * Fill the internal buffers with data in the input buffers serially - * with respect to the total length and the total capacity of the internal buffers. - * Data copied will be shift out of the input buffers. - * - * @param buffers - Input buffers containing the data to be filled in the pooled buffer - * @param totalLength - Total length of the data to be filled in. - * - */ - fill(buffers, totalLength) { - this._size = Math.min(this.capacity, totalLength); - let i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0; - while (totalCopiedNum < this._size) { - const source = buffers[i]; - const target = this.buffers[j]; - const copiedNum = source.copy(target, targetOffset, sourceOffset); - totalCopiedNum += copiedNum; - sourceOffset += copiedNum; - targetOffset += copiedNum; - if (sourceOffset === source.length) { - i++; - sourceOffset = 0; - } - if (targetOffset === target.length) { - j++; - targetOffset = 0; - } - } - // clear copied from source buffers - buffers.splice(0, i); - if (buffers.length > 0) { - buffers[0] = buffers[0].slice(sourceOffset); - } - } - /** - * Get the readable stream assembled from all the data in the internal buffers. - * - */ - getReadableStream() { - return new BuffersStream(this.buffers, this.size); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * This class accepts a Node.js Readable stream as input, and keeps reading data - * from the stream into the internal buffer structure, until it reaches maxBuffers. - * Every available buffer will try to trigger outgoingHandler. - * - * The internal buffer structure includes an incoming buffer array, and a outgoing - * buffer array. The incoming buffer array includes the "empty" buffers can be filled - * with new incoming data. The outgoing array includes the filled buffers to be - * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize. - * - * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING - * - * NUM_OF_ALL_BUFFERS lesser than or equal to maxBuffers - * - * PERFORMANCE IMPROVEMENT TIPS: - * 1. Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. - * 2. concurrency should set a smaller value than maxBuffers, which is helpful to - * reduce the possibility when a outgoing handler waits for the stream data. - * in this situation, outgoing handlers are blocked. - * Outgoing queue shouldn't be empty. - */ -class BufferScheduler { - /** - * Creates an instance of BufferScheduler. - * - * @param readable - A Node.js Readable stream - * @param bufferSize - Buffer size of every maintained buffer - * @param maxBuffers - How many buffers can be allocated - * @param outgoingHandler - An async function scheduled to be - * triggered when a buffer fully filled - * with stream data - * @param concurrency - Concurrency of executing outgoingHandlers (>0) - * @param encoding - [Optional] Encoding of Readable stream when it's a string stream - */ - constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - /** - * An internal event emitter. - */ - this.emitter = new events.EventEmitter(); - /** - * An internal offset marker to track data offset in bytes of next outgoingHandler. - */ - this.offset = 0; - /** - * An internal marker to track whether stream is end. - */ - this.isStreamEnd = false; - /** - * An internal marker to track whether stream or outgoingHandler returns error. - */ - this.isError = false; - /** - * How many handlers are executing. - */ - this.executingOutgoingHandlers = 0; - /** - * How many buffers have been allocated. - */ - this.numBuffers = 0; - /** - * Because this class doesn't know how much data every time stream pops, which - * is defined by highWaterMarker of the stream. So BufferScheduler will cache - * data received from the stream, when data in unresolvedDataArray exceeds the - * blockSize defined, it will try to concat a blockSize of buffer, fill into available - * buffers from incoming and push to outgoing array. - */ - this.unresolvedDataArray = []; - /** - * How much data consisted in unresolvedDataArray. - */ - this.unresolvedLength = 0; - /** - * The array includes all the available buffers can be used to fill data from stream. - */ - this.incoming = []; - /** - * The array (queue) includes all the buffers filled from stream data. - */ - this.outgoing = []; - if (bufferSize <= 0) { - throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`); - } - if (maxBuffers <= 0) { - throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); - } - if (concurrency <= 0) { - throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`); - } - this.bufferSize = bufferSize; - this.maxBuffers = maxBuffers; - this.readable = readable; - this.outgoingHandler = outgoingHandler; - this.concurrency = concurrency; - this.encoding = encoding; - } - /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. - * - */ - async do() { - return new Promise((resolve, reject) => { - this.readable.on("data", (data) => { - data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; - this.appendUnresolvedData(data); - if (!this.resolveData()) { - this.readable.pause(); - } - }); - this.readable.on("error", (err) => { - this.emitter.emit("error", err); - }); - this.readable.on("end", () => { - this.isStreamEnd = true; - this.emitter.emit("checkEnd"); - }); - this.emitter.on("error", (err) => { - this.isError = true; - this.readable.pause(); - reject(err); - }); - this.emitter.on("checkEnd", () => { - if (this.outgoing.length > 0) { - this.triggerOutgoingHandlers(); - return; - } - if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { - if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { - const buffer = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset) - .then(resolve) - .catch(reject); - } - else if (this.unresolvedLength >= this.bufferSize) { - return; - } - else { - resolve(); - } - } - }); - }); - } - /** - * Insert a new data into unresolved array. - * - * @param data - - */ - appendUnresolvedData(data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; - } - /** - * Try to shift a buffer with size in blockSize. The buffer returned may be less - * than blockSize when data in unresolvedDataArray is less than bufferSize. - * - */ - shiftBufferFromUnresolvedDataArray(buffer) { - if (!buffer) { - buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } - else { - buffer.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer.size; - return buffer; - } - /** - * Resolve data in unresolvedDataArray. For every buffer with size in blockSize - * shifted, it will try to get (or allocate a buffer) from incoming, and fill it, - * then push it into outgoing to be handled by outgoing handler. - * - * Return false when available buffers in incoming are not enough, else true. - * - * @returns Return false when buffers in incoming are not enough, else true. - */ - resolveData() { - while (this.unresolvedLength >= this.bufferSize) { - let buffer; - if (this.incoming.length > 0) { - buffer = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer); - } - else { - if (this.numBuffers < this.maxBuffers) { - buffer = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } - else { - // No available buffer, wait for buffer returned - return false; - } - } - this.outgoing.push(buffer); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer = this.outgoing.shift(); - if (buffer) { - this.triggerOutgoingHandler(buffer); - } - } while (buffer); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer) { - const bufferLength = buffer.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength); - } - catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer) { - this.incoming.push(buffer); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } -} - -// Copyright (c) Microsoft Corporation. -/** - * Reads a readable stream into buffer. Fill the buffer from offset to end. - * - * @param stream - A Node.js Readable stream - * @param buffer - Buffer to be filled, length must greater than or equal to offset - * @param offset - From which position in the buffer to be filled, inclusive - * @param end - To which position in the buffer to be filled, exclusive - * @param encoding - Encoding of the Readable stream - */ -async function streamToBuffer(stream, buffer, offset, end, encoding) { - let pos = 0; // Position in stream - const count = end - offset; // Total amount of data needed in stream - return new Promise((resolve, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream.on("readable", () => { - if (pos >= count) { - clearTimeout(timeout); - resolve(); - return; - } - let chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - // How much data needed in this chunk - const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream.on("end", () => { - clearTimeout(timeout); - if (pos < count) { - reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); - } - resolve(); - }); - stream.on("error", (msg) => { - clearTimeout(timeout); - reject(msg); - }); - }); -} -/** - * Reads a readable stream into buffer entirely. - * - * @param stream - A Node.js Readable stream - * @param buffer - Buffer to be filled, length must greater than or equal to offset - * @param encoding - Encoding of the Readable stream - * @returns with the count of bytes read. - * @throws `RangeError` If buffer size is not big enough. - */ -async function streamToBuffer2(stream, buffer, encoding) { - let pos = 0; // Position in stream - const bufferSize = buffer.length; - return new Promise((resolve, reject) => { - stream.on("readable", () => { - let chunk = stream.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - if (pos + chunk.length > bufferSize) { - reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); - return; - } - buffer.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream.on("end", () => { - resolve(pos); - }); - stream.on("error", reject); - }); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed. - * - * @param rs - The read stream. - * @param file - Destination file path. - */ -async function readStreamToLocalFile(rs, file) { - return new Promise((resolve, reject) => { - const ws = fs__namespace.createWriteStream(file); - rs.on("error", (err) => { - reject(err); - }); - ws.on("error", (err) => { - reject(err); - }); - ws.on("close", resolve); - rs.pipe(ws); - }); -} -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Promisified version of fs.stat(). - */ -const fsStat = util__namespace.promisify(fs__namespace.stat); -const fsCreateReadStream = fs__namespace.createReadStream; - -/** - * A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob, - * append blob, or page blob. - */ -class BlobClient extends StorageClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - options = options || {}; - let pipeline; - let url; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - // (url: string, pipeline: Pipeline) - url = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } - else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) || - credentialOrPipelineOrContainerName instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - url = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } - else if (!credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName !== "string") { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - // The second parameter is undefined. Use anonymous credential. - url = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline = newPipeline(new AnonymousCredential(), options); - } - else if (credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName === "string" && - blobNameOrOptions && - typeof blobNameOrOptions === "string") { - // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions) - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreHttp.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } - else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } - else if (extractedCreds.kind === "SASConnString") { - url = - appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + - "?" + - extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } - else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url, pipeline); - ({ blobName: this._name, containerName: this._containerName } = - this.getBlobAndContainerNamesFromUrl()); - this.blobContext = new Blob$1(this.storageClientContext); - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); - } - /** - * The name of the blob. - */ - get name() { - return this._name; - } - /** - * The name of the storage container the blob is associated with. - */ - get containerName() { - return this._containerName; - } - /** - * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp - */ - withSnapshot(snapshot) { - return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); - } - /** - * Creates a new BlobClient object pointing to a version of this blob. - * Provide "" will remove the versionId and return a Client to the base blob. - * - * @param versionId - The versionId. - * @returns A new BlobClient object pointing to the version of this blob. - */ - withVersion(versionId) { - return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId.length === 0 ? undefined : versionId), this.pipeline); - } - /** - * Creates a AppendBlobClient object. - * - */ - getAppendBlobClient() { - return new AppendBlobClient(this.url, this.pipeline); - } - /** - * Creates a BlockBlobClient object. - * - */ - getBlockBlobClient() { - return new BlockBlobClient(this.url, this.pipeline); - } - /** - * Creates a PageBlobClient object. - * - */ - getPageBlobClient() { - return new PageBlobClient(this.url, this.pipeline); - } - /** - * Reads or downloads a blob from the system, including its metadata and properties. - * You can also call Get Blob to read a snapshot. - * - * * In Node.js, data returns in a Readable stream readableStreamBody - * * In browsers, data returns in a promise blobBody - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob - * - * @param offset - From which position of the blob to download, greater than or equal to 0 - * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined - * @param options - Optional options to Blob Download operation. - * - * - * Example usage (Node.js): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * Example usage (browser): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded - * ); - * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); - * } - * ``` - */ - async download(offset = 0, count, options = {}) { - var _a; - options.conditions = options.conditions || {}; - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const { span, updatedOptions } = createSpan("BlobClient-download", options); - try { - const res = await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { - onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream - }, range: offset === 0 && !count ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - // Return browser response immediately - if (!coreHttp.isNode) { - return wrappedRes; - } - // We support retrying when download stream unexpected ends in Node.js runtime - // Following code shouldn't be bundled into browser build, however some - // bundlers may try to bundle following code and "FileReadResponse.ts". - // In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts" - // The config is in package.json "browser" field - if (options.maxRetryRequests === undefined || options.maxRetryRequests < 0) { - // TODO: Default value or make it a required parameter? - options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; - } - if (res.contentLength === undefined) { - throw new RangeError(`File download response doesn't contain valid content length header`); - } - if (!res.etag) { - throw new RangeError(`File download response doesn't contain valid etag header`); - } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a; - const updatedDownloadOptions = { - leaseAccessConditions: options.conditions, - modifiedAccessConditions: { - ifMatch: options.conditions.ifMatch || res.etag, - ifModifiedSince: options.conditions.ifModifiedSince, - ifNoneMatch: options.conditions.ifNoneMatch, - ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions, - }, - range: rangeToString({ - count: offset + res.contentLength - start, - offset: start, - }), - rangeGetContentMD5: options.rangeGetContentMD5, - rangeGetContentCRC64: options.rangeGetContentCrc64, - snapshot: options.snapshot, - cpkInfo: options.customerProvidedKey, - }; - // Debug purpose only - // console.log( - // `Read from internal stream, range: ${ - // updatedOptions.range - // }, options: ${JSON.stringify(updatedOptions)}` - // ); - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; - }, offset, res.contentLength, { - maxRetryRequests: options.maxRetryRequests, - onProgress: options.onProgress, - }); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns true if the Azure blob resource represented by this client exists; false otherwise. - * - * NOTE: use this function with care since an existing blob might be deleted by other clients or - * applications. Vice versa new blobs might be added by other clients or applications after this - * function completes. - * - * @param options - options to Exists operation. - */ - async exists(options = {}) { - const { span, updatedOptions } = createSpan("BlobClient-exists", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - await this.getProperties({ - abortSignal: options.abortSignal, - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions, - }); - return true; - } - catch (e) { - if (e.statusCode === 404) { - // Expected exception when checking blob existence - return false; - } - else if (e.statusCode === 409 && - (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || - e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { - // Expected exception when checking blob existence - return true; - } - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties - * - * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if - * they originally contained uppercase characters. This differs from the metadata keys returned by - * the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which - * will retain their original casing. - * - * @param options - Optional options to Get Properties operation. - */ - async getProperties(options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-getProperties", options); - try { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const res = await this.blobContext.getProperties(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Marks the specified blob or snapshot for deletion. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob - * - * @param options - Optional options to Blob Delete operation. - */ - async delete(options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-delete", options); - options.conditions = options.conditions || {}; - try { - return await this.blobContext.delete(Object.assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob - * - * @param options - Optional options to Blob Delete operation. - */ - async deleteIfExists(options = {}) { - var _a, _b; - const { span, updatedOptions } = createSpan("BlobClient-deleteIfExists", options); - try { - const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } - catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: "Expected exception when deleting a blob or snapshot only if it exists.", - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Restores the contents and metadata of soft deleted blob and any associated - * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 - * or later. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob - * - * @param options - Optional options to Blob Undelete operation. - */ - async undelete(options = {}) { - const { span, updatedOptions } = createSpan("BlobClient-undelete", options); - try { - return await this.blobContext.undelete(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets system properties on the blob. - * - * If no value provided, or no value provided for the specified blob HTTP headers, - * these blob HTTP headers without a value will be cleared. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties - * - * @param blobHTTPHeaders - If no value provided, or no value provided for - * the specified blob HTTP headers, these blob HTTP - * headers without a value will be cleared. - * A common header to set is `blobContentType` - * enabling the browser to provide functionality - * based on file type. - * @param options - Optional options to Blob Set HTTP Headers operation. - */ - async setHTTPHeaders(blobHTTPHeaders, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-setHTTPHeaders", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blobContext.setHttpHeaders(Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets user-defined metadata for the specified blob as one or more name-value pairs. - * - * If no option provided, or no metadata defined in the parameter, the blob - * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata - * - * @param metadata - Replace existing metadata with this value. - * If no value provided the existing metadata will be removed. - * @param options - Optional options to Set Metadata operation. - */ - async setMetadata(metadata, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-setMetadata", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blobContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets tags on the underlying blob. - * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. - * Valid tag key and value characters include lower and upper case letters, digits (0-9), - * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_'). - * - * @param tags - - * @param options - - */ - async setTags(tags, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-setTags", options); - try { - return await this.blobContext.setTags(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)), { tags: toBlobTags(tags) })); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Gets the tags associated with the underlying blob. - * - * @param options - - */ - async getTags(options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-getTags", options); - try { - const response = await this.blobContext.getTags(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); - return wrappedResponse; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Get a {@link BlobLeaseClient} that manages leases on the blob. - * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the blob. - */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); - } - /** - * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob - * - * @param options - Optional options to the Blob Create Snapshot operation. - */ - async createSnapshot(options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-createSnapshot", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blobContext.createSnapshot(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Asynchronously copies a blob to a destination within the storage account. - * This method returns a long running operation poller that allows you to wait - * indefinitely until the copy is completed. - * You can also cancel a copy before it is completed by calling `cancelOperation` on the poller. - * Note that the onProgress callback will not be invoked if the operation completes in the first - * request, and attempting to cancel a completed copy will result in an error being thrown. - * - * In version 2012-02-12 and later, the source for a Copy Blob operation can be - * a committed blob in any Azure storage account. - * Beginning with version 2015-02-21, the source for a Copy Blob operation can be - * an Azure file in any Azure storage account. - * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob - * operation to copy from another storage account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob - * - * Example using automatic polling: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using manual polling: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` - * - * Example using progress updates: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * onProgress(state) { - * console.log(`Progress: ${state.copyProgress}`); - * } - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * // cancel operation after starting it. - * try { - * await copyPoller.cancelOperation(); - * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); - * } - * } - * ``` - * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async beginCopyFromURL(copySource, options = {}) { - const client = { - abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), - getProperties: (...args) => this.getProperties(...args), - startCopyFromURL: (...args) => this.startCopyFromURL(...args), - }; - const poller = new BlobBeginCopyFromUrlPoller({ - blobClient: client, - copySource, - intervalInMs: options.intervalInMs, - onProgress: options.onProgress, - resumeFrom: options.resumeFrom, - startCopyFromURLOptions: options, - }); - // Trigger the startCopyFromURL call by calling poll. - // Any errors from this method should be surfaced to the user. - await poller.poll(); - return poller; - } - /** - * Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero - * length and full metadata. Version 2012-02-12 and newer. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob - * - * @param copyId - Id of the Copy From URL operation. - * @param options - Optional options to the Blob Abort Copy From URL operation. - */ - async abortCopyFromURL(copyId, options = {}) { - const { span, updatedOptions } = createSpan("BlobClient-abortCopyFromURL", options); - try { - return await this.blobContext.abortCopyFromURL(copyId, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not - * return a response until the copy is complete. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url - * - * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication - * @param options - - */ - async syncCopyFromURL(copySource, options = {}) { - var _a, _b, _c; - const { span, updatedOptions } = createSpan("BlobClient-syncCopyFromURL", options); - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - try { - return await this.blobContext.copyFromURL(copySource, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - }, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope, copySourceTags: options.copySourceTags }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets the tier on a blob. The operation is allowed on a page blob in a premium - * storage account and on a block blob in a blob storage account (locally redundant - * storage only). A premium page blob's tier determines the allowed size, IOPS, - * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive - * storage type. This operation does not update the blob's ETag. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier - * - * @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive. - * @param options - Optional options to the Blob Set Tier operation. - */ - async setAccessTier(tier, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobClient-setAccessTier", options); - try { - return await this.blobContext.setTier(toAccessTier(tier), Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), rehydratePriority: options.rehydratePriority }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - async downloadToBuffer(param1, param2, param3, param4 = {}) { - let buffer; - let offset = 0; - let count = 0; - let options = param4; - if (param1 instanceof Buffer) { - buffer = param1; - offset = param2 || 0; - count = typeof param3 === "number" ? param3 : 0; - } - else { - offset = typeof param1 === "number" ? param1 : 0; - count = typeof param2 === "number" ? param2 : 0; - options = param3 || {}; - } - const { span, updatedOptions } = createSpan("BlobClient-downloadToBuffer", options); - try { - if (!options.blockSize) { - options.blockSize = 0; - } - if (options.blockSize < 0) { - throw new RangeError("blockSize option must be >= 0"); - } - if (options.blockSize === 0) { - options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - if (offset < 0) { - throw new RangeError("offset option must be >= 0"); - } - if (count && count <= 0) { - throw new RangeError("count option must be greater than 0"); - } - if (!options.conditions) { - options.conditions = {}; - } - // Customer doesn't specify length, get it - if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); - count = response.contentLength - offset; - if (count < 0) { - throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`); - } - } - // Allocate the buffer of size = count if the buffer is not provided - if (!buffer) { - try { - buffer = Buffer.alloc(count); - } - catch (error) { - throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${error.message}`); - } - } - if (buffer.length < count) { - throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`); - } - let transferProgress = 0; - const batch = new Batch(options.concurrency); - for (let off = offset; off < offset + count; off = off + options.blockSize) { - batch.addOperation(async () => { - // Exclusive chunk end position - let chunkEnd = offset + count; - if (off + options.blockSize < chunkEnd) { - chunkEnd = off + options.blockSize; - } - const response = await this.download(off, chunkEnd - off, { - abortSignal: options.abortSignal, - conditions: options.conditions, - maxRetryRequests: options.maxRetryRequestsPerBlock, - customerProvidedKey: options.customerProvidedKey, - tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)), - }); - const stream = response.readableStreamBody; - await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset); - // Update progress after block is downloaded, in case of block trying - // Could provide finer grained progress updating inside HTTP requests, - // only if convenience layer download try is enabled - transferProgress += chunkEnd - off; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }); - } - await batch.do(); - return buffer; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Downloads an Azure Blob to a local file. - * Fails if the the given file path already exits. - * Offset and count are optional, pass 0 and undefined respectively to download the entire blob. - * - * @param filePath - - * @param offset - From which position of the block blob to download. - * @param count - How much data to be downloaded. Will download to the end when passing undefined. - * @param options - Options to Blob download options. - * @returns The response data for blob download operation, - * but with readableStreamBody set to undefined since its - * content is already read and written into a local file - * at the specified path. - */ - async downloadToFile(filePath, offset = 0, count, options = {}) { - const { span, updatedOptions } = createSpan("BlobClient-downloadToFile", options); - try { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); - if (response.readableStreamBody) { - await readStreamToLocalFile(response.readableStreamBody, filePath); - } - // The stream is no longer accessible so setting it to undefined. - response.blobDownloadStream = undefined; - return response; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - getBlobAndContainerNamesFromUrl() { - let containerName; - let blobName; - try { - // URL may look like the following - // "https://myaccount.blob.core.windows.net/mycontainer/blob?sasString"; - // "https://myaccount.blob.core.windows.net/mycontainer/blob"; - // "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt?sasString"; - // "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt"; - // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername/blob` - // http://localhost:10001/devstoreaccount1/containername/blob - const parsedUrl = coreHttp.URLBuilder.parse(this.url); - if (parsedUrl.getHost().split(".")[1] === "blob") { - // "https://myaccount.blob.core.windows.net/containername/blob". - // .getPath() -> /containername/blob - const pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; - } - else if (isIpEndpointStyle(parsedUrl)) { - // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob - // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob - // .getPath() -> /devstoreaccount1/containername/blob - const pathComponents = parsedUrl.getPath().match("/([^/]*)/([^/]*)(/(.*))?"); - containerName = pathComponents[2]; - blobName = pathComponents[4]; - } - else { - // "https://customdomain.com/containername/blob". - // .getPath() -> /containername/blob - const pathComponents = parsedUrl.getPath().match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; - } - // decode the encoded blobName, containerName - to get all the special characters that might be present in them - containerName = decodeURIComponent(containerName); - blobName = decodeURIComponent(blobName); - // Azure Storage Server will replace "\" with "/" in the blob names - // doing the same in the SDK side so that the user doesn't have to replace "\" instances in the blobName - blobName = blobName.replace(/\\/g, "/"); - if (!containerName) { - throw new Error("Provided containerName is invalid."); - } - return { blobName, containerName }; - } - catch (error) { - throw new Error("Unable to extract blobName and containerName with provided information."); - } - } - /** - * Asynchronously copies a blob to a destination within the storage account. - * In version 2012-02-12 and later, the source for a Copy Blob operation can be - * a committed blob in any Azure storage account. - * Beginning with version 2015-02-21, the source for a Copy Blob operation can be - * an Azure file in any Azure storage account. - * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob - * operation to copy from another storage account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob - * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async startCopyFromURL(copySource, options = {}) { - var _a, _b, _c; - const { span, updatedOptions } = createSpan("BlobClient-startCopyFromURL", options); - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - try { - return await this.blobContext.startCopyFromURL(copySource, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - sourceIfTags: options.sourceConditions.tagConditions, - }, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), sealBlob: options.sealBlob }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Only available for BlobClient constructed with a shared key credential. - * - * Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateSasUrl(options) { - return new Promise((resolve) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve(appendToURLQuery(this.url, sas)); - }); - } - /** - * Delete the immutablility policy on the blob. - * - * @param options - Optional options to delete immutability policy on the blob. - */ - async deleteImmutabilityPolicy(options) { - const { span, updatedOptions } = createSpan("BlobClient-deleteImmutabilityPolicy", options); - try { - return await this.blobContext.deleteImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Set immutablility policy on the blob. - * - * @param options - Optional options to set immutability policy on the blob. - */ - async setImmutabilityPolicy(immutabilityPolicy, options) { - const { span, updatedOptions } = createSpan("BlobClient-setImmutabilityPolicy", options); - try { - return await this.blobContext.setImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, immutabilityPolicyMode: immutabilityPolicy.policyMode, modifiedAccessConditions: options === null || options === void 0 ? void 0 : options.modifiedAccessCondition }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Set legal hold on the blob. - * - * @param options - Optional options to set legal hold on the blob. - */ - async setLegalHold(legalHoldEnabled, options) { - const { span, updatedOptions } = createSpan("BlobClient-setLegalHold", options); - try { - return await this.blobContext.setLegalHold(legalHoldEnabled, Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } -} -/** - * AppendBlobClient defines a set of operations applicable to append blobs. - */ -class AppendBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead. - // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options); - let pipeline; - let url; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - // (url: string, pipeline: Pipeline) - url = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } - else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) || - credentialOrPipelineOrContainerName instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) url = urlOrConnectionString; - url = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } - else if (!credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName !== "string") { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - url = urlOrConnectionString; - // The second parameter is undefined. Use anonymous credential. - pipeline = newPipeline(new AnonymousCredential(), options); - } - else if (credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName === "string" && - blobNameOrOptions && - typeof blobNameOrOptions === "string") { - // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions) - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreHttp.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } - else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } - else if (extractedCreds.kind === "SASConnString") { - url = - appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + - "?" + - extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } - else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url, pipeline); - this.appendBlobContext = new AppendBlob(this.storageClientContext); - } - /** - * Creates a new AppendBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot) { - return new AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); - } - /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param options - Options to the Append Block Create operation. - * - * - * Example usage: - * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); - * await appendBlobClient.create(); - * ``` - */ - async create(options = {}) { - var _a, _b, _c; - const { span, updatedOptions } = createSpan("AppendBlobClient-create", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.appendBlobContext.create(0, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * If the blob with the same name already exists, the content of the existing blob will remain unchanged. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param options - - */ - async createIfNotExists(options = {}) { - var _a, _b; - const { span, updatedOptions } = createSpan("AppendBlobClient-createIfNotExists", options); - const conditions = { ifNoneMatch: ETagAny }; - try { - const res = await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions })); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } - catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: "Expected exception when creating a blob only if it does not already exist.", - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Seals the append blob, making it read only. - * - * @param options - - */ - async seal(options = {}) { - var _a; - const { span, updatedOptions } = createSpan("AppendBlobClient-seal", options); - options.conditions = options.conditions || {}; - try { - return await this.appendBlobContext.seal(Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Commits a new block of data to the end of the existing append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/append-block - * - * @param body - Data to be appended. - * @param contentLength - Length of the body in bytes. - * @param options - Options to the Append Block operation. - * - * - * Example usage: - * - * ```js - * const content = "Hello World!"; - * - * // Create a new append blob and append data to the blob. - * const newAppendBlobClient = containerClient.getAppendBlobClient(""); - * await newAppendBlobClient.create(); - * await newAppendBlobClient.appendBlock(content, content.length); - * - * // Append data to an existing append blob. - * const existingAppendBlobClient = containerClient.getAppendBlobClient(""); - * await existingAppendBlobClient.appendBlock(content, content.length); - * ``` - */ - async appendBlock(body, contentLength, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("AppendBlobClient-appendBlock", options); - options.conditions = options.conditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.appendBlobContext.appendBlock(contentLength, body, Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { - onUploadProgress: options.onProgress, - }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * The Append Block operation commits a new block of data to the end of an existing append blob - * where the contents are read from a source url. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url - * - * @param sourceURL - - * The url to the blob that will be the source of the copy. A source blob in the same storage account can - * be authenticated via Shared Key. However, if the source is a blob in another account, the source blob - * must either be public or must be authenticated via a shared access signature. If the source blob is - * public, no authentication is required to perform the operation. - * @param sourceOffset - Offset in source to be appended - * @param count - Number of bytes to be appended as a block - * @param options - - */ - async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("AppendBlobClient-appendBlockFromURL", options); - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - }, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } -} -/** - * BlockBlobClient defines a set of operations applicable to block blobs. - */ -class BlockBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead. - // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options); - let pipeline; - let url; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - // (url: string, pipeline: Pipeline) - url = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } - else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) || - credentialOrPipelineOrContainerName instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - url = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } - else if (!credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName !== "string") { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - // The second parameter is undefined. Use anonymous credential. - url = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline = newPipeline(new AnonymousCredential(), options); - } - else if (credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName === "string" && - blobNameOrOptions && - typeof blobNameOrOptions === "string") { - // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions) - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreHttp.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } - else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } - else if (extractedCreds.kind === "SASConnString") { - url = - appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + - "?" + - extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } - else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url, pipeline); - this.blockBlobContext = new BlockBlob(this.storageClientContext); - this._blobContext = new Blob$1(this.storageClientContext); - } - /** - * Creates a new BlockBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a URL to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot) { - return new BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Quick query for a JSON or CSV formatted blob. - * - * Example usage (Node.js): - * - * ```js - * // Query and convert a blob to a string - * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * @param query - - * @param options - - */ - async query(query, options = {}) { - var _a; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const { span, updatedOptions } = createSpan("BlockBlobClient-query", options); - try { - if (!coreHttp.isNode) { - throw new Error("This operation currently is only supported in Node.js."); - } - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - const response = await this._blobContext.query(Object.assign({ abortSignal: options.abortSignal, queryRequest: { - queryType: "SQL", - expression: query, - inputSerialization: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration), - }, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions))); - return new BlobQueryResponse(response, { - abortSignal: options.abortSignal, - onProgress: options.onProgress, - onError: options.onError, - }); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Creates a new block blob, or updates the content of an existing block blob. - * Updating an existing block blob overwrites any existing metadata on the blob. - * Partial updates are not supported; the content of the existing blob is - * overwritten with the new content. To perform a partial update of a block blob's, - * use {@link stageBlock} and {@link commitBlockList}. - * - * This is a non-parallel uploading method, please use {@link uploadFile}, - * {@link uploadStream} or {@link uploadBrowserData} for better performance - * with concurrency uploading. - * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function - * which returns a new Readable stream whose offset is from data source beginning. - * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a - * string including non non-Base64/Hex-encoded characters. - * @param options - Options to the Block Blob Upload operation. - * @returns Response data for the Block Blob Upload operation. - * - * Example usage: - * - * ```js - * const content = "Hello world!"; - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` - */ - async upload(body, contentLength, options = {}) { - var _a, _b, _c; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("BlockBlobClient-upload", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.upload(contentLength, body, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { - onUploadProgress: options.onProgress, - }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Creates a new Block Blob where the contents of the blob are read from a given URL. - * This API is supported beginning with the 2020-04-08 version. Partial updates - * are not supported with Put Blob from URL; the content of an existing blob is overwritten with - * the content of the new blob. To perform partial updates to a block blob’s contents using a - * source URL, use {@link stageBlockFromURL} and {@link commitBlockList}. - * - * @param sourceURL - Specifies the URL of the blob. The value - * may be a URL of up to 2 KB in length that specifies a blob. - * The value should be URL-encoded as it would appear - * in a request URI. The source blob must either be public - * or must be authenticated via a shared access signature. - * If the source blob is public, no authentication is required - * to perform the operation. Here are some examples of source object URLs: - * - https://myaccount.blob.core.windows.net/mycontainer/myblob - * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param options - Optional parameters. - */ - async syncUploadFromURL(sourceURL, options = {}) { - var _a, _b, _c, _d, _e; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("BlockBlobClient-syncUploadFromURL", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_a = options.sourceConditions) === null || _a === void 0 ? void 0 : _a.ifMatch, - sourceIfModifiedSince: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifModifiedSince, - sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch, - sourceIfUnmodifiedSince: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifUnmodifiedSince, - sourceIfTags: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.tagConditions, - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags }), convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Uploads the specified block to the block blob's "staging area" to be later - * committed by a call to commitBlockList. - * @see https://docs.microsoft.com/rest/api/storageservices/put-block - * - * @param blockId - A 64-byte value that is base64-encoded - * @param body - Data to upload to the staging area. - * @param contentLength - Number of bytes to upload. - * @param options - Options to the Block Blob Stage Block operation. - * @returns Response data for the Block Blob Stage Block operation. - */ - async stageBlock(blockId, body, contentLength, options = {}) { - const { span, updatedOptions } = createSpan("BlockBlobClient-stageBlock", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.stageBlock(blockId, contentLength, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: { - onUploadProgress: options.onProgress, - }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * The Stage Block From URL operation creates a new block to be committed as part - * of a blob where the contents are read from a URL. - * This API is available starting in version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url - * - * @param blockId - A 64-byte value that is base64-encoded - * @param sourceURL - Specifies the URL of the blob. The value - * may be a URL of up to 2 KB in length that specifies a blob. - * The value should be URL-encoded as it would appear - * in a request URI. The source blob must either be public - * or must be authenticated via a shared access signature. - * If the source blob is public, no authentication is required - * to perform the operation. Here are some examples of source object URLs: - * - https://myaccount.blob.core.windows.net/mycontainer/myblob - * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param offset - From which position of the blob to download, greater than or equal to 0 - * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined - * @param options - Options to the Block Blob Stage Block From URL operation. - * @returns Response data for the Block Blob Stage Block From URL operation. - */ - async stageBlockFromURL(blockId, sourceURL, offset = 0, count, options = {}) { - const { span, updatedOptions } = createSpan("BlockBlobClient-stageBlockFromURL", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, sourceRange: offset === 0 && !count ? undefined : rangeToString({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Writes a blob by specifying the list of block IDs that make up the blob. - * In order to be written as part of a blob, a block must have been successfully written - * to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to - * update a blob by uploading only those blocks that have changed, then committing the new and existing - * blocks together. Any blocks not specified in the block list and permanently deleted. - * @see https://docs.microsoft.com/rest/api/storageservices/put-block-list - * - * @param blocks - Array of 64-byte value that is base64-encoded - * @param options - Options to the Block Blob Commit Block List operation. - * @returns Response data for the Block Blob Commit Block List operation. - */ - async commitBlockList(blocks, options = {}) { - var _a, _b, _c; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("BlockBlobClient-commitBlockList", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.blockBlobContext.commitBlockList({ latest: blocks }, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns the list of blocks that have been uploaded as part of a block blob - * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list - * - * @param listType - Specifies whether to return the list of committed blocks, - * the list of uncommitted blocks, or both lists together. - * @param options - Options to the Block Blob Get Block List operation. - * @returns Response data for the Block Blob Get Block List operation. - */ - async getBlockList(listType, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlockBlobClient-getBlockList", options); - try { - const res = await this.blockBlobContext.getBlockList(listType, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - if (!res.committedBlocks) { - res.committedBlocks = []; - } - if (!res.uncommittedBlocks) { - res.uncommittedBlocks = []; - } - return res; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - // High level functions - /** - * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob. - * - * When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is - * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} - * to commit the block list. - * - * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is - * `blobContentType`, enabling the browser to provide - * functionality based on file type. - * - * @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView - * @param options - - */ - async uploadData(data, options = {}) { - const { span, updatedOptions } = createSpan("BlockBlobClient-uploadData", options); - try { - if (coreHttp.isNode) { - let buffer; - if (data instanceof Buffer) { - buffer = data; - } - else if (data instanceof ArrayBuffer) { - buffer = Buffer.from(data); - } - else { - data = data; - buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); - } - return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions); - } - else { - const browserBlob = new Blob([data]); - return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); - } - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * ONLY AVAILABLE IN BROWSERS. - * - * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob. - * - * When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call - * {@link commitBlockList} to commit the block list. - * - * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is - * `blobContentType`, enabling the browser to provide - * functionality based on file type. - * - * @deprecated Use {@link uploadData} instead. - * - * @param browserData - Blob, File, ArrayBuffer or ArrayBufferView - * @param options - Options to upload browser data. - * @returns Response data for the Blob Upload operation. - */ - async uploadBrowserData(browserData, options = {}) { - const { span, updatedOptions } = createSpan("BlockBlobClient-uploadBrowserData", options); - try { - const browserBlob = new Blob([browserData]); - return await this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * - * Uploads data to block blob. Requires a bodyFactory as the data source, - * which need to return a {@link HttpRequestBody} object with the offset and size provided. - * - * When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is - * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload. - * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList} - * to commit the block list. - * - * @param bodyFactory - - * @param size - size of the data to upload. - * @param options - Options to Upload to Block Blob operation. - * @returns Response data for the Blob Upload operation. - */ - async uploadSeekableInternal(bodyFactory, size, options = {}) { - if (!options.blockSize) { - options.blockSize = 0; - } - if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); - } - if (options.maxSingleShotSize !== 0 && !options.maxSingleShotSize) { - options.maxSingleShotSize = BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - } - if (options.maxSingleShotSize < 0 || - options.maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); - } - if (options.blockSize === 0) { - if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`${size} is too larger to upload to a block blob.`); - } - if (size > options.maxSingleShotSize) { - options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); - if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - } - } - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan("BlockBlobClient-uploadSeekableInternal", options); - try { - if (size <= options.maxSingleShotSize) { - return await this.upload(bodyFactory(0, size), size, updatedOptions); - } - const numBlocks = Math.floor((size - 1) / options.blockSize) + 1; - if (numBlocks > BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`The buffer's size is too big or the BlockSize is too small;` + - `the number of blocks must be <= ${BLOCK_BLOB_MAX_BLOCKS}`); - } - const blockList = []; - const blockIDPrefix = coreHttp.generateUuid(); - let transferProgress = 0; - const batch = new Batch(options.concurrency); - for (let i = 0; i < numBlocks; i++) { - batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); - const start = options.blockSize * i; - const end = i === numBlocks - 1 ? size : start + options.blockSize; - const contentLength = end - start; - blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { - abortSignal: options.abortSignal, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions, - }); - // Update progress after block is successfully uploaded to server, in case of block trying - // TODO: Hook with convenience layer progress event in finer level - transferProgress += contentLength; - if (options.onProgress) { - options.onProgress({ - loadedBytes: transferProgress, - }); - } - }); - } - await batch.do(); - return this.commitBlockList(blockList, updatedOptions); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Uploads a local file in blocks to a block blob. - * - * When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload. - * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList - * to commit the block list. - * - * @param filePath - Full path of local file - * @param options - Options to Upload to Block Blob operation. - * @returns Response data for the Blob Upload operation. - */ - async uploadFile(filePath, options = {}) { - const { span, updatedOptions } = createSpan("BlockBlobClient-uploadFile", options); - try { - const size = (await fsStat(filePath)).size; - return await this.uploadSeekableInternal((offset, count) => { - return () => fsCreateReadStream(filePath, { - autoClose: true, - end: count ? offset + count - 1 : Infinity, - start: offset, - }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Uploads a Node.js Readable stream into block blob. - * - * PERFORMANCE IMPROVEMENT TIPS: - * * Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. - * - * @param stream - Node.js Readable stream - * @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB - * @param maxConcurrency - Max concurrency indicates the max number of buffers that can be allocated, - * positive correlation with max uploading concurrency. Default value is 5 - * @param options - Options to Upload Stream to Block Blob operation. - * @returns Response data for the Blob Upload operation. - */ - async uploadStream(stream, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan("BlockBlobClient-uploadStream", options); - try { - let blockNum = 0; - const blockIDPrefix = coreHttp.generateUuid(); - let transferProgress = 0; - const blockList = []; - const scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, async (body, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); - blockList.push(blockID); - blockNum++; - await this.stageBlock(blockID, body, length, { - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions, - }); - // Update progress after block is successfully uploaded to server, in case of block trying - transferProgress += length; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }, - // concurrency should set a smaller value than maxConcurrency, which is helpful to - // reduce the possibility when a outgoing handler waits for stream data, in - // this situation, outgoing handlers are blocked. - // Outgoing queue shouldn't be empty. - Math.ceil((maxConcurrency / 4) * 3)); - await scheduler.do(); - return await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) })); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } -} -/** - * PageBlobClient defines a set of operations applicable to page blobs. - */ -class PageBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead. - // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options); - let pipeline; - let url; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - // (url: string, pipeline: Pipeline) - url = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } - else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) || - credentialOrPipelineOrContainerName instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - url = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } - else if (!credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName !== "string") { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - // The second parameter is undefined. Use anonymous credential. - url = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } - else if (credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName === "string" && - blobNameOrOptions && - typeof blobNameOrOptions === "string") { - // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions) - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreHttp.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } - else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } - else if (extractedCreds.kind === "SASConnString") { - url = - appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + - "?" + - extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } - else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url, pipeline); - this.pageBlobContext = new PageBlob(this.storageClientContext); - } - /** - * Creates a new PageBlobClient object identical to the source but with the - * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a Client to the base blob. - * - * @param snapshot - The snapshot timestamp. - * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot) { - return new PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline); - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param size - size of the page blob. - * @param options - Options to the Page Blob Create operation. - * @returns Response data for the Page Blob Create operation. - */ - async create(size, options = {}) { - var _a, _b, _c; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-create", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.pageBlobContext.create(0, size, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. If the blob with the same name already exists, the content - * of the existing blob will remain unchanged. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param size - size of the page blob. - * @param options - - */ - async createIfNotExists(size, options = {}) { - var _a, _b; - const { span, updatedOptions } = createSpan("PageBlobClient-createIfNotExists", options); - try { - const conditions = { ifNoneMatch: ETagAny }; - const res = await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } - catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: "Expected exception when creating a blob only if it does not already exist.", - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page - * - * @param body - Data to upload - * @param offset - Offset of destination page blob - * @param count - Content length of the body, also number of bytes to be uploaded - * @param options - Options to the Page Blob Upload Pages operation. - * @returns Response data for the Page Blob Upload Pages operation. - */ - async uploadPages(body, offset, count, options = {}) { - var _a; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-uploadPages", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.pageBlobContext.uploadPages(count, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { - onUploadProgress: options.onProgress, - }, range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * The Upload Pages operation writes a range of pages to a page blob where the - * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-url - * - * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication - * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob - * @param destOffset - Offset of destination page blob - * @param count - Number of bytes to be uploaded from source page blob - * @param options - - */ - async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { - var _a; - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-uploadPagesFromURL", options); - try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), Object.assign({ abortSignal: options.abortSignal, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, sequenceNumberAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Frees the specified pages from the page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page - * - * @param offset - Starting byte position of the pages to clear. - * @param count - Number of bytes to clear. - * @param options - Options to the Page Blob Clear Pages operation. - * @returns Response data for the Page Blob Clear Pages operation. - */ - async clearPages(offset = 0, count, options = {}) { - var _a; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-clearPages", options); - try { - return await this.pageBlobContext.clearPages(0, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns Response data for the Page Blob Get Ranges operation. - */ - async getPageRanges(offset = 0, count, options = {}) { - var _a; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-getPageRanges", options); - try { - return await this.pageBlobContext - .getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))) - .then(rangeResponseFromModel); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * getPageRangesSegment returns a single segment of page ranges starting from the - * specified Marker. Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call getPageRangesSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to PageBlob Get Page Ranges Segment operation. - */ - async listPageRangesSegment(offset = 0, count, marker, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("PageBlobClient-getPageRangesSegment", options); - try { - return await this.pageBlobContext.getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset, count }), marker: marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The - * operation returns the ContinuationToken value within the response body if the - * getting operation did not return all page ranges remaining within the current page. - * The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of get - * items. The marker value is opaque to the client. - * @param options - Options to List Page Ranges operation. - */ - listPageRangeItemSegments(offset = 0, count, marker, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker || marker === undefined) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker, options)); - marker = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker); - } - }); - } - /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to List Page Ranges operation. - */ - listPageRangeItems(offset = 0, count, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1() { - var e_1, _a; - let marker; - try { - for (var _b = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) { - const getPageRangesSegment = _c.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b)); - } - finally { if (e_1) throw e_1.error; } - } - }); - } - /** - * Returns an async iterable iterator to list of page ranges for a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * .byPage() returns an async iterable iterator to list of page ranges for a page blob. - * - * Example using `for await` syntax: - * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRanges()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * - * // Passing next marker as continuationToken - * - * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns An asyncIterableIterator that supports paging. - */ - listPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - // AsyncIterableIterator to iterate over blobs - const iter = this.listPageRangeItems(offset, count, options); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); - }, - }; - } - /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page blob - * @param count - Number of bytes to get ranges diff. - * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - * @returns Response data for the Page Blob Get Page Range Diff operation. - */ - async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { - var _a; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-getPageRangesDiff", options); - try { - return await this.pageBlobContext - .getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevsnapshot: prevSnapshot, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))) - .then(rangeResponseFromModel); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * getPageRangesDiffSegment returns a single segment of page ranges starting from the - * specified Marker for difference between previous snapshot and the target page blob. - * Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call getPageRangesDiffSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param marker - A string value that identifies the portion of the get to be returned with the next get operation. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - */ - async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options) { - var _a; - const { span, updatedOptions } = createSpan("PageBlobClient-getPageRangesDiffSegment", options); - try { - return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevsnapshot: prevSnapshotOrUrl, range: rangeToString({ - offset: offset, - count: count, - }), marker: marker, maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} - * - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The - * operation returns the ContinuationToken value within the response body if the - * getting operation did not return all page ranges remaining within the current page. - * The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of get - * items. The marker value is opaque to the client. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker || marker === undefined) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options)); - marker = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker); - } - }); - } - /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects - * - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var e_2, _a; - let marker; - try { - for (var _b = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) { - const getPageRangesSegment = _c.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b)); - } - finally { if (e_2) throw e_2.error; } - } - }); - } - /** - * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. - * - * Example using `for await` syntax: - * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * - * // Passing next marker as continuationToken - * - * iterator = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` - * @param offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param prevSnapshot - Timestamp of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Ranges operation. - * @returns An asyncIterableIterator that supports paging. - */ - listPageRangesDiff(offset, count, prevSnapshot, options = {}) { - options.conditions = options.conditions || {}; - // AsyncIterableIterator to iterate over blobs - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); - }, - }; - } - /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * @param offset - Starting byte position of the page blob - * @param count - Number of bytes to get ranges diff. - * @param prevSnapshotUrl - URL of snapshot to retrieve the difference. - * @param options - Options to the Page Blob Get Page Ranges Diff operation. - * @returns Response data for the Page Blob Get Page Range Diff operation. - */ - async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { - var _a; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options); - try { - return await this.pageBlobContext - .getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevSnapshotUrl, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions))) - .then(rangeResponseFromModel); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties - * - * @param size - Target size - * @param options - Options to the Page Blob Resize operation. - * @returns Response data for the Page Blob Resize operation. - */ - async resize(size, options = {}) { - var _a; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-resize", options); - try { - return await this.pageBlobContext.resize(size, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties - * - * @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number. - * @param sequenceNumber - Required if sequenceNumberAction is max or update - * @param options - Options to the Page Blob Update Sequence Number operation. - * @returns Response data for the Page Blob Update Sequence Number operation. - */ - async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { - var _a; - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("PageBlobClient-updateSequenceNumber", options); - try { - return await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, Object.assign({ abortSignal: options.abortSignal, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob. - * The snapshot is copied such that only the differential changes between the previously - * copied snapshot are transferred to the destination. - * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. - * @see https://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots - * - * @param copySource - Specifies the name of the source page blob snapshot. For example, - * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param options - Options to the Page Blob Copy Incremental operation. - * @returns Response data for the Page Blob Copy Incremental operation. - */ - async startCopyIncremental(copySource, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("PageBlobClient-startCopyIncremental", options); - try { - return await this.pageBlobContext.copyIncremental(copySource, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } -} - -// Copyright (c) Microsoft Corporation. -async function getBodyAsText(batchResponse) { - let buffer = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer); - // Slice the buffer to trim the empty ending. - buffer = buffer.slice(0, responseLength); - return buffer.toString(); -} -function utf8ByteLength(str) { - return Buffer.byteLength(str); -} - -// Copyright (c) Microsoft Corporation. -const HTTP_HEADER_DELIMITER = ": "; -const SPACE_DELIMITER = " "; -const NOT_FOUND = -1; -/** - * Util class for parsing batch response. - */ -class BatchResponseParser { - constructor(batchResponse, subRequests) { - if (!batchResponse || !batchResponse.contentType) { - // In special case(reported), server may return invalid content-type which could not be parsed. - throw new RangeError("batchResponse is malformed or doesn't contain valid content-type."); - } - if (!subRequests || subRequests.size === 0) { - // This should be prevent during coding. - throw new RangeError("Invalid state: subRequests is not provided or size is 0."); - } - this.batchResponse = batchResponse; - this.subRequests = subRequests; - this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; - this.batchResponseEnding = `--${this.responseBatchBoundary}--`; - } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response - async parseBatchResponse() { - // When logic reach here, suppose batch request has already succeeded with 202, so we can further parse - // sub request's response. - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { - throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); - } - const responseBodyAsText = await getBodyAsText(this.batchResponse); - const subResponses = responseBodyAsText - .split(this.batchResponseEnding)[0] // string after ending is useless - .split(this.perResponsePrefix) - .slice(1); // string before first response boundary is useless - const subResponseCount = subResponses.length; - // Defensive coding in case of potential error parsing. - // Note: subResponseCount == 1 is special case where sub request is invalid. - // We try to prevent such cases through early validation, e.g. validate sub request count >= 1. - // While in unexpected sub request invalid case, we allow sub response to be parsed and return to user. - if (subResponseCount !== this.subRequests.size && subResponseCount !== 1) { - throw new Error("Invalid state: sub responses' count is not equal to sub requests' count."); - } - const deserializedSubResponses = new Array(subResponseCount); - let subResponsesSucceededCount = 0; - let subResponsesFailedCount = 0; - // Parse sub subResponses. - for (let index = 0; index < subResponseCount; index++) { - const subResponse = subResponses[index]; - const deserializedSubResponse = {}; - deserializedSubResponse.headers = new coreHttp.HttpHeaders(); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); - let subRespHeaderStartFound = false; - let subRespHeaderEndFound = false; - let subRespFailed = false; - let contentId = NOT_FOUND; - for (const responseLine of responseLines) { - if (!subRespHeaderStartFound) { - // Convention line to indicate content ID - if (responseLine.startsWith(HeaderConstants.CONTENT_ID)) { - contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); - } - // Http version line with status code indicates the start of sub request's response. - // Example: HTTP/1.1 202 Accepted - if (responseLine.startsWith(HTTP_VERSION_1_1)) { - subRespHeaderStartFound = true; - const tokens = responseLine.split(SPACE_DELIMITER); - deserializedSubResponse.status = parseInt(tokens[1]); - deserializedSubResponse.statusMessage = tokens.slice(2).join(SPACE_DELIMITER); - } - continue; // Skip convention headers not specifically for sub request i.e. Content-Type: application/http and Content-ID: * - } - if (responseLine.trim() === "") { - // Sub response's header start line already found, and the first empty line indicates header end line found. - if (!subRespHeaderEndFound) { - subRespHeaderEndFound = true; - } - continue; // Skip empty line - } - // Note: when code reach here, it indicates subRespHeaderStartFound == true - if (!subRespHeaderEndFound) { - if (responseLine.indexOf(HTTP_HEADER_DELIMITER) === -1) { - // Defensive coding to prevent from missing valuable lines. - throw new Error(`Invalid state: find non-empty line '${responseLine}' without HTTP header delimiter '${HTTP_HEADER_DELIMITER}'.`); - } - // Parse headers of sub response. - const tokens = responseLine.split(HTTP_HEADER_DELIMITER); - deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { - deserializedSubResponse.errorCode = tokens[1]; - subRespFailed = true; - } - } - else { - // Assemble body of sub response. - if (!deserializedSubResponse.bodyAsText) { - deserializedSubResponse.bodyAsText = ""; - } - deserializedSubResponse.bodyAsText += responseLine; - } - } // Inner for end - // The response will contain the Content-ID header for each corresponding subrequest response to use for tracking. - // The Content-IDs are set to a valid index in the subrequests we sent. In the status code 202 path, we could expect it - // to be 1-1 mapping from the [0, subRequests.size) to the Content-IDs returned. If not, we simply don't return that - // unexpected subResponse in the parsed reponse and we can always look it up in the raw response for debugging purpose. - if (contentId !== NOT_FOUND && - Number.isInteger(contentId) && - contentId >= 0 && - contentId < this.subRequests.size && - deserializedSubResponses[contentId] === undefined) { - deserializedSubResponse._request = this.subRequests.get(contentId); - deserializedSubResponses[contentId] = deserializedSubResponse; - } - else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); - } - if (subRespFailed) { - subResponsesFailedCount++; - } - else { - subResponsesSucceededCount++; - } - } - return { - subResponses: deserializedSubResponses, - subResponsesSucceededCount: subResponsesSucceededCount, - subResponsesFailedCount: subResponsesFailedCount, - }; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var MutexLockStatus; -(function (MutexLockStatus) { - MutexLockStatus[MutexLockStatus["LOCKED"] = 0] = "LOCKED"; - MutexLockStatus[MutexLockStatus["UNLOCKED"] = 1] = "UNLOCKED"; -})(MutexLockStatus || (MutexLockStatus = {})); -/** - * An async mutex lock. - */ -class Mutex { - /** - * Lock for a specific key. If the lock has been acquired by another customer, then - * will wait until getting the lock. - * - * @param key - lock key - */ - static async lock(key) { - return new Promise((resolve) => { - if (this.keys[key] === undefined || this.keys[key] === MutexLockStatus.UNLOCKED) { - this.keys[key] = MutexLockStatus.LOCKED; - resolve(); - } - else { - this.onUnlockEvent(key, () => { - this.keys[key] = MutexLockStatus.LOCKED; - resolve(); - }); - } - }); - } - /** - * Unlock a key. - * - * @param key - - */ - static async unlock(key) { - return new Promise((resolve) => { - if (this.keys[key] === MutexLockStatus.LOCKED) { - this.emitUnlockEvent(key); - } - delete this.keys[key]; - resolve(); - }); - } - static onUnlockEvent(key, handler) { - if (this.listeners[key] === undefined) { - this.listeners[key] = [handler]; - } - else { - this.listeners[key].push(handler); - } - } - static emitUnlockEvent(key) { - if (this.listeners[key] !== undefined && this.listeners[key].length > 0) { - const handler = this.listeners[key].shift(); - setImmediate(() => { - handler.call(this); - }); - } - } -} -Mutex.keys = {}; -Mutex.listeners = {}; - -// Copyright (c) Microsoft Corporation. -/** - * A BlobBatch represents an aggregated set of operations on blobs. - * Currently, only `delete` and `setAccessTier` are supported. - */ -class BlobBatch { - constructor() { - this.batch = "batch"; - this.batchRequest = new InnerBatchRequest(); - } - /** - * Get the value of Content-Type for a batch request. - * The value must be multipart/mixed with a batch boundary. - * Example: multipart/mixed; boundary=batch_a81786c8-e301-4e42-a729-a32ca24ae252 - */ - getMultiPartContentType() { - return this.batchRequest.getMultipartContentType(); - } - /** - * Get assembled HTTP request body for sub requests. - */ - getHttpRequestBody() { - return this.batchRequest.getHttpRequestBody(); - } - /** - * Get sub requests that are added into the batch request. - */ - getSubRequests() { - return this.batchRequest.getSubRequests(); - } - async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); - try { - this.batchRequest.preAddSubRequest(subRequest); - await assembleSubRequestFunc(); - this.batchRequest.postAddSubRequest(subRequest); - } - finally { - await Mutex.unlock(this.batch); - } - } - setBatchType(batchType) { - if (!this.batchType) { - this.batchType = batchType; - } - if (this.batchType !== batchType) { - throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`); - } - } - async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url; - let credential; - if (typeof urlOrBlobClient === "string" && - ((coreHttp.isNode && credentialOrOptions instanceof StorageSharedKeyCredential) || - credentialOrOptions instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrOptions))) { - // First overload - url = urlOrBlobClient; - credential = credentialOrOptions; - } - else if (urlOrBlobClient instanceof BlobClient) { - // Second overload - url = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - options = credentialOrOptions; - } - else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); - } - if (!options) { - options = {}; - } - const { span, updatedOptions } = createSpan("BatchDeleteRequest-addSubRequest", options); - try { - this.setBatchType("delete"); - await this.addSubRequestInternal({ - url: url, - credential: credential, - }, async () => { - await new BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); - }); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url; - let credential; - let tier; - if (typeof urlOrBlobClient === "string" && - ((coreHttp.isNode && credentialOrTier instanceof StorageSharedKeyCredential) || - credentialOrTier instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrTier))) { - // First overload - url = urlOrBlobClient; - credential = credentialOrTier; - tier = tierOrOptions; - } - else if (urlOrBlobClient instanceof BlobClient) { - // Second overload - url = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - tier = credentialOrTier; - options = tierOrOptions; - } - else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); - } - if (!options) { - options = {}; - } - const { span, updatedOptions } = createSpan("BatchSetTierRequest-addSubRequest", options); - try { - this.setBatchType("setAccessTier"); - await this.addSubRequestInternal({ - url: url, - credential: credential, - }, async () => { - await new BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions); - }); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } -} -/** - * Inner batch request class which is responsible for assembling and serializing sub requests. - * See https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#request-body for how requests are assembled. - */ -class InnerBatchRequest { - constructor() { - this.operationCount = 0; - this.body = ""; - const tempGuid = coreHttp.generateUuid(); - // batch_{batchid} - this.boundary = `batch_${tempGuid}`; - // --batch_{batchid} - // Content-Type: application/http - // Content-Transfer-Encoding: binary - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; - // multipart/mixed; boundary=batch_{batchid} - this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`; - // --batch_{batchid}-- - this.batchRequestEnding = `--${this.boundary}--`; - this.subRequests = new Map(); - } - /** - * Create pipeline to assemble sub requests. The idea here is to use existing - * credential and serialization/deserialization components, with additional policies to - * filter unnecessary headers, assemble sub requests into request's body - * and intercept request from going to wire. - * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used. - */ - createPipeline(credential) { - const isAnonymousCreds = credential instanceof AnonymousCredential; - const policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); // [deserializationPolicy, BatchHeaderFilterPolicyFactory, (Optional)Credential, BatchRequestAssemblePolicyFactory] - const factories = new Array(policyFactoryLength); - factories[0] = coreHttp.deserializationPolicy(); // Default deserializationPolicy is provided by protocol layer - factories[1] = new BatchHeaderFilterPolicyFactory(); // Use batch header filter policy to exclude unnecessary headers - if (!isAnonymousCreds) { - factories[2] = coreHttp.isTokenCredential(credential) - ? attachCredential(coreHttp.bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), credential) - : credential; - } - factories[policyFactoryLength - 1] = new BatchRequestAssemblePolicyFactory(this); // Use batch assemble policy to assemble request and intercept request from going to wire - return new Pipeline(factories, {}); - } - appendSubRequestToBody(request) { - // Start to assemble sub request - this.body += [ - this.subRequestPrefix, - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, - "", - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}`, // sub request start line with method - ].join(HTTP_LINE_ENDING); - for (const header of request.headers.headersArray()) { - this.body += `${header.name}: ${header.value}${HTTP_LINE_ENDING}`; - } - this.body += HTTP_LINE_ENDING; // sub request's headers need be ending with an empty line - // No body to assemble for current batch request support - // End to assemble sub request - } - preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); - } - // Fast fail if url for sub request is invalid - const path = getURLPath(subRequest.url); - if (!path || path === "") { - throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); - } - } - postAddSubRequest(subRequest) { - this.subRequests.set(this.operationCount, subRequest); - this.operationCount++; - } - // Return the http request body with assembling the ending line to the sub request body. - getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; - } - getMultipartContentType() { - return this.multipartContentType; - } - getSubRequests() { - return this.subRequests; - } -} -class BatchRequestAssemblePolicy extends coreHttp.BaseRequestPolicy { - constructor(batchRequest, nextPolicy, options) { - super(nextPolicy, options); - this.dummyResponse = { - request: new coreHttp.WebResource(), - status: 200, - headers: new coreHttp.HttpHeaders(), - }; - this.batchRequest = batchRequest; - } - async sendRequest(request) { - await this.batchRequest.appendSubRequestToBody(request); - return this.dummyResponse; // Intercept request from going to wire - } -} -class BatchRequestAssemblePolicyFactory { - constructor(batchRequest) { - this.batchRequest = batchRequest; - } - create(nextPolicy, options) { - return new BatchRequestAssemblePolicy(this.batchRequest, nextPolicy, options); - } -} -class BatchHeaderFilterPolicy extends coreHttp.BaseRequestPolicy { - // The base class has a protected constructor. Adding a public one to enable constructing of this class. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/ - constructor(nextPolicy, options) { - super(nextPolicy, options); - } - async sendRequest(request) { - let xMsHeaderName = ""; - for (const header of request.headers.headersArray()) { - if (iEqual(header.name, HeaderConstants.X_MS_VERSION)) { - xMsHeaderName = header.name; - } - } - if (xMsHeaderName !== "") { - request.headers.remove(xMsHeaderName); // The subrequests should not have the x-ms-version header. - } - return this._nextPolicy.sendRequest(request); - } -} -class BatchHeaderFilterPolicyFactory { - create(nextPolicy, options) { - return new BatchHeaderFilterPolicy(nextPolicy, options); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - */ -class BlobBatchClient { - constructor(url, credentialOrPipeline, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } - else if (!credentialOrPipeline) { - // no credential provided - pipeline = newPipeline(new AnonymousCredential(), options); - } - else { - pipeline = newPipeline(credentialOrPipeline, options); - } - const storageClientContext = new StorageClientContext(url, pipeline.toServiceClientOptions()); - const path = getURLPath(url); - if (path && path !== "/") { - // Container scoped. - this.serviceOrContainerContext = new Container(storageClientContext); - } - else { - this.serviceOrContainerContext = new Service(storageClientContext); - } - } - /** - * Creates a {@link BlobBatch}. - * A BlobBatch represents an aggregated set of operations on blobs. - */ - createBatch() { - return new BlobBatch(); - } - async deleteBlobs(urlsOrBlobClients, credentialOrOptions, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - const batch = new BlobBatch(); - for (const urlOrBlobClient of urlsOrBlobClients) { - if (typeof urlOrBlobClient === "string") { - await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); - } - else { - await batch.deleteBlob(urlOrBlobClient, credentialOrOptions); - } - } - return this.submitBatch(batch); - } - async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - const batch = new BlobBatch(); - for (const urlOrBlobClient of urlsOrBlobClients) { - if (typeof urlOrBlobClient === "string") { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); - } - else { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions); - } - } - return this.submitBatch(batch); - } - /** - * Submit batch request which consists of multiple subrequests. - * - * Get `blobBatchClient` and other details before running the snippets. - * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` - * - * Example usage: - * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * Example using a lease: - * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @param batchRequest - A set of Delete or SetTier operations. - * @param options - - */ - async submitBatch(batchRequest, options = {}) { - if (!batchRequest || batchRequest.getSubRequests().size === 0) { - throw new RangeError("Batch request should contain one or more sub requests."); - } - const { span, updatedOptions } = createSpan("BlobBatchClient-submitBatch", options); - try { - const batchRequestBody = batchRequest.getHttpRequestBody(); - // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now. - const rawBatchResponse = await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions))); - // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202). - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); - const responseSummary = await batchResponseParser.parseBatchResponse(); - const res = { - _response: rawBatchResponse._response, - contentType: rawBatchResponse.contentType, - errorCode: rawBatchResponse.errorCode, - requestId: rawBatchResponse.requestId, - clientRequestId: rawBatchResponse.clientRequestId, - version: rawBatchResponse.version, - subResponses: responseSummary.subResponses, - subResponsesSucceededCount: responseSummary.subResponsesSucceededCount, - subResponsesFailedCount: responseSummary.subResponsesFailedCount, - }; - return res; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } -} - -/** - * A ContainerClient represents a URL to the Azure Storage container allowing you to manipulate its blobs. - */ -class ContainerClient extends StorageClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - let pipeline; - let url; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - // (url: string, pipeline: Pipeline) - url = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } - else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) || - credentialOrPipelineOrContainerName instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - url = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } - else if (!credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName !== "string") { - // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) - // The second parameter is undefined. Use anonymous credential. - url = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } - else if (credentialOrPipelineOrContainerName && - typeof credentialOrPipelineOrContainerName === "string") { - // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions) - const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreHttp.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); - if (!options.proxyOptions) { - options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } - else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } - else if (extractedCreds.kind === "SASConnString") { - url = - appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + - "?" + - extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } - else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - else { - throw new Error("Expecting non-empty strings for containerName parameter"); - } - super(url, pipeline); - this._containerName = this.getContainerNameFromUrl(); - this.containerContext = new Container(this.storageClientContext); - } - /** - * The name of the container. - */ - get containerName() { - return this._containerName; - } - /** - * Creates a new container under the specified account. If the container with - * the same name already exists, the operation fails. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata - * - * @param options - Options to Container Create operation. - * - * - * Example usage: - * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * const createContainerResponse = await containerClient.create(); - * console.log("Container was created successfully", createContainerResponse.requestId); - * ``` - */ - async create(options = {}) { - const { span, updatedOptions } = createSpan("ContainerClient-create", options); - try { - // Spread operator in destructuring assignments, - // this will filter out unwanted properties from the response object into result object - return await this.containerContext.create(Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Creates a new container under the specified account. If the container with - * the same name already exists, it is not changed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata - * - * @param options - - */ - async createIfNotExists(options = {}) { - var _a, _b; - const { span, updatedOptions } = createSpan("ContainerClient-createIfNotExists", options); - try { - const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } - catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: "Expected exception when creating a container only if it does not already exist.", - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns true if the Azure container resource represented by this client exists; false otherwise. - * - * NOTE: use this function with care since an existing container might be deleted by other clients or - * applications. Vice versa new containers with the same name might be added by other clients or - * applications after this function completes. - * - * @param options - - */ - async exists(options = {}) { - const { span, updatedOptions } = createSpan("ContainerClient-exists", options); - try { - await this.getProperties({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions, - }); - return true; - } - catch (e) { - if (e.statusCode === 404) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: "Expected exception when checking container existence", - }); - return false; - } - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Creates a {@link BlobClient} - * - * @param blobName - A blob name - * @returns A new BlobClient object for the given blob name. - */ - getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Creates an {@link AppendBlobClient} - * - * @param blobName - An append blob name - */ - getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Creates a {@link BlockBlobClient} - * - * @param blobName - A block blob name - * - * - * Example usage: - * - * ```js - * const content = "Hello world!"; - * - * const blockBlobClient = containerClient.getBlockBlobClient(""); - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` - */ - getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Creates a {@link PageBlobClient} - * - * @param blobName - A page blob name - */ - getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Returns all user-defined metadata and system properties for the specified - * container. The data returned does not include the container's list of blobs. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties - * - * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if - * they originally contained uppercase characters. This differs from the metadata keys returned by - * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which - * will retain their original casing. - * - * @param options - Options to Container Get Properties operation. - */ - async getProperties(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan("ContainerClient-getProperties", options); - try { - return await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Marks the specified container for deletion. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container - * - * @param options - Options to Container Delete operation. - */ - async delete(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan("ContainerClient-delete", options); - try { - return await this.containerContext.delete(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Marks the specified container for deletion if it exists. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container - * - * @param options - Options to Container Delete operation. - */ - async deleteIfExists(options = {}) { - var _a, _b; - const { span, updatedOptions } = createSpan("ContainerClient-deleteIfExists", options); - try { - const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } - catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: "Expected exception when deleting a container only if it exists.", - }); - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets one or more user-defined name-value pairs for the specified container. - * - * If no option provided, or no metadata defined in the parameter, the container - * metadata will be removed. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata - * - * @param metadata - Replace existing metadata with this value. - * If no value provided the existing metadata will be removed. - * @param options - Options to Container Set Metadata operation. - */ - async setMetadata(metadata, options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - if (options.conditions.ifUnmodifiedSince) { - throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service"); - } - const { span, updatedOptions } = createSpan("ContainerClient-setMetadata", options); - try { - return await this.containerContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Gets the permissions for the specified container. The permissions indicate - * whether container data may be accessed publicly. - * - * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings. - * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z". - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl - * - * @param options - Options to Container Get Access Policy operation. - */ - async getAccessPolicy(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - const { span, updatedOptions } = createSpan("ContainerClient-getAccessPolicy", options); - try { - const response = await this.containerContext.getAccessPolicy(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - const res = { - _response: response._response, - blobPublicAccess: response.blobPublicAccess, - date: response.date, - etag: response.etag, - errorCode: response.errorCode, - lastModified: response.lastModified, - requestId: response.requestId, - clientRequestId: response.clientRequestId, - signedIdentifiers: [], - version: response.version, - }; - for (const identifier of response) { - let accessPolicy = undefined; - if (identifier.accessPolicy) { - accessPolicy = { - permissions: identifier.accessPolicy.permissions, - }; - if (identifier.accessPolicy.expiresOn) { - accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn); - } - if (identifier.accessPolicy.startsOn) { - accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn); - } - } - res.signedIdentifiers.push({ - accessPolicy, - id: identifier.id, - }); - } - return res; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets the permissions for the specified container. The permissions indicate - * whether blobs in a container may be accessed publicly. - * - * When you set permissions for a container, the existing permissions are replaced. - * If no access or containerAcl provided, the existing container ACL will be - * removed. - * - * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect. - * During this interval, a shared access signature that is associated with the stored access policy will - * fail with status code 403 (Forbidden), until the access policy becomes active. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl - * - * @param access - The level of public access to data in the container. - * @param containerAcl - Array of elements each having a unique Id and details of the access policy. - * @param options - Options to Container Set Access Policy operation. - */ - async setAccessPolicy(access, containerAcl, options = {}) { - options.conditions = options.conditions || {}; - const { span, updatedOptions } = createSpan("ContainerClient-setAccessPolicy", options); - try { - const acl = []; - for (const identifier of containerAcl || []) { - acl.push({ - accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn - ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) - : "", - permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn - ? truncatedISO8061Date(identifier.accessPolicy.startsOn) - : "", - }, - id: identifier.id, - }); - } - return await this.containerContext.setAccessPolicy(Object.assign({ abortSignal: options.abortSignal, access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Get a {@link BlobLeaseClient} that manages leases on the container. - * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the container. - */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); - } - /** - * Creates a new block blob, or updates the content of an existing block blob. - * - * Updating an existing block blob overwrites any existing metadata on the blob. - * Partial updates are not supported; the content of the existing blob is - * overwritten with the new content. To perform a partial update of a block blob's, - * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}. - * - * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile}, - * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better - * performance with concurrency uploading. - * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob - * - * @param blobName - Name of the block blob to create or update. - * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function - * which returns a new Readable stream whose offset is from data source beginning. - * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a - * string including non non-Base64/Hex-encoded characters. - * @param options - Options to configure the Block Blob Upload operation. - * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. - */ - async uploadBlockBlob(blobName, body, contentLength, options = {}) { - const { span, updatedOptions } = createSpan("ContainerClient-uploadBlockBlob", options); - try { - const blockBlobClient = this.getBlockBlobClient(blobName); - const response = await blockBlobClient.upload(body, contentLength, updatedOptions); - return { - blockBlobClient, - response, - }; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Marks the specified blob or snapshot for deletion. The blob is later deleted - * during garbage collection. Note that in order to delete a blob, you must delete - * all of its snapshots. You can delete both at the same time with the Delete - * Blob operation. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob - * - * @param blobName - - * @param options - Options to Blob Delete operation. - * @returns Block blob deletion response data. - */ - async deleteBlob(blobName, options = {}) { - const { span, updatedOptions } = createSpan("ContainerClient-deleteBlob", options); - try { - let blobClient = this.getBlobClient(blobName); - if (options.versionId) { - blobClient = blobClient.withVersion(options.versionId); - } - return await blobClient.delete(updatedOptions); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * listBlobFlatSegment returns a single segment of blobs starting from the - * specified Marker. Use an empty Marker to start enumeration from the beginning. - * After getting a segment, process it, and then call listBlobsFlatSegment again - * (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs - * - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to Container List Blob Flat Segment operation. - */ - async listBlobFlatSegment(marker, options = {}) { - const { span, updatedOptions } = createSpan("ContainerClient-listBlobFlatSegment", options); - try { - const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); - return blobItem; - }) }) }); - return wrappedResponse; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * listBlobHierarchySegment returns a single segment of blobs starting from - * the specified Marker. Use an empty Marker to start enumeration from the - * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment - * again (passing the the previously-returned Marker) to get the next segment. - * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. - * @param options - Options to Container List Blob Hierarchy Segment operation. - */ - async listBlobHierarchySegment(delimiter, marker, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("ContainerClient-listBlobHierarchySegment", options); - try { - const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); - return wrappedResponse; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse - * - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the ContinuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list blobs operation. - */ - listSegments(marker, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1() { - let listBlobsFlatSegmentResponse; - if (!!marker || marker === undefined) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker, options)); - marker = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker); - } - }); - } - /** - * Returns an AsyncIterableIterator of {@link BlobItem} objects - * - * @param options - Options to list blobs operation. - */ - listItems(options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listItems_1() { - var e_1, _a; - let marker; - try { - for (var _b = tslib.__asyncValues(this.listSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) { - const listBlobsFlatSegmentResponse = _c.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b)); - } - finally { if (e_1) throw e_1.error; } - } - }); - } - /** - * Returns an async iterable iterator to list all the blobs - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * Example using `for await` syntax: - * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * - * // Passing next marker as continuationToken - * - * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints 10 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` - * - * @param options - Options to list blobs. - * @returns An asyncIterableIterator that supports paging. - */ - listBlobsFlat(options = {}) { - const include = []; - if (options.includeCopy) { - include.push("copy"); - } - if (options.includeDeleted) { - include.push("deleted"); - } - if (options.includeMetadata) { - include.push("metadata"); - } - if (options.includeSnapshots) { - include.push("snapshots"); - } - if (options.includeVersions) { - include.push("versions"); - } - if (options.includeUncommitedBlobs) { - include.push("uncommittedblobs"); - } - if (options.includeTags) { - include.push("tags"); - } - if (options.includeDeletedWithVersions) { - include.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = undefined; - } - const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {})); - // AsyncIterableIterator to iterate over blobs - const iter = this.listItems(updatedOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); - }, - }; - } - /** - * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the ContinuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The ContinuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list blobs operation. - */ - listHierarchySegments(delimiter, marker, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1() { - let listBlobsHierarchySegmentResponse; - if (!!marker || marker === undefined) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter, marker, options)); - marker = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker); - } - }); - } - /** - * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. - */ - listItemsByHierarchy(delimiter, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1() { - var e_2, _a; - let marker; - try { - for (var _b = tslib.__asyncValues(this.listHierarchySegments(delimiter, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) { - const listBlobsHierarchySegmentResponse = _c.value; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b)); - } - finally { if (e_2) throw e_2.error; } - } - }); - } - /** - * Returns an async iterable iterator to list all the blobs by hierarchy. - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. - * - * Example using `for await` syntax: - * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * entity = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. - */ - listBlobsByHierarchy(delimiter, options = {}) { - if (delimiter === "") { - throw new RangeError("delimiter should contain one or more characters"); - } - const include = []; - if (options.includeCopy) { - include.push("copy"); - } - if (options.includeDeleted) { - include.push("deleted"); - } - if (options.includeMetadata) { - include.push("metadata"); - } - if (options.includeSnapshots) { - include.push("snapshots"); - } - if (options.includeVersions) { - include.push("versions"); - } - if (options.includeUncommitedBlobs) { - include.push("uncommittedblobs"); - } - if (options.includeTags) { - include.push("tags"); - } - if (options.includeDeletedWithVersions) { - include.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = undefined; - } - const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {})); - // AsyncIterableIterator to iterate over blob prefixes and blobs - const iter = this.listItemsByHierarchy(delimiter, updatedOptions); - return { - /** - * The next method, part of the iteration protocol - */ - async next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); - }, - }; - } - /** - * The Filter Blobs operation enables callers to list blobs in the container whose tags - * match a given search expression. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) { - const { span, updatedOptions } = createSpan("ContainerClient-findBlobsByTagsSegment", options); - try { - const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() { - let response; - if (!!marker || marker === undefined) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options)); - response.blobs = response.blobs || []; - marker = response.continuationToken; - yield yield tslib.__await(response); - } while (marker); - } - }); - } - /** - * Returns an AsyncIterableIterator for blobs. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to findBlobsByTagsItems. - */ - findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() { - var e_3, _a; - let marker; - try { - for (var _b = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) { - const segment = _c.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b)); - } - finally { if (e_3) throw e_3.error; } - } - }); - } - /** - * Returns an async iterable iterator to find all blobs with specified tag - * under the specified container. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = containerClient - * .findBlobsByTags("tagkey='tagvalue'") - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to find blobs by tags. - */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - // AsyncIterableIterator to iterate over blobs - const listSegmentOptions = Object.assign({}, options); - const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); - }, - }; - } - getContainerNameFromUrl() { - let containerName; - try { - // URL may look like the following - // "https://myaccount.blob.core.windows.net/mycontainer?sasString"; - // "https://myaccount.blob.core.windows.net/mycontainer"; - // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername` - // http://localhost:10001/devstoreaccount1/containername - const parsedUrl = coreHttp.URLBuilder.parse(this.url); - if (parsedUrl.getHost().split(".")[1] === "blob") { - // "https://myaccount.blob.core.windows.net/containername". - // "https://customdomain.com/containername". - // .getPath() -> /containername - containerName = parsedUrl.getPath().split("/")[1]; - } - else if (isIpEndpointStyle(parsedUrl)) { - // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername - // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername - // .getPath() -> /devstoreaccount1/containername - containerName = parsedUrl.getPath().split("/")[2]; - } - else { - // "https://customdomain.com/containername". - // .getPath() -> /containername - containerName = parsedUrl.getPath().split("/")[1]; - } - // decode the encoded containerName - to get all the special characters that might be present in it - containerName = decodeURIComponent(containerName); - if (!containerName) { - throw new Error("Provided containerName is invalid."); - } - return containerName; - } - catch (error) { - throw new Error("Unable to extract containerName with provided information."); - } - } - /** - * Only available for ContainerClient constructed with a shared key credential. - * - * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas - * - * @param options - Optional parameters. - * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateSasUrl(options) { - return new Promise((resolve) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve(appendToURLQuery(this.url, sas)); - }); - } - /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this container. - */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value - * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the - * values are set, this should be serialized with toString and set as the permissions field on an - * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but - * the order of the permissions is particular and this class guarantees correctness. - */ -class AccountSASPermissions { - constructor() { - /** - * Permission to read resources and list queues and tables granted. - */ - this.read = false; - /** - * Permission to write resources granted. - */ - this.write = false; - /** - * Permission to create blobs and files granted. - */ - this.delete = false; - /** - * Permission to delete versions granted. - */ - this.deleteVersion = false; - /** - * Permission to list blob containers, blobs, shares, directories, and files granted. - */ - this.list = false; - /** - * Permission to add messages, table entities, and append to blobs granted. - */ - this.add = false; - /** - * Permission to create blobs and files granted. - */ - this.create = false; - /** - * Permissions to update messages and table entities granted. - */ - this.update = false; - /** - * Permission to get and delete messages granted. - */ - this.process = false; - /** - * Specfies Tag access granted. - */ - this.tag = false; - /** - * Permission to filter blobs. - */ - this.filter = false; - /** - * Permission to set immutability policy. - */ - this.setImmutabilityPolicy = false; - /** - * Specifies that Permanent Delete is permitted. - */ - this.permanentDelete = false; - } - /** - * Parse initializes the AccountSASPermissions fields from a string. - * - * @param permissions - - */ - static parse(permissions) { - const accountSASPermissions = new AccountSASPermissions(); - for (const c of permissions) { - switch (c) { - case "r": - accountSASPermissions.read = true; - break; - case "w": - accountSASPermissions.write = true; - break; - case "d": - accountSASPermissions.delete = true; - break; - case "x": - accountSASPermissions.deleteVersion = true; - break; - case "l": - accountSASPermissions.list = true; - break; - case "a": - accountSASPermissions.add = true; - break; - case "c": - accountSASPermissions.create = true; - break; - case "u": - accountSASPermissions.update = true; - break; - case "p": - accountSASPermissions.process = true; - break; - case "t": - accountSASPermissions.tag = true; - break; - case "f": - accountSASPermissions.filter = true; - break; - case "i": - accountSASPermissions.setImmutabilityPolicy = true; - break; - case "y": - accountSASPermissions.permanentDelete = true; - break; - default: - throw new RangeError(`Invalid permission character: ${c}`); - } - } - return accountSASPermissions; - } - /** - * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. - * - * @param permissionLike - - */ - static from(permissionLike) { - const accountSASPermissions = new AccountSASPermissions(); - if (permissionLike.read) { - accountSASPermissions.read = true; - } - if (permissionLike.write) { - accountSASPermissions.write = true; - } - if (permissionLike.delete) { - accountSASPermissions.delete = true; - } - if (permissionLike.deleteVersion) { - accountSASPermissions.deleteVersion = true; - } - if (permissionLike.filter) { - accountSASPermissions.filter = true; - } - if (permissionLike.tag) { - accountSASPermissions.tag = true; - } - if (permissionLike.list) { - accountSASPermissions.list = true; - } - if (permissionLike.add) { - accountSASPermissions.add = true; - } - if (permissionLike.create) { - accountSASPermissions.create = true; - } - if (permissionLike.update) { - accountSASPermissions.update = true; - } - if (permissionLike.process) { - accountSASPermissions.process = true; - } - if (permissionLike.setImmutabilityPolicy) { - accountSASPermissions.setImmutabilityPolicy = true; - } - if (permissionLike.permanentDelete) { - accountSASPermissions.permanentDelete = true; - } - return accountSASPermissions; - } - /** - * Produces the SAS permissions string for an Azure Storage account. - * Call this method to set AccountSASSignatureValues Permissions field. - * - * Using this method will guarantee the resource types are in - * an order accepted by the service. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - * - */ - toString() { - // The order of the characters should be as specified here to ensure correctness: - // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - // Use a string array instead of string concatenating += operator for performance - const permissions = []; - if (this.read) { - permissions.push("r"); - } - if (this.write) { - permissions.push("w"); - } - if (this.delete) { - permissions.push("d"); - } - if (this.deleteVersion) { - permissions.push("x"); - } - if (this.filter) { - permissions.push("f"); - } - if (this.tag) { - permissions.push("t"); - } - if (this.list) { - permissions.push("l"); - } - if (this.add) { - permissions.push("a"); - } - if (this.create) { - permissions.push("c"); - } - if (this.update) { - permissions.push("u"); - } - if (this.process) { - permissions.push("p"); - } - if (this.setImmutabilityPolicy) { - permissions.push("i"); - } - if (this.permanentDelete) { - permissions.push("y"); - } - return permissions.join(""); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value - * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the - * values are set, this should be serialized with toString and set as the resources field on an - * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but - * the order of the resources is particular and this class guarantees correctness. - */ -class AccountSASResourceTypes { - constructor() { - /** - * Permission to access service level APIs granted. - */ - this.service = false; - /** - * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted. - */ - this.container = false; - /** - * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted. - */ - this.object = false; - } - /** - * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an - * Error if it encounters a character that does not correspond to a valid resource type. - * - * @param resourceTypes - - */ - static parse(resourceTypes) { - const accountSASResourceTypes = new AccountSASResourceTypes(); - for (const c of resourceTypes) { - switch (c) { - case "s": - accountSASResourceTypes.service = true; - break; - case "c": - accountSASResourceTypes.container = true; - break; - case "o": - accountSASResourceTypes.object = true; - break; - default: - throw new RangeError(`Invalid resource type: ${c}`); - } - } - return accountSASResourceTypes; - } - /** - * Converts the given resource types to a string. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - * - */ - toString() { - const resourceTypes = []; - if (this.service) { - resourceTypes.push("s"); - } - if (this.container) { - resourceTypes.push("c"); - } - if (this.object) { - resourceTypes.push("o"); - } - return resourceTypes.join(""); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value - * to true means that any SAS which uses these permissions will grant access to that service. Once all the - * values are set, this should be serialized with toString and set as the services field on an - * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but - * the order of the services is particular and this class guarantees correctness. - */ -class AccountSASServices { - constructor() { - /** - * Permission to access blob resources granted. - */ - this.blob = false; - /** - * Permission to access file resources granted. - */ - this.file = false; - /** - * Permission to access queue resources granted. - */ - this.queue = false; - /** - * Permission to access table resources granted. - */ - this.table = false; - } - /** - * Creates an {@link AccountSASServices} from the specified services string. This method will throw an - * Error if it encounters a character that does not correspond to a valid service. - * - * @param services - - */ - static parse(services) { - const accountSASServices = new AccountSASServices(); - for (const c of services) { - switch (c) { - case "b": - accountSASServices.blob = true; - break; - case "f": - accountSASServices.file = true; - break; - case "q": - accountSASServices.queue = true; - break; - case "t": - accountSASServices.table = true; - break; - default: - throw new RangeError(`Invalid service character: ${c}`); - } - } - return accountSASServices; - } - /** - * Converts the given services to a string. - * - */ - toString() { - const services = []; - if (this.blob) { - services.push("b"); - } - if (this.table) { - services.push("t"); - } - if (this.queue) { - services.push("q"); - } - if (this.file) { - services.push("f"); - } - return services.join(""); - } -} - -// Copyright (c) Microsoft Corporation. -/** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Generates a {@link SASQueryParameters} object which contains all SAS query parameters needed to make an actual - * REST request. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - * - * @param accountSASSignatureValues - - * @param sharedKeyCredential - - */ -function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { - const version = accountSASSignatureValues.version - ? accountSASSignatureValues.version - : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && - accountSASSignatureValues.permissions.setImmutabilityPolicy && - version < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (accountSASSignatureValues.permissions && - accountSASSignatureValues.permissions.deleteVersion && - version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); - } - if (accountSASSignatureValues.permissions && - accountSASSignatureValues.permissions.permanentDelete && - version < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); - } - if (accountSASSignatureValues.permissions && - accountSASSignatureValues.permissions.tag && - version < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); - } - if (accountSASSignatureValues.permissions && - accountSASSignatureValues.permissions.filter && - version < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); - } - if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); - } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); - let stringToSign; - if (version >= "2020-12-06") { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn - ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) - : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version, - accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", - "", // Account SAS requires an additional newline character - ].join("\n"); - } - else { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn - ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) - : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version, - "", // Account SAS requires an additional newline character - ].join("\n"); - } - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, accountSASSignatureValues.encryptionScope); -} - -/** - * A BlobServiceClient represents a Client to the Azure Storage Blob service allowing you - * to manipulate blob containers. - */ -class BlobServiceClient extends StorageClient { - constructor(url, credentialOrPipeline, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } - else if ((coreHttp.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential) || - credentialOrPipeline instanceof AnonymousCredential || - coreHttp.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); - } - else { - // The second parameter is undefined. Use anonymous credential - pipeline = newPipeline(new AnonymousCredential(), options); - } - super(url, pipeline); - this.serviceContext = new Service(this.storageClientContext); - } - /** - * - * Creates an instance of BlobServiceClient from connection string. - * - * @param connectionString - Account connection string or a SAS connection string of an Azure storage account. - * [ Note - Account connection string can only be used in NODE.JS runtime. ] - * Account connection string example - - * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` - * SAS connection string example - - * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - * @param options - Optional. Options to configure the HTTP pipeline. - */ - static fromConnectionString(connectionString, - // Legacy, no fix for eslint error without breaking. Disable it for this interface. - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - options) { - options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreHttp.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - if (!options.proxyOptions) { - options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri); - } - const pipeline = newPipeline(sharedKeyCredential, options); - return new BlobServiceClient(extractedCreds.url, pipeline); - } - else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } - else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); - return new BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); - } - else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - /** - * Creates a {@link ContainerClient} object - * - * @param containerName - A container name - * @returns A new ContainerClient object for the given container name. - * - * Example usage: - * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * ``` - */ - getContainerClient(containerName) { - return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); - } - /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * - * @param containerName - Name of the container to create. - * @param options - Options to configure Container Create operation. - * @returns Container creation response and the corresponding container client. - */ - async createContainer(containerName, options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-createContainer", options); - try { - const containerClient = this.getContainerClient(containerName); - const containerCreateResponse = await containerClient.create(updatedOptions); - return { - containerClient, - containerCreateResponse, - }; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Deletes a Blob container. - * - * @param containerName - Name of the container to delete. - * @param options - Options to configure Container Delete operation. - * @returns Container deletion response. - */ - async deleteContainer(containerName, options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-deleteContainer", options); - try { - const containerClient = this.getContainerClient(containerName); - return await containerClient.delete(updatedOptions); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Restore a previously deleted Blob container. - * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container. - * - * @param deletedContainerName - Name of the previously deleted container. - * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container. - * @param options - Options to configure Container Restore operation. - * @returns Container deletion response. - */ - async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-undeleteContainer", options); - try { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName); - // Hack to access a protected member. - const containerContext = new Container(containerClient["storageClientContext"]); - const containerUndeleteResponse = await containerContext.restore(Object.assign({ deletedContainerName, - deletedContainerVersion }, updatedOptions)); - return { containerClient, containerUndeleteResponse }; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName, destinationContainerName, options = {}) { - var _a; - const { span, updatedOptions } = createSpan("BlobServiceClient-renameContainer", options); - try { - const containerClient = this.getContainerClient(destinationContainerName); - // Hack to access a protected member. - const containerContext = new Container(containerClient["storageClientContext"]); - const containerRenameResponse = await containerContext.rename(sourceContainerName, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId })); - return { containerClient, containerRenameResponse }; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Gets the properties of a storage account’s Blob service, including properties - * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties - * - * @param options - Options to the Service Get Properties operation. - * @returns Response data for the Service Get Properties operation. - */ - async getProperties(options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-getProperties", options); - try { - return await this.serviceContext.getProperties(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Sets properties for a storage account’s Blob service endpoint, including properties - * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties - * - * @param properties - - * @param options - Options to the Service Set Properties operation. - * @returns Response data for the Service Set Properties operation. - */ - async setProperties(properties, options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-setProperties", options); - try { - return await this.serviceContext.setProperties(properties, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Retrieves statistics related to replication for the Blob service. It is only - * available on the secondary location endpoint when read-access geo-redundant - * replication is enabled for the storage account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats - * - * @param options - Options to the Service Get Statistics operation. - * @returns Response data for the Service Get Statistics operation. - */ - async getStatistics(options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-getStatistics", options); - try { - return await this.serviceContext.getStatistics(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * The Get Account Information operation returns the sku name and account kind - * for the specified account. - * The Get Account Information operation is available on service versions beginning - * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information - * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. - */ - async getAccountInfo(options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-getAccountInfo", options); - try { - return await this.serviceContext.getAccountInfo(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 - * - * @param marker - A string value that identifies the portion of - * the list of containers to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all containers remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to the Service List Container Segment operation. - * @returns Response data for the Service List Container Segment operation. - */ - async listContainersSegment(marker, options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-listContainersSegment", options); - try { - return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), { include: typeof options.include === "string" ? [options.include] : options.include }), convertTracingToRequestOptionsBase(updatedOptions))); - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags - * match a given search expression. Filter blobs searches across all containers within a - * storage account but can be scoped within the expression to a single container. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-findBlobsByTagsSegment", options); - try { - const response = await this.serviceContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param marker - A string value that identifies the portion of - * the list of blobs to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all blobs remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to find blobs by tags. - */ - findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() { - let response; - if (!!marker || marker === undefined) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options)); - response.blobs = response.blobs || []; - marker = response.continuationToken; - yield yield tslib.__await(response); - } while (marker); - } - }); - } - /** - * Returns an AsyncIterableIterator for blobs. - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to findBlobsByTagsItems. - */ - findBlobsByTagsItems(tagFilterSqlExpression, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() { - var e_1, _a; - let marker; - try { - for (var _b = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) { - const segment = _c.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b)); - } - finally { if (e_1) throw e_1.error; } - } - }); - } - /** - * Returns an async iterable iterator to find all blobs with specified tag - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the blobs in pages. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = blobServiceClient - * .findBlobsByTags("tagkey='tagvalue'") - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints blob names - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression. - * The given expression must evaluate to true for a blob to be returned in the results. - * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter; - * however, only a subset of the OData filter syntax is supported in the Blob service. - * @param options - Options to find blobs by tags. - */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - // AsyncIterableIterator to iterate over blobs - const listSegmentOptions = Object.assign({}, options); - const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); - }, - }; - } - /** - * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses - * - * @param marker - A string value that identifies the portion of - * the list of containers to be returned with the next listing operation. The - * operation returns the continuationToken value within the response body if the - * listing operation did not return all containers remaining to be listed - * with the current page. The continuationToken value can be used as the value for - * the marker parameter in a subsequent call to request the next page of list - * items. The marker value is opaque to the client. - * @param options - Options to list containers operation. - */ - listSegments(marker, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1() { - let listContainersSegmentResponse; - if (!!marker || marker === undefined) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker, options)); - listContainersSegmentResponse.containerItems = - listContainersSegmentResponse.containerItems || []; - marker = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker); - } - }); - } - /** - * Returns an AsyncIterableIterator for Container Items - * - * @param options - Options to list containers operation. - */ - listItems(options = {}) { - return tslib.__asyncGenerator(this, arguments, function* listItems_1() { - var e_2, _a; - let marker; - try { - for (var _b = tslib.__asyncValues(this.listSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) { - const segment = _c.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b)); - } - finally { if (e_2) throw e_2.error; } - } - }); - } - /** - * Returns an async iterable iterator to list all the containers - * under the specified account. - * - * .byPage() returns an async iterable iterator to list the containers in pages. - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const container of blobServiceClient.listContainers()) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 container names - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * // Passing next marker as continuationToken - * iterator = blobServiceClient - * .listContainers() - * .byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; - * - * // Prints 10 container names - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * ``` - * - * @param options - Options to list containers. - * @returns An asyncIterableIterator that supports paging. - */ - listContainers(options = {}) { - if (options.prefix === "") { - options.prefix = undefined; - } - const include = []; - if (options.includeDeleted) { - include.push("deleted"); - } - if (options.includeMetadata) { - include.push("metadata"); - } - if (options.includeSystem) { - include.push("system"); - } - // AsyncIterableIterator to iterate over containers - const listSegmentOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include } : {})); - const iter = this.listItems(listSegmentOptions); - return { - /** - * The next method, part of the iteration protocol - */ - next() { - return iter.next(); - }, - /** - * The connection to the async iterator, part of the iteration protocol - */ - [Symbol.asyncIterator]() { - return this; - }, - /** - * Return an AsyncIterableIterator that works a page at a time - */ - byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); - }, - }; - } - /** - * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential). - * - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key - * - * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time - * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time - */ - async getUserDelegationKey(startsOn, expiresOn, options = {}) { - const { span, updatedOptions } = createSpan("BlobServiceClient-getUserDelegationKey", options); - try { - const response = await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn, false), - }, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions))); - const userDelegationKey = { - signedObjectId: response.signedObjectId, - signedTenantId: response.signedTenantId, - signedStartsOn: new Date(response.signedStartsOn), - signedExpiresOn: new Date(response.signedExpiresOn), - signedService: response.signedService, - signedVersion: response.signedVersion, - value: response.value, - }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); - return res; - } - catch (e) { - span.setStatus({ - code: coreTracing.SpanStatusCode.ERROR, - message: e.message, - }); - throw e; - } - finally { - span.end(); - } - } - /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this service. - */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); - } - /** - * Only available for BlobServiceClient constructed with a shared key credential. - * - * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties - * and parameters passed in. The SAS is signed by the shared key credential of the client. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas - * - * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided. - * @param permissions - Specifies the list of permissions to be associated with the SAS. - * @param resourceTypes - Specifies the resource types associated with the shared access signature. - * @param options - Optional parameters. - * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. - */ - generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); - } - if (expiresOn === undefined) { - const now = new Date(); - expiresOn = new Date(now.getTime() + 3600 * 1000); - } - const sas = generateAccountSASQueryParameters(Object.assign({ permissions, - expiresOn, - resourceTypes, services: AccountSASServices.parse("b").toString() }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** Known values of {@link EncryptionAlgorithmType} that the service accepts. */ -exports.KnownEncryptionAlgorithmType = void 0; -(function (KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; -})(exports.KnownEncryptionAlgorithmType || (exports.KnownEncryptionAlgorithmType = {})); - -Object.defineProperty(exports, "BaseRequestPolicy", ({ - enumerable: true, - get: function () { return coreHttp.BaseRequestPolicy; } -})); -Object.defineProperty(exports, "HttpHeaders", ({ - enumerable: true, - get: function () { return coreHttp.HttpHeaders; } -})); -Object.defineProperty(exports, "RequestPolicyOptions", ({ - enumerable: true, - get: function () { return coreHttp.RequestPolicyOptions; } -})); -Object.defineProperty(exports, "RestError", ({ - enumerable: true, - get: function () { return coreHttp.RestError; } -})); -Object.defineProperty(exports, "WebResource", ({ - enumerable: true, - get: function () { return coreHttp.WebResource; } -})); -Object.defineProperty(exports, "deserializationPolicy", ({ - enumerable: true, - get: function () { return coreHttp.deserializationPolicy; } -})); -exports.AccountSASPermissions = AccountSASPermissions; -exports.AccountSASResourceTypes = AccountSASResourceTypes; -exports.AccountSASServices = AccountSASServices; -exports.AnonymousCredential = AnonymousCredential; -exports.AnonymousCredentialPolicy = AnonymousCredentialPolicy; -exports.AppendBlobClient = AppendBlobClient; -exports.BlobBatch = BlobBatch; -exports.BlobBatchClient = BlobBatchClient; -exports.BlobClient = BlobClient; -exports.BlobLeaseClient = BlobLeaseClient; -exports.BlobSASPermissions = BlobSASPermissions; -exports.BlobServiceClient = BlobServiceClient; -exports.BlockBlobClient = BlockBlobClient; -exports.ContainerClient = ContainerClient; -exports.ContainerSASPermissions = ContainerSASPermissions; -exports.Credential = Credential; -exports.CredentialPolicy = CredentialPolicy; -exports.PageBlobClient = PageBlobClient; -exports.Pipeline = Pipeline; -exports.SASQueryParameters = SASQueryParameters; -exports.StorageBrowserPolicy = StorageBrowserPolicy; -exports.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; -exports.StorageOAuthScopes = StorageOAuthScopes; -exports.StorageRetryPolicy = StorageRetryPolicy; -exports.StorageRetryPolicyFactory = StorageRetryPolicyFactory; -exports.StorageSharedKeyCredential = StorageSharedKeyCredential; -exports.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; -exports.generateAccountSASQueryParameters = generateAccountSASQueryParameters; -exports.generateBlobSASQueryParameters = generateBlobSASQueryParameters; -exports.getBlobServiceAccountAudience = getBlobServiceAccountAudience; -exports.isPipelineLike = isPipelineLike; -exports.logger = logger; -exports.newPipeline = newPipeline; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 77864: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const REGEX_IS_INSTALLATION_LEGACY = /^v1\./; -const REGEX_IS_INSTALLATION = /^ghs_/; -const REGEX_IS_USER_TO_SERVER = /^ghu_/; -async function auth(token) { - const isApp = token.split(/\./).length === 3; - const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); - const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); - const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; - return { - type: "token", - token: token, - tokenType - }; -} - -/** - * Prefix token for usage in the Authorization header - * - * @param token OAuth token or JSON Web Token - */ -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - - return `token ${token}`; -} - -async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge(route, parameters); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); -} - -const createTokenAuth = function createTokenAuth(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } - - if (typeof token !== "string") { - throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); - } - - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); -}; - -exports.createTokenAuth = createTokenAuth; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 61897: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var universalUserAgent = __nccwpck_require__(33843); -var beforeAfterHook = __nccwpck_require__(52732); -var request = __nccwpck_require__(66255); -var graphql = __nccwpck_require__(70007); -var authToken = __nccwpck_require__(77864); - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -const VERSION = "3.6.0"; - -const _excluded = ["authStrategy"]; -class Octokit { - constructor(options = {}) { - const hook = new beforeAfterHook.Collection(); - const requestDefaults = { - baseUrl: request.request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - // @ts-ignore internal usage only, no need to type - hook: hook.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; // prepend default user agent with `options.userAgent` if set - - requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); - - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; - } - - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; - } - - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; - } - - this.request = request.request.defaults(requestDefaults); - this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); - this.log = Object.assign({ - debug: () => {}, - info: () => {}, - warn: console.warn.bind(console), - error: console.error.bind(console) - }, options.log); - this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. - // (2) If only `options.auth` is set, use the default token authentication strategy. - // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. - // TODO: type `options.auth` based on `options.authStrategy`. - - if (!options.authStrategy) { - if (!options.auth) { - // (1) - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - // (2) - const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ - - hook.wrap("request", auth.hook); - this.auth = auth; - } - } else { - const { - authStrategy - } = options, - otherOptions = _objectWithoutProperties(options, _excluded); - - const auth = authStrategy(Object.assign({ - request: this.request, - log: this.log, - // we pass the current octokit instance as well as its constructor options - // to allow for authentication strategies that return a new octokit instance - // that shares the same internal state as the current one. The original - // requirement for this was the "event-octokit" authentication strategy - // of https://github.com/probot/octokit-auth-probot. - octokit: this, - octokitOptions: otherOptions - }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ - - hook.wrap("request", auth.hook); - this.auth = auth; - } // apply plugins - // https://stackoverflow.com/a/16345172 - - - const classConstructor = this.constructor; - classConstructor.plugins.forEach(plugin => { - Object.assign(this, plugin(this, options)); - }); - } - - static defaults(defaults) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - - if (typeof defaults === "function") { - super(defaults(options)); - return; - } - - super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { - userAgent: `${options.userAgent} ${defaults.userAgent}` - } : null)); - } - - }; - return OctokitWithDefaults; - } - /** - * Attach a plugin (or many) to your Octokit instance. - * - * @example - * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) - */ - - - static plugin(...newPlugins) { - var _a; - - const currentPlugins = this.plugins; - const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); - return NewOctokit; - } - -} -Octokit.VERSION = VERSION; -Octokit.plugins = []; - -exports.Octokit = Octokit; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 54471: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var isPlainObject = __nccwpck_require__(93407); -var universalUserAgent = __nccwpck_require__(33843); - -function lowercaseKeys(object) { - if (!object) { - return {}; - } - - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[key]; - return newObj; - }, {}); -} - -function mergeDeep(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach(key => { - if (isPlainObject.isPlainObject(options[key])) { - if (!(key in defaults)) Object.assign(result, { - [key]: options[key] - });else result[key] = mergeDeep(defaults[key], options[key]); - } else { - Object.assign(result, { - [key]: options[key] - }); - } - }); - return result; -} - -function removeUndefinedProperties(obj) { - for (const key in obj) { - if (obj[key] === undefined) { - delete obj[key]; - } - } - - return obj; -} - -function merge(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { - method, - url - } : { - url: method - }, options); - } else { - options = Object.assign({}, route); - } // lowercase header names before merging with defaults to avoid duplicates - - - options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging - - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten - - if (defaults && defaults.mediaType.previews.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); - } - - mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); - return mergedOptions; -} - -function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); - - if (names.length === 0) { - return url; - } - - return url + separator + names.map(name => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); - } - - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); -} - -const urlVariableRegex = /\{[^}]+\}/g; - -function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); -} - -function extractUrlVariableNames(url) { - const matches = url.match(urlVariableRegex); - - if (!matches) { - return []; - } - - return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); -} - -function omit(object, keysToOmit) { - return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { - obj[key] = object[key]; - return obj; - }, {}); -} - -// Based on https://github.com/bramstein/url-template, licensed under BSD -// TODO: create separate package. -// -// Copyright (c) 2012-2014, Bram Stein -// All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* istanbul ignore file */ -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); - } - - return part; - }).join(""); -} - -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} - -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } -} - -function isDefined(value) { - return value !== undefined && value !== null; -} - -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; -} - -function getValues(context, operator, key, modifier) { - var value = context[key], - result = []; - - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); - - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } - - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; - - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - tmp.push(encodeValue(operator, value)); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); - } - }); - } - - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } - } - } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); - } - } - - return result; -} - -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; -} - -function expand(template, context) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { - if (expression) { - let operator = ""; - const values = []; - - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } - - expression.split(/,/g).forEach(function (variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); - }); - - if (operator && operator !== "+") { - var separator = ","; - - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } - - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); - } - }); -} - -function parse(options) { - // https://fetch.spec.whatwg.org/#methods - let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible - - let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later - - const urlVariableNames = extractUrlVariableNames(url); - url = parseUrl(url).expand(parameters); - - if (!/^http/.test(url)) { - url = options.baseUrl + url; - } - - const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit(parameters, omittedParameters); - const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); - - if (!isBinaryRequest) { - if (options.mediaType.format) { - // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw - headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); - } - - if (options.mediaType.previews.length) { - const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; - headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } - } // for GET/HEAD requests, set URL query parameters from remaining parameters - // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters - - - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } else { - headers["content-length"] = 0; - } - } - } // default content-type for JSON if body is set - - - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. - // fetch does not allow to set `content-length` header, but we can set body to an empty string - - - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } // Only return body/request keys if present - - - return Object.assign({ - method, - url, - headers - }, typeof body !== "undefined" ? { - body - } : null, options.request ? { - request: options.request - } : null); -} - -function endpointWithDefaults(defaults, route, options) { - return parse(merge(defaults, route, options)); -} - -function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS = merge(oldDefaults, newDefaults); - const endpoint = endpointWithDefaults.bind(null, DEFAULTS); - return Object.assign(endpoint, { - DEFAULTS, - defaults: withDefaults.bind(null, DEFAULTS), - merge: merge.bind(null, DEFAULTS), - parse - }); -} - -const VERSION = "6.0.12"; - -const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. -// So we use RequestParameters and add method as additional required property. - -const DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "", - previews: [] - } -}; - -const endpoint = withDefaults(null, DEFAULTS); - -exports.endpoint = endpoint; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 70007: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var request = __nccwpck_require__(66255); -var universalUserAgent = __nccwpck_require__(33843); - -const VERSION = "4.8.0"; - -function _buildMessageForResponseErrors(data) { - return `Request failed due to following response errors:\n` + data.errors.map(e => ` - ${e.message}`).join("\n"); -} - -class GraphqlResponseError extends Error { - constructor(request, headers, response) { - super(_buildMessageForResponseErrors(response)); - this.request = request; - this.headers = headers; - this.response = response; - this.name = "GraphqlResponseError"; // Expose the errors and response data in their shorthand properties. - - this.errors = response.errors; - this.data = response.data; // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - } - -} - -const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; -const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; -const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(request, query, options) { - if (options) { - if (typeof query === "string" && "query" in options) { - return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); - } - - for (const key in options) { - if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; - return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); - } - } - - const parsedOptions = typeof query === "string" ? Object.assign({ - query - }, options) : query; - const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS.includes(key)) { - result[key] = parsedOptions[key]; - return result; - } - - if (!result.variables) { - result.variables = {}; - } - - result.variables[key] = parsedOptions[key]; - return result; - }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix - // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 - - const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; - - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); - } - - return request(requestOptions).then(response => { - if (response.data.errors) { - const headers = {}; - - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - - throw new GraphqlResponseError(requestOptions, headers, response.data); - } - - return response.data.data; - }); -} - -function withDefaults(request$1, newDefaults) { - const newRequest = request$1.defaults(newDefaults); - - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; - - return Object.assign(newApi, { - defaults: withDefaults.bind(null, newRequest), - endpoint: request.request.endpoint - }); -} - -const graphql$1 = withDefaults(request.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` - }, - method: "POST", - url: "/graphql" -}); -function withCustomRequest(customRequest) { - return withDefaults(customRequest, { - method: "POST", - url: "/graphql" - }); -} - -exports.GraphqlResponseError = GraphqlResponseError; -exports.graphql = graphql$1; -exports.withCustomRequest = withCustomRequest; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 38082: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const VERSION = "2.21.3"; - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(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; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -/** - * Some “list” response that can be paginated have a different response structure - * - * They have a `total_count` key in the response (search also has `incomplete_results`, - * /installation/repositories also has `repository_selection`), as well as a key with - * the list of the items which name varies from endpoint to endpoint. - * - * Octokit normalizes these responses so that paginated results are always returned following - * the same structure. One challenge is that if the list response has only one page, no Link - * header is provided, so this header alone is not sufficient to check wether a response is - * paginated or not. - * - * We check if a "total_count" key is present in the response data, but also make sure that - * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would - * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref - */ -function normalizePaginatedListResponse(response) { - // endpoints can respond with 204 if repository is empty - if (!response.data) { - return _objectSpread2(_objectSpread2({}, response), {}, { - data: [] - }); - } - - const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); - if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way - // to retrieve the same information. - - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; - - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } - - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } - - response.data.total_count = totalCount; - return response; -} - -function iterator(octokit, route, parameters) { - const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); - const requestMethod = typeof route === "function" ? route : octokit.request; - const method = options.method; - const headers = options.headers; - let url = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url) return { - done: true - }; - - try { - const response = await requestMethod({ - method, - url, - headers - }); - const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: - // '; rel="next", ; rel="last"' - // sets `url` to undefined if "next" URL is not present or `link` header is not set - - url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; - return { - value: normalizedResponse - }; - } catch (error) { - if (error.status !== 409) throw error; - url = ""; - return { - value: { - status: 200, - headers: {}, - data: [] - } - }; - } - } - - }) - }; -} - -function paginate(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = undefined; - } - - return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); -} - -function gather(octokit, results, iterator, mapFn) { - return iterator.next().then(result => { - if (result.done) { - return results; - } - - let earlyExit = false; - - function done() { - earlyExit = true; - } - - results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); - - if (earlyExit) { - return results; - } - - return gather(octokit, results, iterator, mapFn); - }); -} - -const composePaginateRest = Object.assign(paginate, { - iterator -}); - -const paginatingEndpoints = ["GET /app/hook/deliveries", "GET /app/installations", "GET /applications/grants", "GET /authorizations", "GET /enterprises/{enterprise}/actions/permissions/organizations", "GET /enterprises/{enterprise}/actions/runner-groups", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "GET /enterprises/{enterprise}/actions/runners", "GET /enterprises/{enterprise}/audit-log", "GET /enterprises/{enterprise}/secret-scanning/alerts", "GET /enterprises/{enterprise}/settings/billing/advanced-security", "GET /events", "GET /gists", "GET /gists/public", "GET /gists/starred", "GET /gists/{gist_id}/comments", "GET /gists/{gist_id}/commits", "GET /gists/{gist_id}/forks", "GET /installation/repositories", "GET /issues", "GET /licenses", "GET /marketplace_listing/plans", "GET /marketplace_listing/plans/{plan_id}/accounts", "GET /marketplace_listing/stubbed/plans", "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", "GET /networks/{owner}/{repo}/events", "GET /notifications", "GET /organizations", "GET /orgs/{org}/actions/cache/usage-by-repository", "GET /orgs/{org}/actions/permissions/repositories", "GET /orgs/{org}/actions/runner-groups", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "GET /orgs/{org}/actions/runners", "GET /orgs/{org}/actions/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/audit-log", "GET /orgs/{org}/blocks", "GET /orgs/{org}/code-scanning/alerts", "GET /orgs/{org}/codespaces", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/dependabot/secrets", "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", "GET /orgs/{org}/events", "GET /orgs/{org}/external-groups", "GET /orgs/{org}/failed_invitations", "GET /orgs/{org}/hooks", "GET /orgs/{org}/hooks/{hook_id}/deliveries", "GET /orgs/{org}/installations", "GET /orgs/{org}/invitations", "GET /orgs/{org}/invitations/{invitation_id}/teams", "GET /orgs/{org}/issues", "GET /orgs/{org}/members", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/secret-scanning/alerts", "GET /orgs/{org}/settings/billing/advanced-security", "GET /orgs/{org}/team-sync/groups", "GET /orgs/{org}/teams", "GET /orgs/{org}/teams/{team_slug}/discussions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/invitations", "GET /orgs/{org}/teams/{team_slug}/members", "GET /orgs/{org}/teams/{team_slug}/projects", "GET /orgs/{org}/teams/{team_slug}/repos", "GET /orgs/{org}/teams/{team_slug}/teams", "GET /projects/columns/{column_id}/cards", "GET /projects/{project_id}/collaborators", "GET /projects/{project_id}/columns", "GET /repos/{owner}/{repo}/actions/artifacts", "GET /repos/{owner}/{repo}/actions/caches", "GET /repos/{owner}/{repo}/actions/runners", "GET /repos/{owner}/{repo}/actions/runs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "GET /repos/{owner}/{repo}/actions/secrets", "GET /repos/{owner}/{repo}/actions/workflows", "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "GET /repos/{owner}/{repo}/assignees", "GET /repos/{owner}/{repo}/branches", "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "GET /repos/{owner}/{repo}/code-scanning/alerts", "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "GET /repos/{owner}/{repo}/code-scanning/analyses", "GET /repos/{owner}/{repo}/codespaces", "GET /repos/{owner}/{repo}/codespaces/devcontainers", "GET /repos/{owner}/{repo}/codespaces/secrets", "GET /repos/{owner}/{repo}/collaborators", "GET /repos/{owner}/{repo}/comments", "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/commits", "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", "GET /repos/{owner}/{repo}/commits/{ref}/status", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/dependabot/secrets", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/environments", "GET /repos/{owner}/{repo}/events", "GET /repos/{owner}/{repo}/forks", "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", "GET /repos/{owner}/{repo}/hooks", "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "GET /repos/{owner}/{repo}/invitations", "GET /repos/{owner}/{repo}/issues", "GET /repos/{owner}/{repo}/issues/comments", "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/issues/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", "GET /repos/{owner}/{repo}/issues/{issue_number}/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", "GET /repos/{owner}/{repo}/keys", "GET /repos/{owner}/{repo}/labels", "GET /repos/{owner}/{repo}/milestones", "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", "GET /repos/{owner}/{repo}/notifications", "GET /repos/{owner}/{repo}/pages/builds", "GET /repos/{owner}/{repo}/projects", "GET /repos/{owner}/{repo}/pulls", "GET /repos/{owner}/{repo}/pulls/comments", "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "GET /repos/{owner}/{repo}/releases", "GET /repos/{owner}/{repo}/releases/{release_id}/assets", "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repos/{owner}/{repo}/topics", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "GET /search/code", "GET /search/commits", "GET /search/issues", "GET /search/labels", "GET /search/repositories", "GET /search/topics", "GET /search/users", "GET /teams/{team_id}/discussions", "GET /teams/{team_id}/discussions/{discussion_number}/comments", "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /teams/{team_id}/discussions/{discussion_number}/reactions", "GET /teams/{team_id}/invitations", "GET /teams/{team_id}/members", "GET /teams/{team_id}/projects", "GET /teams/{team_id}/repos", "GET /teams/{team_id}/teams", "GET /user/blocks", "GET /user/codespaces", "GET /user/codespaces/secrets", "GET /user/emails", "GET /user/followers", "GET /user/following", "GET /user/gpg_keys", "GET /user/installations", "GET /user/installations/{installation_id}/repositories", "GET /user/issues", "GET /user/keys", "GET /user/marketplace_purchases", "GET /user/marketplace_purchases/stubbed", "GET /user/memberships/orgs", "GET /user/migrations", "GET /user/migrations/{migration_id}/repositories", "GET /user/orgs", "GET /user/packages", "GET /user/packages/{package_type}/{package_name}/versions", "GET /user/public_emails", "GET /user/repos", "GET /user/repository_invitations", "GET /user/starred", "GET /user/subscriptions", "GET /user/teams", "GET /users", "GET /users/{username}/events", "GET /users/{username}/events/orgs/{org}", "GET /users/{username}/events/public", "GET /users/{username}/followers", "GET /users/{username}/following", "GET /users/{username}/gists", "GET /users/{username}/gpg_keys", "GET /users/{username}/keys", "GET /users/{username}/orgs", "GET /users/{username}/packages", "GET /users/{username}/projects", "GET /users/{username}/received_events", "GET /users/{username}/received_events/public", "GET /users/{username}/repos", "GET /users/{username}/starred", "GET /users/{username}/subscriptions"]; - -function isPaginatingEndpoint(arg) { - if (typeof arg === "string") { - return paginatingEndpoints.includes(arg); - } else { - return false; - } -} - -/** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor - */ - -function paginateRest(octokit) { - return { - paginate: Object.assign(paginate.bind(null, octokit), { - iterator: iterator.bind(null, octokit) - }) - }; -} -paginateRest.VERSION = VERSION; - -exports.composePaginateRest = composePaginateRest; -exports.isPaginatingEndpoint = isPaginatingEndpoint; -exports.paginateRest = paginateRest; -exports.paginatingEndpoints = paginatingEndpoints; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 6966: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const VERSION = "1.0.4"; - -/** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor - */ - -function requestLog(octokit) { - octokit.hook.wrap("request", (request, options) => { - octokit.log.debug("request", options); - const start = Date.now(); - const requestOptions = octokit.request.endpoint.parse(options); - const path = requestOptions.url.replace(options.baseUrl, ""); - return request(options).then(response => { - octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); - return response; - }).catch(error => { - octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); - throw error; - }); - }); -} -requestLog.VERSION = VERSION; - -exports.requestLog = requestLog; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 84935: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - - if (enumerableOnly) { - symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - } - - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -const Endpoints = { - actions: { - addCustomLabelsToSelfHostedRunnerForOrg: ["POST /orgs/{org}/actions/runners/{runner_id}/labels"], - addCustomLabelsToSelfHostedRunnerForRepo: ["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], - addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - approveWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"], - cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], - createOrUpdateEnvironmentSecret: ["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], - createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], - createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], - createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], - createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], - createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], - deleteActionsCacheById: ["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"], - deleteActionsCacheByKey: ["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"], - deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - deleteEnvironmentSecret: ["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], - deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], - deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], - deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], - deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], - deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - disableSelectedRepositoryGithubActionsOrganization: ["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"], - disableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"], - downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], - downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], - downloadWorkflowRunAttemptLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"], - downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - enableSelectedRepositoryGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"], - enableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"], - getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], - getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], - getActionsCacheUsageByRepoForOrg: ["GET /orgs/{org}/actions/cache/usage-by-repository"], - getActionsCacheUsageForEnterprise: ["GET /enterprises/{enterprise}/actions/cache/usage"], - getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], - getAllowedActionsOrganization: ["GET /orgs/{org}/actions/permissions/selected-actions"], - getAllowedActionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"], - getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getEnvironmentPublicKey: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"], - getEnvironmentSecret: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], - getGithubActionsDefaultWorkflowPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/workflow"], - getGithubActionsDefaultWorkflowPermissionsOrganization: ["GET /orgs/{org}/actions/permissions/workflow"], - getGithubActionsDefaultWorkflowPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/workflow"], - getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], - getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], - getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], - getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], - getPendingDeploymentsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], - getRepoPermissions: ["GET /repos/{owner}/{repo}/actions/permissions", {}, { - renamed: ["actions", "getGithubActionsPermissionsRepository"] - }], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - getReviewsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"], - getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], - getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], - getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], - getWorkflowAccessToRepository: ["GET /repos/{owner}/{repo}/actions/permissions/access"], - getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], - getWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"], - getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], - getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], - listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], - listEnvironmentSecrets: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets"], - listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], - listJobsForWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"], - listLabelsForSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}/labels"], - listLabelsForSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], - listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], - listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], - listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], - listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], - listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], - listSelectedRepositoriesEnabledGithubActionsOrganization: ["GET /orgs/{org}/actions/permissions/repositories"], - listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], - listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], - listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], - listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], - listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], - reRunJobForWorkflowRun: ["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"], - reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], - reRunWorkflowFailedJobs: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"], - removeAllCustomLabelsFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"], - removeAllCustomLabelsFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], - removeCustomLabelFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"], - removeCustomLabelFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"], - removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - reviewPendingDeploymentsForRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], - setAllowedActionsOrganization: ["PUT /orgs/{org}/actions/permissions/selected-actions"], - setAllowedActionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"], - setCustomLabelsForSelfHostedRunnerForOrg: ["PUT /orgs/{org}/actions/runners/{runner_id}/labels"], - setCustomLabelsForSelfHostedRunnerForRepo: ["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], - setGithubActionsDefaultWorkflowPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/workflow"], - setGithubActionsDefaultWorkflowPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions/workflow"], - setGithubActionsDefaultWorkflowPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/workflow"], - setGithubActionsPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions"], - setGithubActionsPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions"], - setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"], - setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"], - setWorkflowAccessToRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/access"] - }, - activity: { - checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], - deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], - deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], - getFeeds: ["GET /feeds"], - getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], - getThread: ["GET /notifications/threads/{thread_id}"], - getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], - listEventsForAuthenticatedUser: ["GET /users/{username}/events"], - listNotificationsForAuthenticatedUser: ["GET /notifications"], - listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], - listPublicEvents: ["GET /events"], - listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], - listPublicEventsForUser: ["GET /users/{username}/events/public"], - listPublicOrgEvents: ["GET /orgs/{org}/events"], - listReceivedEventsForUser: ["GET /users/{username}/received_events"], - listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], - listRepoEvents: ["GET /repos/{owner}/{repo}/events"], - listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], - listReposStarredByAuthenticatedUser: ["GET /user/starred"], - listReposStarredByUser: ["GET /users/{username}/starred"], - listReposWatchedByUser: ["GET /users/{username}/subscriptions"], - listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], - listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], - listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], - markNotificationsAsRead: ["PUT /notifications"], - markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], - markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], - setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], - setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], - starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], - unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] - }, - apps: { - addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { - renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] - }], - addRepoToInstallationForAuthenticatedUser: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], - checkToken: ["POST /applications/{client_id}/token"], - createFromManifest: ["POST /app-manifests/{code}/conversions"], - createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], - deleteAuthorization: ["DELETE /applications/{client_id}/grant"], - deleteInstallation: ["DELETE /app/installations/{installation_id}"], - deleteToken: ["DELETE /applications/{client_id}/token"], - getAuthenticated: ["GET /app"], - getBySlug: ["GET /apps/{app_slug}"], - getInstallation: ["GET /app/installations/{installation_id}"], - getOrgInstallation: ["GET /orgs/{org}/installation"], - getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], - getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], - getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], - getUserInstallation: ["GET /users/{username}/installation"], - getWebhookConfigForApp: ["GET /app/hook/config"], - getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], - listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], - listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], - listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], - listInstallations: ["GET /app/installations"], - listInstallationsForAuthenticatedUser: ["GET /user/installations"], - listPlans: ["GET /marketplace_listing/plans"], - listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], - listReposAccessibleToInstallation: ["GET /installation/repositories"], - listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], - listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], - listWebhookDeliveries: ["GET /app/hook/deliveries"], - redeliverWebhookDelivery: ["POST /app/hook/deliveries/{delivery_id}/attempts"], - removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { - renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] - }], - removeRepoFromInstallationForAuthenticatedUser: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], - resetToken: ["PATCH /applications/{client_id}/token"], - revokeInstallationAccessToken: ["DELETE /installation/token"], - scopeToken: ["POST /applications/{client_id}/token/scoped"], - suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], - unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"], - updateWebhookConfigForApp: ["PATCH /app/hook/config"] - }, - billing: { - getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], - getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], - getGithubAdvancedSecurityBillingGhe: ["GET /enterprises/{enterprise}/settings/billing/advanced-security"], - getGithubAdvancedSecurityBillingOrg: ["GET /orgs/{org}/settings/billing/advanced-security"], - getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], - getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], - getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], - getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] - }, - checks: { - create: ["POST /repos/{owner}/{repo}/check-runs"], - createSuite: ["POST /repos/{owner}/{repo}/check-suites"], - get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], - getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], - listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"], - listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], - listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"], - listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], - rerequestRun: ["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"], - rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"], - setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences"], - update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] - }, - codeScanning: { - deleteAnalysis: ["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"], - getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { - renamedParameters: { - alert_id: "alert_number" - } - }], - getAnalysis: ["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"], - getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], - listAlertInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"], - listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], - listAlertsInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { - renamed: ["codeScanning", "listAlertInstances"] - }], - listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], - updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], - uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] - }, - codesOfConduct: { - getAllCodesOfConduct: ["GET /codes_of_conduct"], - getConductCode: ["GET /codes_of_conduct/{key}"] - }, - codespaces: { - addRepositoryForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], - codespaceMachinesForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/machines"], - createForAuthenticatedUser: ["POST /user/codespaces"], - createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], - createOrUpdateSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}"], - createWithPrForAuthenticatedUser: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"], - createWithRepoForAuthenticatedUser: ["POST /repos/{owner}/{repo}/codespaces"], - deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], - deleteFromOrganization: ["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"], - deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], - deleteSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}"], - exportForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/exports"], - getExportDetailsForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/exports/{export_id}"], - getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], - getPublicKeyForAuthenticatedUser: ["GET /user/codespaces/secrets/public-key"], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], - getSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}"], - listDevcontainersInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/devcontainers"], - listForAuthenticatedUser: ["GET /user/codespaces"], - listInOrganization: ["GET /orgs/{org}/codespaces", {}, { - renamedParameters: { - org_id: "org" - } - }], - listInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], - listRepositoriesForSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}/repositories"], - listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], - removeRepositoryForSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], - repoMachinesForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/machines"], - setRepositoriesForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories"], - startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], - stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], - stopInOrganization: ["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"], - updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] - }, - dependabot: { - addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}"], - createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], - deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], - deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], - getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], - listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], - listSelectedReposForOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"], - removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], - setSelectedReposForOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"] - }, - dependencyGraph: { - createRepositorySnapshot: ["POST /repos/{owner}/{repo}/dependency-graph/snapshots"], - diffRange: ["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"] - }, - emojis: { - get: ["GET /emojis"] - }, - enterpriseAdmin: { - addCustomLabelsToSelfHostedRunnerForEnterprise: ["POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - disableSelectedOrganizationGithubActionsEnterprise: ["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], - enableSelectedOrganizationGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], - getAllowedActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/selected-actions"], - getGithubActionsPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions"], - getServerStatistics: ["GET /enterprise-installation/{enterprise_or_org}/server-statistics"], - listLabelsForSelfHostedRunnerForEnterprise: ["GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], - removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - removeCustomLabelFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}"], - setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], - setCustomLabelsForSelfHostedRunnerForEnterprise: ["PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], - setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] - }, - gists: { - checkIsStarred: ["GET /gists/{gist_id}/star"], - create: ["POST /gists"], - createComment: ["POST /gists/{gist_id}/comments"], - delete: ["DELETE /gists/{gist_id}"], - deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], - fork: ["POST /gists/{gist_id}/forks"], - get: ["GET /gists/{gist_id}"], - getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], - getRevision: ["GET /gists/{gist_id}/{sha}"], - list: ["GET /gists"], - listComments: ["GET /gists/{gist_id}/comments"], - listCommits: ["GET /gists/{gist_id}/commits"], - listForUser: ["GET /users/{username}/gists"], - listForks: ["GET /gists/{gist_id}/forks"], - listPublic: ["GET /gists/public"], - listStarred: ["GET /gists/starred"], - star: ["PUT /gists/{gist_id}/star"], - unstar: ["DELETE /gists/{gist_id}/star"], - update: ["PATCH /gists/{gist_id}"], - updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] - }, - git: { - createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], - createCommit: ["POST /repos/{owner}/{repo}/git/commits"], - createRef: ["POST /repos/{owner}/{repo}/git/refs"], - createTag: ["POST /repos/{owner}/{repo}/git/tags"], - createTree: ["POST /repos/{owner}/{repo}/git/trees"], - deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], - getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], - getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], - getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], - getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], - getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], - listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], - updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] - }, - gitignore: { - getAllTemplates: ["GET /gitignore/templates"], - getTemplate: ["GET /gitignore/templates/{name}"] - }, - interactions: { - getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], - getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], - getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], - getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits", {}, { - renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] - }], - removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], - removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], - removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits"], - removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits", {}, { - renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] - }], - setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], - setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], - setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], - setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits", {}, { - renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] - }] - }, - issues: { - addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], - addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], - checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], - create: ["POST /repos/{owner}/{repo}/issues"], - createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], - createLabel: ["POST /repos/{owner}/{repo}/labels"], - createMilestone: ["POST /repos/{owner}/{repo}/milestones"], - deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], - deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], - deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], - get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], - getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], - getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], - getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], - getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], - list: ["GET /issues"], - listAssignees: ["GET /repos/{owner}/{repo}/assignees"], - listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], - listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], - listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], - listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], - listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"], - listForAuthenticatedUser: ["GET /user/issues"], - listForOrg: ["GET /orgs/{org}/issues"], - listForRepo: ["GET /repos/{owner}/{repo}/issues"], - listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], - listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], - listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], - listMilestones: ["GET /repos/{owner}/{repo}/milestones"], - lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], - removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], - removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], - removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], - setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], - unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], - update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], - updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], - updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], - updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] - }, - licenses: { - get: ["GET /licenses/{license}"], - getAllCommonlyUsed: ["GET /licenses"], - getForRepo: ["GET /repos/{owner}/{repo}/license"] - }, - markdown: { - render: ["POST /markdown"], - renderRaw: ["POST /markdown/raw", { - headers: { - "content-type": "text/plain; charset=utf-8" - } - }] - }, - meta: { - get: ["GET /meta"], - getOctocat: ["GET /octocat"], - getZen: ["GET /zen"], - root: ["GET /"] - }, - migrations: { - cancelImport: ["DELETE /repos/{owner}/{repo}/import"], - deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive"], - deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive"], - downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive"], - getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive"], - getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], - getImportStatus: ["GET /repos/{owner}/{repo}/import"], - getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], - getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], - getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], - listForAuthenticatedUser: ["GET /user/migrations"], - listForOrg: ["GET /orgs/{org}/migrations"], - listReposForAuthenticatedUser: ["GET /user/migrations/{migration_id}/repositories"], - listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], - listReposForUser: ["GET /user/migrations/{migration_id}/repositories", {}, { - renamed: ["migrations", "listReposForAuthenticatedUser"] - }], - mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], - setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], - startForAuthenticatedUser: ["POST /user/migrations"], - startForOrg: ["POST /orgs/{org}/migrations"], - startImport: ["PUT /repos/{owner}/{repo}/import"], - unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"], - unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"], - updateImport: ["PATCH /repos/{owner}/{repo}/import"] - }, - orgs: { - blockUser: ["PUT /orgs/{org}/blocks/{username}"], - cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], - checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], - checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], - checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], - convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], - createInvitation: ["POST /orgs/{org}/invitations"], - createWebhook: ["POST /orgs/{org}/hooks"], - deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], - get: ["GET /orgs/{org}"], - getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], - getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], - getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], - getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], - getWebhookDelivery: ["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"], - list: ["GET /organizations"], - listAppInstallations: ["GET /orgs/{org}/installations"], - listBlockedUsers: ["GET /orgs/{org}/blocks"], - listCustomRoles: ["GET /organizations/{organization_id}/custom_roles"], - listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], - listForAuthenticatedUser: ["GET /user/orgs"], - listForUser: ["GET /users/{username}/orgs"], - listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], - listMembers: ["GET /orgs/{org}/members"], - listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], - listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], - listPendingInvitations: ["GET /orgs/{org}/invitations"], - listPublicMembers: ["GET /orgs/{org}/public_members"], - listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /orgs/{org}/hooks"], - pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], - removeMember: ["DELETE /orgs/{org}/members/{username}"], - removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], - removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], - removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], - setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], - setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], - unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], - update: ["PATCH /orgs/{org}"], - updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], - updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], - updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] - }, - packages: { - deletePackageForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}"], - deletePackageForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}"], - deletePackageForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}"], - deletePackageVersionForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], - deletePackageVersionForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - deletePackageVersionForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getAllPackageVersionsForAPackageOwnedByAnOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { - renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] - }], - getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions", {}, { - renamed: ["packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"] - }], - getAllPackageVersionsForPackageOwnedByAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions"], - getAllPackageVersionsForPackageOwnedByOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"], - getAllPackageVersionsForPackageOwnedByUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions"], - getPackageForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}"], - getPackageForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}"], - getPackageForUser: ["GET /users/{username}/packages/{package_type}/{package_name}"], - getPackageVersionForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getPackageVersionForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getPackageVersionForUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - listPackagesForAuthenticatedUser: ["GET /user/packages"], - listPackagesForOrganization: ["GET /orgs/{org}/packages"], - listPackagesForUser: ["GET /users/{username}/packages"], - restorePackageForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageVersionForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], - restorePackageVersionForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], - restorePackageVersionForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"] - }, - projects: { - addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], - createCard: ["POST /projects/columns/{column_id}/cards"], - createColumn: ["POST /projects/{project_id}/columns"], - createForAuthenticatedUser: ["POST /user/projects"], - createForOrg: ["POST /orgs/{org}/projects"], - createForRepo: ["POST /repos/{owner}/{repo}/projects"], - delete: ["DELETE /projects/{project_id}"], - deleteCard: ["DELETE /projects/columns/cards/{card_id}"], - deleteColumn: ["DELETE /projects/columns/{column_id}"], - get: ["GET /projects/{project_id}"], - getCard: ["GET /projects/columns/cards/{card_id}"], - getColumn: ["GET /projects/columns/{column_id}"], - getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission"], - listCards: ["GET /projects/columns/{column_id}/cards"], - listCollaborators: ["GET /projects/{project_id}/collaborators"], - listColumns: ["GET /projects/{project_id}/columns"], - listForOrg: ["GET /orgs/{org}/projects"], - listForRepo: ["GET /repos/{owner}/{repo}/projects"], - listForUser: ["GET /users/{username}/projects"], - moveCard: ["POST /projects/columns/cards/{card_id}/moves"], - moveColumn: ["POST /projects/columns/{column_id}/moves"], - removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}"], - update: ["PATCH /projects/{project_id}"], - updateCard: ["PATCH /projects/columns/cards/{card_id}"], - updateColumn: ["PATCH /projects/columns/{column_id}"] - }, - pulls: { - checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - create: ["POST /repos/{owner}/{repo}/pulls"], - createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], - createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], - deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], - get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], - getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - list: ["GET /repos/{owner}/{repo}/pulls"], - listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], - listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], - listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], - listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], - listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], - listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], - update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], - updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"], - updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] - }, - rateLimit: { - get: ["GET /rate_limit"] - }, - reactions: { - createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"], - createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], - createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], - createForRelease: ["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"], - createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], - createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"], - deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"], - deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"], - deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"], - deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"], - deleteForRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"], - deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"], - deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"], - listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"], - listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], - listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], - listForRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"], - listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], - listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"] - }, - repos: { - acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}", {}, { - renamed: ["repos", "acceptInvitationForAuthenticatedUser"] - }], - acceptInvitationForAuthenticatedUser: ["PATCH /user/repository_invitations/{invitation_id}"], - addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], - addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], - checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], - checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts"], - codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], - compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], - compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], - createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], - createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], - createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], - createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], - createDeployKey: ["POST /repos/{owner}/{repo}/keys"], - createDeployment: ["POST /repos/{owner}/{repo}/deployments"], - createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], - createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], - createForAuthenticatedUser: ["POST /user/repos"], - createFork: ["POST /repos/{owner}/{repo}/forks"], - createInOrg: ["POST /orgs/{org}/repos"], - createOrUpdateEnvironment: ["PUT /repos/{owner}/{repo}/environments/{environment_name}"], - createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], - createPagesSite: ["POST /repos/{owner}/{repo}/pages"], - createRelease: ["POST /repos/{owner}/{repo}/releases"], - createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], - createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], - createWebhook: ["POST /repos/{owner}/{repo}/hooks"], - declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}", {}, { - renamed: ["repos", "declineInvitationForAuthenticatedUser"] - }], - declineInvitationForAuthenticatedUser: ["DELETE /user/repository_invitations/{invitation_id}"], - delete: ["DELETE /repos/{owner}/{repo}"], - deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], - deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - deleteAnEnvironment: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}"], - deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], - deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], - deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], - deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], - deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], - deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], - deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], - deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], - deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], - deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], - deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], - deleteTagProtection: ["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"], - deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], - disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes"], - disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"], - disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts"], - downloadArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}", {}, { - renamed: ["repos", "downloadZipballArchive"] - }], - downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], - downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], - enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes"], - enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"], - enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts"], - generateReleaseNotes: ["POST /repos/{owner}/{repo}/releases/generate-notes"], - get: ["GET /repos/{owner}/{repo}"], - getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], - getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], - getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], - getAllTopics: ["GET /repos/{owner}/{repo}/topics"], - getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], - getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], - getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], - getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], - getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], - getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], - getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], - getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], - getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], - getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], - getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], - getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], - getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], - getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], - getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], - getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], - getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], - getEnvironment: ["GET /repos/{owner}/{repo}/environments/{environment_name}"], - getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], - getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], - getPages: ["GET /repos/{owner}/{repo}/pages"], - getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], - getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], - getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], - getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], - getReadme: ["GET /repos/{owner}/{repo}/readme"], - getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], - getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], - getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], - getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], - getStatusChecksProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], - getTeamsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"], - getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], - getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], - getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], - getViews: ["GET /repos/{owner}/{repo}/traffic/views"], - getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], - getWebhookConfigForRepo: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"], - getWebhookDelivery: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"], - listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], - listBranches: ["GET /repos/{owner}/{repo}/branches"], - listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"], - listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], - listCommentsForCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"], - listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], - listCommitStatusesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/statuses"], - listCommits: ["GET /repos/{owner}/{repo}/commits"], - listContributors: ["GET /repos/{owner}/{repo}/contributors"], - listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], - listDeploymentStatuses: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], - listDeployments: ["GET /repos/{owner}/{repo}/deployments"], - listForAuthenticatedUser: ["GET /user/repos"], - listForOrg: ["GET /orgs/{org}/repos"], - listForUser: ["GET /users/{username}/repos"], - listForks: ["GET /repos/{owner}/{repo}/forks"], - listInvitations: ["GET /repos/{owner}/{repo}/invitations"], - listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], - listLanguages: ["GET /repos/{owner}/{repo}/languages"], - listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], - listPublic: ["GET /repositories"], - listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"], - listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], - listReleases: ["GET /repos/{owner}/{repo}/releases"], - listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], - listTags: ["GET /repos/{owner}/{repo}/tags"], - listTeams: ["GET /repos/{owner}/{repo}/teams"], - listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], - merge: ["POST /repos/{owner}/{repo}/merges"], - mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], - pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], - removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - removeCollaborator: ["DELETE /repos/{owner}/{repo}/collaborators/{username}"], - removeStatusCheckContexts: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - removeStatusCheckProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], - removeTeamAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], - renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], - replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], - requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], - setAdminBranchProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - setAppAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - setStatusCheckContexts: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - setTeamAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - setUserAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], - testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], - transfer: ["POST /repos/{owner}/{repo}/transfer"], - update: ["PATCH /repos/{owner}/{repo}"], - updateBranchProtection: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection"], - updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], - updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], - updateInvitation: ["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"], - updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], - updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], - updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { - renamed: ["repos", "updateStatusCheckProtection"] - }], - updateStatusCheckProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], - updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], - updateWebhookConfigForRepo: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"], - uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { - baseUrl: "https://uploads.github.com" - }] - }, - search: { - code: ["GET /search/code"], - commits: ["GET /search/commits"], - issuesAndPullRequests: ["GET /search/issues"], - labels: ["GET /search/labels"], - repos: ["GET /search/repositories"], - topics: ["GET /search/topics"], - users: ["GET /search/users"] - }, - secretScanning: { - getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], - listAlertsForEnterprise: ["GET /enterprises/{enterprise}/secret-scanning/alerts"], - listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], - listLocationsForAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"], - updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] - }, - teams: { - addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], - addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - create: ["POST /orgs/{org}/teams"], - createDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], - createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], - deleteDiscussionCommentInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], - deleteDiscussionInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], - deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], - getByName: ["GET /orgs/{org}/teams/{team_slug}"], - getDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], - getDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], - getMembershipForUserInOrg: ["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"], - list: ["GET /orgs/{org}/teams"], - listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], - listDiscussionCommentsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], - listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], - listForAuthenticatedUser: ["GET /user/teams"], - listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], - listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], - listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], - listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], - removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], - removeProjectInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - removeRepoInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - updateDiscussionCommentInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], - updateDiscussionInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], - updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] - }, - users: { - addEmailForAuthenticated: ["POST /user/emails", {}, { - renamed: ["users", "addEmailForAuthenticatedUser"] - }], - addEmailForAuthenticatedUser: ["POST /user/emails"], - block: ["PUT /user/blocks/{username}"], - checkBlocked: ["GET /user/blocks/{username}"], - checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], - checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], - createGpgKeyForAuthenticated: ["POST /user/gpg_keys", {}, { - renamed: ["users", "createGpgKeyForAuthenticatedUser"] - }], - createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], - createPublicSshKeyForAuthenticated: ["POST /user/keys", {}, { - renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] - }], - createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], - deleteEmailForAuthenticated: ["DELETE /user/emails", {}, { - renamed: ["users", "deleteEmailForAuthenticatedUser"] - }], - deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], - deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}", {}, { - renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] - }], - deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], - deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}", {}, { - renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] - }], - deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], - follow: ["PUT /user/following/{username}"], - getAuthenticated: ["GET /user"], - getByUsername: ["GET /users/{username}"], - getContextForUser: ["GET /users/{username}/hovercard"], - getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}", {}, { - renamed: ["users", "getGpgKeyForAuthenticatedUser"] - }], - getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], - getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}", {}, { - renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] - }], - getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], - list: ["GET /users"], - listBlockedByAuthenticated: ["GET /user/blocks", {}, { - renamed: ["users", "listBlockedByAuthenticatedUser"] - }], - listBlockedByAuthenticatedUser: ["GET /user/blocks"], - listEmailsForAuthenticated: ["GET /user/emails", {}, { - renamed: ["users", "listEmailsForAuthenticatedUser"] - }], - listEmailsForAuthenticatedUser: ["GET /user/emails"], - listFollowedByAuthenticated: ["GET /user/following", {}, { - renamed: ["users", "listFollowedByAuthenticatedUser"] - }], - listFollowedByAuthenticatedUser: ["GET /user/following"], - listFollowersForAuthenticatedUser: ["GET /user/followers"], - listFollowersForUser: ["GET /users/{username}/followers"], - listFollowingForUser: ["GET /users/{username}/following"], - listGpgKeysForAuthenticated: ["GET /user/gpg_keys", {}, { - renamed: ["users", "listGpgKeysForAuthenticatedUser"] - }], - listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], - listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], - listPublicEmailsForAuthenticated: ["GET /user/public_emails", {}, { - renamed: ["users", "listPublicEmailsForAuthenticatedUser"] - }], - listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], - listPublicKeysForUser: ["GET /users/{username}/keys"], - listPublicSshKeysForAuthenticated: ["GET /user/keys", {}, { - renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] - }], - listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], - setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility", {}, { - renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] - }], - setPrimaryEmailVisibilityForAuthenticatedUser: ["PATCH /user/email/visibility"], - unblock: ["DELETE /user/blocks/{username}"], - unfollow: ["DELETE /user/following/{username}"], - updateAuthenticated: ["PATCH /user"] - } -}; - -const VERSION = "5.16.2"; - -function endpointsToMethods(octokit, endpointsMap) { - const newMethods = {}; - - for (const [scope, endpoints] of Object.entries(endpointsMap)) { - for (const [methodName, endpoint] of Object.entries(endpoints)) { - const [route, defaults, decorations] = endpoint; - const [method, url] = route.split(/ /); - const endpointDefaults = Object.assign({ - method, - url - }, defaults); - - if (!newMethods[scope]) { - newMethods[scope] = {}; - } - - const scopeMethods = newMethods[scope]; - - if (decorations) { - scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); - continue; - } - - scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); - } - } - - return newMethods; -} - -function decorate(octokit, scope, methodName, defaults, decorations) { - const requestWithDefaults = octokit.request.defaults(defaults); - /* istanbul ignore next */ - - function withDecorations(...args) { - // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 - let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData` - - if (decorations.mapToData) { - options = Object.assign({}, options, { - data: options[decorations.mapToData], - [decorations.mapToData]: undefined - }); - return requestWithDefaults(options); - } - - if (decorations.renamed) { - const [newScope, newMethodName] = decorations.renamed; - octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); - } - - if (decorations.deprecated) { - octokit.log.warn(decorations.deprecated); - } - - if (decorations.renamedParameters) { - // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 - const options = requestWithDefaults.endpoint.merge(...args); - - for (const [name, alias] of Object.entries(decorations.renamedParameters)) { - if (name in options) { - octokit.log.warn(`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`); - - if (!(alias in options)) { - options[alias] = options[name]; - } - - delete options[name]; - } - } - - return requestWithDefaults(options); - } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 - - - return requestWithDefaults(...args); - } - - return Object.assign(withDecorations, requestWithDefaults); -} - -function restEndpointMethods(octokit) { - const api = endpointsToMethods(octokit, Endpoints); - return { - rest: api - }; -} -restEndpointMethods.VERSION = VERSION; -function legacyRestEndpointMethods(octokit) { - const api = endpointsToMethods(octokit, Endpoints); - return _objectSpread2(_objectSpread2({}, api), {}, { - rest: api - }); -} -legacyRestEndpointMethods.VERSION = VERSION; - -exports.legacyRestEndpointMethods = legacyRestEndpointMethods; -exports.restEndpointMethods = restEndpointMethods; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 33450: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Bottleneck = _interopDefault(__nccwpck_require__(63251)); - -// @ts-ignore -async function errorRequest(octokit, state, error, options) { - if (!error.request || !error.request.request) { - // address https://github.com/octokit/plugin-retry.js/issues/8 - throw error; - } // retry all >= 400 && not doNotRetry - - - if (error.status >= 400 && !state.doNotRetry.includes(error.status)) { - const retries = options.request.retries != null ? options.request.retries : state.retries; - const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2); - throw octokit.retry.retryRequest(error, retries, retryAfter); - } // Maybe eventually there will be more cases here - - - throw error; -} - -// @ts-ignore - -async function wrapRequest(state, request, options) { - const limiter = new Bottleneck(); // @ts-ignore - - limiter.on("failed", function (error, info) { - const maxRetries = ~~error.request.request.retries; - const after = ~~error.request.request.retryAfter; - options.request.retryCount = info.retryCount + 1; - - if (maxRetries > info.retryCount) { - // Returning a number instructs the limiter to retry - // the request after that number of milliseconds have passed - return after * state.retryAfterBaseValue; - } - }); - return limiter.schedule(request, options); -} - -const VERSION = "3.0.9"; -function retry(octokit, octokitOptions) { - const state = Object.assign({ - enabled: true, - retryAfterBaseValue: 1000, - doNotRetry: [400, 401, 403, 404, 422], - retries: 3 - }, octokitOptions.retry); - - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, octokit, state)); - octokit.hook.wrap("request", wrapRequest.bind(null, state)); - } - - return { - retry: { - retryRequest: (error, retries, retryAfter) => { - error.request.request = Object.assign({}, error.request.request, { - retries: retries, - retryAfter: retryAfter - }); - return error; - } - } - }; -} -retry.VERSION = VERSION; - -exports.VERSION = VERSION; -exports.retry = retry; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 66255: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var endpoint = __nccwpck_require__(54471); -var universalUserAgent = __nccwpck_require__(33843); -var isPlainObject = __nccwpck_require__(93407); -var nodeFetch = _interopDefault(__nccwpck_require__(26705)); -var requestError = __nccwpck_require__(54071); - -const VERSION = "5.6.3"; - -function getBufferResponse(response) { - return response.arrayBuffer(); -} - -function fetchWrapper(requestOptions) { - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; - - if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - - let headers = {}; - let status; - let url; - const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; - return fetch(requestOptions.url, Object.assign({ - method: requestOptions.method, - body: requestOptions.body, - headers: requestOptions.headers, - redirect: requestOptions.redirect - }, // `requestOptions.request.agent` type is incompatible - // see https://github.com/octokit/types.ts/pull/264 - requestOptions.request)).then(async response => { - url = response.url; - status = response.status; - - for (const keyAndValue of response.headers) { - headers[keyAndValue[0]] = keyAndValue[1]; - } - - if ("deprecation" in headers) { - const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); - const deprecationLink = matches && matches.pop(); - log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); - } - - if (status === 204 || status === 205) { - return; - } // GitHub API returns 200 for HEAD requests - - - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } - - throw new requestError.RequestError(response.statusText, status, { - response: { - url, - status, - headers, - data: undefined - }, - request: requestOptions - }); - } - - if (status === 304) { - throw new requestError.RequestError("Not modified", status, { - response: { - url, - status, - headers, - data: await getResponseData(response) - }, - request: requestOptions - }); - } - - if (status >= 400) { - const data = await getResponseData(response); - const error = new requestError.RequestError(toErrorMessage(data), status, { - response: { - url, - status, - headers, - data - }, - request: requestOptions - }); - throw error; - } - - return getResponseData(response); - }).then(data => { - return { - status, - url, - headers, - data - }; - }).catch(error => { - if (error instanceof requestError.RequestError) throw error; - throw new requestError.RequestError(error.message, 500, { - request: requestOptions - }); - }); -} - -async function getResponseData(response) { - const contentType = response.headers.get("content-type"); - - if (/application\/json/.test(contentType)) { - return response.json(); - } - - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - - return getBufferResponse(response); -} - -function toErrorMessage(data) { - if (typeof data === "string") return data; // istanbul ignore else - just in case - - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; - } - - return data.message; - } // istanbul ignore next - just in case - - - return `Unknown error: ${JSON.stringify(data)}`; -} - -function withDefaults(oldEndpoint, newDefaults) { - const endpoint = oldEndpoint.defaults(newDefaults); - - const newApi = function (route, parameters) { - const endpointOptions = endpoint.merge(route, parameters); - - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper(endpoint.parse(endpointOptions)); - } - - const request = (route, parameters) => { - return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); - }; - - Object.assign(request, { - endpoint, - defaults: withDefaults.bind(null, endpoint) - }); - return endpointOptions.request.hook(request, endpointOptions); - }; - - return Object.assign(newApi, { - endpoint, - defaults: withDefaults.bind(null, endpoint) - }); -} - -const request = withDefaults(endpoint.endpoint, { - headers: { - "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` - } -}); - -exports.request = request; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 54071: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var deprecation = __nccwpck_require__(14150); -var once = _interopDefault(__nccwpck_require__(55560)); - -const logOnceCode = once(deprecation => console.warn(deprecation)); -const logOnceHeaders = once(deprecation => console.warn(deprecation)); -/** - * Error with extra properties to help with debugging - */ - -class RequestError extends Error { - constructor(message, statusCode, options) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = "HttpError"; - this.status = statusCode; - let headers; - - if ("headers" in options && typeof options.headers !== "undefined") { - headers = options.headers; - } - - if ("response" in options) { - this.response = options.response; - headers = options.response.headers; - } // redact request credentials without mutating original request options - - - const requestCopy = Object.assign({}, options.request); - - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - }); - } - - requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit - // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications - .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended - // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header - .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; // deprecations - - Object.defineProperty(this, "code", { - get() { - logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - } - - }); - Object.defineProperty(this, "headers", { - get() { - logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); - return headers || {}; - } - - }); - } - -} - -exports.RequestError = RequestError; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 29750: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ContextAPI = void 0; -const NoopContextManager_1 = __nccwpck_require__(99522); -const global_utils_1 = __nccwpck_require__(39923); -const diag_1 = __nccwpck_require__(1230); -const API_NAME = 'context'; -const NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager(); -/** - * Singleton object which represents the entry point to the OpenTelemetry Context API - */ -class ContextAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { } - /** Get the singleton instance of the Context API */ - static getInstance() { - if (!this._instance) { - this._instance = new ContextAPI(); - } - return this._instance; - } - /** - * Set the current context manager. - * - * @returns true if the context manager was successfully registered, else false - */ - setGlobalContextManager(contextManager) { - return (0, global_utils_1.registerGlobal)(API_NAME, contextManager, diag_1.DiagAPI.instance()); - } - /** - * Get the currently active context - */ - active() { - return this._getContextManager().active(); - } - /** - * Execute a function with an active context - * - * @param context context to be active during function execution - * @param fn function to execute in a context - * @param thisArg optional receiver to be used for calling fn - * @param args optional arguments forwarded to fn - */ - with(context, fn, thisArg, ...args) { - return this._getContextManager().with(context, fn, thisArg, ...args); - } - /** - * Bind a context to a target function or event emitter - * - * @param context context to bind to the event emitter or function. Defaults to the currently active context - * @param target function or event emitter to bind - */ - bind(context, target) { - return this._getContextManager().bind(context, target); - } - _getContextManager() { - return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_CONTEXT_MANAGER; - } - /** Disable and remove the global context manager */ - disable() { - this._getContextManager().disable(); - (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); - } -} -exports.ContextAPI = ContextAPI; -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 1230: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagAPI = void 0; -const ComponentLogger_1 = __nccwpck_require__(60104); -const logLevelLogger_1 = __nccwpck_require__(83514); -const types_1 = __nccwpck_require__(2573); -const global_utils_1 = __nccwpck_require__(39923); -const API_NAME = 'diag'; -/** - * Singleton object which represents the entry point to the OpenTelemetry internal - * diagnostic API - */ -class DiagAPI { - /** - * Private internal constructor - * @private - */ - constructor() { - function _logProxy(funcName) { - return function (...args) { - const logger = (0, global_utils_1.getGlobal)('diag'); - // shortcut if logger not set - if (!logger) - return; - return logger[funcName](...args); - }; - } - // Using self local variable for minification purposes as 'this' cannot be minified - const self = this; - // DiagAPI specific functions - const setLogger = (logger, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => { - var _a, _b, _c; - if (logger === self) { - // There isn't much we can do here. - // Logging to the console might break the user application. - // Try to log to self. If a logger was previously registered it will receive the log. - const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'); - self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); - return false; - } - if (typeof optionsOrLogLevel === 'number') { - optionsOrLogLevel = { - logLevel: optionsOrLogLevel, - }; - } - const oldLogger = (0, global_utils_1.getGlobal)('diag'); - const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : types_1.DiagLogLevel.INFO, logger); - // There already is an logger registered. We'll let it know before overwriting it. - if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { - const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : ''; - oldLogger.warn(`Current logger will be overwritten from ${stack}`); - newLogger.warn(`Current logger will overwrite one already registered from ${stack}`); - } - return (0, global_utils_1.registerGlobal)('diag', newLogger, self, true); - }; - self.setLogger = setLogger; - self.disable = () => { - (0, global_utils_1.unregisterGlobal)(API_NAME, self); - }; - self.createComponentLogger = (options) => { - return new ComponentLogger_1.DiagComponentLogger(options); - }; - self.verbose = _logProxy('verbose'); - self.debug = _logProxy('debug'); - self.info = _logProxy('info'); - self.warn = _logProxy('warn'); - self.error = _logProxy('error'); - } - /** Get the singleton instance of the DiagAPI API */ - static instance() { - if (!this._instance) { - this._instance = new DiagAPI(); - } - return this._instance; - } -} -exports.DiagAPI = DiagAPI; -//# sourceMappingURL=diag.js.map - -/***/ }), - -/***/ 18692: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MetricsAPI = void 0; -const NoopMeterProvider_1 = __nccwpck_require__(12896); -const global_utils_1 = __nccwpck_require__(39923); -const diag_1 = __nccwpck_require__(1230); -const API_NAME = 'metrics'; -/** - * Singleton object which represents the entry point to the OpenTelemetry Metrics API - */ -class MetricsAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { } - /** Get the singleton instance of the Metrics API */ - static getInstance() { - if (!this._instance) { - this._instance = new MetricsAPI(); - } - return this._instance; - } - /** - * Set the current global meter provider. - * Returns true if the meter provider was successfully registered, else false. - */ - setGlobalMeterProvider(provider) { - return (0, global_utils_1.registerGlobal)(API_NAME, provider, diag_1.DiagAPI.instance()); - } - /** - * Returns the global meter provider. - */ - getMeterProvider() { - return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER; - } - /** - * Returns a meter from the global meter provider. - */ - getMeter(name, version, options) { - return this.getMeterProvider().getMeter(name, version, options); - } - /** Remove the global meter provider */ - disable() { - (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); - } -} -exports.MetricsAPI = MetricsAPI; -//# sourceMappingURL=metrics.js.map - -/***/ }), - -/***/ 7: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PropagationAPI = void 0; -const global_utils_1 = __nccwpck_require__(39923); -const NoopTextMapPropagator_1 = __nccwpck_require__(54353); -const TextMapPropagator_1 = __nccwpck_require__(77865); -const context_helpers_1 = __nccwpck_require__(30052); -const utils_1 = __nccwpck_require__(38558); -const diag_1 = __nccwpck_require__(1230); -const API_NAME = 'propagation'; -const NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator(); -/** - * Singleton object which represents the entry point to the OpenTelemetry Propagation API - */ -class PropagationAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this.createBaggage = utils_1.createBaggage; - this.getBaggage = context_helpers_1.getBaggage; - this.getActiveBaggage = context_helpers_1.getActiveBaggage; - this.setBaggage = context_helpers_1.setBaggage; - this.deleteBaggage = context_helpers_1.deleteBaggage; - } - /** Get the singleton instance of the Propagator API */ - static getInstance() { - if (!this._instance) { - this._instance = new PropagationAPI(); - } - return this._instance; - } - /** - * Set the current propagator. - * - * @returns true if the propagator was successfully registered, else false - */ - setGlobalPropagator(propagator) { - return (0, global_utils_1.registerGlobal)(API_NAME, propagator, diag_1.DiagAPI.instance()); - } - /** - * Inject context into a carrier to be propagated inter-process - * - * @param context Context carrying tracing data to inject - * @param carrier carrier to inject context into - * @param setter Function used to set values on the carrier - */ - inject(context, carrier, setter = TextMapPropagator_1.defaultTextMapSetter) { - return this._getGlobalPropagator().inject(context, carrier, setter); - } - /** - * Extract context from a carrier - * - * @param context Context which the newly created context will inherit from - * @param carrier Carrier to extract context from - * @param getter Function used to extract keys from a carrier - */ - extract(context, carrier, getter = TextMapPropagator_1.defaultTextMapGetter) { - return this._getGlobalPropagator().extract(context, carrier, getter); - } - /** - * Return a list of all fields which may be used by the propagator. - */ - fields() { - return this._getGlobalPropagator().fields(); - } - /** Remove the global propagator */ - disable() { - (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); - } - _getGlobalPropagator() { - return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR; - } -} -exports.PropagationAPI = PropagationAPI; -//# sourceMappingURL=propagation.js.map - -/***/ }), - -/***/ 24508: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceAPI = void 0; -const global_utils_1 = __nccwpck_require__(39923); -const ProxyTracerProvider_1 = __nccwpck_require__(20312); -const spancontext_utils_1 = __nccwpck_require__(60639); -const context_utils_1 = __nccwpck_require__(52771); -const diag_1 = __nccwpck_require__(1230); -const API_NAME = 'trace'; -/** - * Singleton object which represents the entry point to the OpenTelemetry Tracing API - */ -class TraceAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); - this.wrapSpanContext = spancontext_utils_1.wrapSpanContext; - this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; - this.deleteSpan = context_utils_1.deleteSpan; - this.getSpan = context_utils_1.getSpan; - this.getActiveSpan = context_utils_1.getActiveSpan; - this.getSpanContext = context_utils_1.getSpanContext; - this.setSpan = context_utils_1.setSpan; - this.setSpanContext = context_utils_1.setSpanContext; - } - /** Get the singleton instance of the Trace API */ - static getInstance() { - if (!this._instance) { - this._instance = new TraceAPI(); - } - return this._instance; - } - /** - * Set the current global tracer. - * - * @returns true if the tracer provider was successfully registered, else false - */ - setGlobalTracerProvider(provider) { - const success = (0, global_utils_1.registerGlobal)(API_NAME, this._proxyTracerProvider, diag_1.DiagAPI.instance()); - if (success) { - this._proxyTracerProvider.setDelegate(provider); - } - return success; - } - /** - * Returns the global tracer provider. - */ - getTracerProvider() { - return (0, global_utils_1.getGlobal)(API_NAME) || this._proxyTracerProvider; - } - /** - * Returns a tracer from the global tracer provider. - */ - getTracer(name, version) { - return this.getTracerProvider().getTracer(name, version); - } - /** Remove the global tracer provider */ - disable() { - (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); - this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); - } -} -exports.TraceAPI = TraceAPI; -//# sourceMappingURL=trace.js.map - -/***/ }), - -/***/ 30052: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = void 0; -const context_1 = __nccwpck_require__(29750); -const context_2 = __nccwpck_require__(37977); -/** - * Baggage key - */ -const BAGGAGE_KEY = (0, context_2.createContextKey)('OpenTelemetry Baggage Key'); -/** - * Retrieve the current baggage from the given context - * - * @param {Context} Context that manage all context values - * @returns {Baggage} Extracted baggage from the context - */ -function getBaggage(context) { - return context.getValue(BAGGAGE_KEY) || undefined; -} -exports.getBaggage = getBaggage; -/** - * Retrieve the current baggage from the active/current context - * - * @returns {Baggage} Extracted baggage from the context - */ -function getActiveBaggage() { - return getBaggage(context_1.ContextAPI.getInstance().active()); -} -exports.getActiveBaggage = getActiveBaggage; -/** - * Store a baggage in the given context - * - * @param {Context} Context that manage all context values - * @param {Baggage} baggage that will be set in the actual context - */ -function setBaggage(context, baggage) { - return context.setValue(BAGGAGE_KEY, baggage); -} -exports.setBaggage = setBaggage; -/** - * Delete the baggage stored in the given context - * - * @param {Context} Context that manage all context values - */ -function deleteBaggage(context) { - return context.deleteValue(BAGGAGE_KEY); -} -exports.deleteBaggage = deleteBaggage; -//# sourceMappingURL=context-helpers.js.map - -/***/ }), - -/***/ 33274: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BaggageImpl = void 0; -class BaggageImpl { - constructor(entries) { - this._entries = entries ? new Map(entries) : new Map(); - } - getEntry(key) { - const entry = this._entries.get(key); - if (!entry) { - return undefined; - } - return Object.assign({}, entry); - } - getAllEntries() { - return Array.from(this._entries.entries()).map(([k, v]) => [k, v]); - } - setEntry(key, entry) { - const newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.set(key, entry); - return newBaggage; - } - removeEntry(key) { - const newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.delete(key); - return newBaggage; - } - removeEntries(...keys) { - const newBaggage = new BaggageImpl(this._entries); - for (const key of keys) { - newBaggage._entries.delete(key); - } - return newBaggage; - } - clear() { - return new BaggageImpl(); - } -} -exports.BaggageImpl = BaggageImpl; -//# sourceMappingURL=baggage-impl.js.map - -/***/ }), - -/***/ 3997: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageEntryMetadataSymbol = void 0; -/** - * Symbol used to make BaggageEntryMetadata an opaque type - */ -exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); -//# sourceMappingURL=symbol.js.map - -/***/ }), - -/***/ 38558: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; -const diag_1 = __nccwpck_require__(1230); -const baggage_impl_1 = __nccwpck_require__(33274); -const symbol_1 = __nccwpck_require__(3997); -const diag = diag_1.DiagAPI.instance(); -/** - * Create a new Baggage with optional entries - * - * @param entries An array of baggage entries the new baggage should contain - */ -function createBaggage(entries = {}) { - return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries))); -} -exports.createBaggage = createBaggage; -/** - * Create a serializable BaggageEntryMetadata object from a string. - * - * @param str string metadata. Format is currently not defined by the spec and has no special meaning. - * - */ -function baggageEntryMetadataFromString(str) { - if (typeof str !== 'string') { - diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`); - str = ''; - } - return { - __TYPE__: symbol_1.baggageEntryMetadataSymbol, - toString() { - return str; - }, - }; -} -exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 70244: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.context = void 0; -// Split module-level variable definition into separate files to allow -// tree-shaking on each api instance. -const context_1 = __nccwpck_require__(29750); -/** Entrypoint for context API */ -exports.context = context_1.ContextAPI.getInstance(); -//# sourceMappingURL=context-api.js.map - -/***/ }), - -/***/ 99522: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopContextManager = void 0; -const context_1 = __nccwpck_require__(37977); -class NoopContextManager { - active() { - return context_1.ROOT_CONTEXT; - } - with(_context, fn, thisArg, ...args) { - return fn.call(thisArg, ...args); - } - bind(_context, target) { - return target; - } - enable() { - return this; - } - disable() { - return this; - } -} -exports.NoopContextManager = NoopContextManager; -//# sourceMappingURL=NoopContextManager.js.map - -/***/ }), - -/***/ 37977: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ROOT_CONTEXT = exports.createContextKey = void 0; -/** Get a key to uniquely identify a context value */ -function createContextKey(description) { - // The specification states that for the same input, multiple calls should - // return different keys. Due to the nature of the JS dependency management - // system, this creates problems where multiple versions of some package - // could hold different keys for the same property. - // - // Therefore, we use Symbol.for which returns the same key for the same input. - return Symbol.for(description); -} -exports.createContextKey = createContextKey; -class BaseContext { - /** - * Construct a new context which inherits values from an optional parent context. - * - * @param parentContext a context from which to inherit values - */ - constructor(parentContext) { - // for minification - const self = this; - self._currentContext = parentContext ? new Map(parentContext) : new Map(); - self.getValue = (key) => self._currentContext.get(key); - self.setValue = (key, value) => { - const context = new BaseContext(self._currentContext); - context._currentContext.set(key, value); - return context; - }; - self.deleteValue = (key) => { - const context = new BaseContext(self._currentContext); - context._currentContext.delete(key); - return context; - }; - } -} -/** The root context is used as the default parent context when there is no active context */ -exports.ROOT_CONTEXT = new BaseContext(); -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 11414: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.diag = void 0; -// Split module-level variable definition into separate files to allow -// tree-shaking on each api instance. -const diag_1 = __nccwpck_require__(1230); -/** - * Entrypoint for Diag API. - * Defines Diagnostic handler used for internal diagnostic logging operations. - * The default provides a Noop DiagLogger implementation which may be changed via the - * diag.setLogger(logger: DiagLogger) function. - */ -exports.diag = diag_1.DiagAPI.instance(); -//# sourceMappingURL=diag-api.js.map - -/***/ }), - -/***/ 60104: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagComponentLogger = void 0; -const global_utils_1 = __nccwpck_require__(39923); -/** - * Component Logger which is meant to be used as part of any component which - * will add automatically additional namespace in front of the log message. - * It will then forward all message to global diag logger - * @example - * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' }); - * cLogger.debug('test'); - * // @opentelemetry/instrumentation-http test - */ -class DiagComponentLogger { - constructor(props) { - this._namespace = props.namespace || 'DiagComponentLogger'; - } - debug(...args) { - return logProxy('debug', this._namespace, args); - } - error(...args) { - return logProxy('error', this._namespace, args); - } - info(...args) { - return logProxy('info', this._namespace, args); - } - warn(...args) { - return logProxy('warn', this._namespace, args); - } - verbose(...args) { - return logProxy('verbose', this._namespace, args); - } -} -exports.DiagComponentLogger = DiagComponentLogger; -function logProxy(funcName, namespace, args) { - const logger = (0, global_utils_1.getGlobal)('diag'); - // shortcut if logger not set - if (!logger) { - return; - } - args.unshift(namespace); - return logger[funcName](...args); -} -//# sourceMappingURL=ComponentLogger.js.map - -/***/ }), - -/***/ 66769: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagConsoleLogger = void 0; -const consoleMap = [ - { n: 'error', c: 'error' }, - { n: 'warn', c: 'warn' }, - { n: 'info', c: 'info' }, - { n: 'debug', c: 'debug' }, - { n: 'verbose', c: 'trace' }, -]; -/** - * A simple Immutable Console based diagnostic logger which will output any messages to the Console. - * If you want to limit the amount of logging to a specific level or lower use the - * {@link createLogLevelDiagLogger} - */ -class DiagConsoleLogger { - constructor() { - function _consoleFunc(funcName) { - return function (...args) { - if (console) { - // Some environments only expose the console when the F12 developer console is open - // eslint-disable-next-line no-console - let theFunc = console[funcName]; - if (typeof theFunc !== 'function') { - // Not all environments support all functions - // eslint-disable-next-line no-console - theFunc = console.log; - } - // One last final check - if (typeof theFunc === 'function') { - return theFunc.apply(console, args); - } - } - }; - } - for (let i = 0; i < consoleMap.length; i++) { - this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); - } - } -} -exports.DiagConsoleLogger = DiagConsoleLogger; -//# sourceMappingURL=consoleLogger.js.map - -/***/ }), - -/***/ 83514: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createLogLevelDiagLogger = void 0; -const types_1 = __nccwpck_require__(2573); -function createLogLevelDiagLogger(maxLevel, logger) { - if (maxLevel < types_1.DiagLogLevel.NONE) { - maxLevel = types_1.DiagLogLevel.NONE; - } - else if (maxLevel > types_1.DiagLogLevel.ALL) { - maxLevel = types_1.DiagLogLevel.ALL; - } - // In case the logger is null or undefined - logger = logger || {}; - function _filterFunc(funcName, theLevel) { - const theFunc = logger[funcName]; - if (typeof theFunc === 'function' && maxLevel >= theLevel) { - return theFunc.bind(logger); - } - return function () { }; - } - return { - error: _filterFunc('error', types_1.DiagLogLevel.ERROR), - warn: _filterFunc('warn', types_1.DiagLogLevel.WARN), - info: _filterFunc('info', types_1.DiagLogLevel.INFO), - debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG), - verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE), - }; -} -exports.createLogLevelDiagLogger = createLogLevelDiagLogger; -//# sourceMappingURL=logLevelLogger.js.map - -/***/ }), - -/***/ 2573: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagLogLevel = void 0; -/** - * Defines the available internal logging levels for the diagnostic logger, the numeric values - * of the levels are defined to match the original values from the initial LogLevel to avoid - * compatibility/migration issues for any implementation that assume the numeric ordering. - */ -var DiagLogLevel; -(function (DiagLogLevel) { - /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ - DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; - /** Identifies an error scenario */ - DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; - /** Identifies a warning scenario */ - DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; - /** General informational log message */ - DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; - /** General debug log message */ - DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; - /** - * Detailed trace level logging should only be used for development, should only be set - * in a development environment. - */ - DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; - /** Used to set the logging level to include all logging */ - DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; -})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 63914: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = void 0; -var utils_1 = __nccwpck_require__(38558); -Object.defineProperty(exports, "baggageEntryMetadataFromString", ({ enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } })); -// Context APIs -var context_1 = __nccwpck_require__(37977); -Object.defineProperty(exports, "createContextKey", ({ enumerable: true, get: function () { return context_1.createContextKey; } })); -Object.defineProperty(exports, "ROOT_CONTEXT", ({ enumerable: true, get: function () { return context_1.ROOT_CONTEXT; } })); -// Diag APIs -var consoleLogger_1 = __nccwpck_require__(66769); -Object.defineProperty(exports, "DiagConsoleLogger", ({ enumerable: true, get: function () { return consoleLogger_1.DiagConsoleLogger; } })); -var types_1 = __nccwpck_require__(2573); -Object.defineProperty(exports, "DiagLogLevel", ({ enumerable: true, get: function () { return types_1.DiagLogLevel; } })); -// Metrics APIs -var NoopMeter_1 = __nccwpck_require__(7017); -Object.defineProperty(exports, "createNoopMeter", ({ enumerable: true, get: function () { return NoopMeter_1.createNoopMeter; } })); -var Metric_1 = __nccwpck_require__(73814); -Object.defineProperty(exports, "ValueType", ({ enumerable: true, get: function () { return Metric_1.ValueType; } })); -// Propagation APIs -var TextMapPropagator_1 = __nccwpck_require__(77865); -Object.defineProperty(exports, "defaultTextMapGetter", ({ enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapGetter; } })); -Object.defineProperty(exports, "defaultTextMapSetter", ({ enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapSetter; } })); -var ProxyTracer_1 = __nccwpck_require__(4833); -Object.defineProperty(exports, "ProxyTracer", ({ enumerable: true, get: function () { return ProxyTracer_1.ProxyTracer; } })); -var ProxyTracerProvider_1 = __nccwpck_require__(20312); -Object.defineProperty(exports, "ProxyTracerProvider", ({ enumerable: true, get: function () { return ProxyTracerProvider_1.ProxyTracerProvider; } })); -var SamplingResult_1 = __nccwpck_require__(80434); -Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return SamplingResult_1.SamplingDecision; } })); -var span_kind_1 = __nccwpck_require__(42347); -Object.defineProperty(exports, "SpanKind", ({ enumerable: true, get: function () { return span_kind_1.SpanKind; } })); -var status_1 = __nccwpck_require__(61524); -Object.defineProperty(exports, "SpanStatusCode", ({ enumerable: true, get: function () { return status_1.SpanStatusCode; } })); -var trace_flags_1 = __nccwpck_require__(47221); -Object.defineProperty(exports, "TraceFlags", ({ enumerable: true, get: function () { return trace_flags_1.TraceFlags; } })); -var utils_2 = __nccwpck_require__(90969); -Object.defineProperty(exports, "createTraceState", ({ enumerable: true, get: function () { return utils_2.createTraceState; } })); -var spancontext_utils_1 = __nccwpck_require__(60639); -Object.defineProperty(exports, "isSpanContextValid", ({ enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } })); -Object.defineProperty(exports, "isValidTraceId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } })); -Object.defineProperty(exports, "isValidSpanId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } })); -var invalid_span_constants_1 = __nccwpck_require__(57088); -Object.defineProperty(exports, "INVALID_SPANID", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPANID; } })); -Object.defineProperty(exports, "INVALID_TRACEID", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_TRACEID; } })); -Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPAN_CONTEXT; } })); -// Split module-level variable definition into separate files to allow -// tree-shaking on each api instance. -const context_api_1 = __nccwpck_require__(70244); -Object.defineProperty(exports, "context", ({ enumerable: true, get: function () { return context_api_1.context; } })); -const diag_api_1 = __nccwpck_require__(11414); -Object.defineProperty(exports, "diag", ({ enumerable: true, get: function () { return diag_api_1.diag; } })); -const metrics_api_1 = __nccwpck_require__(2053); -Object.defineProperty(exports, "metrics", ({ enumerable: true, get: function () { return metrics_api_1.metrics; } })); -const propagation_api_1 = __nccwpck_require__(16389); -Object.defineProperty(exports, "propagation", ({ enumerable: true, get: function () { return propagation_api_1.propagation; } })); -const trace_api_1 = __nccwpck_require__(56542); -Object.defineProperty(exports, "trace", ({ enumerable: true, get: function () { return trace_api_1.trace; } })); -// Default export. -exports["default"] = { - context: context_api_1.context, - diag: diag_api_1.diag, - metrics: metrics_api_1.metrics, - propagation: propagation_api_1.propagation, - trace: trace_api_1.trace, -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 39923: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; -const platform_1 = __nccwpck_require__(69932); -const version_1 = __nccwpck_require__(59390); -const semver_1 = __nccwpck_require__(45088); -const major = version_1.VERSION.split('.')[0]; -const GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); -const _global = platform_1._globalThis; -function registerGlobal(type, instance, diag, allowOverride = false) { - var _a; - const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { - version: version_1.VERSION, - }); - if (!allowOverride && api[type]) { - // already registered an API of this type - const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); - diag.error(err.stack || err.message); - return false; - } - if (api.version !== version_1.VERSION) { - // All registered APIs must be of the same version exactly - const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${version_1.VERSION}`); - diag.error(err.stack || err.message); - return false; - } - api[type] = instance; - diag.debug(`@opentelemetry/api: Registered a global for ${type} v${version_1.VERSION}.`); - return true; -} -exports.registerGlobal = registerGlobal; -function getGlobal(type) { - var _a, _b; - const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; - if (!globalVersion || !(0, semver_1.isCompatible)(globalVersion)) { - return; - } - return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; -} -exports.getGlobal = getGlobal; -function unregisterGlobal(type, diag) { - diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${version_1.VERSION}.`); - const api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; - if (api) { - delete api[type]; - } -} -exports.unregisterGlobal = unregisterGlobal; -//# sourceMappingURL=global-utils.js.map - -/***/ }), - -/***/ 45088: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isCompatible = exports._makeCompatibilityCheck = void 0; -const version_1 = __nccwpck_require__(59390); -const re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; -/** - * Create a function to test an API version to see if it is compatible with the provided ownVersion. - * - * The returned function has the following semantics: - * - Exact match is always compatible - * - Major versions must match exactly - * - 1.x package cannot use global 2.x package - * - 2.x package cannot use global 1.x package - * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API - * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects - * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 - * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor - * - Patch and build tag differences are not considered at this time - * - * @param ownVersion version which should be checked against - */ -function _makeCompatibilityCheck(ownVersion) { - const acceptedVersions = new Set([ownVersion]); - const rejectedVersions = new Set(); - const myVersionMatch = ownVersion.match(re); - if (!myVersionMatch) { - // we cannot guarantee compatibility so we always return noop - return () => false; - } - const ownVersionParsed = { - major: +myVersionMatch[1], - minor: +myVersionMatch[2], - patch: +myVersionMatch[3], - prerelease: myVersionMatch[4], - }; - // if ownVersion has a prerelease tag, versions must match exactly - if (ownVersionParsed.prerelease != null) { - return function isExactmatch(globalVersion) { - return globalVersion === ownVersion; - }; - } - function _reject(v) { - rejectedVersions.add(v); - return false; - } - function _accept(v) { - acceptedVersions.add(v); - return true; - } - return function isCompatible(globalVersion) { - if (acceptedVersions.has(globalVersion)) { - return true; - } - if (rejectedVersions.has(globalVersion)) { - return false; - } - const globalVersionMatch = globalVersion.match(re); - if (!globalVersionMatch) { - // cannot parse other version - // we cannot guarantee compatibility so we always noop - return _reject(globalVersion); - } - const globalVersionParsed = { - major: +globalVersionMatch[1], - minor: +globalVersionMatch[2], - patch: +globalVersionMatch[3], - prerelease: globalVersionMatch[4], - }; - // if globalVersion has a prerelease tag, versions must match exactly - if (globalVersionParsed.prerelease != null) { - return _reject(globalVersion); - } - // major versions must match - if (ownVersionParsed.major !== globalVersionParsed.major) { - return _reject(globalVersion); - } - if (ownVersionParsed.major === 0) { - if (ownVersionParsed.minor === globalVersionParsed.minor && - ownVersionParsed.patch <= globalVersionParsed.patch) { - return _accept(globalVersion); - } - return _reject(globalVersion); - } - if (ownVersionParsed.minor <= globalVersionParsed.minor) { - return _accept(globalVersion); - } - return _reject(globalVersion); - }; -} -exports._makeCompatibilityCheck = _makeCompatibilityCheck; -/** - * Test an API version to see if it is compatible with this API. - * - * - Exact match is always compatible - * - Major versions must match exactly - * - 1.x package cannot use global 2.x package - * - 2.x package cannot use global 1.x package - * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API - * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects - * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 - * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor - * - Patch and build tag differences are not considered at this time - * - * @param version version of the API requesting an instance of the global API - */ -exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); -//# sourceMappingURL=semver.js.map - -/***/ }), - -/***/ 2053: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.metrics = void 0; -// Split module-level variable definition into separate files to allow -// tree-shaking on each api instance. -const metrics_1 = __nccwpck_require__(18692); -/** Entrypoint for metrics API */ -exports.metrics = metrics_1.MetricsAPI.getInstance(); -//# sourceMappingURL=metrics-api.js.map - -/***/ }), - -/***/ 73814: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ValueType = void 0; -/** The Type of value. It describes how the data is reported. */ -var ValueType; -(function (ValueType) { - ValueType[ValueType["INT"] = 0] = "INT"; - ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE"; -})(ValueType = exports.ValueType || (exports.ValueType = {})); -//# sourceMappingURL=Metric.js.map - -/***/ }), - -/***/ 7017: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0; -/** - * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses - * constant NoopMetrics for all of its methods. - */ -class NoopMeter { - constructor() { } - /** - * @see {@link Meter.createHistogram} - */ - createHistogram(_name, _options) { - return exports.NOOP_HISTOGRAM_METRIC; - } - /** - * @see {@link Meter.createCounter} - */ - createCounter(_name, _options) { - return exports.NOOP_COUNTER_METRIC; - } - /** - * @see {@link Meter.createUpDownCounter} - */ - createUpDownCounter(_name, _options) { - return exports.NOOP_UP_DOWN_COUNTER_METRIC; - } - /** - * @see {@link Meter.createObservableGauge} - */ - createObservableGauge(_name, _options) { - return exports.NOOP_OBSERVABLE_GAUGE_METRIC; - } - /** - * @see {@link Meter.createObservableCounter} - */ - createObservableCounter(_name, _options) { - return exports.NOOP_OBSERVABLE_COUNTER_METRIC; - } - /** - * @see {@link Meter.createObservableUpDownCounter} - */ - createObservableUpDownCounter(_name, _options) { - return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; - } - /** - * @see {@link Meter.addBatchObservableCallback} - */ - addBatchObservableCallback(_callback, _observables) { } - /** - * @see {@link Meter.removeBatchObservableCallback} - */ - removeBatchObservableCallback(_callback) { } -} -exports.NoopMeter = NoopMeter; -class NoopMetric { -} -exports.NoopMetric = NoopMetric; -class NoopCounterMetric extends NoopMetric { - add(_value, _attributes) { } -} -exports.NoopCounterMetric = NoopCounterMetric; -class NoopUpDownCounterMetric extends NoopMetric { - add(_value, _attributes) { } -} -exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric; -class NoopHistogramMetric extends NoopMetric { - record(_value, _attributes) { } -} -exports.NoopHistogramMetric = NoopHistogramMetric; -class NoopObservableMetric { - addCallback(_callback) { } - removeCallback(_callback) { } -} -exports.NoopObservableMetric = NoopObservableMetric; -class NoopObservableCounterMetric extends NoopObservableMetric { -} -exports.NoopObservableCounterMetric = NoopObservableCounterMetric; -class NoopObservableGaugeMetric extends NoopObservableMetric { -} -exports.NoopObservableGaugeMetric = NoopObservableGaugeMetric; -class NoopObservableUpDownCounterMetric extends NoopObservableMetric { -} -exports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric; -exports.NOOP_METER = new NoopMeter(); -// Synchronous instruments -exports.NOOP_COUNTER_METRIC = new NoopCounterMetric(); -exports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric(); -exports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric(); -// Asynchronous instruments -exports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric(); -exports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric(); -exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric(); -/** - * Create a no-op Meter - */ -function createNoopMeter() { - return exports.NOOP_METER; -} -exports.createNoopMeter = createNoopMeter; -//# sourceMappingURL=NoopMeter.js.map - -/***/ }), - -/***/ 12896: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; -const NoopMeter_1 = __nccwpck_require__(7017); -/** - * An implementation of the {@link MeterProvider} which returns an impotent Meter - * for all calls to `getMeter` - */ -class NoopMeterProvider { - getMeter(_name, _version, _options) { - return NoopMeter_1.NOOP_METER; - } -} -exports.NoopMeterProvider = NoopMeterProvider; -exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); -//# sourceMappingURL=NoopMeterProvider.js.map - -/***/ }), - -/***/ 69932: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(92921), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 10114: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 92921: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(10114), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 16389: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.propagation = void 0; -// Split module-level variable definition into separate files to allow -// tree-shaking on each api instance. -const propagation_1 = __nccwpck_require__(7); -/** Entrypoint for propagation API */ -exports.propagation = propagation_1.PropagationAPI.getInstance(); -//# sourceMappingURL=propagation-api.js.map - -/***/ }), - -/***/ 54353: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopTextMapPropagator = void 0; -/** - * No-op implementations of {@link TextMapPropagator}. - */ -class NoopTextMapPropagator { - /** Noop inject function does nothing */ - inject(_context, _carrier) { } - /** Noop extract function does nothing and returns the input context */ - extract(context, _carrier) { - return context; - } - fields() { - return []; - } -} -exports.NoopTextMapPropagator = NoopTextMapPropagator; -//# sourceMappingURL=NoopTextMapPropagator.js.map - -/***/ }), - -/***/ 77865: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0; -exports.defaultTextMapGetter = { - get(carrier, key) { - if (carrier == null) { - return undefined; - } - return carrier[key]; - }, - keys(carrier) { - if (carrier == null) { - return []; - } - return Object.keys(carrier); - }, -}; -exports.defaultTextMapSetter = { - set(carrier, key, value) { - if (carrier == null) { - return; - } - carrier[key] = value; - }, -}; -//# sourceMappingURL=TextMapPropagator.js.map - -/***/ }), - -/***/ 56542: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.trace = void 0; -// Split module-level variable definition into separate files to allow -// tree-shaking on each api instance. -const trace_1 = __nccwpck_require__(24508); -/** Entrypoint for trace API */ -exports.trace = trace_1.TraceAPI.getInstance(); -//# sourceMappingURL=trace-api.js.map - -/***/ }), - -/***/ 47168: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NonRecordingSpan = void 0; -const invalid_span_constants_1 = __nccwpck_require__(57088); -/** - * The NonRecordingSpan is the default {@link Span} that is used when no Span - * implementation is available. All operations are no-op including context - * propagation. - */ -class NonRecordingSpan { - constructor(_spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) { - this._spanContext = _spanContext; - } - // Returns a SpanContext. - spanContext() { - return this._spanContext; - } - // By default does nothing - setAttribute(_key, _value) { - return this; - } - // By default does nothing - setAttributes(_attributes) { - return this; - } - // By default does nothing - addEvent(_name, _attributes) { - return this; - } - // By default does nothing - setStatus(_status) { - return this; - } - // By default does nothing - updateName(_name) { - return this; - } - // By default does nothing - end(_endTime) { } - // isRecording always returns false for NonRecordingSpan. - isRecording() { - return false; - } - // By default does nothing - recordException(_exception, _time) { } -} -exports.NonRecordingSpan = NonRecordingSpan; -//# sourceMappingURL=NonRecordingSpan.js.map - -/***/ }), - -/***/ 9051: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopTracer = void 0; -const context_1 = __nccwpck_require__(29750); -const context_utils_1 = __nccwpck_require__(52771); -const NonRecordingSpan_1 = __nccwpck_require__(47168); -const spancontext_utils_1 = __nccwpck_require__(60639); -const contextApi = context_1.ContextAPI.getInstance(); -/** - * No-op implementations of {@link Tracer}. - */ -class NoopTracer { - // startSpan starts a noop span. - startSpan(name, options, context = contextApi.active()) { - const root = Boolean(options === null || options === void 0 ? void 0 : options.root); - if (root) { - return new NonRecordingSpan_1.NonRecordingSpan(); - } - const parentFromContext = context && (0, context_utils_1.getSpanContext)(context); - if (isSpanContext(parentFromContext) && - (0, spancontext_utils_1.isSpanContextValid)(parentFromContext)) { - return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext); - } - else { - return new NonRecordingSpan_1.NonRecordingSpan(); - } - } - startActiveSpan(name, arg2, arg3, arg4) { - let opts; - let ctx; - let fn; - if (arguments.length < 2) { - return; - } - else if (arguments.length === 2) { - fn = arg2; - } - else if (arguments.length === 3) { - opts = arg2; - fn = arg3; - } - else { - opts = arg2; - ctx = arg3; - fn = arg4; - } - const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active(); - const span = this.startSpan(name, opts, parentContext); - const contextWithSpanSet = (0, context_utils_1.setSpan)(parentContext, span); - return contextApi.with(contextWithSpanSet, fn, undefined, span); - } -} -exports.NoopTracer = NoopTracer; -function isSpanContext(spanContext) { - return (typeof spanContext === 'object' && - typeof spanContext['spanId'] === 'string' && - typeof spanContext['traceId'] === 'string' && - typeof spanContext['traceFlags'] === 'number'); -} -//# sourceMappingURL=NoopTracer.js.map - -/***/ }), - -/***/ 94602: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopTracerProvider = void 0; -const NoopTracer_1 = __nccwpck_require__(9051); -/** - * An implementation of the {@link TracerProvider} which returns an impotent - * Tracer for all calls to `getTracer`. - * - * All operations are no-op. - */ -class NoopTracerProvider { - getTracer(_name, _version, _options) { - return new NoopTracer_1.NoopTracer(); - } -} -exports.NoopTracerProvider = NoopTracerProvider; -//# sourceMappingURL=NoopTracerProvider.js.map - -/***/ }), - -/***/ 4833: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyTracer = void 0; -const NoopTracer_1 = __nccwpck_require__(9051); -const NOOP_TRACER = new NoopTracer_1.NoopTracer(); -/** - * Proxy tracer provided by the proxy tracer provider - */ -class ProxyTracer { - constructor(_provider, name, version, options) { - this._provider = _provider; - this.name = name; - this.version = version; - this.options = options; - } - startSpan(name, options, context) { - return this._getTracer().startSpan(name, options, context); - } - startActiveSpan(_name, _options, _context, _fn) { - const tracer = this._getTracer(); - return Reflect.apply(tracer.startActiveSpan, tracer, arguments); - } - /** - * Try to get a tracer from the proxy tracer provider. - * If the proxy tracer provider has no delegate, return a noop tracer. - */ - _getTracer() { - if (this._delegate) { - return this._delegate; - } - const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); - if (!tracer) { - return NOOP_TRACER; - } - this._delegate = tracer; - return this._delegate; - } -} -exports.ProxyTracer = ProxyTracer; -//# sourceMappingURL=ProxyTracer.js.map - -/***/ }), - -/***/ 20312: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyTracerProvider = void 0; -const ProxyTracer_1 = __nccwpck_require__(4833); -const NoopTracerProvider_1 = __nccwpck_require__(94602); -const NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider(); -/** - * Tracer provider which provides {@link ProxyTracer}s. - * - * Before a delegate is set, tracers provided are NoOp. - * When a delegate is set, traces are provided from the delegate. - * When a delegate is set after tracers have already been provided, - * all tracers already provided will use the provided delegate implementation. - */ -class ProxyTracerProvider { - /** - * Get a {@link ProxyTracer} - */ - getTracer(name, version, options) { - var _a; - return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options)); - } - getDelegate() { - var _a; - return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER; - } - /** - * Set the delegate tracer provider - */ - setDelegate(delegate) { - this._delegate = delegate; - } - getDelegateTracer(name, version, options) { - var _a; - return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options); - } -} -exports.ProxyTracerProvider = ProxyTracerProvider; -//# sourceMappingURL=ProxyTracerProvider.js.map - -/***/ }), - -/***/ 80434: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SamplingDecision = void 0; -/** - * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead. - * A sampling decision that determines how a {@link Span} will be recorded - * and collected. - */ -var SamplingDecision; -(function (SamplingDecision) { - /** - * `Span.isRecording() === false`, span will not be recorded and all events - * and attributes will be dropped. - */ - SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; - /** - * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} - * MUST NOT be set. - */ - SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; - /** - * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} - * MUST be set. - */ - SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; -})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); -//# sourceMappingURL=SamplingResult.js.map - -/***/ }), - -/***/ 52771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getActiveSpan = exports.getSpan = void 0; -const context_1 = __nccwpck_require__(37977); -const NonRecordingSpan_1 = __nccwpck_require__(47168); -const context_2 = __nccwpck_require__(29750); -/** - * span key - */ -const SPAN_KEY = (0, context_1.createContextKey)('OpenTelemetry Context Key SPAN'); -/** - * Return the span if one exists - * - * @param context context to get span from - */ -function getSpan(context) { - return context.getValue(SPAN_KEY) || undefined; -} -exports.getSpan = getSpan; -/** - * Gets the span from the current context, if one exists. - */ -function getActiveSpan() { - return getSpan(context_2.ContextAPI.getInstance().active()); -} -exports.getActiveSpan = getActiveSpan; -/** - * Set the span on a context - * - * @param context context to use as parent - * @param span span to set active - */ -function setSpan(context, span) { - return context.setValue(SPAN_KEY, span); -} -exports.setSpan = setSpan; -/** - * Remove current span stored in the context - * - * @param context context to delete span from - */ -function deleteSpan(context) { - return context.deleteValue(SPAN_KEY); -} -exports.deleteSpan = deleteSpan; -/** - * Wrap span context in a NoopSpan and set as span in a new - * context - * - * @param context context to set active span on - * @param spanContext span context to be wrapped - */ -function setSpanContext(context, spanContext) { - return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext)); -} -exports.setSpanContext = setSpanContext; -/** - * Get the span context of the span if it exists. - * - * @param context context to get values from - */ -function getSpanContext(context) { - var _a; - return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext(); -} -exports.getSpanContext = getSpanContext; -//# sourceMappingURL=context-utils.js.map - -/***/ }), - -/***/ 77903: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceStateImpl = void 0; -const tracestate_validators_1 = __nccwpck_require__(95618); -const MAX_TRACE_STATE_ITEMS = 32; -const MAX_TRACE_STATE_LEN = 512; -const LIST_MEMBERS_SEPARATOR = ','; -const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; -/** - * TraceState must be a class and not a simple object type because of the spec - * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). - * - * Here is the list of allowed mutations: - * - New key-value pair should be added into the beginning of the list - * - The value of any key can be updated. Modified keys MUST be moved to the - * beginning of the list. - */ -class TraceStateImpl { - constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); - } - set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - const traceState = this._clone(); - if (traceState._internalState.has(key)) { - traceState._internalState.delete(key); - } - traceState._internalState.set(key, value); - return traceState; - } - unset(key) { - const traceState = this._clone(); - traceState._internalState.delete(key); - return traceState; - } - get(key) { - return this._internalState.get(key); - } - serialize() { - return this._keys() - .reduce((agg, key) => { - agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); - return agg; - }, []) - .join(LIST_MEMBERS_SEPARATOR); - } - _parse(rawTraceState) { - if (rawTraceState.length > MAX_TRACE_STATE_LEN) - return; - this._internalState = rawTraceState - .split(LIST_MEMBERS_SEPARATOR) - .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); - if (i !== -1) { - const key = listMember.slice(0, i); - const value = listMember.slice(i + 1, part.length); - if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) { - agg.set(key, value); - } - else { - // TODO: Consider to add warning log - } - } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .slice(0, MAX_TRACE_STATE_ITEMS)); - } - } - _keys() { - return Array.from(this._internalState.keys()).reverse(); - } - _clone() { - const traceState = new TraceStateImpl(); - traceState._internalState = new Map(this._internalState); - return traceState; - } -} -exports.TraceStateImpl = TraceStateImpl; -//# sourceMappingURL=tracestate-impl.js.map - -/***/ }), - -/***/ 95618: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateValue = exports.validateKey = void 0; -const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; -const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; -const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; -const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); -const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; -const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; -/** - * Key is opaque string up to 256 characters printable. It MUST begin with a - * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, - * underscores _, dashes -, asterisks *, and forward slashes /. - * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the - * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. - * see https://www.w3.org/TR/trace-context/#key - */ -function validateKey(key) { - return VALID_KEY_REGEX.test(key); -} -exports.validateKey = validateKey; -/** - * Value is opaque string up to 256 characters printable ASCII RFC0020 - * characters (i.e., the range 0x20 to 0x7E) except comma , and =. - */ -function validateValue(value) { - return (VALID_VALUE_BASE_REGEX.test(value) && - !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); -} -exports.validateValue = validateValue; -//# sourceMappingURL=tracestate-validators.js.map - -/***/ }), - -/***/ 90969: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createTraceState = void 0; -const tracestate_impl_1 = __nccwpck_require__(77903); -function createTraceState(rawTraceState) { - return new tracestate_impl_1.TraceStateImpl(rawTraceState); -} -exports.createTraceState = createTraceState; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 57088: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; -const trace_flags_1 = __nccwpck_require__(47221); -exports.INVALID_SPANID = '0000000000000000'; -exports.INVALID_TRACEID = '00000000000000000000000000000000'; -exports.INVALID_SPAN_CONTEXT = { - traceId: exports.INVALID_TRACEID, - spanId: exports.INVALID_SPANID, - traceFlags: trace_flags_1.TraceFlags.NONE, -}; -//# sourceMappingURL=invalid-span-constants.js.map - -/***/ }), - -/***/ 42347: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanKind = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var SpanKind; -(function (SpanKind) { - /** Default value. Indicates that the span is used internally. */ - SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; -})(SpanKind = exports.SpanKind || (exports.SpanKind = {})); -//# sourceMappingURL=span_kind.js.map - -/***/ }), - -/***/ 60639: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const invalid_span_constants_1 = __nccwpck_require__(57088); -const NonRecordingSpan_1 = __nccwpck_require__(47168); -const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; -const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; -function isValidTraceId(traceId) { - return VALID_TRACEID_REGEX.test(traceId) && traceId !== invalid_span_constants_1.INVALID_TRACEID; -} -exports.isValidTraceId = isValidTraceId; -function isValidSpanId(spanId) { - return VALID_SPANID_REGEX.test(spanId) && spanId !== invalid_span_constants_1.INVALID_SPANID; -} -exports.isValidSpanId = isValidSpanId; -/** - * Returns true if this {@link SpanContext} is valid. - * @return true if this {@link SpanContext} is valid. - */ -function isSpanContextValid(spanContext) { - return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)); -} -exports.isSpanContextValid = isSpanContextValid; -/** - * Wrap the given {@link SpanContext} in a new non-recording {@link Span} - * - * @param spanContext span context to be wrapped - * @returns a new non-recording {@link Span} with the provided context - */ -function wrapSpanContext(spanContext) { - return new NonRecordingSpan_1.NonRecordingSpan(spanContext); -} -exports.wrapSpanContext = wrapSpanContext; -//# sourceMappingURL=spancontext-utils.js.map - -/***/ }), - -/***/ 61524: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanStatusCode = void 0; -/** - * An enumeration of status codes. - */ -var SpanStatusCode; -(function (SpanStatusCode) { - /** - * The default status. - */ - SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; - /** - * The operation contains an error. - */ - SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; -})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); -//# sourceMappingURL=status.js.map - -/***/ }), - -/***/ 47221: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceFlags = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var TraceFlags; -(function (TraceFlags) { - /** Represents no flag set. */ - TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; - /** Bit to represent whether trace is sampled in trace flags. */ - TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; -})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); -//# sourceMappingURL=trace_flags.js.map - -/***/ }), - -/***/ 59390: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.7.0'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 37889: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ClientStreamingCall = void 0; -/** - * A client streaming RPC call. This means that the clients sends 0, 1, or - * more messages to the server, and the server replies with exactly one - * message. - */ -class ClientStreamingCall { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; - } - /** - * Instead of awaiting the response status and trailers, you can - * just as well await this call itself to receive the server outcome. - * Note that it may still be valid to send more request messages. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter(this, void 0, void 0, function* () { - let [headers, response, status, trailers] = yield Promise.all([this.headers, this.response, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - headers, - response, - status, - trailers - }; - }); - } -} -exports.ClientStreamingCall = ClientStreamingCall; - - -/***/ }), - -/***/ 71409: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Deferred = exports.DeferredState = void 0; -var DeferredState; -(function (DeferredState) { - DeferredState[DeferredState["PENDING"] = 0] = "PENDING"; - DeferredState[DeferredState["REJECTED"] = 1] = "REJECTED"; - DeferredState[DeferredState["RESOLVED"] = 2] = "RESOLVED"; -})(DeferredState = exports.DeferredState || (exports.DeferredState = {})); -/** - * A deferred promise. This is a "controller" for a promise, which lets you - * pass a promise around and reject or resolve it from the outside. - * - * Warning: This class is to be used with care. Using it can make code very - * difficult to read. It is intended for use in library code that exposes - * promises, not for regular business logic. - */ -class Deferred { - /** - * @param preventUnhandledRejectionWarning - prevents the warning - * "Unhandled Promise rejection" by adding a noop rejection handler. - * Working with calls returned from the runtime-rpc package in an - * async function usually means awaiting one call property after - * the other. This means that the "status" is not being awaited when - * an earlier await for the "headers" is rejected. This causes the - * "unhandled promise reject" warning. A more correct behaviour for - * calls might be to become aware whether at least one of the - * promises is handled and swallow the rejection warning for the - * others. - */ - constructor(preventUnhandledRejectionWarning = true) { - this._state = DeferredState.PENDING; - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - if (preventUnhandledRejectionWarning) { - this._promise.catch(_ => { }); - } - } - /** - * Get the current state of the promise. - */ - get state() { - return this._state; - } - /** - * Get the deferred promise. - */ - get promise() { - return this._promise; - } - /** - * Resolve the promise. Throws if the promise is already resolved or rejected. - */ - resolve(value) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot resolve ${DeferredState[this.state].toLowerCase()}`); - this._resolve(value); - this._state = DeferredState.RESOLVED; - } - /** - * Reject the promise. Throws if the promise is already resolved or rejected. - */ - reject(reason) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot reject ${DeferredState[this.state].toLowerCase()}`); - this._reject(reason); - this._state = DeferredState.REJECTED; - } - /** - * Resolve the promise. Ignore if not pending. - */ - resolvePending(val) { - if (this._state === DeferredState.PENDING) - this.resolve(val); - } - /** - * Reject the promise. Ignore if not pending. - */ - rejectPending(reason) { - if (this._state === DeferredState.PENDING) - this.reject(reason); - } -} -exports.Deferred = Deferred; - - -/***/ }), - -/***/ 36826: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DuplexStreamingCall = void 0; -/** - * A duplex streaming RPC call. This means that the clients sends an - * arbitrary amount of messages to the server, while at the same time, - * the server sends an arbitrary amount of messages to the client. - */ -class DuplexStreamingCall { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; - } - /** - * Instead of awaiting the response status and trailers, you can - * just as well await this call itself to receive the server outcome. - * Note that it may still be valid to send more request messages. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter(this, void 0, void 0, function* () { - let [headers, status, trailers] = yield Promise.all([this.headers, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - headers, - status, - trailers, - }; - }); - } -} -exports.DuplexStreamingCall = DuplexStreamingCall; - - -/***/ }), - -/***/ 44420: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Public API of the rpc runtime. -// Note: we do not use `export * from ...` to help tree shakers, -// webpack verbose output hints that this should be useful -Object.defineProperty(exports, "__esModule", ({ value: true })); -var service_type_1 = __nccwpck_require__(56892); -Object.defineProperty(exports, "ServiceType", ({ enumerable: true, get: function () { return service_type_1.ServiceType; } })); -var reflection_info_1 = __nccwpck_require__(62496); -Object.defineProperty(exports, "readMethodOptions", ({ enumerable: true, get: function () { return reflection_info_1.readMethodOptions; } })); -Object.defineProperty(exports, "readMethodOption", ({ enumerable: true, get: function () { return reflection_info_1.readMethodOption; } })); -Object.defineProperty(exports, "readServiceOption", ({ enumerable: true, get: function () { return reflection_info_1.readServiceOption; } })); -var rpc_error_1 = __nccwpck_require__(78636); -Object.defineProperty(exports, "RpcError", ({ enumerable: true, get: function () { return rpc_error_1.RpcError; } })); -var rpc_options_1 = __nccwpck_require__(28576); -Object.defineProperty(exports, "mergeRpcOptions", ({ enumerable: true, get: function () { return rpc_options_1.mergeRpcOptions; } })); -var rpc_output_stream_1 = __nccwpck_require__(72726); -Object.defineProperty(exports, "RpcOutputStreamController", ({ enumerable: true, get: function () { return rpc_output_stream_1.RpcOutputStreamController; } })); -var test_transport_1 = __nccwpck_require__(79122); -Object.defineProperty(exports, "TestTransport", ({ enumerable: true, get: function () { return test_transport_1.TestTransport; } })); -var deferred_1 = __nccwpck_require__(71409); -Object.defineProperty(exports, "Deferred", ({ enumerable: true, get: function () { return deferred_1.Deferred; } })); -Object.defineProperty(exports, "DeferredState", ({ enumerable: true, get: function () { return deferred_1.DeferredState; } })); -var duplex_streaming_call_1 = __nccwpck_require__(36826); -Object.defineProperty(exports, "DuplexStreamingCall", ({ enumerable: true, get: function () { return duplex_streaming_call_1.DuplexStreamingCall; } })); -var client_streaming_call_1 = __nccwpck_require__(37889); -Object.defineProperty(exports, "ClientStreamingCall", ({ enumerable: true, get: function () { return client_streaming_call_1.ClientStreamingCall; } })); -var server_streaming_call_1 = __nccwpck_require__(46173); -Object.defineProperty(exports, "ServerStreamingCall", ({ enumerable: true, get: function () { return server_streaming_call_1.ServerStreamingCall; } })); -var unary_call_1 = __nccwpck_require__(29288); -Object.defineProperty(exports, "UnaryCall", ({ enumerable: true, get: function () { return unary_call_1.UnaryCall; } })); -var rpc_interceptor_1 = __nccwpck_require__(52849); -Object.defineProperty(exports, "stackIntercept", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackIntercept; } })); -Object.defineProperty(exports, "stackDuplexStreamingInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackDuplexStreamingInterceptors; } })); -Object.defineProperty(exports, "stackClientStreamingInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackClientStreamingInterceptors; } })); -Object.defineProperty(exports, "stackServerStreamingInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackServerStreamingInterceptors; } })); -Object.defineProperty(exports, "stackUnaryInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackUnaryInterceptors; } })); -var server_call_context_1 = __nccwpck_require__(43352); -Object.defineProperty(exports, "ServerCallContextController", ({ enumerable: true, get: function () { return server_call_context_1.ServerCallContextController; } })); - - -/***/ }), - -/***/ 62496: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readServiceOption = exports.readMethodOption = exports.readMethodOptions = exports.normalizeMethodInfo = void 0; -const runtime_1 = __nccwpck_require__(68886); -/** - * Turns PartialMethodInfo into MethodInfo. - */ -function normalizeMethodInfo(method, service) { - var _a, _b, _c; - let m = method; - m.service = service; - m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : runtime_1.lowerCamelCase(m.name); - // noinspection PointlessBooleanExpressionJS - m.serverStreaming = !!m.serverStreaming; - // noinspection PointlessBooleanExpressionJS - m.clientStreaming = !!m.clientStreaming; - m.options = (_b = m.options) !== null && _b !== void 0 ? _b : {}; - m.idempotency = (_c = m.idempotency) !== null && _c !== void 0 ? _c : undefined; - return m; -} -exports.normalizeMethodInfo = normalizeMethodInfo; -/** - * Read custom method options from a generated service client. - * - * @deprecated use readMethodOption() - */ -function readMethodOptions(service, methodName, extensionName, extensionType) { - var _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : undefined; -} -exports.readMethodOptions = readMethodOptions; -function readMethodOption(service, methodName, extensionName, extensionType) { - var _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - if (!options) { - return undefined; - } - const optionVal = options[extensionName]; - if (optionVal === undefined) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; -} -exports.readMethodOption = readMethodOption; -function readServiceOption(service, extensionName, extensionType) { - const options = service.options; - if (!options) { - return undefined; - } - const optionVal = options[extensionName]; - if (optionVal === undefined) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; -} -exports.readServiceOption = readServiceOption; - - -/***/ }), - -/***/ 78636: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RpcError = void 0; -/** - * An error that occurred while calling a RPC method. - */ -class RpcError extends Error { - constructor(message, code = 'UNKNOWN', meta) { - super(message); - this.name = 'RpcError'; - // see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#example - Object.setPrototypeOf(this, new.target.prototype); - this.code = code; - this.meta = meta !== null && meta !== void 0 ? meta : {}; - } - toString() { - const l = [this.name + ': ' + this.message]; - if (this.code) { - l.push(''); - l.push('Code: ' + this.code); - } - if (this.serviceName && this.methodName) { - l.push('Method: ' + this.serviceName + '/' + this.methodName); - } - let m = Object.entries(this.meta); - if (m.length) { - l.push(''); - l.push('Meta:'); - for (let [k, v] of m) { - l.push(` ${k}: ${v}`); - } - } - return l.join('\n'); - } -} -exports.RpcError = RpcError; - - -/***/ }), - -/***/ 52849: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.stackDuplexStreamingInterceptors = exports.stackClientStreamingInterceptors = exports.stackServerStreamingInterceptors = exports.stackUnaryInterceptors = exports.stackIntercept = void 0; -const runtime_1 = __nccwpck_require__(68886); -/** - * Creates a "stack" of of all interceptors specified in the given `RpcOptions`. - * Used by generated client implementations. - * @internal - */ -function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter(i => i.interceptUnary).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); - } - return tail(method, input, options); - } - if (kind == "serverStreaming") { - let tail = (mtd, inp, opt) => transport.serverStreaming(mtd, inp, opt); - for (const curr of ((_b = options.interceptors) !== null && _b !== void 0 ? _b : []).filter(i => i.interceptServerStreaming).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptServerStreaming(next, mtd, inp, opt); - } - return tail(method, input, options); - } - if (kind == "clientStreaming") { - let tail = (mtd, opt) => transport.clientStreaming(mtd, opt); - for (const curr of ((_c = options.interceptors) !== null && _c !== void 0 ? _c : []).filter(i => i.interceptClientStreaming).reverse()) { - const next = tail; - tail = (mtd, opt) => curr.interceptClientStreaming(next, mtd, opt); - } - return tail(method, options); - } - if (kind == "duplex") { - let tail = (mtd, opt) => transport.duplex(mtd, opt); - for (const curr of ((_d = options.interceptors) !== null && _d !== void 0 ? _d : []).filter(i => i.interceptDuplex).reverse()) { - const next = tail; - tail = (mtd, opt) => curr.interceptDuplex(next, mtd, opt); - } - return tail(method, options); - } - runtime_1.assertNever(kind); -} -exports.stackIntercept = stackIntercept; -/** - * @deprecated replaced by `stackIntercept()`, still here to support older generated code - */ -function stackUnaryInterceptors(transport, method, input, options) { - return stackIntercept("unary", transport, method, options, input); -} -exports.stackUnaryInterceptors = stackUnaryInterceptors; -/** - * @deprecated replaced by `stackIntercept()`, still here to support older generated code - */ -function stackServerStreamingInterceptors(transport, method, input, options) { - return stackIntercept("serverStreaming", transport, method, options, input); -} -exports.stackServerStreamingInterceptors = stackServerStreamingInterceptors; -/** - * @deprecated replaced by `stackIntercept()`, still here to support older generated code - */ -function stackClientStreamingInterceptors(transport, method, options) { - return stackIntercept("clientStreaming", transport, method, options); -} -exports.stackClientStreamingInterceptors = stackClientStreamingInterceptors; -/** - * @deprecated replaced by `stackIntercept()`, still here to support older generated code - */ -function stackDuplexStreamingInterceptors(transport, method, options) { - return stackIntercept("duplex", transport, method, options); -} -exports.stackDuplexStreamingInterceptors = stackDuplexStreamingInterceptors; - - -/***/ }), - -/***/ 28576: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.mergeRpcOptions = void 0; -const runtime_1 = __nccwpck_require__(68886); -/** - * Merges custom RPC options with defaults. Returns a new instance and keeps - * the "defaults" and the "options" unmodified. - * - * Merges `RpcMetadata` "meta", overwriting values from "defaults" with - * values from "options". Does not append values to existing entries. - * - * Merges "jsonOptions", including "jsonOptions.typeRegistry", by creating - * a new array that contains types from "options.jsonOptions.typeRegistry" - * first, then types from "defaults.jsonOptions.typeRegistry". - * - * Merges "binaryOptions". - * - * Merges "interceptors" by creating a new array that contains interceptors - * from "defaults" first, then interceptors from "options". - * - * Works with objects that extend `RpcOptions`, but only if the added - * properties are of type Date, primitive like string, boolean, or Array - * of primitives. If you have other property types, you have to merge them - * yourself. - */ -function mergeRpcOptions(defaults, options) { - if (!options) - return defaults; - let o = {}; - copy(defaults, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); - break; - } - } - return o; -} -exports.mergeRpcOptions = mergeRpcOptions; -function copy(a, into) { - if (!a) - return; - let c = into; - for (let [k, v] of Object.entries(a)) { - if (v instanceof Date) - c[k] = new Date(v.getTime()); - else if (Array.isArray(v)) - c[k] = v.concat(); - else - c[k] = v; - } -} - - -/***/ }), - -/***/ 72726: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RpcOutputStreamController = void 0; -const deferred_1 = __nccwpck_require__(71409); -const runtime_1 = __nccwpck_require__(68886); -/** - * A `RpcOutputStream` that you control. - */ -class RpcOutputStreamController { - constructor() { - this._lis = { - nxt: [], - msg: [], - err: [], - cmp: [], - }; - this._closed = false; - } - // --- RpcOutputStream callback API - onNext(callback) { - return this.addLis(callback, this._lis.nxt); - } - onMessage(callback) { - return this.addLis(callback, this._lis.msg); - } - onError(callback) { - return this.addLis(callback, this._lis.err); - } - onComplete(callback) { - return this.addLis(callback, this._lis.cmp); - } - addLis(callback, list) { - list.push(callback); - return () => { - let i = list.indexOf(callback); - if (i >= 0) - list.splice(i, 1); - }; - } - // remove all listeners - clearLis() { - for (let l of Object.values(this._lis)) - l.splice(0, l.length); - } - // --- Controller API - /** - * Is this stream already closed by a completion or error? - */ - get closed() { - return this._closed !== false; - } - /** - * Emit message, close with error, or close successfully, but only one - * at a time. - * Can be used to wrap a stream by using the other stream's `onNext`. - */ - notifyNext(message, error, complete) { - runtime_1.assert((message ? 1 : 0) + (error ? 1 : 0) + (complete ? 1 : 0) <= 1, 'only one emission at a time'); - if (message) - this.notifyMessage(message); - if (error) - this.notifyError(error); - if (complete) - this.notifyComplete(); - } - /** - * Emits a new message. Throws if stream is closed. - * - * Triggers onNext and onMessage callbacks. - */ - notifyMessage(message) { - runtime_1.assert(!this.closed, 'stream is closed'); - this.pushIt({ value: message, done: false }); - this._lis.msg.forEach(l => l(message)); - this._lis.nxt.forEach(l => l(message, undefined, false)); - } - /** - * Closes the stream with an error. Throws if stream is closed. - * - * Triggers onNext and onError callbacks. - */ - notifyError(error) { - runtime_1.assert(!this.closed, 'stream is closed'); - this._closed = error; - this.pushIt(error); - this._lis.err.forEach(l => l(error)); - this._lis.nxt.forEach(l => l(undefined, error, false)); - this.clearLis(); - } - /** - * Closes the stream successfully. Throws if stream is closed. - * - * Triggers onNext and onComplete callbacks. - */ - notifyComplete() { - runtime_1.assert(!this.closed, 'stream is closed'); - this._closed = true; - this.pushIt({ value: null, done: true }); - this._lis.cmp.forEach(l => l()); - this._lis.nxt.forEach(l => l(undefined, undefined, true)); - this.clearLis(); - } - /** - * Creates an async iterator (that can be used with `for await {...}`) - * to consume the stream. - * - * Some things to note: - * - If an error occurs, the `for await` will throw it. - * - If an error occurred before the `for await` was started, `for await` - * will re-throw it. - * - If the stream is already complete, the `for await` will be empty. - * - If your `for await` consumes slower than the stream produces, - * for example because you are relaying messages in a slow operation, - * messages are queued. - */ - [Symbol.asyncIterator]() { - // init the iterator state, enabling pushIt() - if (!this._itState) { - this._itState = { q: [] }; - } - // if we are closed, we are definitely not receiving any more messages. - // but we can't let the iterator get stuck. we want to either: - // a) finish the new iterator immediately, because we are completed - // b) reject the new iterator, because we errored - if (this._closed === true) - this.pushIt({ value: null, done: true }); - else if (this._closed !== false) - this.pushIt(this._closed); - // the async iterator - return { - next: () => { - let state = this._itState; - runtime_1.assert(state, "bad state"); // if we don't have a state here, code is broken - // there should be no pending result. - // did the consumer call next() before we resolved our previous result promise? - runtime_1.assert(!state.p, "iterator contract broken"); - // did we produce faster than the iterator consumed? - // return the oldest result from the queue. - let first = state.q.shift(); - if (first) - return ("value" in first) ? Promise.resolve(first) : Promise.reject(first); - // we have no result ATM, but we promise one. - // as soon as we have a result, we must resolve promise. - state.p = new deferred_1.Deferred(); - return state.p.promise; - }, - }; - } - // "push" a new iterator result. - // this either resolves a pending promise, or enqueues the result. - pushIt(result) { - let state = this._itState; - if (!state) - return; - // is the consumer waiting for us? - if (state.p) { - // yes, consumer is waiting for this promise. - const p = state.p; - runtime_1.assert(p.state == deferred_1.DeferredState.PENDING, "iterator contract broken"); - // resolve the promise - ("value" in result) ? p.resolve(result) : p.reject(result); - // must cleanup, otherwise iterator.next() would pick it up again. - delete state.p; - } - else { - // we are producing faster than the iterator consumes. - // push result onto queue. - state.q.push(result); - } - } -} -exports.RpcOutputStreamController = RpcOutputStreamController; - - -/***/ }), - -/***/ 43352: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ServerCallContextController = void 0; -class ServerCallContextController { - constructor(method, headers, deadline, sendResponseHeadersFn, defaultStatus = { code: 'OK', detail: '' }) { - this._cancelled = false; - this._listeners = []; - this.method = method; - this.headers = headers; - this.deadline = deadline; - this.trailers = {}; - this._sendRH = sendResponseHeadersFn; - this.status = defaultStatus; - } - /** - * Set the call cancelled. - * - * Invokes all callbacks registered with onCancel() and - * sets `cancelled = true`. - */ - notifyCancelled() { - if (!this._cancelled) { - this._cancelled = true; - for (let l of this._listeners) { - l(); - } - } - } - /** - * Send response headers. - */ - sendResponseHeaders(data) { - this._sendRH(data); - } - /** - * Is the call cancelled? - * - * When the client closes the connection before the server - * is done, the call is cancelled. - * - * If you want to cancel a request on the server, throw a - * RpcError with the CANCELLED status code. - */ - get cancelled() { - return this._cancelled; - } - /** - * Add a callback for cancellation. - */ - onCancel(callback) { - const l = this._listeners; - l.push(callback); - return () => { - let i = l.indexOf(callback); - if (i >= 0) - l.splice(i, 1); - }; - } -} -exports.ServerCallContextController = ServerCallContextController; - - -/***/ }), - -/***/ 46173: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ServerStreamingCall = void 0; -/** - * A server streaming RPC call. The client provides exactly one input message - * but the server may respond with 0, 1, or more messages. - */ -class ServerStreamingCall { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; - } - /** - * Instead of awaiting the response status and trailers, you can - * just as well await this call itself to receive the server outcome. - * You should first setup some listeners to the `request` to - * see the actual messages the server replied with. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter(this, void 0, void 0, function* () { - let [headers, status, trailers] = yield Promise.all([this.headers, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - request: this.request, - headers, - status, - trailers, - }; - }); - } -} -exports.ServerStreamingCall = ServerStreamingCall; - - -/***/ }), - -/***/ 56892: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ServiceType = void 0; -const reflection_info_1 = __nccwpck_require__(62496); -class ServiceType { - constructor(typeName, methods, options) { - this.typeName = typeName; - this.methods = methods.map(i => reflection_info_1.normalizeMethodInfo(i, this)); - this.options = options !== null && options !== void 0 ? options : {}; - } -} -exports.ServiceType = ServiceType; - - -/***/ }), - -/***/ 79122: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TestTransport = void 0; -const rpc_error_1 = __nccwpck_require__(78636); -const runtime_1 = __nccwpck_require__(68886); -const rpc_output_stream_1 = __nccwpck_require__(72726); -const rpc_options_1 = __nccwpck_require__(28576); -const unary_call_1 = __nccwpck_require__(29288); -const server_streaming_call_1 = __nccwpck_require__(46173); -const client_streaming_call_1 = __nccwpck_require__(37889); -const duplex_streaming_call_1 = __nccwpck_require__(36826); -/** - * Transport for testing. - */ -class TestTransport { - /** - * Initialize with mock data. Omitted fields have default value. - */ - constructor(data) { - /** - * Suppress warning / error about uncaught rejections of - * "status" and "trailers". - */ - this.suppressUncaughtRejections = true; - this.headerDelay = 10; - this.responseDelay = 50; - this.betweenResponseDelay = 10; - this.afterResponseDelay = 10; - this.data = data !== null && data !== void 0 ? data : {}; - } - /** - * Sent message(s) during the last operation. - */ - get sentMessages() { - if (this.lastInput instanceof TestInputStream) { - return this.lastInput.sent; - } - else if (typeof this.lastInput == "object") { - return [this.lastInput.single]; - } - return []; - } - /** - * Sending message(s) completed? - */ - get sendComplete() { - if (this.lastInput instanceof TestInputStream) { - return this.lastInput.completed; - } - else if (typeof this.lastInput == "object") { - return true; - } - return false; - } - // Creates a promise for response headers from the mock data. - promiseHeaders() { - var _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : TestTransport.defaultHeaders; - return headers instanceof rpc_error_1.RpcError - ? Promise.reject(headers) - : Promise.resolve(headers); - } - // Creates a promise for a single, valid, message from the mock data. - promiseSingleResponse(method) { - if (this.data.response instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.response); - } - let r; - if (Array.isArray(this.data.response)) { - runtime_1.assert(this.data.response.length > 0); - r = this.data.response[0]; - } - else if (this.data.response !== undefined) { - r = this.data.response; - } - else { - r = method.O.create(); - } - runtime_1.assert(method.O.is(r)); - return Promise.resolve(r); - } - /** - * Pushes response messages from the mock data to the output stream. - * If an error response, status or trailers are mocked, the stream is - * closed with the respective error. - * Otherwise, stream is completed successfully. - * - * The returned promise resolves when the stream is closed. It should - * not reject. If it does, code is broken. - */ - streamResponses(method, stream, abort) { - return __awaiter(this, void 0, void 0, function* () { - // normalize "data.response" into an array of valid output messages - const messages = []; - if (this.data.response === undefined) { - messages.push(method.O.create()); - } - else if (Array.isArray(this.data.response)) { - for (let msg of this.data.response) { - runtime_1.assert(method.O.is(msg)); - messages.push(msg); - } - } - else if (!(this.data.response instanceof rpc_error_1.RpcError)) { - runtime_1.assert(method.O.is(this.data.response)); - messages.push(this.data.response); - } - // start the stream with an initial delay. - // if the request is cancelled, notify() error and exit. - try { - yield delay(this.responseDelay, abort)(undefined); - } - catch (error) { - stream.notifyError(error); - return; - } - // if error response was mocked, notify() error (stream is now closed with error) and exit. - if (this.data.response instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.response); - return; - } - // regular response messages were mocked. notify() them. - for (let msg of messages) { - stream.notifyMessage(msg); - // add a short delay between responses - // if the request is cancelled, notify() error and exit. - try { - yield delay(this.betweenResponseDelay, abort)(undefined); - } - catch (error) { - stream.notifyError(error); - return; - } - } - // error status was mocked, notify() error (stream is now closed with error) and exit. - if (this.data.status instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.status); - return; - } - // error trailers were mocked, notify() error (stream is now closed with error) and exit. - if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.trailers); - return; - } - // stream completed successfully - stream.notifyComplete(); - }); - } - // Creates a promise for response status from the mock data. - promiseStatus() { - var _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : TestTransport.defaultStatus; - return status instanceof rpc_error_1.RpcError - ? Promise.reject(status) - : Promise.resolve(status); - } - // Creates a promise for response trailers from the mock data. - promiseTrailers() { - var _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : TestTransport.defaultTrailers; - return trailers instanceof rpc_error_1.RpcError - ? Promise.reject(trailers) - : Promise.resolve(trailers); - } - maybeSuppressUncaught(...promise) { - if (this.suppressUncaughtRejections) { - for (let p of promise) { - p.catch(() => { - }); - } - } - } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); - } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() - .then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise - .catch(_ => { - }) - .then(delay(this.responseDelay, options.abort)) - .then(_ => this.promiseSingleResponse(method)), statusPromise = responsePromise - .catch(_ => { - }) - .then(delay(this.afterResponseDelay, options.abort)) - .then(_ => this.promiseStatus()), trailersPromise = responsePromise - .catch(_ => { - }) - .then(delay(this.afterResponseDelay, options.abort)) - .then(_ => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = { single: input }; - return new unary_call_1.UnaryCall(method, requestHeaders, input, headersPromise, responsePromise, statusPromise, trailersPromise); - } - serverStreaming(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() - .then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise - .then(delay(this.responseDelay, options.abort)) - .catch(() => { - }) - .then(() => this.streamResponses(method, outputStream, options.abort)) - .then(delay(this.afterResponseDelay, options.abort)), statusPromise = responseStreamClosedPromise - .then(() => this.promiseStatus()), trailersPromise = responseStreamClosedPromise - .then(() => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = { single: input }; - return new server_streaming_call_1.ServerStreamingCall(method, requestHeaders, input, headersPromise, outputStream, statusPromise, trailersPromise); - } - clientStreaming(method, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() - .then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise - .catch(_ => { - }) - .then(delay(this.responseDelay, options.abort)) - .then(_ => this.promiseSingleResponse(method)), statusPromise = responsePromise - .catch(_ => { - }) - .then(delay(this.afterResponseDelay, options.abort)) - .then(_ => this.promiseStatus()), trailersPromise = responsePromise - .catch(_ => { - }) - .then(delay(this.afterResponseDelay, options.abort)) - .then(_ => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = new TestInputStream(this.data, options.abort); - return new client_streaming_call_1.ClientStreamingCall(method, requestHeaders, this.lastInput, headersPromise, responsePromise, statusPromise, trailersPromise); - } - duplex(method, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() - .then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise - .then(delay(this.responseDelay, options.abort)) - .catch(() => { - }) - .then(() => this.streamResponses(method, outputStream, options.abort)) - .then(delay(this.afterResponseDelay, options.abort)), statusPromise = responseStreamClosedPromise - .then(() => this.promiseStatus()), trailersPromise = responseStreamClosedPromise - .then(() => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = new TestInputStream(this.data, options.abort); - return new duplex_streaming_call_1.DuplexStreamingCall(method, requestHeaders, this.lastInput, headersPromise, outputStream, statusPromise, trailersPromise); - } -} -exports.TestTransport = TestTransport; -TestTransport.defaultHeaders = { - responseHeader: "test" -}; -TestTransport.defaultStatus = { - code: "OK", detail: "all good" -}; -TestTransport.defaultTrailers = { - responseTrailer: "test" -}; -function delay(ms, abort) { - return (v) => new Promise((resolve, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - } - else { - const id = setTimeout(() => resolve(v), ms); - if (abort) { - abort.addEventListener("abort", ev => { - clearTimeout(id); - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - }); - } - } - }); -} -class TestInputStream { - constructor(data, abort) { - this._completed = false; - this._sent = []; - this.data = data; - this.abort = abort; - } - get sent() { - return this._sent; - } - get completed() { - return this._completed; - } - send(message) { - if (this.data.inputMessage instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.inputMessage); - } - const delayMs = this.data.inputMessage === undefined - ? 10 - : this.data.inputMessage; - return Promise.resolve(undefined) - .then(() => { - this._sent.push(message); - }) - .then(delay(delayMs, this.abort)); - } - complete() { - if (this.data.inputComplete instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.inputComplete); - } - const delayMs = this.data.inputComplete === undefined - ? 10 - : this.data.inputComplete; - return Promise.resolve(undefined) - .then(() => { - this._completed = true; - }) - .then(delay(delayMs, this.abort)); - } -} - - -/***/ }), - -/***/ 29288: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UnaryCall = void 0; -/** - * A unary RPC call. Unary means there is exactly one input message and - * exactly one output message unless an error occurred. - */ -class UnaryCall { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; - } - /** - * If you are only interested in the final outcome of this call, - * you can await it to receive a `FinishedUnaryCall`. - */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); - } - promiseFinished() { - return __awaiter(this, void 0, void 0, function* () { - let [headers, response, status, trailers] = yield Promise.all([this.headers, this.response, this.status, this.trailers]); - return { - method: this.method, - requestHeaders: this.requestHeaders, - request: this.request, - headers, - response, - status, - trailers - }; - }); - } -} -exports.UnaryCall = UnaryCall; - - -/***/ }), - -/***/ 8602: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.assertFloat32 = exports.assertUInt32 = exports.assertInt32 = exports.assertNever = exports.assert = void 0; -/** - * assert that condition is true or throw error (with message) - */ -function assert(condition, msg) { - if (!condition) { - throw new Error(msg); - } -} -exports.assert = assert; -/** - * assert that value cannot exist = type `never`. throw runtime error if it does. - */ -function assertNever(value, msg) { - throw new Error(msg !== null && msg !== void 0 ? msg : 'Unexpected object: ' + value); -} -exports.assertNever = assertNever; -const FLOAT32_MAX = 3.4028234663852886e+38, FLOAT32_MIN = -3.4028234663852886e+38, UINT32_MAX = 0xFFFFFFFF, INT32_MAX = 0X7FFFFFFF, INT32_MIN = -0X80000000; -function assertInt32(arg) { - if (typeof arg !== "number") - throw new Error('invalid int 32: ' + typeof arg); - if (!Number.isInteger(arg) || arg > INT32_MAX || arg < INT32_MIN) - throw new Error('invalid int 32: ' + arg); -} -exports.assertInt32 = assertInt32; -function assertUInt32(arg) { - if (typeof arg !== "number") - throw new Error('invalid uint 32: ' + typeof arg); - if (!Number.isInteger(arg) || arg > UINT32_MAX || arg < 0) - throw new Error('invalid uint 32: ' + arg); -} -exports.assertUInt32 = assertUInt32; -function assertFloat32(arg) { - if (typeof arg !== "number") - throw new Error('invalid float 32: ' + typeof arg); - if (!Number.isFinite(arg)) - return; - if (arg > FLOAT32_MAX || arg < FLOAT32_MIN) - throw new Error('invalid float 32: ' + arg); -} -exports.assertFloat32 = assertFloat32; - - -/***/ }), - -/***/ 26335: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.base64encode = exports.base64decode = void 0; -// lookup table from base64 character to byte -let encTable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); -// lookup table from base64 character *code* to byte because lookup by number is fast -let decTable = []; -for (let i = 0; i < encTable.length; i++) - decTable[encTable[i].charCodeAt(0)] = i; -// support base64url variants -decTable["-".charCodeAt(0)] = encTable.indexOf("+"); -decTable["_".charCodeAt(0)] = encTable.indexOf("/"); -/** - * Decodes a base64 string to a byte array. - * - * - ignores white-space, including line breaks and tabs - * - allows inner padding (can decode concatenated base64 strings) - * - does not require padding - * - understands base64url encoding: - * "-" instead of "+", - * "_" instead of "/", - * no padding - */ -function base64decode(base64Str) { - // estimate byte size, not accounting for inner padding and whitespace - let es = base64Str.length * 3 / 4; - // if (es % 3 !== 0) - // throw new Error('invalid base64 string'); - if (base64Str[base64Str.length - 2] == '=') - es -= 2; - else if (base64Str[base64Str.length - 1] == '=') - es -= 1; - let bytes = new Uint8Array(es), bytePos = 0, // position in byte array - groupPos = 0, // position in base64 group - b, // current byte - p = 0 // previous byte - ; - for (let i = 0; i < base64Str.length; i++) { - b = decTable[base64Str.charCodeAt(i)]; - if (b === undefined) { - // noinspection FallThroughInSwitchStatementJS - switch (base64Str[i]) { - case '=': - groupPos = 0; // reset state when padding found - case '\n': - case '\r': - case '\t': - case ' ': - continue; // skip white-space, and padding - default: - throw Error(`invalid base64 string.`); - } - } - switch (groupPos) { - case 0: - p = b; - groupPos = 1; - break; - case 1: - bytes[bytePos++] = p << 2 | (b & 48) >> 4; - p = b; - groupPos = 2; - break; - case 2: - bytes[bytePos++] = (p & 15) << 4 | (b & 60) >> 2; - p = b; - groupPos = 3; - break; - case 3: - bytes[bytePos++] = (p & 3) << 6 | b; - groupPos = 0; - break; - } - } - if (groupPos == 1) - throw Error(`invalid base64 string.`); - return bytes.subarray(0, bytePos); -} -exports.base64decode = base64decode; -/** - * Encodes a byte array to a base64 string. - * Adds padding at the end. - * Does not insert newlines. - */ -function base64encode(bytes) { - let base64 = '', groupPos = 0, // position in base64 group - b, // current byte - p = 0; // carry over from previous byte - for (let i = 0; i < bytes.length; i++) { - b = bytes[i]; - switch (groupPos) { - case 0: - base64 += encTable[b >> 2]; - p = (b & 3) << 4; - groupPos = 1; - break; - case 1: - base64 += encTable[p | b >> 4]; - p = (b & 15) << 2; - groupPos = 2; - break; - case 2: - base64 += encTable[p | b >> 6]; - base64 += encTable[b & 63]; - groupPos = 0; - break; - } - } - // padding required? - if (groupPos) { - base64 += encTable[p]; - base64 += '='; - if (groupPos == 1) - base64 += '='; - } - return base64; -} -exports.base64encode = base64encode; - - -/***/ }), - -/***/ 54816: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WireType = exports.mergeBinaryOptions = exports.UnknownFieldHandler = void 0; -/** - * This handler implements the default behaviour for unknown fields. - * When reading data, unknown fields are stored on the message, in a - * symbol property. - * When writing data, the symbol property is queried and unknown fields - * are serialized into the output again. - */ -var UnknownFieldHandler; -(function (UnknownFieldHandler) { - /** - * The symbol used to store unknown fields for a message. - * The property must conform to `UnknownFieldContainer`. - */ - UnknownFieldHandler.symbol = Symbol.for("protobuf-ts/unknown"); - /** - * Store an unknown field during binary read directly on the message. - * This method is compatible with `BinaryReadOptions.readUnknownField`. - */ - UnknownFieldHandler.onRead = (typeName, message, fieldNo, wireType, data) => { - let container = is(message) ? message[UnknownFieldHandler.symbol] : message[UnknownFieldHandler.symbol] = []; - container.push({ no: fieldNo, wireType, data }); - }; - /** - * Write unknown fields stored for the message to the writer. - * This method is compatible with `BinaryWriteOptions.writeUnknownFields`. - */ - UnknownFieldHandler.onWrite = (typeName, message, writer) => { - for (let { no, wireType, data } of UnknownFieldHandler.list(message)) - writer.tag(no, wireType).raw(data); - }; - /** - * List unknown fields stored for the message. - * Note that there may be multiples fields with the same number. - */ - UnknownFieldHandler.list = (message, fieldNo) => { - if (is(message)) { - let all = message[UnknownFieldHandler.symbol]; - return fieldNo ? all.filter(uf => uf.no == fieldNo) : all; - } - return []; - }; - /** - * Returns the last unknown field by field number. - */ - UnknownFieldHandler.last = (message, fieldNo) => UnknownFieldHandler.list(message, fieldNo).slice(-1)[0]; - const is = (message) => message && Array.isArray(message[UnknownFieldHandler.symbol]); -})(UnknownFieldHandler = exports.UnknownFieldHandler || (exports.UnknownFieldHandler = {})); -/** - * Merges binary write or read options. Later values override earlier values. - */ -function mergeBinaryOptions(a, b) { - return Object.assign(Object.assign({}, a), b); -} -exports.mergeBinaryOptions = mergeBinaryOptions; -/** - * Protobuf binary format wire types. - * - * A wire type provides just enough information to find the length of the - * following value. - * - * See https://developers.google.com/protocol-buffers/docs/encoding#structure - */ -var WireType; -(function (WireType) { - /** - * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum - */ - WireType[WireType["Varint"] = 0] = "Varint"; - /** - * Used for fixed64, sfixed64, double. - * Always 8 bytes with little-endian byte order. - */ - WireType[WireType["Bit64"] = 1] = "Bit64"; - /** - * Used for string, bytes, embedded messages, packed repeated fields - * - * Only repeated numeric types (types which use the varint, 32-bit, - * or 64-bit wire types) can be packed. In proto3, such fields are - * packed by default. - */ - WireType[WireType["LengthDelimited"] = 2] = "LengthDelimited"; - /** - * Used for groups - * @deprecated - */ - WireType[WireType["StartGroup"] = 3] = "StartGroup"; - /** - * Used for groups - * @deprecated - */ - WireType[WireType["EndGroup"] = 4] = "EndGroup"; - /** - * Used for fixed32, sfixed32, float. - * Always 4 bytes with little-endian byte order. - */ - WireType[WireType["Bit32"] = 5] = "Bit32"; -})(WireType = exports.WireType || (exports.WireType = {})); - - -/***/ }), - -/***/ 92889: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BinaryReader = exports.binaryReadOptions = void 0; -const binary_format_contract_1 = __nccwpck_require__(54816); -const pb_long_1 = __nccwpck_require__(61753); -const goog_varint_1 = __nccwpck_require__(93223); -const defaultsRead = { - readUnknownField: true, - readerFactory: bytes => new BinaryReader(bytes), -}; -/** - * Make options for reading binary data form partial options. - */ -function binaryReadOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead; -} -exports.binaryReadOptions = binaryReadOptions; -class BinaryReader { - constructor(buf, textDecoder) { - this.varint64 = goog_varint_1.varint64read; // dirty cast for `this` - /** - * Read a `uint32` field, an unsigned 32 bit varint. - */ - this.uint32 = goog_varint_1.varint32read; // dirty cast for `this` and access to protected `buf` - this.buf = buf; - this.len = buf.length; - this.pos = 0; - this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - this.textDecoder = textDecoder !== null && textDecoder !== void 0 ? textDecoder : new TextDecoder("utf-8", { - fatal: true, - ignoreBOM: true, - }); - } - /** - * Reads a tag - field number and wire type. - */ - tag() { - let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7; - if (fieldNo <= 0 || wireType < 0 || wireType > 5) - throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); - return [fieldNo, wireType]; - } - /** - * Skip one element on the wire and return the skipped data. - * Supports WireType.StartGroup since v2.0.0-alpha.23. - */ - skip(wireType) { - let start = this.pos; - // noinspection FallThroughInSwitchStatementJS - switch (wireType) { - case binary_format_contract_1.WireType.Varint: - while (this.buf[this.pos++] & 0x80) { - // ignore - } - break; - case binary_format_contract_1.WireType.Bit64: - this.pos += 4; - case binary_format_contract_1.WireType.Bit32: - this.pos += 4; - break; - case binary_format_contract_1.WireType.LengthDelimited: - let len = this.uint32(); - this.pos += len; - break; - case binary_format_contract_1.WireType.StartGroup: - // From descriptor.proto: Group type is deprecated, not supported in proto3. - // But we must still be able to parse and treat as unknown. - let t; - while ((t = this.tag()[1]) !== binary_format_contract_1.WireType.EndGroup) { - this.skip(t); - } - break; - default: - throw new Error("cant skip wire type " + wireType); - } - this.assertBounds(); - return this.buf.subarray(start, this.pos); - } - /** - * Throws error if position in byte array is out of range. - */ - assertBounds() { - if (this.pos > this.len) - throw new RangeError("premature EOF"); - } - /** - * Read a `int32` field, a signed 32 bit varint. - */ - int32() { - return this.uint32() | 0; - } - /** - * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. - */ - sint32() { - let zze = this.uint32(); - // decode zigzag - return (zze >>> 1) ^ -(zze & 1); - } - /** - * Read a `int64` field, a signed 64-bit varint. - */ - int64() { - return new pb_long_1.PbLong(...this.varint64()); - } - /** - * Read a `uint64` field, an unsigned 64-bit varint. - */ - uint64() { - return new pb_long_1.PbULong(...this.varint64()); - } - /** - * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. - */ - sint64() { - let [lo, hi] = this.varint64(); - // decode zig zag - let s = -(lo & 1); - lo = ((lo >>> 1 | (hi & 1) << 31) ^ s); - hi = (hi >>> 1 ^ s); - return new pb_long_1.PbLong(lo, hi); - } - /** - * Read a `bool` field, a variant. - */ - bool() { - let [lo, hi] = this.varint64(); - return lo !== 0 || hi !== 0; - } - /** - * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. - */ - fixed32() { - return this.view.getUint32((this.pos += 4) - 4, true); - } - /** - * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. - */ - sfixed32() { - return this.view.getInt32((this.pos += 4) - 4, true); - } - /** - * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. - */ - fixed64() { - return new pb_long_1.PbULong(this.sfixed32(), this.sfixed32()); - } - /** - * Read a `fixed64` field, a signed, fixed-length 64-bit integer. - */ - sfixed64() { - return new pb_long_1.PbLong(this.sfixed32(), this.sfixed32()); - } - /** - * Read a `float` field, 32-bit floating point number. - */ - float() { - return this.view.getFloat32((this.pos += 4) - 4, true); - } - /** - * Read a `double` field, a 64-bit floating point number. - */ - double() { - return this.view.getFloat64((this.pos += 8) - 8, true); - } - /** - * Read a `bytes` field, length-delimited arbitrary data. - */ - bytes() { - let len = this.uint32(); - let start = this.pos; - this.pos += len; - this.assertBounds(); - return this.buf.subarray(start, start + len); - } - /** - * Read a `string` field, length-delimited data converted to UTF-8 text. - */ - string() { - return this.textDecoder.decode(this.bytes()); - } -} -exports.BinaryReader = BinaryReader; - - -/***/ }), - -/***/ 23957: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BinaryWriter = exports.binaryWriteOptions = void 0; -const pb_long_1 = __nccwpck_require__(61753); -const goog_varint_1 = __nccwpck_require__(93223); -const assert_1 = __nccwpck_require__(8602); -const defaultsWrite = { - writeUnknownFields: true, - writerFactory: () => new BinaryWriter(), -}; -/** - * Make options for writing binary data form partial options. - */ -function binaryWriteOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; -} -exports.binaryWriteOptions = binaryWriteOptions; -class BinaryWriter { - constructor(textEncoder) { - /** - * Previous fork states. - */ - this.stack = []; - this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder(); - this.chunks = []; - this.buf = []; - } - /** - * Return all bytes written and reset this writer. - */ - finish() { - this.chunks.push(new Uint8Array(this.buf)); // flush the buffer - let len = 0; - for (let i = 0; i < this.chunks.length; i++) - len += this.chunks[i].length; - let bytes = new Uint8Array(len); - let offset = 0; - for (let i = 0; i < this.chunks.length; i++) { - bytes.set(this.chunks[i], offset); - offset += this.chunks[i].length; - } - this.chunks = []; - return bytes; - } - /** - * Start a new fork for length-delimited data like a message - * or a packed repeated field. - * - * Must be joined later with `join()`. - */ - fork() { - this.stack.push({ chunks: this.chunks, buf: this.buf }); - this.chunks = []; - this.buf = []; - return this; - } - /** - * Join the last fork. Write its length and bytes, then - * return to the previous state. - */ - join() { - // get chunk of fork - let chunk = this.finish(); - // restore previous state - let prev = this.stack.pop(); - if (!prev) - throw new Error('invalid state, fork stack empty'); - this.chunks = prev.chunks; - this.buf = prev.buf; - // write length of chunk as varint - this.uint32(chunk.byteLength); - return this.raw(chunk); - } - /** - * Writes a tag (field number and wire type). - * - * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. - * - * Generated code should compute the tag ahead of time and call `uint32()`. - */ - tag(fieldNo, type) { - return this.uint32((fieldNo << 3 | type) >>> 0); - } - /** - * Write a chunk of raw bytes. - */ - raw(chunk) { - if (this.buf.length) { - this.chunks.push(new Uint8Array(this.buf)); - this.buf = []; - } - this.chunks.push(chunk); - return this; - } - /** - * Write a `uint32` value, an unsigned 32 bit varint. - */ - uint32(value) { - assert_1.assertUInt32(value); - // write value as varint 32, inlined for speed - while (value > 0x7f) { - this.buf.push((value & 0x7f) | 0x80); - value = value >>> 7; - } - this.buf.push(value); - return this; - } - /** - * Write a `int32` value, a signed 32 bit varint. - */ - int32(value) { - assert_1.assertInt32(value); - goog_varint_1.varint32write(value, this.buf); - return this; - } - /** - * Write a `bool` value, a variant. - */ - bool(value) { - this.buf.push(value ? 1 : 0); - return this; - } - /** - * Write a `bytes` value, length-delimited arbitrary data. - */ - bytes(value) { - this.uint32(value.byteLength); // write length of chunk as varint - return this.raw(value); - } - /** - * Write a `string` value, length-delimited data converted to UTF-8 text. - */ - string(value) { - let chunk = this.textEncoder.encode(value); - this.uint32(chunk.byteLength); // write length of chunk as varint - return this.raw(chunk); - } - /** - * Write a `float` value, 32-bit floating point number. - */ - float(value) { - assert_1.assertFloat32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setFloat32(0, value, true); - return this.raw(chunk); - } - /** - * Write a `double` value, a 64-bit floating point number. - */ - double(value) { - let chunk = new Uint8Array(8); - new DataView(chunk.buffer).setFloat64(0, value, true); - return this.raw(chunk); - } - /** - * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. - */ - fixed32(value) { - assert_1.assertUInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setUint32(0, value, true); - return this.raw(chunk); - } - /** - * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. - */ - sfixed32(value) { - assert_1.assertInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setInt32(0, value, true); - return this.raw(chunk); - } - /** - * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. - */ - sint32(value) { - assert_1.assertInt32(value); - // zigzag encode - value = ((value << 1) ^ (value >> 31)) >>> 0; - goog_varint_1.varint32write(value, this.buf); - return this; - } - /** - * Write a `fixed64` value, a signed, fixed-length 64-bit integer. - */ - sfixed64(value) { - let chunk = new Uint8Array(8); - let view = new DataView(chunk.buffer); - let long = pb_long_1.PbLong.from(value); - view.setInt32(0, long.lo, true); - view.setInt32(4, long.hi, true); - return this.raw(chunk); - } - /** - * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. - */ - fixed64(value) { - let chunk = new Uint8Array(8); - let view = new DataView(chunk.buffer); - let long = pb_long_1.PbULong.from(value); - view.setInt32(0, long.lo, true); - view.setInt32(4, long.hi, true); - return this.raw(chunk); - } - /** - * Write a `int64` value, a signed 64-bit varint. - */ - int64(value) { - let long = pb_long_1.PbLong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; - } - /** - * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. - */ - sint64(value) { - let long = pb_long_1.PbLong.from(value), - // zigzag encode - sign = long.hi >> 31, lo = (long.lo << 1) ^ sign, hi = ((long.hi << 1) | (long.lo >>> 31)) ^ sign; - goog_varint_1.varint64write(lo, hi, this.buf); - return this; - } - /** - * Write a `uint64` value, an unsigned 64-bit varint. - */ - uint64(value) { - let long = pb_long_1.PbULong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; - } -} -exports.BinaryWriter = BinaryWriter; - - -/***/ }), - -/***/ 70257: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.listEnumNumbers = exports.listEnumNames = exports.listEnumValues = exports.isEnumObject = void 0; -/** - * Is this a lookup object generated by Typescript, for a Typescript enum - * generated by protobuf-ts? - * - * - No `const enum` (enum must not be inlined, we need reverse mapping). - * - No string enum (we need int32 for protobuf). - * - Must have a value for 0 (otherwise, we would need to support custom default values). - */ -function isEnumObject(arg) { - if (typeof arg != 'object' || arg === null) { - return false; - } - if (!arg.hasOwnProperty(0)) { - return false; - } - for (let k of Object.keys(arg)) { - let num = parseInt(k); - if (!Number.isNaN(num)) { - // is there a name for the number? - let nam = arg[num]; - if (nam === undefined) - return false; - // does the name resolve back to the number? - if (arg[nam] !== num) - return false; - } - else { - // is there a number for the name? - let num = arg[k]; - if (num === undefined) - return false; - // is it a string enum? - if (typeof num !== 'number') - return false; - // do we know the number? - if (arg[num] === undefined) - return false; - } - } - return true; -} -exports.isEnumObject = isEnumObject; -/** - * Lists all values of a Typescript enum, as an array of objects with a "name" - * property and a "number" property. - * - * Note that it is possible that a number appears more than once, because it is - * possible to have aliases in an enum. - * - * Throws if the enum does not adhere to the rules of enums generated by - * protobuf-ts. See `isEnumObject()`. - */ -function listEnumValues(enumObject) { - if (!isEnumObject(enumObject)) - throw new Error("not a typescript enum object"); - let values = []; - for (let [name, number] of Object.entries(enumObject)) - if (typeof number == "number") - values.push({ name, number }); - return values; -} -exports.listEnumValues = listEnumValues; -/** - * Lists the names of a Typescript enum. - * - * Throws if the enum does not adhere to the rules of enums generated by - * protobuf-ts. See `isEnumObject()`. - */ -function listEnumNames(enumObject) { - return listEnumValues(enumObject).map(val => val.name); -} -exports.listEnumNames = listEnumNames; -/** - * Lists the numbers of a Typescript enum. - * - * Throws if the enum does not adhere to the rules of enums generated by - * protobuf-ts. See `isEnumObject()`. - */ -function listEnumNumbers(enumObject) { - return listEnumValues(enumObject) - .map(val => val.number) - .filter((num, index, arr) => arr.indexOf(num) == index); -} -exports.listEnumNumbers = listEnumNumbers; - - -/***/ }), - -/***/ 93223: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// Copyright 2008 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Code generated by the Protocol Buffer compiler is owned by the owner -// of the input file used when generating it. This code is not -// standalone and requires a support library to be linked with it. This -// support library is itself covered by the above license. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.varint32read = exports.varint32write = exports.int64toString = exports.int64fromString = exports.varint64write = exports.varint64read = void 0; -/** - * Read a 64 bit varint as two JS numbers. - * - * Returns tuple: - * [0]: low bits - * [0]: high bits - * - * Copyright 2008 Google Inc. All rights reserved. - * - * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 - */ -function varint64read() { - let lowBits = 0; - let highBits = 0; - for (let shift = 0; shift < 28; shift += 7) { - let b = this.buf[this.pos++]; - lowBits |= (b & 0x7F) << shift; - if ((b & 0x80) == 0) { - this.assertBounds(); - return [lowBits, highBits]; - } - } - let middleByte = this.buf[this.pos++]; - // last four bits of the first 32 bit number - lowBits |= (middleByte & 0x0F) << 28; - // 3 upper bits are part of the next 32 bit number - highBits = (middleByte & 0x70) >> 4; - if ((middleByte & 0x80) == 0) { - this.assertBounds(); - return [lowBits, highBits]; - } - for (let shift = 3; shift <= 31; shift += 7) { - let b = this.buf[this.pos++]; - highBits |= (b & 0x7F) << shift; - if ((b & 0x80) == 0) { - this.assertBounds(); - return [lowBits, highBits]; - } - } - throw new Error('invalid varint'); -} -exports.varint64read = varint64read; -/** - * Write a 64 bit varint, given as two JS numbers, to the given bytes array. - * - * Copyright 2008 Google Inc. All rights reserved. - * - * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 - */ -function varint64write(lo, hi, bytes) { - for (let i = 0; i < 28; i = i + 7) { - const shift = lo >>> i; - const hasNext = !((shift >>> 7) == 0 && hi == 0); - const byte = (hasNext ? shift | 0x80 : shift) & 0xFF; - bytes.push(byte); - if (!hasNext) { - return; - } - } - const splitBits = ((lo >>> 28) & 0x0F) | ((hi & 0x07) << 4); - const hasMoreBits = !((hi >> 3) == 0); - bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xFF); - if (!hasMoreBits) { - return; - } - for (let i = 3; i < 31; i = i + 7) { - const shift = hi >>> i; - const hasNext = !((shift >>> 7) == 0); - const byte = (hasNext ? shift | 0x80 : shift) & 0xFF; - bytes.push(byte); - if (!hasNext) { - return; - } - } - bytes.push((hi >>> 31) & 0x01); -} -exports.varint64write = varint64write; -// constants for binary math -const TWO_PWR_32_DBL = (1 << 16) * (1 << 16); -/** - * Parse decimal string of 64 bit integer value as two JS numbers. - * - * Returns tuple: - * [0]: minus sign? - * [1]: low bits - * [2]: high bits - * - * Copyright 2008 Google Inc. - */ -function int64fromString(dec) { - // Check for minus sign. - let minus = dec[0] == '-'; - if (minus) - dec = dec.slice(1); - // Work 6 decimal digits at a time, acting like we're converting base 1e6 - // digits to binary. This is safe to do with floating point math because - // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. - const base = 1e6; - let lowBits = 0; - let highBits = 0; - function add1e6digit(begin, end) { - // Note: Number('') is 0. - const digit1e6 = Number(dec.slice(begin, end)); - highBits *= base; - lowBits = lowBits * base + digit1e6; - // Carry bits from lowBits to highBits - if (lowBits >= TWO_PWR_32_DBL) { - highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); - lowBits = lowBits % TWO_PWR_32_DBL; - } - } - add1e6digit(-24, -18); - add1e6digit(-18, -12); - add1e6digit(-12, -6); - add1e6digit(-6); - return [minus, lowBits, highBits]; -} -exports.int64fromString = int64fromString; -/** - * Format 64 bit integer value (as two JS numbers) to decimal string. - * - * Copyright 2008 Google Inc. - */ -function int64toString(bitsLow, bitsHigh) { - // Skip the expensive conversion if the number is small enough to use the - // built-in conversions. - if ((bitsHigh >>> 0) <= 0x1FFFFF) { - return '' + (TWO_PWR_32_DBL * bitsHigh + (bitsLow >>> 0)); - } - // What this code is doing is essentially converting the input number from - // base-2 to base-1e7, which allows us to represent the 64-bit range with - // only 3 (very large) digits. Those digits are then trivial to convert to - // a base-10 string. - // The magic numbers used here are - - // 2^24 = 16777216 = (1,6777216) in base-1e7. - // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. - // Split 32:32 representation into 16:24:24 representation so our - // intermediate digits don't overflow. - let low = bitsLow & 0xFFFFFF; - let mid = (((bitsLow >>> 24) | (bitsHigh << 8)) >>> 0) & 0xFFFFFF; - let high = (bitsHigh >> 16) & 0xFFFF; - // Assemble our three base-1e7 digits, ignoring carries. The maximum - // value in a digit at this step is representable as a 48-bit integer, which - // can be stored in a 64-bit floating point number. - let digitA = low + (mid * 6777216) + (high * 6710656); - let digitB = mid + (high * 8147497); - let digitC = (high * 2); - // Apply carries from A to B and from B to C. - let base = 10000000; - if (digitA >= base) { - digitB += Math.floor(digitA / base); - digitA %= base; - } - if (digitB >= base) { - digitC += Math.floor(digitB / base); - digitB %= base; - } - // Convert base-1e7 digits to base-10, with optional leading zeroes. - function decimalFrom1e7(digit1e7, needLeadingZeros) { - let partial = digit1e7 ? String(digit1e7) : ''; - if (needLeadingZeros) { - return '0000000'.slice(partial.length) + partial; - } - return partial; - } - return decimalFrom1e7(digitC, /*needLeadingZeros=*/ 0) + - decimalFrom1e7(digitB, /*needLeadingZeros=*/ digitC) + - // If the final 1e7 digit didn't need leading zeros, we would have - // returned via the trivial code path at the top. - decimalFrom1e7(digitA, /*needLeadingZeros=*/ 1); -} -exports.int64toString = int64toString; -/** - * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` - * - * Copyright 2008 Google Inc. All rights reserved. - * - * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 - */ -function varint32write(value, bytes) { - if (value >= 0) { - // write value as varint 32 - while (value > 0x7f) { - bytes.push((value & 0x7f) | 0x80); - value = value >>> 7; - } - bytes.push(value); - } - else { - for (let i = 0; i < 9; i++) { - bytes.push(value & 127 | 128); - value = value >> 7; - } - bytes.push(1); - } -} -exports.varint32write = varint32write; -/** - * Read an unsigned 32 bit varint. - * - * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 - */ -function varint32read() { - let b = this.buf[this.pos++]; - let result = b & 0x7F; - if ((b & 0x80) == 0) { - this.assertBounds(); - return result; - } - b = this.buf[this.pos++]; - result |= (b & 0x7F) << 7; - if ((b & 0x80) == 0) { - this.assertBounds(); - return result; - } - b = this.buf[this.pos++]; - result |= (b & 0x7F) << 14; - if ((b & 0x80) == 0) { - this.assertBounds(); - return result; - } - b = this.buf[this.pos++]; - result |= (b & 0x7F) << 21; - if ((b & 0x80) == 0) { - this.assertBounds(); - return result; - } - // Extract only last 4 bits - b = this.buf[this.pos++]; - result |= (b & 0x0F) << 28; - for (let readBytes = 5; ((b & 0x80) !== 0) && readBytes < 10; readBytes++) - b = this.buf[this.pos++]; - if ((b & 0x80) != 0) - throw new Error('invalid varint'); - this.assertBounds(); - // Result can have 32 bits, convert it to unsigned - return result >>> 0; -} -exports.varint32read = varint32read; - - -/***/ }), - -/***/ 68886: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Public API of the protobuf-ts runtime. -// Note: we do not use `export * from ...` to help tree shakers, -// webpack verbose output hints that this should be useful -Object.defineProperty(exports, "__esModule", ({ value: true })); -// Convenience JSON typings and corresponding type guards -var json_typings_1 = __nccwpck_require__(49999); -Object.defineProperty(exports, "typeofJsonValue", ({ enumerable: true, get: function () { return json_typings_1.typeofJsonValue; } })); -Object.defineProperty(exports, "isJsonObject", ({ enumerable: true, get: function () { return json_typings_1.isJsonObject; } })); -// Base 64 encoding -var base64_1 = __nccwpck_require__(26335); -Object.defineProperty(exports, "base64decode", ({ enumerable: true, get: function () { return base64_1.base64decode; } })); -Object.defineProperty(exports, "base64encode", ({ enumerable: true, get: function () { return base64_1.base64encode; } })); -// UTF8 encoding -var protobufjs_utf8_1 = __nccwpck_require__(58950); -Object.defineProperty(exports, "utf8read", ({ enumerable: true, get: function () { return protobufjs_utf8_1.utf8read; } })); -// Binary format contracts, options for reading and writing, for example -var binary_format_contract_1 = __nccwpck_require__(54816); -Object.defineProperty(exports, "WireType", ({ enumerable: true, get: function () { return binary_format_contract_1.WireType; } })); -Object.defineProperty(exports, "mergeBinaryOptions", ({ enumerable: true, get: function () { return binary_format_contract_1.mergeBinaryOptions; } })); -Object.defineProperty(exports, "UnknownFieldHandler", ({ enumerable: true, get: function () { return binary_format_contract_1.UnknownFieldHandler; } })); -// Standard IBinaryReader implementation -var binary_reader_1 = __nccwpck_require__(92889); -Object.defineProperty(exports, "BinaryReader", ({ enumerable: true, get: function () { return binary_reader_1.BinaryReader; } })); -Object.defineProperty(exports, "binaryReadOptions", ({ enumerable: true, get: function () { return binary_reader_1.binaryReadOptions; } })); -// Standard IBinaryWriter implementation -var binary_writer_1 = __nccwpck_require__(23957); -Object.defineProperty(exports, "BinaryWriter", ({ enumerable: true, get: function () { return binary_writer_1.BinaryWriter; } })); -Object.defineProperty(exports, "binaryWriteOptions", ({ enumerable: true, get: function () { return binary_writer_1.binaryWriteOptions; } })); -// Int64 and UInt64 implementations required for the binary format -var pb_long_1 = __nccwpck_require__(61753); -Object.defineProperty(exports, "PbLong", ({ enumerable: true, get: function () { return pb_long_1.PbLong; } })); -Object.defineProperty(exports, "PbULong", ({ enumerable: true, get: function () { return pb_long_1.PbULong; } })); -// JSON format contracts, options for reading and writing, for example -var json_format_contract_1 = __nccwpck_require__(29367); -Object.defineProperty(exports, "jsonReadOptions", ({ enumerable: true, get: function () { return json_format_contract_1.jsonReadOptions; } })); -Object.defineProperty(exports, "jsonWriteOptions", ({ enumerable: true, get: function () { return json_format_contract_1.jsonWriteOptions; } })); -Object.defineProperty(exports, "mergeJsonOptions", ({ enumerable: true, get: function () { return json_format_contract_1.mergeJsonOptions; } })); -// Message type contract -var message_type_contract_1 = __nccwpck_require__(43785); -Object.defineProperty(exports, "MESSAGE_TYPE", ({ enumerable: true, get: function () { return message_type_contract_1.MESSAGE_TYPE; } })); -// Message type implementation via reflection -var message_type_1 = __nccwpck_require__(15106); -Object.defineProperty(exports, "MessageType", ({ enumerable: true, get: function () { return message_type_1.MessageType; } })); -// Reflection info, generated by the plugin, exposed to the user, used by reflection ops -var reflection_info_1 = __nccwpck_require__(67910); -Object.defineProperty(exports, "ScalarType", ({ enumerable: true, get: function () { return reflection_info_1.ScalarType; } })); -Object.defineProperty(exports, "LongType", ({ enumerable: true, get: function () { return reflection_info_1.LongType; } })); -Object.defineProperty(exports, "RepeatType", ({ enumerable: true, get: function () { return reflection_info_1.RepeatType; } })); -Object.defineProperty(exports, "normalizeFieldInfo", ({ enumerable: true, get: function () { return reflection_info_1.normalizeFieldInfo; } })); -Object.defineProperty(exports, "readFieldOptions", ({ enumerable: true, get: function () { return reflection_info_1.readFieldOptions; } })); -Object.defineProperty(exports, "readFieldOption", ({ enumerable: true, get: function () { return reflection_info_1.readFieldOption; } })); -Object.defineProperty(exports, "readMessageOption", ({ enumerable: true, get: function () { return reflection_info_1.readMessageOption; } })); -// Message operations via reflection -var reflection_type_check_1 = __nccwpck_require__(25167); -Object.defineProperty(exports, "ReflectionTypeCheck", ({ enumerable: true, get: function () { return reflection_type_check_1.ReflectionTypeCheck; } })); -var reflection_create_1 = __nccwpck_require__(75726); -Object.defineProperty(exports, "reflectionCreate", ({ enumerable: true, get: function () { return reflection_create_1.reflectionCreate; } })); -var reflection_scalar_default_1 = __nccwpck_require__(19526); -Object.defineProperty(exports, "reflectionScalarDefault", ({ enumerable: true, get: function () { return reflection_scalar_default_1.reflectionScalarDefault; } })); -var reflection_merge_partial_1 = __nccwpck_require__(98044); -Object.defineProperty(exports, "reflectionMergePartial", ({ enumerable: true, get: function () { return reflection_merge_partial_1.reflectionMergePartial; } })); -var reflection_equals_1 = __nccwpck_require__(4827); -Object.defineProperty(exports, "reflectionEquals", ({ enumerable: true, get: function () { return reflection_equals_1.reflectionEquals; } })); -var reflection_binary_reader_1 = __nccwpck_require__(89611); -Object.defineProperty(exports, "ReflectionBinaryReader", ({ enumerable: true, get: function () { return reflection_binary_reader_1.ReflectionBinaryReader; } })); -var reflection_binary_writer_1 = __nccwpck_require__(66907); -Object.defineProperty(exports, "ReflectionBinaryWriter", ({ enumerable: true, get: function () { return reflection_binary_writer_1.ReflectionBinaryWriter; } })); -var reflection_json_reader_1 = __nccwpck_require__(46790); -Object.defineProperty(exports, "ReflectionJsonReader", ({ enumerable: true, get: function () { return reflection_json_reader_1.ReflectionJsonReader; } })); -var reflection_json_writer_1 = __nccwpck_require__(11094); -Object.defineProperty(exports, "ReflectionJsonWriter", ({ enumerable: true, get: function () { return reflection_json_writer_1.ReflectionJsonWriter; } })); -var reflection_contains_message_type_1 = __nccwpck_require__(59946); -Object.defineProperty(exports, "containsMessageType", ({ enumerable: true, get: function () { return reflection_contains_message_type_1.containsMessageType; } })); -// Oneof helpers -var oneof_1 = __nccwpck_require__(18063); -Object.defineProperty(exports, "isOneofGroup", ({ enumerable: true, get: function () { return oneof_1.isOneofGroup; } })); -Object.defineProperty(exports, "setOneofValue", ({ enumerable: true, get: function () { return oneof_1.setOneofValue; } })); -Object.defineProperty(exports, "getOneofValue", ({ enumerable: true, get: function () { return oneof_1.getOneofValue; } })); -Object.defineProperty(exports, "clearOneofValue", ({ enumerable: true, get: function () { return oneof_1.clearOneofValue; } })); -Object.defineProperty(exports, "getSelectedOneofValue", ({ enumerable: true, get: function () { return oneof_1.getSelectedOneofValue; } })); -// Enum object type guard and reflection util, may be interesting to the user. -var enum_object_1 = __nccwpck_require__(70257); -Object.defineProperty(exports, "listEnumValues", ({ enumerable: true, get: function () { return enum_object_1.listEnumValues; } })); -Object.defineProperty(exports, "listEnumNames", ({ enumerable: true, get: function () { return enum_object_1.listEnumNames; } })); -Object.defineProperty(exports, "listEnumNumbers", ({ enumerable: true, get: function () { return enum_object_1.listEnumNumbers; } })); -Object.defineProperty(exports, "isEnumObject", ({ enumerable: true, get: function () { return enum_object_1.isEnumObject; } })); -// lowerCamelCase() is exported for plugin, rpc-runtime and other rpc packages -var lower_camel_case_1 = __nccwpck_require__(4073); -Object.defineProperty(exports, "lowerCamelCase", ({ enumerable: true, get: function () { return lower_camel_case_1.lowerCamelCase; } })); -// assertion functions are exported for plugin, may also be useful to user -var assert_1 = __nccwpck_require__(8602); -Object.defineProperty(exports, "assert", ({ enumerable: true, get: function () { return assert_1.assert; } })); -Object.defineProperty(exports, "assertNever", ({ enumerable: true, get: function () { return assert_1.assertNever; } })); -Object.defineProperty(exports, "assertInt32", ({ enumerable: true, get: function () { return assert_1.assertInt32; } })); -Object.defineProperty(exports, "assertUInt32", ({ enumerable: true, get: function () { return assert_1.assertUInt32; } })); -Object.defineProperty(exports, "assertFloat32", ({ enumerable: true, get: function () { return assert_1.assertFloat32; } })); - - -/***/ }), - -/***/ 29367: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.mergeJsonOptions = exports.jsonWriteOptions = exports.jsonReadOptions = void 0; -const defaultsWrite = { - emitDefaultValues: false, - enumAsInteger: false, - useProtoFieldName: false, - prettySpaces: 0, -}, defaultsRead = { - ignoreUnknownFields: false, -}; -/** - * Make options for reading JSON data from partial options. - */ -function jsonReadOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead; -} -exports.jsonReadOptions = jsonReadOptions; -/** - * Make options for writing JSON data from partial options. - */ -function jsonWriteOptions(options) { - return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; -} -exports.jsonWriteOptions = jsonWriteOptions; -/** - * Merges JSON write or read options. Later values override earlier values. Type registries are merged. - */ -function mergeJsonOptions(a, b) { - var _a, _b; - let c = Object.assign(Object.assign({}, a), b); - c.typeRegistry = [...((_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : []), ...((_b = b === null || b === void 0 ? void 0 : b.typeRegistry) !== null && _b !== void 0 ? _b : [])]; - return c; -} -exports.mergeJsonOptions = mergeJsonOptions; - - -/***/ }), - -/***/ 49999: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isJsonObject = exports.typeofJsonValue = void 0; -/** - * Get the type of a JSON value. - * Distinguishes between array, null and object. - */ -function typeofJsonValue(value) { - let t = typeof value; - if (t == "object") { - if (Array.isArray(value)) - return "array"; - if (value === null) - return "null"; - } - return t; -} -exports.typeofJsonValue = typeofJsonValue; -/** - * Is this a JSON object (instead of an array or null)? - */ -function isJsonObject(value) { - return value !== null && typeof value == "object" && !Array.isArray(value); -} -exports.isJsonObject = isJsonObject; - - -/***/ }), - -/***/ 4073: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.lowerCamelCase = void 0; -/** - * Converts snake_case to lowerCamelCase. - * - * Should behave like protoc: - * https://github.com/protocolbuffers/protobuf/blob/e8ae137c96444ea313485ed1118c5e43b2099cf1/src/google/protobuf/compiler/java/java_helpers.cc#L118 - */ -function lowerCamelCase(snakeCase) { - let capNext = false; - const sb = []; - for (let i = 0; i < snakeCase.length; i++) { - let next = snakeCase.charAt(i); - if (next == '_') { - capNext = true; - } - else if (/\d/.test(next)) { - sb.push(next); - capNext = true; - } - else if (capNext) { - sb.push(next.toUpperCase()); - capNext = false; - } - else if (i == 0) { - sb.push(next.toLowerCase()); - } - else { - sb.push(next); - } - } - return sb.join(''); -} -exports.lowerCamelCase = lowerCamelCase; - - -/***/ }), - -/***/ 43785: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MESSAGE_TYPE = void 0; -/** - * The symbol used as a key on message objects to store the message type. - * - * Note that this is an experimental feature - it is here to stay, but - * implementation details may change without notice. - */ -exports.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); - - -/***/ }), - -/***/ 15106: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageType = void 0; -const message_type_contract_1 = __nccwpck_require__(43785); -const reflection_info_1 = __nccwpck_require__(67910); -const reflection_type_check_1 = __nccwpck_require__(25167); -const reflection_json_reader_1 = __nccwpck_require__(46790); -const reflection_json_writer_1 = __nccwpck_require__(11094); -const reflection_binary_reader_1 = __nccwpck_require__(89611); -const reflection_binary_writer_1 = __nccwpck_require__(66907); -const reflection_create_1 = __nccwpck_require__(75726); -const reflection_merge_partial_1 = __nccwpck_require__(98044); -const json_typings_1 = __nccwpck_require__(49999); -const json_format_contract_1 = __nccwpck_require__(29367); -const reflection_equals_1 = __nccwpck_require__(4827); -const binary_writer_1 = __nccwpck_require__(23957); -const binary_reader_1 = __nccwpck_require__(92889); -/** - * This standard message type provides reflection-based - * operations to work with a message. - */ -class MessageType { - constructor(name, fields, options) { - this.defaultCheckDepth = 16; - this.typeName = name; - this.fields = fields.map(reflection_info_1.normalizeFieldInfo); - this.options = options !== null && options !== void 0 ? options : {}; - this.messagePrototype = Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: this }); - this.refTypeCheck = new reflection_type_check_1.ReflectionTypeCheck(this); - this.refJsonReader = new reflection_json_reader_1.ReflectionJsonReader(this); - this.refJsonWriter = new reflection_json_writer_1.ReflectionJsonWriter(this); - this.refBinReader = new reflection_binary_reader_1.ReflectionBinaryReader(this); - this.refBinWriter = new reflection_binary_writer_1.ReflectionBinaryWriter(this); - } - create(value) { - let message = reflection_create_1.reflectionCreate(this); - if (value !== undefined) { - reflection_merge_partial_1.reflectionMergePartial(this, message, value); - } - return message; - } - /** - * Clone the message. - * - * Unknown fields are discarded. - */ - clone(message) { - let copy = this.create(); - reflection_merge_partial_1.reflectionMergePartial(this, copy, message); - return copy; - } - /** - * Determines whether two message of the same type have the same field values. - * Checks for deep equality, traversing repeated fields, oneof groups, maps - * and messages recursively. - * Will also return true if both messages are `undefined`. - */ - equals(a, b) { - return reflection_equals_1.reflectionEquals(this, a, b); - } - /** - * Is the given value assignable to our message type - * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? - */ - is(arg, depth = this.defaultCheckDepth) { - return this.refTypeCheck.is(arg, depth, false); - } - /** - * Is the given value assignable to our message type, - * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? - */ - isAssignable(arg, depth = this.defaultCheckDepth) { - return this.refTypeCheck.is(arg, depth, true); - } - /** - * Copy partial data into the target message. - */ - mergePartial(target, source) { - reflection_merge_partial_1.reflectionMergePartial(this, target, source); - } - /** - * Create a new message from binary format. - */ - fromBinary(data, options) { - let opt = binary_reader_1.binaryReadOptions(options); - return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); - } - /** - * Read a new message from a JSON value. - */ - fromJson(json, options) { - return this.internalJsonRead(json, json_format_contract_1.jsonReadOptions(options)); - } - /** - * Read a new message from a JSON string. - * This is equivalent to `T.fromJson(JSON.parse(json))`. - */ - fromJsonString(json, options) { - let value = JSON.parse(json); - return this.fromJson(value, options); - } - /** - * Write the message to canonical JSON value. - */ - toJson(message, options) { - return this.internalJsonWrite(message, json_format_contract_1.jsonWriteOptions(options)); - } - /** - * Convert the message to canonical JSON string. - * This is equivalent to `JSON.stringify(T.toJson(t))` - */ - toJsonString(message, options) { - var _a; - let value = this.toJson(message, options); - return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); - } - /** - * Write the message to binary format. - */ - toBinary(message, options) { - let opt = binary_writer_1.binaryWriteOptions(options); - return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); - } - /** - * This is an internal method. If you just want to read a message from - * JSON, use `fromJson()` or `fromJsonString()`. - * - * Reads JSON value and merges the fields into the target - * according to protobuf rules. If the target is omitted, - * a new instance is created first. - */ - internalJsonRead(json, options, target) { - if (json !== null && typeof json == "object" && !Array.isArray(json)) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refJsonReader.read(json, message, options); - return message; - } - throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json)}.`); - } - /** - * This is an internal method. If you just want to write a message - * to JSON, use `toJson()` or `toJsonString(). - * - * Writes JSON value and returns it. - */ - internalJsonWrite(message, options) { - return this.refJsonWriter.write(message, options); - } - /** - * This is an internal method. If you just want to write a message - * in binary format, use `toBinary()`. - * - * Serializes the message in binary format and appends it to the given - * writer. Returns passed writer. - */ - internalBinaryWrite(message, writer, options) { - this.refBinWriter.write(message, writer, options); - return writer; - } - /** - * This is an internal method. If you just want to read a message from - * binary data, use `fromBinary()`. - * - * Reads data from binary format and merges the fields into - * the target according to protobuf rules. If the target is - * omitted, a new instance is created first. - */ - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refBinReader.read(reader, message, options, length); - return message; - } -} -exports.MessageType = MessageType; - - -/***/ }), - -/***/ 18063: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSelectedOneofValue = exports.clearOneofValue = exports.setUnknownOneofValue = exports.setOneofValue = exports.getOneofValue = exports.isOneofGroup = void 0; -/** - * Is the given value a valid oneof group? - * - * We represent protobuf `oneof` as algebraic data types (ADT) in generated - * code. But when working with messages of unknown type, the ADT does not - * help us. - * - * This type guard checks if the given object adheres to the ADT rules, which - * are as follows: - * - * 1) Must be an object. - * - * 2) Must have a "oneofKind" discriminator property. - * - * 3) If "oneofKind" is `undefined`, no member field is selected. The object - * must not have any other properties. - * - * 4) If "oneofKind" is a `string`, the member field with this name is - * selected. - * - * 5) If a member field is selected, the object must have a second property - * with this name. The property must not be `undefined`. - * - * 6) No extra properties are allowed. The object has either one property - * (no selection) or two properties (selection). - * - */ -function isOneofGroup(any) { - if (typeof any != 'object' || any === null || !any.hasOwnProperty('oneofKind')) { - return false; - } - switch (typeof any.oneofKind) { - case "string": - if (any[any.oneofKind] === undefined) - return false; - return Object.keys(any).length == 2; - case "undefined": - return Object.keys(any).length == 1; - default: - return false; - } -} -exports.isOneofGroup = isOneofGroup; -/** - * Returns the value of the given field in a oneof group. - */ -function getOneofValue(oneof, kind) { - return oneof[kind]; -} -exports.getOneofValue = getOneofValue; -function setOneofValue(oneof, kind, value) { - if (oneof.oneofKind !== undefined) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = kind; - if (value !== undefined) { - oneof[kind] = value; - } -} -exports.setOneofValue = setOneofValue; -function setUnknownOneofValue(oneof, kind, value) { - if (oneof.oneofKind !== undefined) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = kind; - if (value !== undefined && kind !== undefined) { - oneof[kind] = value; - } -} -exports.setUnknownOneofValue = setUnknownOneofValue; -/** - * Removes the selected field in a oneof group. - * - * Note that the recommended way to modify a oneof group is to set - * a new object: - * - * ```ts - * message.result = { oneofKind: undefined }; - * ``` - */ -function clearOneofValue(oneof) { - if (oneof.oneofKind !== undefined) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = undefined; -} -exports.clearOneofValue = clearOneofValue; -/** - * Returns the selected value of the given oneof group. - * - * Not that the recommended way to access a oneof group is to check - * the "oneofKind" property and let TypeScript narrow down the union - * type for you: - * - * ```ts - * if (message.result.oneofKind === "error") { - * message.result.error; // string - * } - * ``` - * - * In the rare case you just need the value, and do not care about - * which protobuf field is selected, you can use this function - * for convenience. - */ -function getSelectedOneofValue(oneof) { - if (oneof.oneofKind === undefined) { - return undefined; - } - return oneof[oneof.oneofKind]; -} -exports.getSelectedOneofValue = getSelectedOneofValue; - - -/***/ }), - -/***/ 61753: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PbLong = exports.PbULong = exports.detectBi = void 0; -const goog_varint_1 = __nccwpck_require__(93223); -let BI; -function detectBi() { - const dv = new DataView(new ArrayBuffer(8)); - const ok = globalThis.BigInt !== undefined - && typeof dv.getBigInt64 === "function" - && typeof dv.getBigUint64 === "function" - && typeof dv.setBigInt64 === "function" - && typeof dv.setBigUint64 === "function"; - BI = ok ? { - MIN: BigInt("-9223372036854775808"), - MAX: BigInt("9223372036854775807"), - UMIN: BigInt("0"), - UMAX: BigInt("18446744073709551615"), - C: BigInt, - V: dv, - } : undefined; -} -exports.detectBi = detectBi; -detectBi(); -function assertBi(bi) { - if (!bi) - throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support"); -} -// used to validate from(string) input (when bigint is unavailable) -const RE_DECIMAL_STR = /^-?[0-9]+$/; -// constants for binary math -const TWO_PWR_32_DBL = 0x100000000; -const HALF_2_PWR_32 = 0x080000000; -// base class for PbLong and PbULong provides shared code -class SharedPbLong { - /** - * Create a new instance with the given bits. - */ - constructor(lo, hi) { - this.lo = lo | 0; - this.hi = hi | 0; - } - /** - * Is this instance equal to 0? - */ - isZero() { - return this.lo == 0 && this.hi == 0; - } - /** - * Convert to a native number. - */ - toNumber() { - let result = this.hi * TWO_PWR_32_DBL + (this.lo >>> 0); - if (!Number.isSafeInteger(result)) - throw new Error("cannot convert to safe number"); - return result; - } -} -/** - * 64-bit unsigned integer as two 32-bit values. - * Converts between `string`, `number` and `bigint` representations. - */ -class PbULong extends SharedPbLong { - /** - * Create instance from a `string`, `number` or `bigint`. - */ - static from(value) { - if (BI) - // noinspection FallThroughInSwitchStatementJS - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - if (value == "") - throw new Error('string is no integer'); - value = BI.C(value); - case "number": - if (value === 0) - return this.ZERO; - value = BI.C(value); - case "bigint": - if (!value) - return this.ZERO; - if (value < BI.UMIN) - throw new Error('signed value for ulong'); - if (value > BI.UMAX) - throw new Error('ulong too large'); - BI.V.setBigUint64(0, value, true); - return new PbULong(BI.V.getInt32(0, true), BI.V.getInt32(4, true)); - } - else - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - value = value.trim(); - if (!RE_DECIMAL_STR.test(value)) - throw new Error('string is no integer'); - let [minus, lo, hi] = goog_varint_1.int64fromString(value); - if (minus) - throw new Error('signed value for ulong'); - return new PbULong(lo, hi); - case "number": - if (value == 0) - return this.ZERO; - if (!Number.isSafeInteger(value)) - throw new Error('number is no integer'); - if (value < 0) - throw new Error('signed value for ulong'); - return new PbULong(value, value / TWO_PWR_32_DBL); - } - throw new Error('unknown value ' + typeof value); - } - /** - * Convert to decimal string. - */ - toString() { - return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); - } - /** - * Convert to native bigint. - */ - toBigInt() { - assertBi(BI); - BI.V.setInt32(0, this.lo, true); - BI.V.setInt32(4, this.hi, true); - return BI.V.getBigUint64(0, true); - } -} -exports.PbULong = PbULong; -/** - * ulong 0 singleton. - */ -PbULong.ZERO = new PbULong(0, 0); -/** - * 64-bit signed integer as two 32-bit values. - * Converts between `string`, `number` and `bigint` representations. - */ -class PbLong extends SharedPbLong { - /** - * Create instance from a `string`, `number` or `bigint`. - */ - static from(value) { - if (BI) - // noinspection FallThroughInSwitchStatementJS - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - if (value == "") - throw new Error('string is no integer'); - value = BI.C(value); - case "number": - if (value === 0) - return this.ZERO; - value = BI.C(value); - case "bigint": - if (!value) - return this.ZERO; - if (value < BI.MIN) - throw new Error('signed long too small'); - if (value > BI.MAX) - throw new Error('signed long too large'); - BI.V.setBigInt64(0, value, true); - return new PbLong(BI.V.getInt32(0, true), BI.V.getInt32(4, true)); - } - else - switch (typeof value) { - case "string": - if (value == "0") - return this.ZERO; - value = value.trim(); - if (!RE_DECIMAL_STR.test(value)) - throw new Error('string is no integer'); - let [minus, lo, hi] = goog_varint_1.int64fromString(value); - if (minus) { - if (hi > HALF_2_PWR_32 || (hi == HALF_2_PWR_32 && lo != 0)) - throw new Error('signed long too small'); - } - else if (hi >= HALF_2_PWR_32) - throw new Error('signed long too large'); - let pbl = new PbLong(lo, hi); - return minus ? pbl.negate() : pbl; - case "number": - if (value == 0) - return this.ZERO; - if (!Number.isSafeInteger(value)) - throw new Error('number is no integer'); - return value > 0 - ? new PbLong(value, value / TWO_PWR_32_DBL) - : new PbLong(-value, -value / TWO_PWR_32_DBL).negate(); - } - throw new Error('unknown value ' + typeof value); - } - /** - * Do we have a minus sign? - */ - isNegative() { - return (this.hi & HALF_2_PWR_32) !== 0; - } - /** - * Negate two's complement. - * Invert all the bits and add one to the result. - */ - negate() { - let hi = ~this.hi, lo = this.lo; - if (lo) - lo = ~lo + 1; - else - hi += 1; - return new PbLong(lo, hi); - } - /** - * Convert to decimal string. - */ - toString() { - if (BI) - return this.toBigInt().toString(); - if (this.isNegative()) { - let n = this.negate(); - return '-' + goog_varint_1.int64toString(n.lo, n.hi); - } - return goog_varint_1.int64toString(this.lo, this.hi); - } - /** - * Convert to native bigint. - */ - toBigInt() { - assertBi(BI); - BI.V.setInt32(0, this.lo, true); - BI.V.setInt32(4, this.hi, true); - return BI.V.getBigInt64(0, true); - } -} -exports.PbLong = PbLong; -/** - * long 0 singleton. - */ -PbLong.ZERO = new PbLong(0, 0); - - -/***/ }), - -/***/ 58950: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// Copyright (c) 2016, Daniel Wirtz All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// * Neither the name of its author, nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.utf8read = void 0; -const fromCharCodes = (chunk) => String.fromCharCode.apply(String, chunk); -/** - * @deprecated This function will no longer be exported with the next major - * release, since protobuf-ts has switch to TextDecoder API. If you need this - * function, please migrate to @protobufjs/utf8. For context, see - * https://github.com/timostamm/protobuf-ts/issues/184 - * - * Reads UTF8 bytes as a string. - * - * See [protobufjs / utf8](https://github.com/protobufjs/protobuf.js/blob/9893e35b854621cce64af4bf6be2cff4fb892796/lib/utf8/index.js#L40) - * - * Copyright (c) 2016, Daniel Wirtz - */ -function utf8read(bytes) { - if (bytes.length < 1) - return ""; - let pos = 0, // position in bytes - parts = [], chunk = [], i = 0, // char offset - t; // temporary - let len = bytes.length; - while (pos < len) { - t = bytes[pos++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | bytes[pos++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (bytes[pos++] & 63) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } - else - chunk[i++] = (t & 15) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63; - if (i > 8191) { - parts.push(fromCharCodes(chunk)); - i = 0; - } - } - if (parts.length) { - if (i) - parts.push(fromCharCodes(chunk.slice(0, i))); - return parts.join(""); - } - return fromCharCodes(chunk.slice(0, i)); -} -exports.utf8read = utf8read; - - -/***/ }), - -/***/ 89611: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReflectionBinaryReader = void 0; -const binary_format_contract_1 = __nccwpck_require__(54816); -const reflection_info_1 = __nccwpck_require__(67910); -const reflection_long_convert_1 = __nccwpck_require__(63402); -const reflection_scalar_default_1 = __nccwpck_require__(19526); -/** - * Reads proto3 messages in binary format using reflection information. - * - * https://developers.google.com/protocol-buffers/docs/encoding - */ -class ReflectionBinaryReader { - constructor(info) { - this.info = info; - } - prepare() { - var _a; - if (!this.fieldNoToField) { - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - this.fieldNoToField = new Map(fieldsInput.map(field => [field.no, field])); - } - } - /** - * Reads a message from binary format into the target message. - * - * Repeated fields are appended. Map entries are added, overwriting - * existing keys. - * - * If a message field is already present, it will be merged with the - * new data. - */ - read(reader, message, options, length) { - this.prepare(); - const end = length === undefined ? reader.len : reader.pos + length; - while (reader.pos < end) { - // read the tag and find the field - const [fieldNo, wireType] = reader.tag(), field = this.fieldNoToField.get(fieldNo); - if (!field) { - let u = options.readUnknownField; - if (u == "throw") - throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.info.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? binary_format_contract_1.UnknownFieldHandler.onRead : u)(this.info.typeName, message, fieldNo, wireType, d); - continue; - } - // target object for the field we are reading - let target = message, repeated = field.repeat, localName = field.localName; - // if field is member of oneof ADT, use ADT as target - if (field.oneof) { - target = target[field.oneof]; - // if other oneof member selected, set new ADT - if (target.oneofKind !== localName) - target = message[field.oneof] = { - oneofKind: localName - }; - } - // we have handled oneof above, we just have read the value into `target[localName]` - switch (field.kind) { - case "scalar": - case "enum": - let T = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; - let L = field.kind == "scalar" ? field.L : undefined; - if (repeated) { - let arr = target[localName]; // safe to assume presence of array, oneof cannot contain repeated values - if (wireType == binary_format_contract_1.WireType.LengthDelimited && T != reflection_info_1.ScalarType.STRING && T != reflection_info_1.ScalarType.BYTES) { - let e = reader.uint32() + reader.pos; - while (reader.pos < e) - arr.push(this.scalar(reader, T, L)); - } - else - arr.push(this.scalar(reader, T, L)); - } - else - target[localName] = this.scalar(reader, T, L); - break; - case "message": - if (repeated) { - let arr = target[localName]; // safe to assume presence of array, oneof cannot contain repeated values - let msg = field.T().internalBinaryRead(reader, reader.uint32(), options); - arr.push(msg); - } - else - target[localName] = field.T().internalBinaryRead(reader, reader.uint32(), options, target[localName]); - break; - case "map": - let [mapKey, mapVal] = this.mapEntry(field, reader, options); - // safe to assume presence of map object, oneof cannot contain repeated values - target[localName][mapKey] = mapVal; - break; - } - } - } - /** - * Read a map field, expecting key field = 1, value field = 2 - */ - mapEntry(field, reader, options) { - let length = reader.uint32(); - let end = reader.pos + length; - let key = undefined; // javascript only allows number or string for object properties - let val = undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - if (field.K == reflection_info_1.ScalarType.BOOL) - key = reader.bool().toString(); - else - // long types are read as string, number types are okay as number - key = this.scalar(reader, field.K, reflection_info_1.LongType.STRING); - break; - case 2: - switch (field.V.kind) { - case "scalar": - val = this.scalar(reader, field.V.T, field.V.L); - break; - case "enum": - val = reader.int32(); - break; - case "message": - val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); - break; - } - break; - default: - throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) in map entry for ${this.info.typeName}#${field.name}`); - } - } - if (key === undefined) { - let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); - key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; - } - if (val === undefined) - switch (field.V.kind) { - case "scalar": - val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); - break; - case "enum": - val = 0; - break; - case "message": - val = field.V.T().create(); - break; - } - return [key, val]; - } - scalar(reader, type, longType) { - switch (type) { - case reflection_info_1.ScalarType.INT32: - return reader.int32(); - case reflection_info_1.ScalarType.STRING: - return reader.string(); - case reflection_info_1.ScalarType.BOOL: - return reader.bool(); - case reflection_info_1.ScalarType.DOUBLE: - return reader.double(); - case reflection_info_1.ScalarType.FLOAT: - return reader.float(); - case reflection_info_1.ScalarType.INT64: - return reflection_long_convert_1.reflectionLongConvert(reader.int64(), longType); - case reflection_info_1.ScalarType.UINT64: - return reflection_long_convert_1.reflectionLongConvert(reader.uint64(), longType); - case reflection_info_1.ScalarType.FIXED64: - return reflection_long_convert_1.reflectionLongConvert(reader.fixed64(), longType); - case reflection_info_1.ScalarType.FIXED32: - return reader.fixed32(); - case reflection_info_1.ScalarType.BYTES: - return reader.bytes(); - case reflection_info_1.ScalarType.UINT32: - return reader.uint32(); - case reflection_info_1.ScalarType.SFIXED32: - return reader.sfixed32(); - case reflection_info_1.ScalarType.SFIXED64: - return reflection_long_convert_1.reflectionLongConvert(reader.sfixed64(), longType); - case reflection_info_1.ScalarType.SINT32: - return reader.sint32(); - case reflection_info_1.ScalarType.SINT64: - return reflection_long_convert_1.reflectionLongConvert(reader.sint64(), longType); - } - } -} -exports.ReflectionBinaryReader = ReflectionBinaryReader; - - -/***/ }), - -/***/ 66907: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReflectionBinaryWriter = void 0; -const binary_format_contract_1 = __nccwpck_require__(54816); -const reflection_info_1 = __nccwpck_require__(67910); -const assert_1 = __nccwpck_require__(8602); -const pb_long_1 = __nccwpck_require__(61753); -/** - * Writes proto3 messages in binary format using reflection information. - * - * https://developers.google.com/protocol-buffers/docs/encoding - */ -class ReflectionBinaryWriter { - constructor(info) { - this.info = info; - } - prepare() { - if (!this.fields) { - const fieldsInput = this.info.fields ? this.info.fields.concat() : []; - this.fields = fieldsInput.sort((a, b) => a.no - b.no); - } - } - /** - * Writes the message to binary format. - */ - write(message, writer, options) { - this.prepare(); - for (const field of this.fields) { - let value, // this will be our field value, whether it is member of a oneof or not - emitDefault, // whether we emit the default value (only true for oneof members) - repeated = field.repeat, localName = field.localName; - // handle oneof ADT - if (field.oneof) { - const group = message[field.oneof]; - if (group.oneofKind !== localName) - continue; // if field is not selected, skip - value = group[localName]; - emitDefault = true; - } - else { - value = message[localName]; - emitDefault = false; - } - // we have handled oneof above. we just have to honor `emitDefault`. - switch (field.kind) { - case "scalar": - case "enum": - let T = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; - if (repeated) { - assert_1.assert(Array.isArray(value)); - if (repeated == reflection_info_1.RepeatType.PACKED) - this.packed(writer, T, field.no, value); - else - for (const item of value) - this.scalar(writer, T, field.no, item, true); - } - else if (value === undefined) - assert_1.assert(field.opt); - else - this.scalar(writer, T, field.no, value, emitDefault || field.opt); - break; - case "message": - if (repeated) { - assert_1.assert(Array.isArray(value)); - for (const item of value) - this.message(writer, options, field.T(), field.no, item); - } - else { - this.message(writer, options, field.T(), field.no, value); - } - break; - case "map": - assert_1.assert(typeof value == 'object' && value !== null); - for (const [key, val] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val); - break; - } - } - let u = options.writeUnknownFields; - if (u !== false) - (u === true ? binary_format_contract_1.UnknownFieldHandler.onWrite : u)(this.info.typeName, message, writer); - } - mapEntry(writer, options, field, key, value) { - writer.tag(field.no, binary_format_contract_1.WireType.LengthDelimited); - writer.fork(); - // javascript only allows number or string for object properties - // we convert from our representation to the protobuf type - let keyValue = key; - switch (field.K) { - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.UINT32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - keyValue = Number.parseInt(key); - break; - case reflection_info_1.ScalarType.BOOL: - assert_1.assert(key == 'true' || key == 'false'); - keyValue = key == 'true'; - break; - } - // write key, expecting key field number = 1 - this.scalar(writer, field.K, 1, keyValue, true); - // write value, expecting value field number = 2 - switch (field.V.kind) { - case 'scalar': - this.scalar(writer, field.V.T, 2, value, true); - break; - case 'enum': - this.scalar(writer, reflection_info_1.ScalarType.INT32, 2, value, true); - break; - case 'message': - this.message(writer, options, field.V.T(), 2, value); - break; - } - writer.join(); - } - message(writer, options, handler, fieldNo, value) { - if (value === undefined) - return; - handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); - writer.join(); - } - /** - * Write a single scalar value. - */ - scalar(writer, type, fieldNo, value, emitDefault) { - let [wireType, method, isDefault] = this.scalarInfo(type, value); - if (!isDefault || emitDefault) { - writer.tag(fieldNo, wireType); - writer[method](value); - } - } - /** - * Write an array of scalar values in packed format. - */ - packed(writer, type, fieldNo, value) { - if (!value.length) - return; - assert_1.assert(type !== reflection_info_1.ScalarType.BYTES && type !== reflection_info_1.ScalarType.STRING); - // write tag - writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); - // begin length-delimited - writer.fork(); - // write values without tags - let [, method,] = this.scalarInfo(type); - for (let i = 0; i < value.length; i++) - writer[method](value[i]); - // end length delimited - writer.join(); - } - /** - * Get information for writing a scalar value. - * - * Returns tuple: - * [0]: appropriate WireType - * [1]: name of the appropriate method of IBinaryWriter - * [2]: whether the given value is a default value - * - * If argument `value` is omitted, [2] is always false. - */ - scalarInfo(type, value) { - let t = binary_format_contract_1.WireType.Varint; - let m; - let i = value === undefined; - let d = value === 0; - switch (type) { - case reflection_info_1.ScalarType.INT32: - m = "int32"; - break; - case reflection_info_1.ScalarType.STRING: - d = i || !value.length; - t = binary_format_contract_1.WireType.LengthDelimited; - m = "string"; - break; - case reflection_info_1.ScalarType.BOOL: - d = value === false; - m = "bool"; - break; - case reflection_info_1.ScalarType.UINT32: - m = "uint32"; - break; - case reflection_info_1.ScalarType.DOUBLE: - t = binary_format_contract_1.WireType.Bit64; - m = "double"; - break; - case reflection_info_1.ScalarType.FLOAT: - t = binary_format_contract_1.WireType.Bit32; - m = "float"; - break; - case reflection_info_1.ScalarType.INT64: - d = i || pb_long_1.PbLong.from(value).isZero(); - m = "int64"; - break; - case reflection_info_1.ScalarType.UINT64: - d = i || pb_long_1.PbULong.from(value).isZero(); - m = "uint64"; - break; - case reflection_info_1.ScalarType.FIXED64: - d = i || pb_long_1.PbULong.from(value).isZero(); - t = binary_format_contract_1.WireType.Bit64; - m = "fixed64"; - break; - case reflection_info_1.ScalarType.BYTES: - d = i || !value.byteLength; - t = binary_format_contract_1.WireType.LengthDelimited; - m = "bytes"; - break; - case reflection_info_1.ScalarType.FIXED32: - t = binary_format_contract_1.WireType.Bit32; - m = "fixed32"; - break; - case reflection_info_1.ScalarType.SFIXED32: - t = binary_format_contract_1.WireType.Bit32; - m = "sfixed32"; - break; - case reflection_info_1.ScalarType.SFIXED64: - d = i || pb_long_1.PbLong.from(value).isZero(); - t = binary_format_contract_1.WireType.Bit64; - m = "sfixed64"; - break; - case reflection_info_1.ScalarType.SINT32: - m = "sint32"; - break; - case reflection_info_1.ScalarType.SINT64: - d = i || pb_long_1.PbLong.from(value).isZero(); - m = "sint64"; - break; - } - return [t, m, i || d]; - } -} -exports.ReflectionBinaryWriter = ReflectionBinaryWriter; - - -/***/ }), - -/***/ 59946: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.containsMessageType = void 0; -const message_type_contract_1 = __nccwpck_require__(43785); -/** - * Check if the provided object is a proto message. - * - * Note that this is an experimental feature - it is here to stay, but - * implementation details may change without notice. - */ -function containsMessageType(msg) { - return msg[message_type_contract_1.MESSAGE_TYPE] != null; -} -exports.containsMessageType = containsMessageType; - - -/***/ }), - -/***/ 75726: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reflectionCreate = void 0; -const reflection_scalar_default_1 = __nccwpck_require__(19526); -const message_type_contract_1 = __nccwpck_require__(43785); -/** - * Creates an instance of the generic message, using the field - * information. - */ -function reflectionCreate(type) { - /** - * This ternary can be removed in the next major version. - * The `Object.create()` code path utilizes a new `messagePrototype` - * property on the `IMessageType` which has this same `MESSAGE_TYPE` - * non-enumerable property on it. Doing it this way means that we only - * pay the cost of `Object.defineProperty()` once per `IMessageType` - * class of once per "instance". The falsy code path is only provided - * for backwards compatibility in cases where the runtime library is - * updated without also updating the generated code. - */ - const msg = type.messagePrototype - ? Object.create(type.messagePrototype) - : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type }); - for (let field of type.fields) { - let name = field.localName; - if (field.opt) - continue; - if (field.oneof) - msg[field.oneof] = { oneofKind: undefined }; - else if (field.repeat) - msg[name] = []; - else - switch (field.kind) { - case "scalar": - msg[name] = reflection_scalar_default_1.reflectionScalarDefault(field.T, field.L); - break; - case "enum": - // we require 0 to be default value for all enums - msg[name] = 0; - break; - case "map": - msg[name] = {}; - break; - } - } - return msg; -} -exports.reflectionCreate = reflectionCreate; - - -/***/ }), - -/***/ 4827: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reflectionEquals = void 0; -const reflection_info_1 = __nccwpck_require__(67910); -/** - * Determines whether two message of the same type have the same field values. - * Checks for deep equality, traversing repeated fields, oneof groups, maps - * and messages recursively. - * Will also return true if both messages are `undefined`. - */ -function reflectionEquals(info, a, b) { - if (a === b) - return true; - if (!a || !b) - return false; - for (let field of info.fields) { - let localName = field.localName; - let val_a = field.oneof ? a[field.oneof][localName] : a[localName]; - let val_b = field.oneof ? b[field.oneof][localName] : b[localName]; - switch (field.kind) { - case "enum": - case "scalar": - let t = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; - if (!(field.repeat - ? repeatedPrimitiveEq(t, val_a, val_b) - : primitiveEq(t, val_a, val_b))) - return false; - break; - case "map": - if (!(field.V.kind == "message" - ? repeatedMsgEq(field.V.T(), objectValues(val_a), objectValues(val_b)) - : repeatedPrimitiveEq(field.V.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.V.T, objectValues(val_a), objectValues(val_b)))) - return false; - break; - case "message": - let T = field.T(); - if (!(field.repeat - ? repeatedMsgEq(T, val_a, val_b) - : T.equals(val_a, val_b))) - return false; - break; - } - } - return true; -} -exports.reflectionEquals = reflectionEquals; -const objectValues = Object.values; -function primitiveEq(type, a, b) { - if (a === b) - return true; - if (type !== reflection_info_1.ScalarType.BYTES) - return false; - let ba = a; - let bb = b; - if (ba.length !== bb.length) - return false; - for (let i = 0; i < ba.length; i++) - if (ba[i] != bb[i]) - return false; - return true; -} -function repeatedPrimitiveEq(type, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!primitiveEq(type, a[i], b[i])) - return false; - return true; -} -function repeatedMsgEq(type, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!type.equals(a[i], b[i])) - return false; - return true; -} - - -/***/ }), - -/***/ 67910: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readMessageOption = exports.readFieldOption = exports.readFieldOptions = exports.normalizeFieldInfo = exports.RepeatType = exports.LongType = exports.ScalarType = void 0; -const lower_camel_case_1 = __nccwpck_require__(4073); -/** - * Scalar value types. This is a subset of field types declared by protobuf - * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE - * are omitted, but the numerical values are identical. - */ -var ScalarType; -(function (ScalarType) { - // 0 is reserved for errors. - // Order is weird for historical reasons. - ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE"; - ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT"; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - ScalarType[ScalarType["INT64"] = 3] = "INT64"; - ScalarType[ScalarType["UINT64"] = 4] = "UINT64"; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - ScalarType[ScalarType["INT32"] = 5] = "INT32"; - ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64"; - ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32"; - ScalarType[ScalarType["BOOL"] = 8] = "BOOL"; - ScalarType[ScalarType["STRING"] = 9] = "STRING"; - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - // TYPE_GROUP = 10, - // TYPE_MESSAGE = 11, // Length-delimited aggregate. - // New in version 2. - ScalarType[ScalarType["BYTES"] = 12] = "BYTES"; - ScalarType[ScalarType["UINT32"] = 13] = "UINT32"; - // TYPE_ENUM = 14, - ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32"; - ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64"; - ScalarType[ScalarType["SINT32"] = 17] = "SINT32"; - ScalarType[ScalarType["SINT64"] = 18] = "SINT64"; -})(ScalarType = exports.ScalarType || (exports.ScalarType = {})); -/** - * JavaScript representation of 64 bit integral types. Equivalent to the - * field option "jstype". - * - * By default, protobuf-ts represents 64 bit types as `bigint`. - * - * You can change the default behaviour by enabling the plugin parameter - * `long_type_string`, which will represent 64 bit types as `string`. - * - * Alternatively, you can change the behaviour for individual fields - * with the field option "jstype": - * - * ```protobuf - * uint64 my_field = 1 [jstype = JS_STRING]; - * uint64 other_field = 2 [jstype = JS_NUMBER]; - * ``` - */ -var LongType; -(function (LongType) { - /** - * Use JavaScript `bigint`. - * - * Field option `[jstype = JS_NORMAL]`. - */ - LongType[LongType["BIGINT"] = 0] = "BIGINT"; - /** - * Use JavaScript `string`. - * - * Field option `[jstype = JS_STRING]`. - */ - LongType[LongType["STRING"] = 1] = "STRING"; - /** - * Use JavaScript `number`. - * - * Large values will loose precision. - * - * Field option `[jstype = JS_NUMBER]`. - */ - LongType[LongType["NUMBER"] = 2] = "NUMBER"; -})(LongType = exports.LongType || (exports.LongType = {})); -/** - * Protobuf 2.1.0 introduced packed repeated fields. - * Setting the field option `[packed = true]` enables packing. - * - * In proto3, all repeated fields are packed by default. - * Setting the field option `[packed = false]` disables packing. - * - * Packed repeated fields are encoded with a single tag, - * then a length-delimiter, then the element values. - * - * Unpacked repeated fields are encoded with a tag and - * value for each element. - * - * `bytes` and `string` cannot be packed. - */ -var RepeatType; -(function (RepeatType) { - /** - * The field is not repeated. - */ - RepeatType[RepeatType["NO"] = 0] = "NO"; - /** - * The field is repeated and should be packed. - * Invalid for `bytes` and `string`, they cannot be packed. - */ - RepeatType[RepeatType["PACKED"] = 1] = "PACKED"; - /** - * The field is repeated but should not be packed. - * The only valid repeat type for repeated `bytes` and `string`. - */ - RepeatType[RepeatType["UNPACKED"] = 2] = "UNPACKED"; -})(RepeatType = exports.RepeatType || (exports.RepeatType = {})); -/** - * Turns PartialFieldInfo into FieldInfo. - */ -function normalizeFieldInfo(field) { - var _a, _b, _c, _d; - field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : lower_camel_case_1.lowerCamelCase(field.name); - field.jsonName = (_b = field.jsonName) !== null && _b !== void 0 ? _b : lower_camel_case_1.lowerCamelCase(field.name); - field.repeat = (_c = field.repeat) !== null && _c !== void 0 ? _c : RepeatType.NO; - field.opt = (_d = field.opt) !== null && _d !== void 0 ? _d : (field.repeat ? false : field.oneof ? false : field.kind == "message"); - return field; -} -exports.normalizeFieldInfo = normalizeFieldInfo; -/** - * Read custom field options from a generated message type. - * - * @deprecated use readFieldOption() - */ -function readFieldOptions(messageType, fieldName, extensionName, extensionType) { - var _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : undefined; -} -exports.readFieldOptions = readFieldOptions; -function readFieldOption(messageType, fieldName, extensionName, extensionType) { - var _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; - if (!options) { - return undefined; - } - const optionVal = options[extensionName]; - if (optionVal === undefined) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; -} -exports.readFieldOption = readFieldOption; -function readMessageOption(messageType, extensionName, extensionType) { - const options = messageType.options; - const optionVal = options[extensionName]; - if (optionVal === undefined) { - return optionVal; - } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; -} -exports.readMessageOption = readMessageOption; - - -/***/ }), - -/***/ 46790: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReflectionJsonReader = void 0; -const json_typings_1 = __nccwpck_require__(49999); -const base64_1 = __nccwpck_require__(26335); -const reflection_info_1 = __nccwpck_require__(67910); -const pb_long_1 = __nccwpck_require__(61753); -const assert_1 = __nccwpck_require__(8602); -const reflection_long_convert_1 = __nccwpck_require__(63402); -/** - * Reads proto3 messages in canonical JSON format using reflection information. - * - * https://developers.google.com/protocol-buffers/docs/proto3#json - */ -class ReflectionJsonReader { - constructor(info) { - this.info = info; - } - prepare() { - var _a; - if (this.fMap === undefined) { - this.fMap = {}; - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - for (const field of fieldsInput) { - this.fMap[field.name] = field; - this.fMap[field.jsonName] = field; - this.fMap[field.localName] = field; - } - } - } - // Cannot parse JSON for #. - assert(condition, fieldName, jsonValue) { - if (!condition) { - let what = json_typings_1.typeofJsonValue(jsonValue); - if (what == "number" || what == "boolean") - what = jsonValue.toString(); - throw new Error(`Cannot parse JSON ${what} for ${this.info.typeName}#${fieldName}`); - } - } - /** - * Reads a message from canonical JSON format into the target message. - * - * Repeated fields are appended. Map entries are added, overwriting - * existing keys. - * - * If a message field is already present, it will be merged with the - * new data. - */ - read(input, message, options) { - this.prepare(); - const oneofsHandled = []; - for (const [jsonKey, jsonValue] of Object.entries(input)) { - const field = this.fMap[jsonKey]; - if (!field) { - if (!options.ignoreUnknownFields) - throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${jsonKey}`); - continue; - } - const localName = field.localName; - // handle oneof ADT - let target; // this will be the target for the field value, whether it is member of a oneof or not - if (field.oneof) { - if (jsonValue === null && (field.kind !== 'enum' || field.T()[0] !== 'google.protobuf.NullValue')) { - continue; - } - // since json objects are unordered by specification, it is not possible to take the last of multiple oneofs - if (oneofsHandled.includes(field.oneof)) - throw new Error(`Multiple members of the oneof group "${field.oneof}" of ${this.info.typeName} are present in JSON.`); - oneofsHandled.push(field.oneof); - target = message[field.oneof] = { - oneofKind: localName - }; - } - else { - target = message; - } - // we have handled oneof above. we just have read the value into `target`. - if (field.kind == 'map') { - if (jsonValue === null) { - continue; - } - // check input - this.assert(json_typings_1.isJsonObject(jsonValue), field.name, jsonValue); - // our target to put map entries into - const fieldObj = target[localName]; - // read entries - for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { - this.assert(jsonObjValue !== null, field.name + " map value", null); - // read value - let val; - switch (field.V.kind) { - case "message": - val = field.V.T().internalJsonRead(jsonObjValue, options); - break; - case "enum": - val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val === false) - continue; - break; - case "scalar": - val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); - break; - } - this.assert(val !== undefined, field.name + " map value", jsonObjValue); - // read key - let key = jsonObjKey; - if (field.K == reflection_info_1.ScalarType.BOOL) - key = key == "true" ? true : key == "false" ? false : key; - key = this.scalar(key, field.K, reflection_info_1.LongType.STRING, field.name).toString(); - fieldObj[key] = val; - } - } - else if (field.repeat) { - if (jsonValue === null) - continue; - // check input - this.assert(Array.isArray(jsonValue), field.name, jsonValue); - // our target to put array entries into - const fieldArr = target[localName]; - // read array entries - for (const jsonItem of jsonValue) { - this.assert(jsonItem !== null, field.name, null); - let val; - switch (field.kind) { - case "message": - val = field.T().internalJsonRead(jsonItem, options); - break; - case "enum": - val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val === false) - continue; - break; - case "scalar": - val = this.scalar(jsonItem, field.T, field.L, field.name); - break; - } - this.assert(val !== undefined, field.name, jsonValue); - fieldArr.push(val); - } - } - else { - switch (field.kind) { - case "message": - if (jsonValue === null && field.T().typeName != 'google.protobuf.Value') { - this.assert(field.oneof === undefined, field.name + " (oneof member)", null); - continue; - } - target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]); - break; - case "enum": - let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val === false) - continue; - target[localName] = val; - break; - case "scalar": - target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); - break; - } - } - } - } - /** - * Returns `false` for unrecognized string representations. - * - * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). - */ - enum(type, json, fieldName, ignoreUnknownFields) { - if (type[0] == 'google.protobuf.NullValue') - assert_1.assert(json === null || json === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} only accepts null.`); - if (json === null) - // we require 0 to be default value for all enums - return 0; - switch (typeof json) { - case "number": - assert_1.assert(Number.isInteger(json), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json}.`); - return json; - case "string": - let localEnumName = json; - if (type[2] && json.substring(0, type[2].length) === type[2]) - // lookup without the shared prefix - localEnumName = json.substring(type[2].length); - let enumNumber = type[1][localEnumName]; - if (typeof enumNumber === 'undefined' && ignoreUnknownFields) { - return false; - } - assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} has no value for "${json}".`); - return enumNumber; - } - assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json}".`); - } - scalar(json, type, longType, fieldName) { - let e; - try { - switch (type) { - // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". - // Either numbers or strings are accepted. Exponent notation is also accepted. - case reflection_info_1.ScalarType.DOUBLE: - case reflection_info_1.ScalarType.FLOAT: - if (json === null) - return .0; - if (json === "NaN") - return Number.NaN; - if (json === "Infinity") - return Number.POSITIVE_INFINITY; - if (json === "-Infinity") - return Number.NEGATIVE_INFINITY; - if (json === "") { - e = "empty string"; - break; - } - if (typeof json == "string" && json.trim().length !== json.length) { - e = "extra whitespace"; - break; - } - if (typeof json != "string" && typeof json != "number") { - break; - } - let float = Number(json); - if (Number.isNaN(float)) { - e = "not a number"; - break; - } - if (!Number.isFinite(float)) { - // infinity and -infinity are handled by string representation above, so this is an error - e = "too large or small"; - break; - } - if (type == reflection_info_1.ScalarType.FLOAT) - assert_1.assertFloat32(float); - return float; - // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - case reflection_info_1.ScalarType.UINT32: - if (json === null) - return 0; - let int32; - if (typeof json == "number") - int32 = json; - else if (json === "") - e = "empty string"; - else if (typeof json == "string") { - if (json.trim().length !== json.length) - e = "extra whitespace"; - else - int32 = Number(json); - } - if (int32 === undefined) - break; - if (type == reflection_info_1.ScalarType.UINT32) - assert_1.assertUInt32(int32); - else - assert_1.assertInt32(int32); - return int32; - // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - if (json === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - if (typeof json != "number" && typeof json != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json), longType); - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.UINT64: - if (json === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - if (typeof json != "number" && typeof json != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json), longType); - // bool: - case reflection_info_1.ScalarType.BOOL: - if (json === null) - return false; - if (typeof json !== "boolean") - break; - return json; - // string: - case reflection_info_1.ScalarType.STRING: - if (json === null) - return ""; - if (typeof json !== "string") { - e = "extra whitespace"; - break; - } - try { - encodeURIComponent(json); - } - catch (e) { - e = "invalid UTF8"; - break; - } - return json; - // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. - // Either standard or URL-safe base64 encoding with/without paddings are accepted. - case reflection_info_1.ScalarType.BYTES: - if (json === null || json === "") - return new Uint8Array(0); - if (typeof json !== 'string') - break; - return base64_1.base64decode(json); - } - } - catch (error) { - e = error.message; - } - this.assert(false, fieldName + (e ? " - " + e : ""), json); - } -} -exports.ReflectionJsonReader = ReflectionJsonReader; - - -/***/ }), - -/***/ 11094: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReflectionJsonWriter = void 0; -const base64_1 = __nccwpck_require__(26335); -const pb_long_1 = __nccwpck_require__(61753); -const reflection_info_1 = __nccwpck_require__(67910); -const assert_1 = __nccwpck_require__(8602); -/** - * Writes proto3 messages in canonical JSON format using reflection - * information. - * - * https://developers.google.com/protocol-buffers/docs/proto3#json - */ -class ReflectionJsonWriter { - constructor(info) { - var _a; - this.fields = (_a = info.fields) !== null && _a !== void 0 ? _a : []; - } - /** - * Converts the message to a JSON object, based on the field descriptors. - */ - write(message, options) { - const json = {}, source = message; - for (const field of this.fields) { - // field is not part of a oneof, simply write as is - if (!field.oneof) { - let jsonValue = this.field(field, source[field.localName], options); - if (jsonValue !== undefined) - json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; - continue; - } - // field is part of a oneof - const group = source[field.oneof]; - if (group.oneofKind !== field.localName) - continue; // not selected, skip - const opt = field.kind == 'scalar' || field.kind == 'enum' - ? Object.assign(Object.assign({}, options), { emitDefaultValues: true }) : options; - let jsonValue = this.field(field, group[field.localName], opt); - assert_1.assert(jsonValue !== undefined); - json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; - } - return json; - } - field(field, value, options) { - let jsonValue = undefined; - if (field.kind == 'map') { - assert_1.assert(typeof value == "object" && value !== null); - const jsonObj = {}; - switch (field.V.kind) { - case "scalar": - for (const [entryKey, entryValue] of Object.entries(value)) { - const val = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val !== undefined); - jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key - } - break; - case "message": - const messageType = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - const val = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val !== undefined); - jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key - } - break; - case "enum": - const enumInfo = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - assert_1.assert(entryValue === undefined || typeof entryValue == 'number'); - const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val !== undefined); - jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key - } - break; - } - if (options.emitDefaultValues || Object.keys(jsonObj).length > 0) - jsonValue = jsonObj; - } - else if (field.repeat) { - assert_1.assert(Array.isArray(value)); - const jsonArr = []; - switch (field.kind) { - case "scalar": - for (let i = 0; i < value.length; i++) { - const val = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val !== undefined); - jsonArr.push(val); - } - break; - case "enum": - const enumInfo = field.T(); - for (let i = 0; i < value.length; i++) { - assert_1.assert(value[i] === undefined || typeof value[i] == 'number'); - const val = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val !== undefined); - jsonArr.push(val); - } - break; - case "message": - const messageType = field.T(); - for (let i = 0; i < value.length; i++) { - const val = this.message(messageType, value[i], field.name, options); - assert_1.assert(val !== undefined); - jsonArr.push(val); - } - break; - } - // add converted array to json output - if (options.emitDefaultValues || jsonArr.length > 0 || options.emitDefaultValues) - jsonValue = jsonArr; - } - else { - switch (field.kind) { - case "scalar": - jsonValue = this.scalar(field.T, value, field.name, field.opt, options.emitDefaultValues); - break; - case "enum": - jsonValue = this.enum(field.T(), value, field.name, field.opt, options.emitDefaultValues, options.enumAsInteger); - break; - case "message": - jsonValue = this.message(field.T(), value, field.name, options); - break; - } - } - return jsonValue; - } - /** - * Returns `null` as the default for google.protobuf.NullValue. - */ - enum(type, value, fieldName, optional, emitDefaultValues, enumAsInteger) { - if (type[0] == 'google.protobuf.NullValue') - return !emitDefaultValues && !optional ? undefined : null; - if (value === undefined) { - assert_1.assert(optional); - return undefined; - } - if (value === 0 && !emitDefaultValues && !optional) - // we require 0 to be default value for all enums - return undefined; - assert_1.assert(typeof value == 'number'); - assert_1.assert(Number.isInteger(value)); - if (enumAsInteger || !type[1].hasOwnProperty(value)) - // if we don't now the enum value, just return the number - return value; - if (type[2]) - // restore the dropped prefix - return type[2] + type[1][value]; - return type[1][value]; - } - message(type, value, fieldName, options) { - if (value === undefined) - return options.emitDefaultValues ? null : undefined; - return type.internalJsonWrite(value, options); - } - scalar(type, value, fieldName, optional, emitDefaultValues) { - if (value === undefined) { - assert_1.assert(optional); - return undefined; - } - const ed = emitDefaultValues || optional; - // noinspection FallThroughInSwitchStatementJS - switch (type) { - // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - if (value === 0) - return ed ? 0 : undefined; - assert_1.assertInt32(value); - return value; - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.UINT32: - if (value === 0) - return ed ? 0 : undefined; - assert_1.assertUInt32(value); - return value; - // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". - // Either numbers or strings are accepted. Exponent notation is also accepted. - case reflection_info_1.ScalarType.FLOAT: - assert_1.assertFloat32(value); - case reflection_info_1.ScalarType.DOUBLE: - if (value === 0) - return ed ? 0 : undefined; - assert_1.assert(typeof value == 'number'); - if (Number.isNaN(value)) - return 'NaN'; - if (value === Number.POSITIVE_INFINITY) - return 'Infinity'; - if (value === Number.NEGATIVE_INFINITY) - return '-Infinity'; - return value; - // string: - case reflection_info_1.ScalarType.STRING: - if (value === "") - return ed ? '' : undefined; - assert_1.assert(typeof value == 'string'); - return value; - // bool: - case reflection_info_1.ScalarType.BOOL: - if (value === false) - return ed ? false : undefined; - assert_1.assert(typeof value == 'boolean'); - return value; - // JSON value will be a decimal string. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.UINT64: - case reflection_info_1.ScalarType.FIXED64: - assert_1.assert(typeof value == 'number' || typeof value == 'string' || typeof value == 'bigint'); - let ulong = pb_long_1.PbULong.from(value); - if (ulong.isZero() && !ed) - return undefined; - return ulong.toString(); - // JSON value will be a decimal string. Either numbers or strings are accepted. - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - assert_1.assert(typeof value == 'number' || typeof value == 'string' || typeof value == 'bigint'); - let long = pb_long_1.PbLong.from(value); - if (long.isZero() && !ed) - return undefined; - return long.toString(); - // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. - // Either standard or URL-safe base64 encoding with/without paddings are accepted. - case reflection_info_1.ScalarType.BYTES: - assert_1.assert(value instanceof Uint8Array); - if (!value.byteLength) - return ed ? "" : undefined; - return base64_1.base64encode(value); - } - } -} -exports.ReflectionJsonWriter = ReflectionJsonWriter; - - -/***/ }), - -/***/ 63402: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reflectionLongConvert = void 0; -const reflection_info_1 = __nccwpck_require__(67910); -/** - * Utility method to convert a PbLong or PbUlong to a JavaScript - * representation during runtime. - * - * Works with generated field information, `undefined` is equivalent - * to `STRING`. - */ -function reflectionLongConvert(long, type) { - switch (type) { - case reflection_info_1.LongType.BIGINT: - return long.toBigInt(); - case reflection_info_1.LongType.NUMBER: - return long.toNumber(); - default: - // case undefined: - // case LongType.STRING: - return long.toString(); - } -} -exports.reflectionLongConvert = reflectionLongConvert; - - -/***/ }), - -/***/ 98044: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reflectionMergePartial = void 0; -/** - * Copy partial data into the target message. - * - * If a singular scalar or enum field is present in the source, it - * replaces the field in the target. - * - * If a singular message field is present in the source, it is merged - * with the target field by calling mergePartial() of the responsible - * message type. - * - * If a repeated field is present in the source, its values replace - * all values in the target array, removing extraneous values. - * Repeated message fields are copied, not merged. - * - * If a map field is present in the source, entries are added to the - * target map, replacing entries with the same key. Entries that only - * exist in the target remain. Entries with message values are copied, - * not merged. - * - * Note that this function differs from protobuf merge semantics, - * which appends repeated fields. - */ -function reflectionMergePartial(info, target, source) { - let fieldValue, // the field value we are working with - input = source, output; // where we want our field value to go - for (let field of info.fields) { - let name = field.localName; - if (field.oneof) { - const group = input[field.oneof]; // this is the oneof`s group in the source - if ((group === null || group === void 0 ? void 0 : group.oneofKind) == undefined) { // the user is free to omit - continue; // we skip this field, and all other members too - } - fieldValue = group[name]; // our value comes from the the oneof group of the source - output = target[field.oneof]; // and our output is the oneof group of the target - output.oneofKind = group.oneofKind; // always update discriminator - if (fieldValue == undefined) { - delete output[name]; // remove any existing value - continue; // skip further work on field - } - } - else { - fieldValue = input[name]; // we are using the source directly - output = target; // we want our field value to go directly into the target - if (fieldValue == undefined) { - continue; // skip further work on field, existing value is used as is - } - } - if (field.repeat) - output[name].length = fieldValue.length; // resize target array to match source array - // now we just work with `fieldValue` and `output` to merge the value - switch (field.kind) { - case "scalar": - case "enum": - if (field.repeat) - for (let i = 0; i < fieldValue.length; i++) - output[name][i] = fieldValue[i]; // not a reference type - else - output[name] = fieldValue; // not a reference type - break; - case "message": - let T = field.T(); - if (field.repeat) - for (let i = 0; i < fieldValue.length; i++) - output[name][i] = T.create(fieldValue[i]); - else if (output[name] === undefined) - output[name] = T.create(fieldValue); // nothing to merge with - else - T.mergePartial(output[name], fieldValue); - break; - case "map": - // Map and repeated fields are simply overwritten, not appended or merged - switch (field.V.kind) { - case "scalar": - case "enum": - Object.assign(output[name], fieldValue); // elements are not reference types - break; - case "message": - let T = field.V.T(); - for (let k of Object.keys(fieldValue)) - output[name][k] = T.create(fieldValue[k]); - break; - } - break; - } - } -} -exports.reflectionMergePartial = reflectionMergePartial; - - -/***/ }), - -/***/ 19526: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reflectionScalarDefault = void 0; -const reflection_info_1 = __nccwpck_require__(67910); -const reflection_long_convert_1 = __nccwpck_require__(63402); -const pb_long_1 = __nccwpck_require__(61753); -/** - * Creates the default value for a scalar type. - */ -function reflectionScalarDefault(type, longType = reflection_info_1.LongType.STRING) { - switch (type) { - case reflection_info_1.ScalarType.BOOL: - return false; - case reflection_info_1.ScalarType.UINT64: - case reflection_info_1.ScalarType.FIXED64: - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - case reflection_info_1.ScalarType.DOUBLE: - case reflection_info_1.ScalarType.FLOAT: - return 0.0; - case reflection_info_1.ScalarType.BYTES: - return new Uint8Array(0); - case reflection_info_1.ScalarType.STRING: - return ""; - default: - // case ScalarType.INT32: - // case ScalarType.UINT32: - // case ScalarType.SINT32: - // case ScalarType.FIXED32: - // case ScalarType.SFIXED32: - return 0; - } -} -exports.reflectionScalarDefault = reflectionScalarDefault; - - -/***/ }), - -/***/ 25167: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReflectionTypeCheck = void 0; -const reflection_info_1 = __nccwpck_require__(67910); -const oneof_1 = __nccwpck_require__(18063); -// noinspection JSMethodCanBeStatic -class ReflectionTypeCheck { - constructor(info) { - var _a; - this.fields = (_a = info.fields) !== null && _a !== void 0 ? _a : []; - } - prepare() { - if (this.data) - return; - const req = [], known = [], oneofs = []; - for (let field of this.fields) { - if (field.oneof) { - if (!oneofs.includes(field.oneof)) { - oneofs.push(field.oneof); - req.push(field.oneof); - known.push(field.oneof); - } - } - else { - known.push(field.localName); - switch (field.kind) { - case "scalar": - case "enum": - if (!field.opt || field.repeat) - req.push(field.localName); - break; - case "message": - if (field.repeat) - req.push(field.localName); - break; - case "map": - req.push(field.localName); - break; - } - } - } - this.data = { req, known, oneofs: Object.values(oneofs) }; - } - /** - * Is the argument a valid message as specified by the - * reflection information? - * - * Checks all field types recursively. The `depth` - * specifies how deep into the structure the check will be. - * - * With a depth of 0, only the presence of fields - * is checked. - * - * With a depth of 1 or more, the field types are checked. - * - * With a depth of 2 or more, the members of map, repeated - * and message fields are checked. - * - * Message fields will be checked recursively with depth - 1. - * - * The number of map entries / repeated values being checked - * is < depth. - */ - is(message, depth, allowExcessProperties = false) { - if (depth < 0) - return true; - if (message === null || message === undefined || typeof message != 'object') - return false; - this.prepare(); - let keys = Object.keys(message), data = this.data; - // if a required field is missing in arg, this cannot be a T - if (keys.length < data.req.length || data.req.some(n => !keys.includes(n))) - return false; - if (!allowExcessProperties) { - // if the arg contains a key we dont know, this is not a literal T - if (keys.some(k => !data.known.includes(k))) - return false; - } - // "With a depth of 0, only the presence and absence of fields is checked." - // "With a depth of 1 or more, the field types are checked." - if (depth < 1) { - return true; - } - // check oneof group - for (const name of data.oneofs) { - const group = message[name]; - if (!oneof_1.isOneofGroup(group)) - return false; - if (group.oneofKind === undefined) - continue; - const field = this.fields.find(f => f.localName === group.oneofKind); - if (!field) - return false; // we found no field, but have a kind, something is wrong - if (!this.field(group[group.oneofKind], field, allowExcessProperties, depth)) - return false; - } - // check types - for (const field of this.fields) { - if (field.oneof !== undefined) - continue; - if (!this.field(message[field.localName], field, allowExcessProperties, depth)) - return false; - } - return true; - } - field(arg, field, allowExcessProperties, depth) { - let repeated = field.repeat; - switch (field.kind) { - case "scalar": - if (arg === undefined) - return field.opt; - if (repeated) - return this.scalars(arg, field.T, depth, field.L); - return this.scalar(arg, field.T, field.L); - case "enum": - if (arg === undefined) - return field.opt; - if (repeated) - return this.scalars(arg, reflection_info_1.ScalarType.INT32, depth); - return this.scalar(arg, reflection_info_1.ScalarType.INT32); - case "message": - if (arg === undefined) - return true; - if (repeated) - return this.messages(arg, field.T(), allowExcessProperties, depth); - return this.message(arg, field.T(), allowExcessProperties, depth); - case "map": - if (typeof arg != 'object' || arg === null) - return false; - if (depth < 2) - return true; - if (!this.mapKeys(arg, field.K, depth)) - return false; - switch (field.V.kind) { - case "scalar": - return this.scalars(Object.values(arg), field.V.T, depth, field.V.L); - case "enum": - return this.scalars(Object.values(arg), reflection_info_1.ScalarType.INT32, depth); - case "message": - return this.messages(Object.values(arg), field.V.T(), allowExcessProperties, depth); - } - break; - } - return true; - } - message(arg, type, allowExcessProperties, depth) { - if (allowExcessProperties) { - return type.isAssignable(arg, depth); - } - return type.is(arg, depth); - } - messages(arg, type, allowExcessProperties, depth) { - if (!Array.isArray(arg)) - return false; - if (depth < 2) - return true; - if (allowExcessProperties) { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type.isAssignable(arg[i], depth - 1)) - return false; - } - else { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type.is(arg[i], depth - 1)) - return false; - } - return true; - } - scalar(arg, type, longType) { - let argType = typeof arg; - switch (type) { - case reflection_info_1.ScalarType.UINT64: - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.INT64: - case reflection_info_1.ScalarType.SFIXED64: - case reflection_info_1.ScalarType.SINT64: - switch (longType) { - case reflection_info_1.LongType.BIGINT: - return argType == "bigint"; - case reflection_info_1.LongType.NUMBER: - return argType == "number" && !isNaN(arg); - default: - return argType == "string"; - } - case reflection_info_1.ScalarType.BOOL: - return argType == 'boolean'; - case reflection_info_1.ScalarType.STRING: - return argType == 'string'; - case reflection_info_1.ScalarType.BYTES: - return arg instanceof Uint8Array; - case reflection_info_1.ScalarType.DOUBLE: - case reflection_info_1.ScalarType.FLOAT: - return argType == 'number' && !isNaN(arg); - default: - // case ScalarType.UINT32: - // case ScalarType.FIXED32: - // case ScalarType.INT32: - // case ScalarType.SINT32: - // case ScalarType.SFIXED32: - return argType == 'number' && Number.isInteger(arg); - } - } - scalars(arg, type, depth, longType) { - if (!Array.isArray(arg)) - return false; - if (depth < 2) - return true; - if (Array.isArray(arg)) - for (let i = 0; i < arg.length && i < depth; i++) - if (!this.scalar(arg[i], type, longType)) - return false; - return true; - } - mapKeys(map, type, depth) { - let keys = Object.keys(map); - switch (type) { - case reflection_info_1.ScalarType.INT32: - case reflection_info_1.ScalarType.FIXED32: - case reflection_info_1.ScalarType.SFIXED32: - case reflection_info_1.ScalarType.SINT32: - case reflection_info_1.ScalarType.UINT32: - return this.scalars(keys.slice(0, depth).map(k => parseInt(k)), type, depth); - case reflection_info_1.ScalarType.BOOL: - return this.scalars(keys.slice(0, depth).map(k => k == 'true' ? true : k == 'false' ? false : k), type, depth); - default: - return this.scalars(keys, type, depth, reflection_info_1.LongType.STRING); - } - } -} -exports.ReflectionTypeCheck = ReflectionTypeCheck; - - -/***/ }), - -/***/ 8207: -/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { - -"use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -const events_1 = __nccwpck_require__(24434); -const debug_1 = __importDefault(__nccwpck_require__(2830)); -const promisify_1 = __importDefault(__nccwpck_require__(98067)); -const debug = debug_1.default('agent-base'); -function isAgent(v) { - return Boolean(v) && typeof v.addRequest === 'function'; -} -function isSecureEndpoint() { - const { stack } = new Error(); - if (typeof stack !== 'string') - return false; - return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); -} -function createAgent(callback, opts) { - return new createAgent.Agent(callback, opts); -} -(function (createAgent) { - /** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ - class Agent extends events_1.EventEmitter { - constructor(callback, _opts) { - super(); - let opts = _opts; - if (typeof callback === 'function') { - this.callback = callback; - } - else if (callback) { - opts = callback; - } - // Timeout for the socket to be returned from the callback - this.timeout = null; - if (opts && typeof opts.timeout === 'number') { - this.timeout = opts.timeout; - } - // These aren't actually used by `agent-base`, but are required - // for the TypeScript definition files in `@types/node` :/ - this.maxFreeSockets = 1; - this.maxSockets = 1; - this.maxTotalSockets = Infinity; - this.sockets = {}; - this.freeSockets = {}; - this.requests = {}; - this.options = {}; - } - get defaultPort() { - if (typeof this.explicitDefaultPort === 'number') { - return this.explicitDefaultPort; - } - return isSecureEndpoint() ? 443 : 80; - } - set defaultPort(v) { - this.explicitDefaultPort = v; - } - get protocol() { - if (typeof this.explicitProtocol === 'string') { - return this.explicitProtocol; - } - return isSecureEndpoint() ? 'https:' : 'http:'; - } - set protocol(v) { - this.explicitProtocol = v; - } - callback(req, opts, fn) { - throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); - } - /** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ - addRequest(req, _opts) { - const opts = Object.assign({}, _opts); - if (typeof opts.secureEndpoint !== 'boolean') { - opts.secureEndpoint = isSecureEndpoint(); - } - if (opts.host == null) { - opts.host = 'localhost'; - } - if (opts.port == null) { - opts.port = opts.secureEndpoint ? 443 : 80; - } - if (opts.protocol == null) { - opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; - } - if (opts.host && opts.path) { - // If both a `host` and `path` are specified then it's most - // likely the result of a `url.parse()` call... we need to - // remove the `path` portion so that `net.connect()` doesn't - // attempt to open that as a unix socket file. - delete opts.path; - } - delete opts.agent; - delete opts.hostname; - delete opts._defaultAgent; - delete opts.defaultPort; - delete opts.createConnection; - // Hint to use "Connection: close" - // XXX: non-documented `http` module API :( - req._last = true; - req.shouldKeepAlive = false; - let timedOut = false; - let timeoutId = null; - const timeoutMs = opts.timeout || this.timeout; - const onerror = (err) => { - if (req._hadError) - return; - req.emit('error', err); - // For Safety. Some additional errors might fire later on - // and we need to make sure we don't double-fire the error event. - req._hadError = true; - }; - const ontimeout = () => { - timeoutId = null; - timedOut = true; - const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); - err.code = 'ETIMEOUT'; - onerror(err); - }; - const callbackError = (err) => { - if (timedOut) - return; - if (timeoutId !== null) { - clearTimeout(timeoutId); - timeoutId = null; - } - onerror(err); - }; - const onsocket = (socket) => { - if (timedOut) - return; - if (timeoutId != null) { - clearTimeout(timeoutId); - timeoutId = null; - } - if (isAgent(socket)) { - // `socket` is actually an `http.Agent` instance, so - // relinquish responsibility for this `req` to the Agent - // from here on - debug('Callback returned another Agent instance %o', socket.constructor.name); - socket.addRequest(req, opts); - return; - } - if (socket) { - socket.once('free', () => { - this.freeSocket(socket, opts); - }); - req.onSocket(socket); - return; - } - const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); - onerror(err); - }; - if (typeof this.callback !== 'function') { - onerror(new Error('`callback` is not defined')); - return; - } - if (!this.promisifiedCallback) { - if (this.callback.length >= 3) { - debug('Converting legacy callback function to promise'); - this.promisifiedCallback = promisify_1.default(this.callback); - } - else { - this.promisifiedCallback = this.callback; - } - } - if (typeof timeoutMs === 'number' && timeoutMs > 0) { - timeoutId = setTimeout(ontimeout, timeoutMs); - } - if ('port' in opts && typeof opts.port !== 'number') { - opts.port = Number(opts.port); - } - try { - debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); - Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); - } - catch (err) { - Promise.reject(err).catch(callbackError); - } - } - freeSocket(socket, opts) { - debug('Freeing socket %o %o', socket.constructor.name, opts); - socket.destroy(); - } - destroy() { - debug('Destroying agent %o', this.constructor.name); - } - } - createAgent.Agent = Agent; - // So that `instanceof` works correctly - createAgent.prototype = createAgent.Agent.prototype; -})(createAgent || (createAgent = {})); -module.exports = createAgent; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 98067: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -function promisify(fn) { - return function (req, opts) { - return new Promise((resolve, reject) => { - fn.call(this, req, opts, (err, rtn) => { - if (err) { - reject(err); - } - else { - resolve(rtn); - } - }); - }); - }; -} -exports["default"] = promisify; -//# sourceMappingURL=promisify.js.map - -/***/ }), - -/***/ 38816: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/** - * archiver-utils - * - * Copyright (c) 2012-2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-archiver/blob/master/LICENSE-MIT - */ -var fs = __nccwpck_require__(35744); -var path = __nccwpck_require__(16928); - -var flatten = __nccwpck_require__(43549); -var difference = __nccwpck_require__(91306); -var union = __nccwpck_require__(51104); -var isPlainObject = __nccwpck_require__(29888); - -var glob = __nccwpck_require__(33574); - -var file = module.exports = {}; - -var pathSeparatorRe = /[\/\\]/g; - -// Process specified wildcard glob patterns or filenames against a -// callback, excluding and uniquing files in the result set. -var processPatterns = function(patterns, fn) { - // Filepaths to return. - var result = []; - // Iterate over flattened patterns array. - flatten(patterns).forEach(function(pattern) { - // If the first character is ! it should be omitted - var exclusion = pattern.indexOf('!') === 0; - // If the pattern is an exclusion, remove the ! - if (exclusion) { pattern = pattern.slice(1); } - // Find all matching files for this pattern. - var matches = fn(pattern); - if (exclusion) { - // If an exclusion, remove matching files. - result = difference(result, matches); - } else { - // Otherwise add matching files. - result = union(result, matches); - } - }); - return result; -}; - -// True if the file path exists. -file.exists = function() { - var filepath = path.join.apply(path, arguments); - return fs.existsSync(filepath); -}; - -// Return an array of all file paths that match the given wildcard patterns. -file.expand = function(...args) { - // If the first argument is an options object, save those options to pass - // into the File.prototype.glob.sync method. - var options = isPlainObject(args[0]) ? args.shift() : {}; - // Use the first argument if it's an Array, otherwise convert the arguments - // object to an array and use that. - var patterns = Array.isArray(args[0]) ? args[0] : args; - // Return empty set if there are no patterns or filepaths. - if (patterns.length === 0) { return []; } - // Return all matching filepaths. - var matches = processPatterns(patterns, function(pattern) { - // Find all matching files for this pattern. - return glob.sync(pattern, options); - }); - // Filter result set? - if (options.filter) { - matches = matches.filter(function(filepath) { - filepath = path.join(options.cwd || '', filepath); - try { - if (typeof options.filter === 'function') { - return options.filter(filepath); - } else { - // If the file is of the right type and exists, this should work. - return fs.statSync(filepath)[options.filter](); - } - } catch(e) { - // Otherwise, it's probably not the right type. - return false; - } - }); - } - return matches; -}; - -// Build a multi task "files" object dynamically. -file.expandMapping = function(patterns, destBase, options) { - options = Object.assign({ - rename: function(destBase, destPath) { - return path.join(destBase || '', destPath); - } - }, options); - var files = []; - var fileByDest = {}; - // Find all files matching pattern, using passed-in options. - file.expand(options, patterns).forEach(function(src) { - var destPath = src; - // Flatten? - if (options.flatten) { - destPath = path.basename(destPath); - } - // Change the extension? - if (options.ext) { - destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); - } - // Generate destination filename. - var dest = options.rename(destBase, destPath, options); - // Prepend cwd to src path if necessary. - if (options.cwd) { src = path.join(options.cwd, src); } - // Normalize filepaths to be unix-style. - dest = dest.replace(pathSeparatorRe, '/'); - src = src.replace(pathSeparatorRe, '/'); - // Map correct src path to dest path. - if (fileByDest[dest]) { - // If dest already exists, push this src onto that dest's src array. - fileByDest[dest].src.push(src); - } else { - // Otherwise create a new src-dest file mapping object. - files.push({ - src: [src], - dest: dest, - }); - // And store a reference for later use. - fileByDest[dest] = files[files.length - 1]; - } - }); - return files; -}; - -// reusing bits of grunt's multi-task source normalization -file.normalizeFilesArray = function(data) { - var files = []; - - data.forEach(function(obj) { - var prop; - if ('src' in obj || 'dest' in obj) { - files.push(obj); - } - }); - - if (files.length === 0) { - return []; - } - - files = _(files).chain().forEach(function(obj) { - if (!('src' in obj) || !obj.src) { return; } - // Normalize .src properties to flattened array. - if (Array.isArray(obj.src)) { - obj.src = flatten(obj.src); - } else { - obj.src = [obj.src]; - } - }).map(function(obj) { - // Build options object, removing unwanted properties. - var expandOptions = Object.assign({}, obj); - delete expandOptions.src; - delete expandOptions.dest; - - // Expand file mappings. - if (obj.expand) { - return file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) { - // Copy obj properties to result. - var result = Object.assign({}, obj); - // Make a clone of the orig obj available. - result.orig = Object.assign({}, obj); - // Set .src and .dest, processing both as templates. - result.src = mapObj.src; - result.dest = mapObj.dest; - // Remove unwanted properties. - ['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) { - delete result[prop]; - }); - return result; - }); - } - - // Copy obj properties to result, adding an .orig property. - var result = Object.assign({}, obj); - // Make a clone of the orig obj available. - result.orig = Object.assign({}, obj); - - if ('src' in result) { - // Expose an expand-on-demand getter method as .src. - Object.defineProperty(result, 'src', { - enumerable: true, - get: function fn() { - var src; - if (!('result' in fn)) { - src = obj.src; - // If src is an array, flatten it. Otherwise, make it into an array. - src = Array.isArray(src) ? flatten(src) : [src]; - // Expand src files, memoizing result. - fn.result = file.expand(expandOptions, src); - } - return fn.result; - } - }); - } - - if ('dest' in result) { - result.dest = obj.dest; - } - - return result; - }).flatten().value(); - - return files; -}; - - -/***/ }), - -/***/ 53296: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/** - * archiver-utils - * - * Copyright (c) 2015 Chris Talkington. - * Licensed under the MIT license. - * https://github.com/archiverjs/archiver-utils/blob/master/LICENSE - */ -var fs = __nccwpck_require__(35744); -var path = __nccwpck_require__(16928); -var nutil = __nccwpck_require__(39023); -var lazystream = __nccwpck_require__(32126); -var normalizePath = __nccwpck_require__(56133); -var defaults = __nccwpck_require__(97623); - -var Stream = (__nccwpck_require__(2203).Stream); -var PassThrough = (__nccwpck_require__(91963).PassThrough); - -var utils = module.exports = {}; -utils.file = __nccwpck_require__(38816); - -function assertPath(path) { - if (typeof path !== 'string') { - throw new TypeError('Path must be a string. Received ' + nutils.inspect(path)); - } -} - -utils.collectStream = function(source, callback) { - var collection = []; - var size = 0; - - source.on('error', callback); - - source.on('data', function(chunk) { - collection.push(chunk); - size += chunk.length; - }); - - source.on('end', function() { - var buf = new Buffer(size); - var offset = 0; - - collection.forEach(function(data) { - data.copy(buf, offset); - offset += data.length; - }); - - callback(null, buf); - }); -}; - -utils.dateify = function(dateish) { - dateish = dateish || new Date(); - - if (dateish instanceof Date) { - dateish = dateish; - } else if (typeof dateish === 'string') { - dateish = new Date(dateish); - } else { - dateish = new Date(); - } - - return dateish; -}; - -// this is slightly different from lodash version -utils.defaults = function(object, source, guard) { - var args = arguments; - args[0] = args[0] || {}; - - return defaults(...args); -}; - -utils.isStream = function(source) { - return source instanceof Stream; -}; - -utils.lazyReadStream = function(filepath) { - return new lazystream.Readable(function() { - return fs.createReadStream(filepath); - }); -}; - -utils.normalizeInputSource = function(source) { - if (source === null) { - return new Buffer(0); - } else if (typeof source === 'string') { - return new Buffer(source); - } else if (utils.isStream(source) && !source._readableState) { - var normalized = new PassThrough(); - source.pipe(normalized); - - return normalized; - } - - return source; -}; - -utils.sanitizePath = function(filepath) { - return normalizePath(filepath, false).replace(/^\w+:/, '').replace(/^(\.\.\/|\/)+/, ''); -}; - -utils.trailingSlashIt = function(str) { - return str.slice(-1) !== '/' ? str + '/' : str; -}; - -utils.unixifyPath = function(filepath) { - return normalizePath(filepath, false).replace(/^\w+:/, ''); -}; - -utils.walkdir = function(dirpath, base, callback) { - var results = []; - - if (typeof base === 'function') { - callback = base; - base = dirpath; - } - - fs.readdir(dirpath, function(err, list) { - var i = 0; - var file; - var filepath; - - if (err) { - return callback(err); - } - - (function next() { - file = list[i++]; - - if (!file) { - return callback(null, results); - } - - filepath = path.join(dirpath, file); - - fs.stat(filepath, function(err, stats) { - results.push({ - path: filepath, - relative: path.relative(base, filepath).replace(/\\/g, '/'), - stats: stats - }); - - if (stats && stats.isDirectory()) { - utils.walkdir(filepath, base, function(err, res) { - res.forEach(function(dirEntry) { - results.push(dirEntry); - }); - next(); - }); - } else { - next(); - } - }); - })(); - }); -}; - - -/***/ }), - -/***/ 8807: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - - - -/**/ - -var pna = __nccwpck_require__(41564); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ - -var Readable = __nccwpck_require__(93109); -var Writable = __nccwpck_require__(30853); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; - -/***/ }), - -/***/ 37931: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - - - -module.exports = PassThrough; - -var Transform = __nccwpck_require__(68489); - -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; - -/***/ }), - -/***/ 93109: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -/**/ - -var pna = __nccwpck_require__(41564); -/**/ - -module.exports = Readable; - -/**/ -var isArray = __nccwpck_require__(82513); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = (__nccwpck_require__(24434).EventEmitter); - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = __nccwpck_require__(89515); -/**/ - -/**/ - -var Buffer = (__nccwpck_require__(12250).Buffer); -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ - -/**/ -var debugUtil = __nccwpck_require__(39023); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = __nccwpck_require__(64349); -var destroyImpl = __nccwpck_require__(70873); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || __nccwpck_require__(8807); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(77026)/* .StringDecoder */ .I); - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || __nccwpck_require__(8807); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(77026)/* .StringDecoder */ .I); - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { hasUnpiped: false }); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} - -/***/ }), - -/***/ 68489: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - - - -module.exports = Transform; - -var Duplex = __nccwpck_require__(8807); - -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} - -/***/ }), - -/***/ 30853: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - - - -/**/ - -var pna = __nccwpck_require__(41564); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ - -/**/ -var internalUtil = { - deprecate: __nccwpck_require__(24488) -}; -/**/ - -/**/ -var Stream = __nccwpck_require__(89515); -/**/ - -/**/ - -var Buffer = (__nccwpck_require__(12250).Buffer); -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = __nccwpck_require__(70873); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || __nccwpck_require__(8807); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || __nccwpck_require__(8807); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - - // reuse the free corkReq. - state.corkedRequestsFree.next = corkReq; -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; - -/***/ }), - -/***/ 64349: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = (__nccwpck_require__(12250).Buffer); -var util = __nccwpck_require__(39023); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} - -/***/ }), - -/***/ 70873: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -/**/ - -var pna = __nccwpck_require__(41564); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - pna.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, this, err); - } - } - - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - pna.nextTick(emitErrorNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, _this, err); - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; - -/***/ }), - -/***/ 89515: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = __nccwpck_require__(2203); - - -/***/ }), - -/***/ 91963: -/***/ ((module, exports, __nccwpck_require__) => { - -var Stream = __nccwpck_require__(2203); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = __nccwpck_require__(93109); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = __nccwpck_require__(30853); - exports.Duplex = __nccwpck_require__(8807); - exports.Transform = __nccwpck_require__(68489); - exports.PassThrough = __nccwpck_require__(37931); -} - - -/***/ }), - -/***/ 12250: -/***/ ((module, exports, __nccwpck_require__) => { - -/* eslint-disable node/no-deprecated-api */ -var buffer = __nccwpck_require__(20181) -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} - - -/***/ }), - -/***/ 77026: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -/**/ - -var Buffer = (__nccwpck_require__(12250).Buffer); -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.I = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - 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; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; +const Endpoints = { + actions: { + addCustomLabelsToSelfHostedRunnerForOrg: ["POST /orgs/{org}/actions/runners/{runner_id}/labels"], + addCustomLabelsToSelfHostedRunnerForRepo: ["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + approveWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"], + cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], + createOrUpdateEnvironmentSecret: ["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], + createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], + createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], + createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], + createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], + deleteActionsCacheById: ["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"], + deleteActionsCacheByKey: ["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"], + deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + deleteEnvironmentSecret: ["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], + deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], + deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], + deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + disableSelectedRepositoryGithubActionsOrganization: ["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"], + disableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"], + downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], + downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], + downloadWorkflowRunAttemptLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"], + downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + enableSelectedRepositoryGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"], + enableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"], + getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], + getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], + getActionsCacheUsageByRepoForOrg: ["GET /orgs/{org}/actions/cache/usage-by-repository"], + getActionsCacheUsageForEnterprise: ["GET /enterprises/{enterprise}/actions/cache/usage"], + getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], + getAllowedActionsOrganization: ["GET /orgs/{org}/actions/permissions/selected-actions"], + getAllowedActionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"], + getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getEnvironmentPublicKey: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"], + getEnvironmentSecret: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + getGithubActionsDefaultWorkflowPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/workflow"], + getGithubActionsDefaultWorkflowPermissionsOrganization: ["GET /orgs/{org}/actions/permissions/workflow"], + getGithubActionsDefaultWorkflowPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/workflow"], + getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], + getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], + getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], + getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getPendingDeploymentsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + getRepoPermissions: ["GET /repos/{owner}/{repo}/actions/permissions", {}, { + renamed: ["actions", "getGithubActionsPermissionsRepository"] + }], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getReviewsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"], + getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], + getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], + getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], + getWorkflowAccessToRepository: ["GET /repos/{owner}/{repo}/actions/permissions/access"], + getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], + getWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"], + getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], + getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], + listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets"], + listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], + listJobsForWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"], + listLabelsForSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}/labels"], + listLabelsForSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], + listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], + listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], + listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], + listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], + listSelectedRepositoriesEnabledGithubActionsOrganization: ["GET /orgs/{org}/actions/permissions/repositories"], + listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], + listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], + listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], + listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], + listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], + reRunJobForWorkflowRun: ["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"], + reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], + reRunWorkflowFailedJobs: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"], + removeAllCustomLabelsFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"], + removeAllCustomLabelsFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + removeCustomLabelFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"], + removeCustomLabelFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"], + removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + reviewPendingDeploymentsForRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + setAllowedActionsOrganization: ["PUT /orgs/{org}/actions/permissions/selected-actions"], + setAllowedActionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"], + setCustomLabelsForSelfHostedRunnerForOrg: ["PUT /orgs/{org}/actions/runners/{runner_id}/labels"], + setCustomLabelsForSelfHostedRunnerForRepo: ["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + setGithubActionsDefaultWorkflowPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/workflow"], + setGithubActionsDefaultWorkflowPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions/workflow"], + setGithubActionsDefaultWorkflowPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/workflow"], + setGithubActionsPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions"], + setGithubActionsPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"], + setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"], + setWorkflowAccessToRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/access"] + }, + activity: { + checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], + deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], + deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], + getFeeds: ["GET /feeds"], + getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], + getThread: ["GET /notifications/threads/{thread_id}"], + getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], + listEventsForAuthenticatedUser: ["GET /users/{username}/events"], + listNotificationsForAuthenticatedUser: ["GET /notifications"], + listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], + listPublicEvents: ["GET /events"], + listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], + listPublicEventsForUser: ["GET /users/{username}/events/public"], + listPublicOrgEvents: ["GET /orgs/{org}/events"], + listReceivedEventsForUser: ["GET /users/{username}/received_events"], + listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], + listRepoEvents: ["GET /repos/{owner}/{repo}/events"], + listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], + listReposStarredByAuthenticatedUser: ["GET /user/starred"], + listReposStarredByUser: ["GET /users/{username}/starred"], + listReposWatchedByUser: ["GET /users/{username}/subscriptions"], + listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], + listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], + listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], + markNotificationsAsRead: ["PUT /notifications"], + markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], + setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], + setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], + starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], + unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] + }, + apps: { + addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { + renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] + }], + addRepoToInstallationForAuthenticatedUser: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], + checkToken: ["POST /applications/{client_id}/token"], + createFromManifest: ["POST /app-manifests/{code}/conversions"], + createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], + deleteAuthorization: ["DELETE /applications/{client_id}/grant"], + deleteInstallation: ["DELETE /app/installations/{installation_id}"], + deleteToken: ["DELETE /applications/{client_id}/token"], + getAuthenticated: ["GET /app"], + getBySlug: ["GET /apps/{app_slug}"], + getInstallation: ["GET /app/installations/{installation_id}"], + getOrgInstallation: ["GET /orgs/{org}/installation"], + getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], + getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], + getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], + getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], + listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], + listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], + listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], + listInstallations: ["GET /app/installations"], + listInstallationsForAuthenticatedUser: ["GET /user/installations"], + listPlans: ["GET /marketplace_listing/plans"], + listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], + listReposAccessibleToInstallation: ["GET /installation/repositories"], + listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], + listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: ["POST /app/hook/deliveries/{delivery_id}/attempts"], + removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { + renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] + }], + removeRepoFromInstallationForAuthenticatedUser: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], + resetToken: ["PATCH /applications/{client_id}/token"], + revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], + suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], + unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"], + updateWebhookConfigForApp: ["PATCH /app/hook/config"] + }, + billing: { + getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], + getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], + getGithubAdvancedSecurityBillingGhe: ["GET /enterprises/{enterprise}/settings/billing/advanced-security"], + getGithubAdvancedSecurityBillingOrg: ["GET /orgs/{org}/settings/billing/advanced-security"], + getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], + getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], + getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], + getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] + }, + checks: { + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], + listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], + listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], + rerequestRun: ["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"], + rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"], + setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences"], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] + }, + codeScanning: { + deleteAnalysis: ["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"], + getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { + renamedParameters: { + alert_id: "alert_number" } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); + }], + getAnalysis: ["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"], + listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { + renamed: ["codeScanning", "listAlertInstances"] + }], + listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], + updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], + uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] + }, + codesOfConduct: { + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"] + }, + codespaces: { + addRepositoryForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], + codespaceMachinesForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/machines"], + createForAuthenticatedUser: ["POST /user/codespaces"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + createOrUpdateSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}"], + createWithPrForAuthenticatedUser: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"], + createWithRepoForAuthenticatedUser: ["POST /repos/{owner}/{repo}/codespaces"], + deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], + deleteFromOrganization: ["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + deleteSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}"], + exportForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/exports"], + getExportDetailsForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/exports/{export_id}"], + getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], + getPublicKeyForAuthenticatedUser: ["GET /user/codespaces/secrets/public-key"], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + getSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}"], + listDevcontainersInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/devcontainers"], + listForAuthenticatedUser: ["GET /user/codespaces"], + listInOrganization: ["GET /orgs/{org}/codespaces", {}, { + renamedParameters: { + org_id: "org" } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} - -/***/ }), - -/***/ 99392: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/** - * Archiver Vending - * - * @ignore - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var Archiver = __nccwpck_require__(50549); - -var formats = {}; - -/** - * Dispenses a new Archiver instance. - * - * @constructor - * @param {String} format The archive format to use. - * @param {Object} options See [Archiver]{@link Archiver} - * @return {Archiver} - */ -var vending = function(format, options) { - return vending.create(format, options); -}; - -/** - * Creates a new Archiver instance. - * - * @param {String} format The archive format to use. - * @param {Object} options See [Archiver]{@link Archiver} - * @return {Archiver} - */ -vending.create = function(format, options) { - if (formats[format]) { - var instance = new Archiver(format, options); - instance.setFormat(format); - instance.setModule(new formats[format](options)); - - return instance; - } else { - throw new Error('create(' + format + '): format not registered'); - } -}; - -/** - * Registers a format for use with archiver. - * - * @param {String} format The name of the format. - * @param {Function} module The function for archiver to interact with. - * @return void - */ -vending.registerFormat = function(format, module) { - if (formats[format]) { - throw new Error('register(' + format + '): format already registered'); - } - - if (typeof module !== 'function') { - throw new Error('register(' + format + '): format module invalid'); - } - - if (typeof module.prototype.append !== 'function' || typeof module.prototype.finalize !== 'function') { - throw new Error('register(' + format + '): format module missing methods'); - } - - formats[format] = module; -}; - -/** - * Check if the format is already registered. - * - * @param {String} format the name of the format. - * @return boolean - */ -vending.isRegisteredFormat = function (format) { - if (formats[format]) { - return true; - } - - return false; -}; - -vending.registerFormat('zip', __nccwpck_require__(22836)); -vending.registerFormat('tar', __nccwpck_require__(10396)); -vending.registerFormat('json', __nccwpck_require__(54693)); - -module.exports = vending; - -/***/ }), - -/***/ 50549: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/** - * Archiver Core - * - * @ignore - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var fs = __nccwpck_require__(79896); -var glob = __nccwpck_require__(51364); -var async = __nccwpck_require__(97329); -var path = __nccwpck_require__(16928); -var util = __nccwpck_require__(53296); - -var inherits = (__nccwpck_require__(39023).inherits); -var ArchiverError = __nccwpck_require__(13110); -var Transform = (__nccwpck_require__(86131).Transform); - -var win32 = process.platform === 'win32'; - -/** - * @constructor - * @param {String} format The archive format to use. - * @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}. - */ -var Archiver = function(format, options) { - if (!(this instanceof Archiver)) { - return new Archiver(format, options); - } - - if (typeof format !== 'string') { - options = format; - format = 'zip'; + }], + listInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], + listRepositoriesForSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}/repositories"], + listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], + removeRepositoryForSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], + repoMachinesForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/machines"], + setRepositoriesForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories"], + startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], + stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], + stopInOrganization: ["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"], + updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] + }, + dependabot: { + addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], + listSelectedReposForOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"], + removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"] + }, + dependencyGraph: { + createRepositorySnapshot: ["POST /repos/{owner}/{repo}/dependency-graph/snapshots"], + diffRange: ["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"] + }, + emojis: { + get: ["GET /emojis"] + }, + enterpriseAdmin: { + addCustomLabelsToSelfHostedRunnerForEnterprise: ["POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + disableSelectedOrganizationGithubActionsEnterprise: ["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + enableSelectedOrganizationGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + getAllowedActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/selected-actions"], + getGithubActionsPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions"], + getServerStatistics: ["GET /enterprise-installation/{enterprise_or_org}/server-statistics"], + listLabelsForSelfHostedRunnerForEnterprise: ["GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], + removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + removeCustomLabelFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}"], + setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], + setCustomLabelsForSelfHostedRunnerForEnterprise: ["PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], + setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] + }, + gists: { + checkIsStarred: ["GET /gists/{gist_id}/star"], + create: ["POST /gists"], + createComment: ["POST /gists/{gist_id}/comments"], + delete: ["DELETE /gists/{gist_id}"], + deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], + fork: ["POST /gists/{gist_id}/forks"], + get: ["GET /gists/{gist_id}"], + getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], + getRevision: ["GET /gists/{gist_id}/{sha}"], + list: ["GET /gists"], + listComments: ["GET /gists/{gist_id}/comments"], + listCommits: ["GET /gists/{gist_id}/commits"], + listForUser: ["GET /users/{username}/gists"], + listForks: ["GET /gists/{gist_id}/forks"], + listPublic: ["GET /gists/public"], + listStarred: ["GET /gists/starred"], + star: ["PUT /gists/{gist_id}/star"], + unstar: ["DELETE /gists/{gist_id}/star"], + update: ["PATCH /gists/{gist_id}"], + updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] + }, + git: { + createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], + createCommit: ["POST /repos/{owner}/{repo}/git/commits"], + createRef: ["POST /repos/{owner}/{repo}/git/refs"], + createTag: ["POST /repos/{owner}/{repo}/git/tags"], + createTree: ["POST /repos/{owner}/{repo}/git/trees"], + deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], + getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], + getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], + getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], + getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], + getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], + listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], + updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] + }, + gitignore: { + getAllTemplates: ["GET /gitignore/templates"], + getTemplate: ["GET /gitignore/templates/{name}"] + }, + interactions: { + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits", {}, { + renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] + }], + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], + removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits"], + removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits", {}, { + renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] + }], + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits", {}, { + renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] + }] + }, + issues: { + addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], + checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], + create: ["POST /repos/{owner}/{repo}/issues"], + createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], + createLabel: ["POST /repos/{owner}/{repo}/labels"], + createMilestone: ["POST /repos/{owner}/{repo}/milestones"], + deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], + deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], + deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], + get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], + getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], + getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], + getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], + getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], + list: ["GET /issues"], + listAssignees: ["GET /repos/{owner}/{repo}/assignees"], + listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], + listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], + listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], + listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], + listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"], + listForAuthenticatedUser: ["GET /user/issues"], + listForOrg: ["GET /orgs/{org}/issues"], + listForRepo: ["GET /repos/{owner}/{repo}/issues"], + listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], + listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], + listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], + listMilestones: ["GET /repos/{owner}/{repo}/milestones"], + lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], + removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], + removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], + setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], + unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], + update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], + updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], + updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], + updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] + }, + licenses: { + get: ["GET /licenses/{license}"], + getAllCommonlyUsed: ["GET /licenses"], + getForRepo: ["GET /repos/{owner}/{repo}/license"] + }, + markdown: { + render: ["POST /markdown"], + renderRaw: ["POST /markdown/raw", { + headers: { + "content-type": "text/plain; charset=utf-8" + } + }] + }, + meta: { + get: ["GET /meta"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"] + }, + migrations: { + cancelImport: ["DELETE /repos/{owner}/{repo}/import"], + deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive"], + deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive"], + downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive"], + getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive"], + getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], + getImportStatus: ["GET /repos/{owner}/{repo}/import"], + getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], + getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], + getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], + listForAuthenticatedUser: ["GET /user/migrations"], + listForOrg: ["GET /orgs/{org}/migrations"], + listReposForAuthenticatedUser: ["GET /user/migrations/{migration_id}/repositories"], + listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], + listReposForUser: ["GET /user/migrations/{migration_id}/repositories", {}, { + renamed: ["migrations", "listReposForAuthenticatedUser"] + }], + mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], + setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], + startForAuthenticatedUser: ["POST /user/migrations"], + startForOrg: ["POST /orgs/{org}/migrations"], + startImport: ["PUT /repos/{owner}/{repo}/import"], + unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"], + unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"], + updateImport: ["PATCH /repos/{owner}/{repo}/import"] + }, + orgs: { + blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], + checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], + checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], + checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], + convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], + createInvitation: ["POST /orgs/{org}/invitations"], + createWebhook: ["POST /orgs/{org}/hooks"], + deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], + get: ["GET /orgs/{org}"], + getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], + getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"], + list: ["GET /organizations"], + listAppInstallations: ["GET /orgs/{org}/installations"], + listBlockedUsers: ["GET /orgs/{org}/blocks"], + listCustomRoles: ["GET /organizations/{organization_id}/custom_roles"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], + listForAuthenticatedUser: ["GET /user/orgs"], + listForUser: ["GET /users/{username}/orgs"], + listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], + listMembers: ["GET /orgs/{org}/members"], + listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], + listPendingInvitations: ["GET /orgs/{org}/invitations"], + listPublicMembers: ["GET /orgs/{org}/public_members"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /orgs/{org}/hooks"], + pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], + removeMember: ["DELETE /orgs/{org}/members/{username}"], + removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], + removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], + removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], + setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], + setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], + unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], + update: ["PATCH /orgs/{org}"], + updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], + updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] + }, + packages: { + deletePackageForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}"], + deletePackageForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}"], + deletePackageForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}"], + deletePackageVersionForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + deletePackageVersionForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + deletePackageVersionForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getAllPackageVersionsForAPackageOwnedByAnOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] + }], + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"] + }], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions"], + getPackageForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}"], + getPackageForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}"], + getPackageForUser: ["GET /users/{username}/packages/{package_type}/{package_name}"], + getPackageVersionForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + listPackagesForAuthenticatedUser: ["GET /user/packages"], + listPackagesForOrganization: ["GET /orgs/{org}/packages"], + listPackagesForUser: ["GET /users/{username}/packages"], + restorePackageForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageVersionForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], + restorePackageVersionForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], + restorePackageVersionForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"] + }, + projects: { + addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], + createCard: ["POST /projects/columns/{column_id}/cards"], + createColumn: ["POST /projects/{project_id}/columns"], + createForAuthenticatedUser: ["POST /user/projects"], + createForOrg: ["POST /orgs/{org}/projects"], + createForRepo: ["POST /repos/{owner}/{repo}/projects"], + delete: ["DELETE /projects/{project_id}"], + deleteCard: ["DELETE /projects/columns/cards/{card_id}"], + deleteColumn: ["DELETE /projects/columns/{column_id}"], + get: ["GET /projects/{project_id}"], + getCard: ["GET /projects/columns/cards/{card_id}"], + getColumn: ["GET /projects/columns/{column_id}"], + getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission"], + listCards: ["GET /projects/columns/{column_id}/cards"], + listCollaborators: ["GET /projects/{project_id}/collaborators"], + listColumns: ["GET /projects/{project_id}/columns"], + listForOrg: ["GET /orgs/{org}/projects"], + listForRepo: ["GET /repos/{owner}/{repo}/projects"], + listForUser: ["GET /users/{username}/projects"], + moveCard: ["POST /projects/columns/cards/{card_id}/moves"], + moveColumn: ["POST /projects/columns/{column_id}/moves"], + removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}"], + update: ["PATCH /projects/{project_id}"], + updateCard: ["PATCH /projects/columns/cards/{card_id}"], + updateColumn: ["PATCH /projects/columns/{column_id}"] + }, + pulls: { + checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + create: ["POST /repos/{owner}/{repo}/pulls"], + createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], + createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], + get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], + getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + list: ["GET /repos/{owner}/{repo}/pulls"], + listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], + listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], + listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], + listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], + listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], + update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], + updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"], + updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] + }, + rateLimit: { + get: ["GET /rate_limit"] + }, + reactions: { + createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"], + createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], + createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], + createForRelease: ["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"], + createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], + createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"], + deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"], + deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"], + deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"], + deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"], + deleteForRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"], + deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"], + deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"], + listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"], + listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], + listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], + listForRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"], + listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], + listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"] + }, + repos: { + acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}", {}, { + renamed: ["repos", "acceptInvitationForAuthenticatedUser"] + }], + acceptInvitationForAuthenticatedUser: ["PATCH /user/repository_invitations/{invitation_id}"], + addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], + addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], + checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts"], + codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], + compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], + createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], + createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], + createDeployKey: ["POST /repos/{owner}/{repo}/keys"], + createDeployment: ["POST /repos/{owner}/{repo}/deployments"], + createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], + createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], + createForAuthenticatedUser: ["POST /user/repos"], + createFork: ["POST /repos/{owner}/{repo}/forks"], + createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateEnvironment: ["PUT /repos/{owner}/{repo}/environments/{environment_name}"], + createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], + createPagesSite: ["POST /repos/{owner}/{repo}/pages"], + createRelease: ["POST /repos/{owner}/{repo}/releases"], + createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], + createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], + createWebhook: ["POST /repos/{owner}/{repo}/hooks"], + declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}", {}, { + renamed: ["repos", "declineInvitationForAuthenticatedUser"] + }], + declineInvitationForAuthenticatedUser: ["DELETE /user/repository_invitations/{invitation_id}"], + delete: ["DELETE /repos/{owner}/{repo}"], + deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + deleteAnEnvironment: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}"], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], + deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], + deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], + deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], + deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], + deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], + deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], + deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], + deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], + deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], + deleteTagProtection: ["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"], + deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], + disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes"], + disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"], + disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts"], + downloadArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}", {}, { + renamed: ["repos", "downloadZipballArchive"] + }], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], + enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes"], + enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"], + enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts"], + generateReleaseNotes: ["POST /repos/{owner}/{repo}/releases/generate-notes"], + get: ["GET /repos/{owner}/{repo}"], + getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], + getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], + getAllTopics: ["GET /repos/{owner}/{repo}/topics"], + getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], + getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], + getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], + getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], + getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], + getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], + getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], + getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], + getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], + getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], + getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], + getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], + getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], + getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], + getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], + getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], + getEnvironment: ["GET /repos/{owner}/{repo}/environments/{environment_name}"], + getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], + getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], + getPages: ["GET /repos/{owner}/{repo}/pages"], + getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], + getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], + getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], + getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], + getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], + getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], + getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], + getStatusChecksProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + getTeamsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"], + getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], + getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], + getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], + getViews: ["GET /repos/{owner}/{repo}/traffic/views"], + getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], + listBranches: ["GET /repos/{owner}/{repo}/branches"], + listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"], + listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], + listCommentsForCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"], + listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], + listCommitStatusesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/statuses"], + listCommits: ["GET /repos/{owner}/{repo}/commits"], + listContributors: ["GET /repos/{owner}/{repo}/contributors"], + listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], + listDeploymentStatuses: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], + listDeployments: ["GET /repos/{owner}/{repo}/deployments"], + listForAuthenticatedUser: ["GET /user/repos"], + listForOrg: ["GET /orgs/{org}/repos"], + listForUser: ["GET /users/{username}/repos"], + listForks: ["GET /repos/{owner}/{repo}/forks"], + listInvitations: ["GET /repos/{owner}/{repo}/invitations"], + listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], + listLanguages: ["GET /repos/{owner}/{repo}/languages"], + listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], + listPublic: ["GET /repositories"], + listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"], + listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], + listReleases: ["GET /repos/{owner}/{repo}/releases"], + listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], + listTags: ["GET /repos/{owner}/{repo}/tags"], + listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], + merge: ["POST /repos/{owner}/{repo}/merges"], + mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], + pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], + removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + removeCollaborator: ["DELETE /repos/{owner}/{repo}/collaborators/{username}"], + removeStatusCheckContexts: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + removeStatusCheckProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + removeTeamAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], + replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], + requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], + setAdminBranchProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + setAppAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + setStatusCheckContexts: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + setTeamAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + setUserAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], + transfer: ["POST /repos/{owner}/{repo}/transfer"], + update: ["PATCH /repos/{owner}/{repo}"], + updateBranchProtection: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection"], + updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], + updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], + updateInvitation: ["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"], + updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], + updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], + updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { + renamed: ["repos", "updateStatusCheckProtection"] + }], + updateStatusCheckProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"], + uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { + baseUrl: "https://uploads.github.com" + }] + }, + search: { + code: ["GET /search/code"], + commits: ["GET /search/commits"], + issuesAndPullRequests: ["GET /search/issues"], + labels: ["GET /search/labels"], + repos: ["GET /search/repositories"], + topics: ["GET /search/topics"], + users: ["GET /search/users"] + }, + secretScanning: { + getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], + listAlertsForEnterprise: ["GET /enterprises/{enterprise}/secret-scanning/alerts"], + listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + listLocationsForAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"], + updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] + }, + teams: { + addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], + addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"], + addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"], + checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + create: ["POST /orgs/{org}/teams"], + createDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], + createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], + deleteDiscussionCommentInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + deleteDiscussionInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], + getByName: ["GET /orgs/{org}/teams/{team_slug}"], + getDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + getDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + getMembershipForUserInOrg: ["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"], + list: ["GET /orgs/{org}/teams"], + listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], + listDiscussionCommentsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], + listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], + listForAuthenticatedUser: ["GET /user/teams"], + listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], + listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], + listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], + listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], + removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], + removeProjectInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"], + removeRepoInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + updateDiscussionCommentInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + updateDiscussionInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] + }, + users: { + addEmailForAuthenticated: ["POST /user/emails", {}, { + renamed: ["users", "addEmailForAuthenticatedUser"] + }], + addEmailForAuthenticatedUser: ["POST /user/emails"], + block: ["PUT /user/blocks/{username}"], + checkBlocked: ["GET /user/blocks/{username}"], + checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], + checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], + createGpgKeyForAuthenticated: ["POST /user/gpg_keys", {}, { + renamed: ["users", "createGpgKeyForAuthenticatedUser"] + }], + createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], + createPublicSshKeyForAuthenticated: ["POST /user/keys", {}, { + renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] + }], + createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], + deleteEmailForAuthenticated: ["DELETE /user/emails", {}, { + renamed: ["users", "deleteEmailForAuthenticatedUser"] + }], + deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], + deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}", {}, { + renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] + }], + deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], + deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}", {}, { + renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] + }], + deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], + follow: ["PUT /user/following/{username}"], + getAuthenticated: ["GET /user"], + getByUsername: ["GET /users/{username}"], + getContextForUser: ["GET /users/{username}/hovercard"], + getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}", {}, { + renamed: ["users", "getGpgKeyForAuthenticatedUser"] + }], + getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], + getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}", {}, { + renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] + }], + getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], + list: ["GET /users"], + listBlockedByAuthenticated: ["GET /user/blocks", {}, { + renamed: ["users", "listBlockedByAuthenticatedUser"] + }], + listBlockedByAuthenticatedUser: ["GET /user/blocks"], + listEmailsForAuthenticated: ["GET /user/emails", {}, { + renamed: ["users", "listEmailsForAuthenticatedUser"] + }], + listEmailsForAuthenticatedUser: ["GET /user/emails"], + listFollowedByAuthenticated: ["GET /user/following", {}, { + renamed: ["users", "listFollowedByAuthenticatedUser"] + }], + listFollowedByAuthenticatedUser: ["GET /user/following"], + listFollowersForAuthenticatedUser: ["GET /user/followers"], + listFollowersForUser: ["GET /users/{username}/followers"], + listFollowingForUser: ["GET /users/{username}/following"], + listGpgKeysForAuthenticated: ["GET /user/gpg_keys", {}, { + renamed: ["users", "listGpgKeysForAuthenticatedUser"] + }], + listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], + listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], + listPublicEmailsForAuthenticated: ["GET /user/public_emails", {}, { + renamed: ["users", "listPublicEmailsForAuthenticatedUser"] + }], + listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], + listPublicKeysForUser: ["GET /users/{username}/keys"], + listPublicSshKeysForAuthenticated: ["GET /user/keys", {}, { + renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] + }], + listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], + setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility", {}, { + renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] + }], + setPrimaryEmailVisibilityForAuthenticatedUser: ["PATCH /user/email/visibility"], + unblock: ["DELETE /user/blocks/{username}"], + unfollow: ["DELETE /user/following/{username}"], + updateAuthenticated: ["PATCH /user"] } - - options = this.options = util.defaults(options, { - highWaterMark: 1024 * 1024, - statConcurrency: 4 - }); - - Transform.call(this, options); - - this._format = false; - this._module = false; - this._pending = 0; - this._pointer = 0; - - this._entriesCount = 0; - this._entriesProcessedCount = 0; - this._fsEntriesTotalBytes = 0; - this._fsEntriesProcessedBytes = 0; - - this._queue = async.queue(this._onQueueTask.bind(this), 1); - this._queue.drain(this._onQueueDrain.bind(this)); - - this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency); - this._statQueue.drain(this._onQueueDrain.bind(this)); - - this._state = { - aborted: false, - finalize: false, - finalizing: false, - finalized: false, - modulePiped: false - }; - - this._streams = []; }; -inherits(Archiver, Transform); - -/** - * Internal logic for `abort`. - * - * @private - * @return void - */ -Archiver.prototype._abort = function() { - this._state.aborted = true; - this._queue.kill(); - this._statQueue.kill(); - - if (this._queue.idle()) { - this._shutdown(); - } -}; +const VERSION = "5.16.2"; -/** - * Internal helper for appending files. - * - * @private - * @param {String} filepath The source filepath. - * @param {EntryData} data The entry data. - * @return void - */ -Archiver.prototype._append = function(filepath, data) { - data = data || {}; +function endpointsToMethods(octokit, endpointsMap) { + const newMethods = {}; - var task = { - source: null, - filepath: filepath - }; + for (const [scope, endpoints] of Object.entries(endpointsMap)) { + for (const [methodName, endpoint] of Object.entries(endpoints)) { + const [route, defaults, decorations] = endpoint; + const [method, url] = route.split(/ /); + const endpointDefaults = Object.assign({ + method, + url + }, defaults); - if (!data.name) { - data.name = filepath; - } + if (!newMethods[scope]) { + newMethods[scope] = {}; + } - data.sourcePath = filepath; - task.data = data; - this._entriesCount++; + const scopeMethods = newMethods[scope]; - if (data.stats && data.stats instanceof fs.Stats) { - task = this._updateQueueTaskWithStats(task, data.stats); - if (task) { - if (data.stats.size) { - this._fsEntriesTotalBytes += data.stats.size; + if (decorations) { + scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); + continue; } - this._queue.push(task); + scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); } - } else { - this._statQueue.push(task); - } -}; - -/** - * Internal logic for `finalize`. - * - * @private - * @return void - */ -Archiver.prototype._finalize = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return; - } - - this._state.finalizing = true; - - this._moduleFinalize(); - - this._state.finalizing = false; - this._state.finalized = true; -}; - -/** - * Checks the various state variables to determine if we can `finalize`. - * - * @private - * @return {Boolean} - */ -Archiver.prototype._maybeFinalize = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return false; } - if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - return true; - } + return newMethods; +} - return false; -}; +function decorate(octokit, scope, methodName, defaults, decorations) { + const requestWithDefaults = octokit.request.defaults(defaults); + /* istanbul ignore next */ -/** - * Appends an entry to the module. - * - * @private - * @fires Archiver#entry - * @param {(Buffer|Stream)} source - * @param {EntryData} data - * @param {Function} callback - * @return void - */ -Archiver.prototype._moduleAppend = function(source, data, callback) { - if (this._state.aborted) { - callback(); - return; - } + function withDecorations(...args) { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData` - this._module.append(source, data, function(err) { - this._task = null; + if (decorations.mapToData) { + options = Object.assign({}, options, { + data: options[decorations.mapToData], + [decorations.mapToData]: undefined + }); + return requestWithDefaults(options); + } - if (this._state.aborted) { - this._shutdown(); - return; + if (decorations.renamed) { + const [newScope, newMethodName] = decorations.renamed; + octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); } - if (err) { - this.emit('error', err); - setImmediate(callback); - return; + if (decorations.deprecated) { + octokit.log.warn(decorations.deprecated); } - /** - * Fires when the entry's input has been processed and appended to the archive. - * - * @event Archiver#entry - * @type {EntryData} - */ - this.emit('entry', data); - this._entriesProcessedCount++; + if (decorations.renamedParameters) { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + const options = requestWithDefaults.endpoint.merge(...args); - if (data.stats && data.stats.size) { - this._fsEntriesProcessedBytes += data.stats.size; - } + for (const [name, alias] of Object.entries(decorations.renamedParameters)) { + if (name in options) { + octokit.log.warn(`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`); - /** - * @event Archiver#progress - * @type {ProgressData} - */ - this.emit('progress', { - entries: { - total: this._entriesCount, - processed: this._entriesProcessedCount - }, - fs: { - totalBytes: this._fsEntriesTotalBytes, - processedBytes: this._fsEntriesProcessedBytes - } - }); + if (!(alias in options)) { + options[alias] = options[name]; + } - setImmediate(callback); - }.bind(this)); -}; + delete options[name]; + } + } -/** - * Finalizes the module. - * - * @private - * @return void - */ -Archiver.prototype._moduleFinalize = function() { - if (typeof this._module.finalize === 'function') { - this._module.finalize(); - } else if (typeof this._module.end === 'function') { - this._module.end(); - } else { - this.emit('error', new ArchiverError('NOENDMETHOD')); - } -}; + return requestWithDefaults(options); + } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 -/** - * Pipes the module to our internal stream with error bubbling. - * - * @private - * @return void - */ -Archiver.prototype._modulePipe = function() { - this._module.on('error', this._onModuleError.bind(this)); - this._module.pipe(this); - this._state.modulePiped = true; -}; -/** - * Determines if the current module supports a defined feature. - * - * @private - * @param {String} key - * @return {Boolean} - */ -Archiver.prototype._moduleSupports = function(key) { - if (!this._module.supports || !this._module.supports[key]) { - return false; + return requestWithDefaults(...args); } - return this._module.supports[key]; -}; - -/** - * Unpipes the module from our internal stream. - * - * @private - * @return void - */ -Archiver.prototype._moduleUnpipe = function() { - this._module.unpipe(this); - this._state.modulePiped = false; -}; + return Object.assign(withDecorations, requestWithDefaults); +} -/** - * Normalizes entry data with fallbacks for key properties. - * - * @private - * @param {Object} data - * @param {fs.Stats} stats - * @return {Object} - */ -Archiver.prototype._normalizeEntryData = function(data, stats) { - data = util.defaults(data, { - type: 'file', - name: null, - date: null, - mode: null, - prefix: null, - sourcePath: null, - stats: false +function restEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, Endpoints); + return { + rest: api + }; +} +restEndpointMethods.VERSION = VERSION; +function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, Endpoints); + return _objectSpread2(_objectSpread2({}, api), {}, { + rest: api }); +} +legacyRestEndpointMethods.VERSION = VERSION; - if (stats && data.stats === false) { - data.stats = stats; - } +exports.legacyRestEndpointMethods = legacyRestEndpointMethods; +exports.restEndpointMethods = restEndpointMethods; +//# sourceMappingURL=index.js.map - var isDir = data.type === 'directory'; - if (data.name) { - if (typeof data.prefix === 'string' && '' !== data.prefix) { - data.name = data.prefix + '/' + data.name; - data.prefix = null; - } +/***/ }), - data.name = util.sanitizePath(data.name); +/***/ 33450: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (data.type !== 'symlink' && data.name.slice(-1) === '/') { - isDir = true; - data.type = 'directory'; - } else if (isDir) { - data.name += '/'; - } - } +"use strict"; - // 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644 - if (typeof data.mode === 'number') { - if (win32) { - data.mode &= 511; - } else { - data.mode &= 4095 - } - } else if (data.stats && data.mode === null) { - if (win32) { - data.mode = data.stats.mode & 511; - } else { - data.mode = data.stats.mode & 4095; - } - // stat isn't reliable on windows; force 0755 for dir - if (win32 && isDir) { - data.mode = 493; - } - } else if (data.mode === null) { - data.mode = isDir ? 493 : 420; - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (data.stats && data.date === null) { - data.date = data.stats.mtime; - } else { - data.date = util.dateify(data.date); - } +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - return data; -}; +var Bottleneck = _interopDefault(__nccwpck_require__(63251)); -/** - * Error listener that re-emits error on to our internal stream. - * - * @private - * @param {Error} err - * @return void - */ -Archiver.prototype._onModuleError = function(err) { - /** - * @event Archiver#error - * @type {ErrorData} - */ - this.emit('error', err); -}; +// @ts-ignore +async function errorRequest(octokit, state, error, options) { + if (!error.request || !error.request.request) { + // address https://github.com/octokit/plugin-retry.js/issues/8 + throw error; + } // retry all >= 400 && not doNotRetry -/** - * Checks the various state variables after queue has drained to determine if - * we need to `finalize`. - * - * @private - * @return void - */ -Archiver.prototype._onQueueDrain = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return; - } - if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - } -}; + if (error.status >= 400 && !state.doNotRetry.includes(error.status)) { + const retries = options.request.retries != null ? options.request.retries : state.retries; + const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2); + throw octokit.retry.retryRequest(error, retries, retryAfter); + } // Maybe eventually there will be more cases here -/** - * Appends each queue task to the module. - * - * @private - * @param {Object} task - * @param {Function} callback - * @return void - */ -Archiver.prototype._onQueueTask = function(task, callback) { - var fullCallback = () => { - if(task.data.callback) { - task.data.callback(); - } - callback(); - } - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - fullCallback(); - return; - } + throw error; +} - this._task = task; - this._moduleAppend(task.source, task.data, fullCallback); -}; +// @ts-ignore -/** - * Performs a file stat and reinjects the task back into the queue. - * - * @private - * @param {Object} task - * @param {Function} callback - * @return void - */ -Archiver.prototype._onStatQueueTask = function(task, callback) { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - callback(); - return; - } +async function wrapRequest(state, request, options) { + const limiter = new Bottleneck(); // @ts-ignore + + limiter.on("failed", function (error, info) { + const maxRetries = ~~error.request.request.retries; + const after = ~~error.request.request.retryAfter; + options.request.retryCount = info.retryCount + 1; - fs.lstat(task.filepath, function(err, stats) { - if (this._state.aborted) { - setImmediate(callback); - return; + if (maxRetries > info.retryCount) { + // Returning a number instructs the limiter to retry + // the request after that number of milliseconds have passed + return after * state.retryAfterBaseValue; } + }); + return limiter.schedule(request, options); +} - if (err) { - this._entriesCount--; +const VERSION = "3.0.9"; +function retry(octokit, octokitOptions) { + const state = Object.assign({ + enabled: true, + retryAfterBaseValue: 1000, + doNotRetry: [400, 401, 403, 404, 422], + retries: 3 + }, octokitOptions.retry); - /** - * @event Archiver#warning - * @type {ErrorData} - */ - this.emit('warning', err); - setImmediate(callback); - return; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, octokit, state)); + octokit.hook.wrap("request", wrapRequest.bind(null, state)); + } + + return { + retry: { + retryRequest: (error, retries, retryAfter) => { + error.request.request = Object.assign({}, error.request.request, { + retries: retries, + retryAfter: retryAfter + }); + return error; + } } + }; +} +retry.VERSION = VERSION; - task = this._updateQueueTaskWithStats(task, stats); +exports.VERSION = VERSION; +exports.retry = retry; +//# sourceMappingURL=index.js.map - if (task) { - if (stats.size) { - this._fsEntriesTotalBytes += stats.size; - } - this._queue.push(task); - } +/***/ }), - setImmediate(callback); - }.bind(this)); -}; +/***/ 66255: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Unpipes the module and ends our internal stream. - * - * @private - * @return void - */ -Archiver.prototype._shutdown = function() { - this._moduleUnpipe(); - this.end(); -}; +"use strict"; -/** - * Tracks the bytes emitted by our internal stream. - * - * @private - * @param {Buffer} chunk - * @param {String} encoding - * @param {Function} callback - * @return void - */ -Archiver.prototype._transform = function(chunk, encoding, callback) { - if (chunk) { - this._pointer += chunk.length; - } - callback(null, chunk); -}; +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Updates and normalizes a queue task using stats data. - * - * @private - * @param {Object} task - * @param {fs.Stats} stats - * @return {Object} - */ -Archiver.prototype._updateQueueTaskWithStats = function(task, stats) { - if (stats.isFile()) { - task.data.type = 'file'; - task.data.sourceType = 'stream'; - task.source = util.lazyReadStream(task.filepath); - } else if (stats.isDirectory() && this._moduleSupports('directory')) { - task.data.name = util.trailingSlashIt(task.data.name); - task.data.type = 'directory'; - task.data.sourcePath = util.trailingSlashIt(task.filepath); - task.data.sourceType = 'buffer'; - task.source = Buffer.concat([]); - } else if (stats.isSymbolicLink() && this._moduleSupports('symlink')) { - var linkPath = fs.readlinkSync(task.filepath); - var dirName = path.dirname(task.filepath); - task.data.type = 'symlink'; - task.data.linkname = path.relative(dirName, path.resolve(dirName, linkPath)); - task.data.sourceType = 'buffer'; - task.source = Buffer.concat([]); - } else { - if (stats.isDirectory()) { - this.emit('warning', new ArchiverError('DIRECTORYNOTSUPPORTED', task.data)); - } else if (stats.isSymbolicLink()) { - this.emit('warning', new ArchiverError('SYMLINKNOTSUPPORTED', task.data)); - } else { - this.emit('warning', new ArchiverError('ENTRYNOTSUPPORTED', task.data)); - } +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - return null; - } +var endpoint = __nccwpck_require__(54471); +var universalUserAgent = __nccwpck_require__(33843); +var isPlainObject = __nccwpck_require__(93407); +var nodeFetch = _interopDefault(__nccwpck_require__(26705)); +var requestError = __nccwpck_require__(54071); - task.data = this._normalizeEntryData(task.data, stats); +const VERSION = "5.6.3"; - return task; -}; +function getBufferResponse(response) { + return response.arrayBuffer(); +} -/** - * Aborts the archiving process, taking a best-effort approach, by: - * - * - removing any pending queue tasks - * - allowing any active queue workers to finish - * - detaching internal module pipes - * - ending both sides of the Transform stream - * - * It will NOT drain any remaining sources. - * - * @return {this} - */ -Archiver.prototype.abort = function() { - if (this._state.aborted || this._state.finalized) { - return this; +function fetchWrapper(requestOptions) { + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + + if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); } - this._abort(); + let headers = {}; + let status; + let url; + const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; + return fetch(requestOptions.url, Object.assign({ + method: requestOptions.method, + body: requestOptions.body, + headers: requestOptions.headers, + redirect: requestOptions.redirect + }, // `requestOptions.request.agent` type is incompatible + // see https://github.com/octokit/types.ts/pull/264 + requestOptions.request)).then(async response => { + url = response.url; + status = response.status; - return this; -}; + for (const keyAndValue of response.headers) { + headers[keyAndValue[0]] = keyAndValue[1]; + } -/** - * Appends an input source (text string, buffer, or stream) to the instance. - * - * When the instance has received, processed, and emitted the input, the `entry` - * event is fired. - * - * @fires Archiver#entry - * @param {(Buffer|Stream|String)} source The input source. - * @param {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.append = function(source, data) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; - } + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); + } - data = this._normalizeEntryData(data); + if (status === 204 || status === 205) { + return; + } // GitHub API returns 200 for HEAD requests - if (typeof data.name !== 'string' || data.name.length === 0) { - this.emit('error', new ArchiverError('ENTRYNAMEREQUIRED')); - return this; - } - if (data.type === 'directory' && !this._moduleSupports('directory')) { - this.emit('error', new ArchiverError('DIRECTORYNOTSUPPORTED', { name: data.name })); - return this; - } + if (requestOptions.method === "HEAD") { + if (status < 400) { + return; + } - source = util.normalizeInputSource(source); + throw new requestError.RequestError(response.statusText, status, { + response: { + url, + status, + headers, + data: undefined + }, + request: requestOptions + }); + } - if (Buffer.isBuffer(source)) { - data.sourceType = 'buffer'; - } else if (util.isStream(source)) { - data.sourceType = 'stream'; - } else { - this.emit('error', new ArchiverError('INPUTSTEAMBUFFERREQUIRED', { name: data.name })); - return this; - } + if (status === 304) { + throw new requestError.RequestError("Not modified", status, { + response: { + url, + status, + headers, + data: await getResponseData(response) + }, + request: requestOptions + }); + } - this._entriesCount++; - this._queue.push({ - data: data, - source: source + if (status >= 400) { + const data = await getResponseData(response); + const error = new requestError.RequestError(toErrorMessage(data), status, { + response: { + url, + status, + headers, + data + }, + request: requestOptions + }); + throw error; + } + + return getResponseData(response); + }).then(data => { + return { + status, + url, + headers, + data + }; + }).catch(error => { + if (error instanceof requestError.RequestError) throw error; + throw new requestError.RequestError(error.message, 500, { + request: requestOptions + }); }); +} - return this; -}; +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); -/** - * Appends a directory and its files, recursively, given its dirpath. - * - * @param {String} dirpath The source directory path. - * @param {String} destpath The destination path within the archive. - * @param {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and - * [TarEntryData]{@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.directory = function(dirpath, destpath, data) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; + if (/application\/json/.test(contentType)) { + return response.json(); } - if (typeof dirpath !== 'string' || dirpath.length === 0) { - this.emit('error', new ArchiverError('DIRECTORYDIRPATHREQUIRED')); - return this; + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); } - this._pending++; - - if (destpath === false) { - destpath = ''; - } else if (typeof destpath !== 'string'){ - destpath = dirpath; - } + return getBufferResponse(response); +} - var dataFunction = false; - if (typeof data === 'function') { - dataFunction = data; - data = {}; - } else if (typeof data !== 'object') { - data = {}; - } +function toErrorMessage(data) { + if (typeof data === "string") return data; // istanbul ignore else - just in case - var globOptions = { - stat: true, - dot: true - }; + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } - function onGlobEnd() { - this._pending--; - this._maybeFinalize(); - } + return data.message; + } // istanbul ignore next - just in case - function onGlobError(err) { - this.emit('error', err); - } - function onGlobMatch(match){ - globber.pause(); + return `Unknown error: ${JSON.stringify(data)}`; +} - var ignoreMatch = false; - var entryData = Object.assign({}, data); - entryData.name = match.relative; - entryData.prefix = destpath; - entryData.stats = match.stat; - entryData.callback = globber.resume.bind(globber); +function withDefaults(oldEndpoint, newDefaults) { + const endpoint = oldEndpoint.defaults(newDefaults); - try { - if (dataFunction) { - entryData = dataFunction(entryData); + const newApi = function (route, parameters) { + const endpointOptions = endpoint.merge(route, parameters); - if (entryData === false) { - ignoreMatch = true; - } else if (typeof entryData !== 'object') { - throw new ArchiverError('DIRECTORYFUNCTIONINVALIDDATA', { dirpath: dirpath }); - } - } - } catch(e) { - this.emit('error', e); - return; + if (!endpointOptions.request || !endpointOptions.request.hook) { + return fetchWrapper(endpoint.parse(endpointOptions)); } - if (ignoreMatch) { - globber.resume(); - return; - } + const request = (route, parameters) => { + return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); + }; - this._append(match.absolute, entryData); + Object.assign(request, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); + return endpointOptions.request.hook(request, endpointOptions); + }; + + return Object.assign(newApi, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); +} + +const request = withDefaults(endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` } +}); - var globber = glob(dirpath, globOptions); - globber.on('error', onGlobError.bind(this)); - globber.on('match', onGlobMatch.bind(this)); - globber.on('end', onGlobEnd.bind(this)); +exports.request = request; +//# sourceMappingURL=index.js.map - return this; -}; -/** - * Appends a file given its filepath using a - * [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to - * prevent issues with open file limits. - * - * When the instance has received, processed, and emitted the file, the `entry` - * event is fired. - * - * @param {String} filepath The source filepath. - * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and - * [TarEntryData]{@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.file = function(filepath, data) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; - } +/***/ }), - if (typeof filepath !== 'string' || filepath.length === 0) { - this.emit('error', new ArchiverError('FILEFILEPATHREQUIRED')); - return this; - } +/***/ 54071: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - this._append(filepath, data); +"use strict"; - return this; -}; -/** - * Appends multiple files that match a glob pattern. - * - * @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/minimatch} to match. - * @param {Object} options See [node-readdir-glob]{@link https://github.com/yqnn/node-readdir-glob#options}. - * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and - * [TarEntryData]{@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.glob = function(pattern, options, data) { - this._pending++; +Object.defineProperty(exports, "__esModule", ({ value: true })); - options = util.defaults(options, { - stat: true, - pattern: pattern - }); +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - function onGlobEnd() { - this._pending--; - this._maybeFinalize(); - } +var deprecation = __nccwpck_require__(14150); +var once = _interopDefault(__nccwpck_require__(55560)); - function onGlobError(err) { - this.emit('error', err); - } +const logOnceCode = once(deprecation => console.warn(deprecation)); +const logOnceHeaders = once(deprecation => console.warn(deprecation)); +/** + * Error with extra properties to help with debugging + */ - function onGlobMatch(match){ - globber.pause(); - var entryData = Object.assign({}, data); - entryData.callback = globber.resume.bind(globber); - entryData.stats = match.stat; - entryData.name = match.relative; +class RequestError extends Error { + constructor(message, statusCode, options) { + super(message); // Maintains proper stack trace (only available on V8) - this._append(match.absolute, entryData); - } + /* istanbul ignore next */ - var globber = glob(options.cwd || '.', options); - globber.on('error', onGlobError.bind(this)); - globber.on('match', onGlobMatch.bind(this)); - globber.on('end', onGlobEnd.bind(this)); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } - return this; -}; + this.name = "HttpError"; + this.status = statusCode; + let headers; -/** - * Finalizes the instance and prevents further appending to the archive - * structure (queue will continue til drained). - * - * The `end`, `close` or `finish` events on the destination stream may fire - * right after calling this method so you should set listeners beforehand to - * properly detect stream completion. - * - * @return {Promise} - */ -Archiver.prototype.finalize = function() { - if (this._state.aborted) { - var abortedError = new ArchiverError('ABORTED'); - this.emit('error', abortedError); - return Promise.reject(abortedError); - } + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } - if (this._state.finalize) { - var finalizingError = new ArchiverError('FINALIZING'); - this.emit('error', finalizingError); - return Promise.reject(finalizingError); - } + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } // redact request credentials without mutating original request options - this._state.finalize = true; - if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - } + const requestCopy = Object.assign({}, options.request); - var self = this; + if (options.request.headers.authorization) { + requestCopy.headers = Object.assign({}, options.request.headers, { + authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") + }); + } - return new Promise(function(resolve, reject) { - var errored; + requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit + // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications + .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended + // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header + .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); + this.request = requestCopy; // deprecations - self._module.on('end', function() { - if (!errored) { - resolve(); + Object.defineProperty(this, "code", { + get() { + logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; } - }) - self._module.on('error', function(err) { - errored = true; - reject(err); - }) - }) -}; + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); + return headers || {}; + } -/** - * Sets the module format name used for archiving. - * - * @param {String} format The name of the format. - * @return {this} - */ -Archiver.prototype.setFormat = function(format) { - if (this._format) { - this.emit('error', new ArchiverError('FORMATSET')); - return this; + }); } - this._format = format; +} - return this; -}; +exports.RequestError = RequestError; +//# sourceMappingURL=index.js.map -/** - * Sets the module used for archiving. - * - * @param {Function} module The function for archiver to interact with. - * @return {this} - */ -Archiver.prototype.setModule = function(module) { - if (this._state.aborted) { - this.emit('error', new ArchiverError('ABORTED')); - return this; - } - if (this._state.module) { - this.emit('error', new ArchiverError('MODULESET')); - return this; - } +/***/ }), - this._module = module; - this._modulePipe(); +/***/ 37889: +/***/ (function(__unused_webpack_module, exports) { - return this; -}; +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ClientStreamingCall = void 0; /** - * Appends a symlink to the instance. - * - * This does NOT interact with filesystem and is used for programmatically creating symlinks. - * - * @param {String} filepath The symlink path (within archive). - * @param {String} target The target path (within archive). - * @param {Number} mode Sets the entry permissions. - * @return {this} + * A client streaming RPC call. This means that the clients sends 0, 1, or + * more messages to the server, and the server replies with exactly one + * message. */ -Archiver.prototype.symlink = function(filepath, target, mode) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; - } - - if (typeof filepath !== 'string' || filepath.length === 0) { - this.emit('error', new ArchiverError('SYMLINKFILEPATHREQUIRED')); - return this; - } - - if (typeof target !== 'string' || target.length === 0) { - this.emit('error', new ArchiverError('SYMLINKTARGETREQUIRED', { filepath: filepath })); - return this; - } - - if (!this._moduleSupports('symlink')) { - this.emit('error', new ArchiverError('SYMLINKNOTSUPPORTED', { filepath: filepath })); - return this; - } - - var data = {}; - data.type = 'symlink'; - data.name = filepath.replace(/\\/g, '/'); - data.linkname = target.replace(/\\/g, '/'); - data.sourceType = 'buffer'; +class ClientStreamingCall { + constructor(method, requestHeaders, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.response = response; + this.status = status; + this.trailers = trailers; + } + /** + * Instead of awaiting the response status and trailers, you can + * just as well await this call itself to receive the server outcome. + * Note that it may still be valid to send more request messages. + */ + then(onfulfilled, onrejected) { + return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); + } + promiseFinished() { + return __awaiter(this, void 0, void 0, function* () { + let [headers, response, status, trailers] = yield Promise.all([this.headers, this.response, this.status, this.trailers]); + return { + method: this.method, + requestHeaders: this.requestHeaders, + headers, + response, + status, + trailers + }; + }); + } +} +exports.ClientStreamingCall = ClientStreamingCall; - if (typeof mode === "number") { - data.mode = mode; - } - this._entriesCount++; - this._queue.push({ - data: data, - source: Buffer.concat([]) - }); +/***/ }), - return this; -}; +/***/ 71409: +/***/ ((__unused_webpack_module, exports) => { -/** - * Returns the current length (in bytes) that has been emitted. - * - * @return {Number} - */ -Archiver.prototype.pointer = function() { - return this._pointer; -}; +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Deferred = exports.DeferredState = void 0; +var DeferredState; +(function (DeferredState) { + DeferredState[DeferredState["PENDING"] = 0] = "PENDING"; + DeferredState[DeferredState["REJECTED"] = 1] = "REJECTED"; + DeferredState[DeferredState["RESOLVED"] = 2] = "RESOLVED"; +})(DeferredState = exports.DeferredState || (exports.DeferredState = {})); /** - * Middleware-like helper that has yet to be fully implemented. + * A deferred promise. This is a "controller" for a promise, which lets you + * pass a promise around and reject or resolve it from the outside. * - * @private - * @param {Function} plugin - * @return {this} + * Warning: This class is to be used with care. Using it can make code very + * difficult to read. It is intended for use in library code that exposes + * promises, not for regular business logic. */ -Archiver.prototype.use = function(plugin) { - this._streams.push(plugin); - return this; -}; - -module.exports = Archiver; +class Deferred { + /** + * @param preventUnhandledRejectionWarning - prevents the warning + * "Unhandled Promise rejection" by adding a noop rejection handler. + * Working with calls returned from the runtime-rpc package in an + * async function usually means awaiting one call property after + * the other. This means that the "status" is not being awaited when + * an earlier await for the "headers" is rejected. This causes the + * "unhandled promise reject" warning. A more correct behaviour for + * calls might be to become aware whether at least one of the + * promises is handled and swallow the rejection warning for the + * others. + */ + constructor(preventUnhandledRejectionWarning = true) { + this._state = DeferredState.PENDING; + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + if (preventUnhandledRejectionWarning) { + this._promise.catch(_ => { }); + } + } + /** + * Get the current state of the promise. + */ + get state() { + return this._state; + } + /** + * Get the deferred promise. + */ + get promise() { + return this._promise; + } + /** + * Resolve the promise. Throws if the promise is already resolved or rejected. + */ + resolve(value) { + if (this.state !== DeferredState.PENDING) + throw new Error(`cannot resolve ${DeferredState[this.state].toLowerCase()}`); + this._resolve(value); + this._state = DeferredState.RESOLVED; + } + /** + * Reject the promise. Throws if the promise is already resolved or rejected. + */ + reject(reason) { + if (this.state !== DeferredState.PENDING) + throw new Error(`cannot reject ${DeferredState[this.state].toLowerCase()}`); + this._reject(reason); + this._state = DeferredState.REJECTED; + } + /** + * Resolve the promise. Ignore if not pending. + */ + resolvePending(val) { + if (this._state === DeferredState.PENDING) + this.resolve(val); + } + /** + * Reject the promise. Ignore if not pending. + */ + rejectPending(reason) { + if (this._state === DeferredState.PENDING) + this.reject(reason); + } +} +exports.Deferred = Deferred; -/** - * @typedef {Object} CoreOptions - * @global - * @property {Number} [statConcurrency=4] Sets the number of workers used to - * process the internal fs stat queue. - */ -/** - * @typedef {Object} TransformOptions - * @property {Boolean} [allowHalfOpen=true] If set to false, then the stream - * will automatically end the readable side when the writable side ends and vice - * versa. - * @property {Boolean} [readableObjectMode=false] Sets objectMode for readable - * side of the stream. Has no effect if objectMode is true. - * @property {Boolean} [writableObjectMode=false] Sets objectMode for writable - * side of the stream. Has no effect if objectMode is true. - * @property {Boolean} [decodeStrings=true] Whether or not to decode strings - * into Buffers before passing them to _write(). `Writable` - * @property {String} [encoding=NULL] If specified, then buffers will be decoded - * to strings using the specified encoding. `Readable` - * @property {Number} [highWaterMark=16kb] The maximum number of bytes to store - * in the internal buffer before ceasing to read from the underlying resource. - * `Readable` `Writable` - * @property {Boolean} [objectMode=false] Whether this stream should behave as a - * stream of objects. Meaning that stream.read(n) returns a single value instead - * of a Buffer of size n. `Readable` `Writable` - */ +/***/ }), -/** - * @typedef {Object} EntryData - * @property {String} name Sets the entry name including internal path. - * @property {(String|Date)} [date=NOW()] Sets the entry date. - * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. - * @property {String} [prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - */ +/***/ 36826: +/***/ (function(__unused_webpack_module, exports) { -/** - * @typedef {Object} ErrorData - * @property {String} message The message of the error. - * @property {String} code The error code assigned to this error. - * @property {String} data Additional data provided for reporting or debugging (where available). - */ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DuplexStreamingCall = void 0; /** - * @typedef {Object} ProgressData - * @property {Object} entries - * @property {Number} entries.total Number of entries that have been appended. - * @property {Number} entries.processed Number of entries that have been processed. - * @property {Object} fs - * @property {Number} fs.totalBytes Number of bytes that have been appended. Calculated asynchronously and might not be accurate: it growth while entries are added. (based on fs.Stats) - * @property {Number} fs.processedBytes Number of bytes that have been processed. (based on fs.Stats) + * A duplex streaming RPC call. This means that the clients sends an + * arbitrary amount of messages to the server, while at the same time, + * the server sends an arbitrary amount of messages to the client. */ +class DuplexStreamingCall { + constructor(method, requestHeaders, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; + } + /** + * Instead of awaiting the response status and trailers, you can + * just as well await this call itself to receive the server outcome. + * Note that it may still be valid to send more request messages. + */ + then(onfulfilled, onrejected) { + return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); + } + promiseFinished() { + return __awaiter(this, void 0, void 0, function* () { + let [headers, status, trailers] = yield Promise.all([this.headers, this.status, this.trailers]); + return { + method: this.method, + requestHeaders: this.requestHeaders, + headers, + status, + trailers, + }; + }); + } +} +exports.DuplexStreamingCall = DuplexStreamingCall; /***/ }), -/***/ 13110: -/***/ ((module, exports, __nccwpck_require__) => { +/***/ 44420: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Archiver Core - * - * @ignore - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ +"use strict"; -var util = __nccwpck_require__(39023); +// Public API of the rpc runtime. +// Note: we do not use `export * from ...` to help tree shakers, +// webpack verbose output hints that this should be useful +Object.defineProperty(exports, "__esModule", ({ value: true })); +var service_type_1 = __nccwpck_require__(56892); +Object.defineProperty(exports, "ServiceType", ({ enumerable: true, get: function () { return service_type_1.ServiceType; } })); +var reflection_info_1 = __nccwpck_require__(62496); +Object.defineProperty(exports, "readMethodOptions", ({ enumerable: true, get: function () { return reflection_info_1.readMethodOptions; } })); +Object.defineProperty(exports, "readMethodOption", ({ enumerable: true, get: function () { return reflection_info_1.readMethodOption; } })); +Object.defineProperty(exports, "readServiceOption", ({ enumerable: true, get: function () { return reflection_info_1.readServiceOption; } })); +var rpc_error_1 = __nccwpck_require__(78636); +Object.defineProperty(exports, "RpcError", ({ enumerable: true, get: function () { return rpc_error_1.RpcError; } })); +var rpc_options_1 = __nccwpck_require__(28576); +Object.defineProperty(exports, "mergeRpcOptions", ({ enumerable: true, get: function () { return rpc_options_1.mergeRpcOptions; } })); +var rpc_output_stream_1 = __nccwpck_require__(72726); +Object.defineProperty(exports, "RpcOutputStreamController", ({ enumerable: true, get: function () { return rpc_output_stream_1.RpcOutputStreamController; } })); +var test_transport_1 = __nccwpck_require__(79122); +Object.defineProperty(exports, "TestTransport", ({ enumerable: true, get: function () { return test_transport_1.TestTransport; } })); +var deferred_1 = __nccwpck_require__(71409); +Object.defineProperty(exports, "Deferred", ({ enumerable: true, get: function () { return deferred_1.Deferred; } })); +Object.defineProperty(exports, "DeferredState", ({ enumerable: true, get: function () { return deferred_1.DeferredState; } })); +var duplex_streaming_call_1 = __nccwpck_require__(36826); +Object.defineProperty(exports, "DuplexStreamingCall", ({ enumerable: true, get: function () { return duplex_streaming_call_1.DuplexStreamingCall; } })); +var client_streaming_call_1 = __nccwpck_require__(37889); +Object.defineProperty(exports, "ClientStreamingCall", ({ enumerable: true, get: function () { return client_streaming_call_1.ClientStreamingCall; } })); +var server_streaming_call_1 = __nccwpck_require__(46173); +Object.defineProperty(exports, "ServerStreamingCall", ({ enumerable: true, get: function () { return server_streaming_call_1.ServerStreamingCall; } })); +var unary_call_1 = __nccwpck_require__(29288); +Object.defineProperty(exports, "UnaryCall", ({ enumerable: true, get: function () { return unary_call_1.UnaryCall; } })); +var rpc_interceptor_1 = __nccwpck_require__(52849); +Object.defineProperty(exports, "stackIntercept", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackIntercept; } })); +Object.defineProperty(exports, "stackDuplexStreamingInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackDuplexStreamingInterceptors; } })); +Object.defineProperty(exports, "stackClientStreamingInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackClientStreamingInterceptors; } })); +Object.defineProperty(exports, "stackServerStreamingInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackServerStreamingInterceptors; } })); +Object.defineProperty(exports, "stackUnaryInterceptors", ({ enumerable: true, get: function () { return rpc_interceptor_1.stackUnaryInterceptors; } })); +var server_call_context_1 = __nccwpck_require__(43352); +Object.defineProperty(exports, "ServerCallContextController", ({ enumerable: true, get: function () { return server_call_context_1.ServerCallContextController; } })); -const ERROR_CODES = { - 'ABORTED': 'archive was aborted', - 'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value', - 'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function', - 'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value', - 'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value', - 'FINALIZING': 'archive already finalizing', - 'QUEUECLOSED': 'queue closed', - 'NOENDMETHOD': 'no suitable finalize/end method defined by module', - 'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module', - 'FORMATSET': 'archive format already set', - 'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance', - 'MODULESET': 'module already set', - 'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module', - 'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value', - 'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value', - 'ENTRYNOTSUPPORTED': 'entry not supported' -}; -function ArchiverError(code, data) { - Error.captureStackTrace(this, this.constructor); - //this.name = this.constructor.name; - this.message = ERROR_CODES[code] || code; - this.code = code; - this.data = data; -} +/***/ }), -util.inherits(ArchiverError, Error); +/***/ 62496: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -exports = module.exports = ArchiverError; +"use strict"; -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.readServiceOption = exports.readMethodOption = exports.readMethodOptions = exports.normalizeMethodInfo = void 0; +const runtime_1 = __nccwpck_require__(68886); +/** + * Turns PartialMethodInfo into MethodInfo. + */ +function normalizeMethodInfo(method, service) { + var _a, _b, _c; + let m = method; + m.service = service; + m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : runtime_1.lowerCamelCase(m.name); + // noinspection PointlessBooleanExpressionJS + m.serverStreaming = !!m.serverStreaming; + // noinspection PointlessBooleanExpressionJS + m.clientStreaming = !!m.clientStreaming; + m.options = (_b = m.options) !== null && _b !== void 0 ? _b : {}; + m.idempotency = (_c = m.idempotency) !== null && _c !== void 0 ? _c : undefined; + return m; +} +exports.normalizeMethodInfo = normalizeMethodInfo; +/** + * Read custom method options from a generated service client. + * + * @deprecated use readMethodOption() + */ +function readMethodOptions(service, methodName, extensionName, extensionType) { + var _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : undefined; +} +exports.readMethodOptions = readMethodOptions; +function readMethodOption(service, methodName, extensionName, extensionType) { + var _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return undefined; + } + const optionVal = options[extensionName]; + if (optionVal === undefined) { + return optionVal; + } + return extensionType ? extensionType.fromJson(optionVal) : optionVal; +} +exports.readMethodOption = readMethodOption; +function readServiceOption(service, extensionName, extensionType) { + const options = service.options; + if (!options) { + return undefined; + } + const optionVal = options[extensionName]; + if (optionVal === undefined) { + return optionVal; + } + return extensionType ? extensionType.fromJson(optionVal) : optionVal; +} +exports.readServiceOption = readServiceOption; -/***/ 54693: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * JSON Format Plugin - * - * @module plugins/json - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var inherits = (__nccwpck_require__(39023).inherits); -var Transform = (__nccwpck_require__(86131).Transform); +/***/ }), -var crc32 = __nccwpck_require__(19776); -var util = __nccwpck_require__(53296); +/***/ 78636: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RpcError = void 0; /** - * @constructor - * @param {(JsonOptions|TransformOptions)} options + * An error that occurred while calling a RPC method. */ -var Json = function(options) { - if (!(this instanceof Json)) { - return new Json(options); - } - - options = this.options = util.defaults(options, {}); +class RpcError extends Error { + constructor(message, code = 'UNKNOWN', meta) { + super(message); + this.name = 'RpcError'; + // see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#example + Object.setPrototypeOf(this, new.target.prototype); + this.code = code; + this.meta = meta !== null && meta !== void 0 ? meta : {}; + } + toString() { + const l = [this.name + ': ' + this.message]; + if (this.code) { + l.push(''); + l.push('Code: ' + this.code); + } + if (this.serviceName && this.methodName) { + l.push('Method: ' + this.serviceName + '/' + this.methodName); + } + let m = Object.entries(this.meta); + if (m.length) { + l.push(''); + l.push('Meta:'); + for (let [k, v] of m) { + l.push(` ${k}: ${v}`); + } + } + return l.join('\n'); + } +} +exports.RpcError = RpcError; - Transform.call(this, options); - this.supports = { - directory: true, - symlink: true - }; +/***/ }), - this.files = []; -}; +/***/ 52849: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -inherits(Json, Transform); +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.stackDuplexStreamingInterceptors = exports.stackClientStreamingInterceptors = exports.stackServerStreamingInterceptors = exports.stackUnaryInterceptors = exports.stackIntercept = void 0; +const runtime_1 = __nccwpck_require__(68886); /** - * [_transform description] - * - * @private - * @param {Buffer} chunk - * @param {String} encoding - * @param {Function} callback - * @return void + * Creates a "stack" of of all interceptors specified in the given `RpcOptions`. + * Used by generated client implementations. + * @internal */ -Json.prototype._transform = function(chunk, encoding, callback) { - callback(null, chunk); -}; - +function stackIntercept(kind, transport, method, options, input) { + var _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter(i => i.interceptUnary).reverse()) { + const next = tail; + tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); + } + return tail(method, input, options); + } + if (kind == "serverStreaming") { + let tail = (mtd, inp, opt) => transport.serverStreaming(mtd, inp, opt); + for (const curr of ((_b = options.interceptors) !== null && _b !== void 0 ? _b : []).filter(i => i.interceptServerStreaming).reverse()) { + const next = tail; + tail = (mtd, inp, opt) => curr.interceptServerStreaming(next, mtd, inp, opt); + } + return tail(method, input, options); + } + if (kind == "clientStreaming") { + let tail = (mtd, opt) => transport.clientStreaming(mtd, opt); + for (const curr of ((_c = options.interceptors) !== null && _c !== void 0 ? _c : []).filter(i => i.interceptClientStreaming).reverse()) { + const next = tail; + tail = (mtd, opt) => curr.interceptClientStreaming(next, mtd, opt); + } + return tail(method, options); + } + if (kind == "duplex") { + let tail = (mtd, opt) => transport.duplex(mtd, opt); + for (const curr of ((_d = options.interceptors) !== null && _d !== void 0 ? _d : []).filter(i => i.interceptDuplex).reverse()) { + const next = tail; + tail = (mtd, opt) => curr.interceptDuplex(next, mtd, opt); + } + return tail(method, options); + } + runtime_1.assertNever(kind); +} +exports.stackIntercept = stackIntercept; /** - * [_writeStringified description] - * - * @private - * @return void + * @deprecated replaced by `stackIntercept()`, still here to support older generated code */ -Json.prototype._writeStringified = function() { - var fileString = JSON.stringify(this.files); - this.write(fileString); -}; - +function stackUnaryInterceptors(transport, method, input, options) { + return stackIntercept("unary", transport, method, options, input); +} +exports.stackUnaryInterceptors = stackUnaryInterceptors; /** - * [append description] - * - * @param {(Buffer|Stream)} source - * @param {EntryData} data - * @param {Function} callback - * @return void + * @deprecated replaced by `stackIntercept()`, still here to support older generated code */ -Json.prototype.append = function(source, data, callback) { - var self = this; - - data.crc32 = 0; - - function onend(err, sourceBuffer) { - if (err) { - callback(err); - return; - } +function stackServerStreamingInterceptors(transport, method, input, options) { + return stackIntercept("serverStreaming", transport, method, options, input); +} +exports.stackServerStreamingInterceptors = stackServerStreamingInterceptors; +/** + * @deprecated replaced by `stackIntercept()`, still here to support older generated code + */ +function stackClientStreamingInterceptors(transport, method, options) { + return stackIntercept("clientStreaming", transport, method, options); +} +exports.stackClientStreamingInterceptors = stackClientStreamingInterceptors; +/** + * @deprecated replaced by `stackIntercept()`, still here to support older generated code + */ +function stackDuplexStreamingInterceptors(transport, method, options) { + return stackIntercept("duplex", transport, method, options); +} +exports.stackDuplexStreamingInterceptors = stackDuplexStreamingInterceptors; - data.size = sourceBuffer.length || 0; - data.crc32 = crc32.unsigned(sourceBuffer); - self.files.push(data); +/***/ }), - callback(null, data); - } +/***/ 28576: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (data.sourceType === 'buffer') { - onend(null, source); - } else if (data.sourceType === 'stream') { - util.collectStream(source, onend); - } -}; +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.mergeRpcOptions = void 0; +const runtime_1 = __nccwpck_require__(68886); /** - * [finalize description] + * Merges custom RPC options with defaults. Returns a new instance and keeps + * the "defaults" and the "options" unmodified. * - * @return void - */ -Json.prototype.finalize = function() { - this._writeStringified(); - this.end(); -}; - -module.exports = Json; - -/** - * @typedef {Object} JsonOptions - * @global + * Merges `RpcMetadata` "meta", overwriting values from "defaults" with + * values from "options". Does not append values to existing entries. + * + * Merges "jsonOptions", including "jsonOptions.typeRegistry", by creating + * a new array that contains types from "options.jsonOptions.typeRegistry" + * first, then types from "defaults.jsonOptions.typeRegistry". + * + * Merges "binaryOptions". + * + * Merges "interceptors" by creating a new array that contains interceptors + * from "defaults" first, then interceptors from "options". + * + * Works with objects that extend `RpcOptions`, but only if the added + * properties are of type Date, primitive like string, boolean, or Array + * of primitives. If you have other property types, you have to merge them + * yourself. */ +function mergeRpcOptions(defaults, options) { + if (!options) + return defaults; + let o = {}; + copy(defaults, o); + copy(options, o); + for (let key of Object.keys(options)) { + let val = options[key]; + switch (key) { + case "jsonOptions": + o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); + break; + case "binaryOptions": + o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); + break; + case "meta": + o.meta = {}; + copy(defaults.meta, o.meta); + copy(options.meta, o.meta); + break; + case "interceptors": + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); + break; + } + } + return o; +} +exports.mergeRpcOptions = mergeRpcOptions; +function copy(a, into) { + if (!a) + return; + let c = into; + for (let [k, v] of Object.entries(a)) { + if (v instanceof Date) + c[k] = new Date(v.getTime()); + else if (Array.isArray(v)) + c[k] = v.concat(); + else + c[k] = v; + } +} /***/ }), -/***/ 10396: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 72726: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RpcOutputStreamController = void 0; +const deferred_1 = __nccwpck_require__(71409); +const runtime_1 = __nccwpck_require__(68886); /** - * TAR Format Plugin - * - * @module plugins/tar - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. + * A `RpcOutputStream` that you control. */ -var zlib = __nccwpck_require__(43106); +class RpcOutputStreamController { + constructor() { + this._lis = { + nxt: [], + msg: [], + err: [], + cmp: [], + }; + this._closed = false; + // --- RpcOutputStream async iterator API + // iterator state. + // is undefined when no iterator has been acquired yet. + this._itState = { q: [] }; + } + // --- RpcOutputStream callback API + onNext(callback) { + return this.addLis(callback, this._lis.nxt); + } + onMessage(callback) { + return this.addLis(callback, this._lis.msg); + } + onError(callback) { + return this.addLis(callback, this._lis.err); + } + onComplete(callback) { + return this.addLis(callback, this._lis.cmp); + } + addLis(callback, list) { + list.push(callback); + return () => { + let i = list.indexOf(callback); + if (i >= 0) + list.splice(i, 1); + }; + } + // remove all listeners + clearLis() { + for (let l of Object.values(this._lis)) + l.splice(0, l.length); + } + // --- Controller API + /** + * Is this stream already closed by a completion or error? + */ + get closed() { + return this._closed !== false; + } + /** + * Emit message, close with error, or close successfully, but only one + * at a time. + * Can be used to wrap a stream by using the other stream's `onNext`. + */ + notifyNext(message, error, complete) { + runtime_1.assert((message ? 1 : 0) + (error ? 1 : 0) + (complete ? 1 : 0) <= 1, 'only one emission at a time'); + if (message) + this.notifyMessage(message); + if (error) + this.notifyError(error); + if (complete) + this.notifyComplete(); + } + /** + * Emits a new message. Throws if stream is closed. + * + * Triggers onNext and onMessage callbacks. + */ + notifyMessage(message) { + runtime_1.assert(!this.closed, 'stream is closed'); + this.pushIt({ value: message, done: false }); + this._lis.msg.forEach(l => l(message)); + this._lis.nxt.forEach(l => l(message, undefined, false)); + } + /** + * Closes the stream with an error. Throws if stream is closed. + * + * Triggers onNext and onError callbacks. + */ + notifyError(error) { + runtime_1.assert(!this.closed, 'stream is closed'); + this._closed = error; + this.pushIt(error); + this._lis.err.forEach(l => l(error)); + this._lis.nxt.forEach(l => l(undefined, error, false)); + this.clearLis(); + } + /** + * Closes the stream successfully. Throws if stream is closed. + * + * Triggers onNext and onComplete callbacks. + */ + notifyComplete() { + runtime_1.assert(!this.closed, 'stream is closed'); + this._closed = true; + this.pushIt({ value: null, done: true }); + this._lis.cmp.forEach(l => l()); + this._lis.nxt.forEach(l => l(undefined, undefined, true)); + this.clearLis(); + } + /** + * Creates an async iterator (that can be used with `for await {...}`) + * to consume the stream. + * + * Some things to note: + * - If an error occurs, the `for await` will throw it. + * - If an error occurred before the `for await` was started, `for await` + * will re-throw it. + * - If the stream is already complete, the `for await` will be empty. + * - If your `for await` consumes slower than the stream produces, + * for example because you are relaying messages in a slow operation, + * messages are queued. + */ + [Symbol.asyncIterator]() { + // if we are closed, we are definitely not receiving any more messages. + // but we can't let the iterator get stuck. we want to either: + // a) finish the new iterator immediately, because we are completed + // b) reject the new iterator, because we errored + if (this._closed === true) + this.pushIt({ value: null, done: true }); + else if (this._closed !== false) + this.pushIt(this._closed); + // the async iterator + return { + next: () => { + let state = this._itState; + runtime_1.assert(state, "bad state"); // if we don't have a state here, code is broken + // there should be no pending result. + // did the consumer call next() before we resolved our previous result promise? + runtime_1.assert(!state.p, "iterator contract broken"); + // did we produce faster than the iterator consumed? + // return the oldest result from the queue. + let first = state.q.shift(); + if (first) + return ("value" in first) ? Promise.resolve(first) : Promise.reject(first); + // we have no result ATM, but we promise one. + // as soon as we have a result, we must resolve promise. + state.p = new deferred_1.Deferred(); + return state.p.promise; + }, + }; + } + // "push" a new iterator result. + // this either resolves a pending promise, or enqueues the result. + pushIt(result) { + let state = this._itState; + // is the consumer waiting for us? + if (state.p) { + // yes, consumer is waiting for this promise. + const p = state.p; + runtime_1.assert(p.state == deferred_1.DeferredState.PENDING, "iterator contract broken"); + // resolve the promise + ("value" in result) ? p.resolve(result) : p.reject(result); + // must cleanup, otherwise iterator.next() would pick it up again. + delete state.p; + } + else { + // we are producing faster than the iterator consumes. + // push result onto queue. + state.q.push(result); + } + } +} +exports.RpcOutputStreamController = RpcOutputStreamController; -var engine = __nccwpck_require__(56118); -var util = __nccwpck_require__(53296); -/** - * @constructor - * @param {TarOptions} options - */ -var Tar = function(options) { - if (!(this instanceof Tar)) { - return new Tar(options); - } +/***/ }), - options = this.options = util.defaults(options, { - gzip: false - }); +/***/ 43352: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ServerCallContextController = void 0; +class ServerCallContextController { + constructor(method, headers, deadline, sendResponseHeadersFn, defaultStatus = { code: 'OK', detail: '' }) { + this._cancelled = false; + this._listeners = []; + this.method = method; + this.headers = headers; + this.deadline = deadline; + this.trailers = {}; + this._sendRH = sendResponseHeadersFn; + this.status = defaultStatus; + } + /** + * Set the call cancelled. + * + * Invokes all callbacks registered with onCancel() and + * sets `cancelled = true`. + */ + notifyCancelled() { + if (!this._cancelled) { + this._cancelled = true; + for (let l of this._listeners) { + l(); + } + } + } + /** + * Send response headers. + */ + sendResponseHeaders(data) { + this._sendRH(data); + } + /** + * Is the call cancelled? + * + * When the client closes the connection before the server + * is done, the call is cancelled. + * + * If you want to cancel a request on the server, throw a + * RpcError with the CANCELLED status code. + */ + get cancelled() { + return this._cancelled; + } + /** + * Add a callback for cancellation. + */ + onCancel(callback) { + const l = this._listeners; + l.push(callback); + return () => { + let i = l.indexOf(callback); + if (i >= 0) + l.splice(i, 1); + }; + } +} +exports.ServerCallContextController = ServerCallContextController; - if (typeof options.gzipOptions !== 'object') { - options.gzipOptions = {}; - } - this.supports = { - directory: true, - symlink: true - }; +/***/ }), - this.engine = engine.pack(options); - this.compressor = false; +/***/ 46173: +/***/ (function(__unused_webpack_module, exports) { - if (options.gzip) { - this.compressor = zlib.createGzip(options.gzipOptions); - this.compressor.on('error', this._onCompressorError.bind(this)); - } -}; +"use strict"; -/** - * [_onCompressorError description] - * - * @private - * @param {Error} err - * @return void - */ -Tar.prototype._onCompressorError = function(err) { - this.engine.emit('error', err); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ServerStreamingCall = void 0; /** - * [append description] - * - * @param {(Buffer|Stream)} source - * @param {TarEntryData} data - * @param {Function} callback - * @return void + * A server streaming RPC call. The client provides exactly one input message + * but the server may respond with 0, 1, or more messages. */ -Tar.prototype.append = function(source, data, callback) { - var self = this; +class ServerStreamingCall { + constructor(method, requestHeaders, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; + } + /** + * Instead of awaiting the response status and trailers, you can + * just as well await this call itself to receive the server outcome. + * You should first setup some listeners to the `request` to + * see the actual messages the server replied with. + */ + then(onfulfilled, onrejected) { + return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); + } + promiseFinished() { + return __awaiter(this, void 0, void 0, function* () { + let [headers, status, trailers] = yield Promise.all([this.headers, this.status, this.trailers]); + return { + method: this.method, + requestHeaders: this.requestHeaders, + request: this.request, + headers, + status, + trailers, + }; + }); + } +} +exports.ServerStreamingCall = ServerStreamingCall; - data.mtime = data.date; - function append(err, sourceBuffer) { - if (err) { - callback(err); - return; +/***/ }), + +/***/ 56892: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ServiceType = void 0; +const reflection_info_1 = __nccwpck_require__(62496); +class ServiceType { + constructor(typeName, methods, options) { + this.typeName = typeName; + this.methods = methods.map(i => reflection_info_1.normalizeMethodInfo(i, this)); + this.options = options !== null && options !== void 0 ? options : {}; } +} +exports.ServiceType = ServiceType; - self.engine.entry(data, sourceBuffer, function(err) { - callback(err, data); - }); - } - if (data.sourceType === 'buffer') { - append(null, source); - } else if (data.sourceType === 'stream' && data.stats) { - data.size = data.stats.size; +/***/ }), - var entry = self.engine.entry(data, function(err) { - callback(err, data); - }); +/***/ 79122: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - source.pipe(entry); - } else if (data.sourceType === 'stream') { - util.collectStream(source, append); - } -}; +"use strict"; -/** - * [finalize description] - * - * @return void - */ -Tar.prototype.finalize = function() { - this.engine.finalize(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TestTransport = void 0; +const rpc_error_1 = __nccwpck_require__(78636); +const runtime_1 = __nccwpck_require__(68886); +const rpc_output_stream_1 = __nccwpck_require__(72726); +const rpc_options_1 = __nccwpck_require__(28576); +const unary_call_1 = __nccwpck_require__(29288); +const server_streaming_call_1 = __nccwpck_require__(46173); +const client_streaming_call_1 = __nccwpck_require__(37889); +const duplex_streaming_call_1 = __nccwpck_require__(36826); /** - * [on description] - * - * @return this.engine + * Transport for testing. */ -Tar.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); +class TestTransport { + /** + * Initialize with mock data. Omitted fields have default value. + */ + constructor(data) { + /** + * Suppress warning / error about uncaught rejections of + * "status" and "trailers". + */ + this.suppressUncaughtRejections = true; + this.headerDelay = 10; + this.responseDelay = 50; + this.betweenResponseDelay = 10; + this.afterResponseDelay = 10; + this.data = data !== null && data !== void 0 ? data : {}; + } + /** + * Sent message(s) during the last operation. + */ + get sentMessages() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.sent; + } + else if (typeof this.lastInput == "object") { + return [this.lastInput.single]; + } + return []; + } + /** + * Sending message(s) completed? + */ + get sendComplete() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.completed; + } + else if (typeof this.lastInput == "object") { + return true; + } + return false; + } + // Creates a promise for response headers from the mock data. + promiseHeaders() { + var _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : TestTransport.defaultHeaders; + return headers instanceof rpc_error_1.RpcError + ? Promise.reject(headers) + : Promise.resolve(headers); + } + // Creates a promise for a single, valid, message from the mock data. + promiseSingleResponse(method) { + if (this.data.response instanceof rpc_error_1.RpcError) { + return Promise.reject(this.data.response); + } + let r; + if (Array.isArray(this.data.response)) { + runtime_1.assert(this.data.response.length > 0); + r = this.data.response[0]; + } + else if (this.data.response !== undefined) { + r = this.data.response; + } + else { + r = method.O.create(); + } + runtime_1.assert(method.O.is(r)); + return Promise.resolve(r); + } + /** + * Pushes response messages from the mock data to the output stream. + * If an error response, status or trailers are mocked, the stream is + * closed with the respective error. + * Otherwise, stream is completed successfully. + * + * The returned promise resolves when the stream is closed. It should + * not reject. If it does, code is broken. + */ + streamResponses(method, stream, abort) { + return __awaiter(this, void 0, void 0, function* () { + // normalize "data.response" into an array of valid output messages + const messages = []; + if (this.data.response === undefined) { + messages.push(method.O.create()); + } + else if (Array.isArray(this.data.response)) { + for (let msg of this.data.response) { + runtime_1.assert(method.O.is(msg)); + messages.push(msg); + } + } + else if (!(this.data.response instanceof rpc_error_1.RpcError)) { + runtime_1.assert(method.O.is(this.data.response)); + messages.push(this.data.response); + } + // start the stream with an initial delay. + // if the request is cancelled, notify() error and exit. + try { + yield delay(this.responseDelay, abort)(undefined); + } + catch (error) { + stream.notifyError(error); + return; + } + // if error response was mocked, notify() error (stream is now closed with error) and exit. + if (this.data.response instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.response); + return; + } + // regular response messages were mocked. notify() them. + for (let msg of messages) { + stream.notifyMessage(msg); + // add a short delay between responses + // if the request is cancelled, notify() error and exit. + try { + yield delay(this.betweenResponseDelay, abort)(undefined); + } + catch (error) { + stream.notifyError(error); + return; + } + } + // error status was mocked, notify() error (stream is now closed with error) and exit. + if (this.data.status instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.status); + return; + } + // error trailers were mocked, notify() error (stream is now closed with error) and exit. + if (this.data.trailers instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.trailers); + return; + } + // stream completed successfully + stream.notifyComplete(); + }); + } + // Creates a promise for response status from the mock data. + promiseStatus() { + var _a; + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : TestTransport.defaultStatus; + return status instanceof rpc_error_1.RpcError + ? Promise.reject(status) + : Promise.resolve(status); + } + // Creates a promise for response trailers from the mock data. + promiseTrailers() { + var _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : TestTransport.defaultTrailers; + return trailers instanceof rpc_error_1.RpcError + ? Promise.reject(trailers) + : Promise.resolve(trailers); + } + maybeSuppressUncaught(...promise) { + if (this.suppressUncaughtRejections) { + for (let p of promise) { + p.catch(() => { + }); + } + } + } + mergeOptions(options) { + return rpc_options_1.mergeRpcOptions({}, options); + } + unary(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() + .then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise + .catch(_ => { + }) + .then(delay(this.responseDelay, options.abort)) + .then(_ => this.promiseSingleResponse(method)), statusPromise = responsePromise + .catch(_ => { + }) + .then(delay(this.afterResponseDelay, options.abort)) + .then(_ => this.promiseStatus()), trailersPromise = responsePromise + .catch(_ => { + }) + .then(delay(this.afterResponseDelay, options.abort)) + .then(_ => this.promiseTrailers()); + this.maybeSuppressUncaught(statusPromise, trailersPromise); + this.lastInput = { single: input }; + return new unary_call_1.UnaryCall(method, requestHeaders, input, headersPromise, responsePromise, statusPromise, trailersPromise); + } + serverStreaming(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() + .then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise + .then(delay(this.responseDelay, options.abort)) + .catch(() => { + }) + .then(() => this.streamResponses(method, outputStream, options.abort)) + .then(delay(this.afterResponseDelay, options.abort)), statusPromise = responseStreamClosedPromise + .then(() => this.promiseStatus()), trailersPromise = responseStreamClosedPromise + .then(() => this.promiseTrailers()); + this.maybeSuppressUncaught(statusPromise, trailersPromise); + this.lastInput = { single: input }; + return new server_streaming_call_1.ServerStreamingCall(method, requestHeaders, input, headersPromise, outputStream, statusPromise, trailersPromise); + } + clientStreaming(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() + .then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise + .catch(_ => { + }) + .then(delay(this.responseDelay, options.abort)) + .then(_ => this.promiseSingleResponse(method)), statusPromise = responsePromise + .catch(_ => { + }) + .then(delay(this.afterResponseDelay, options.abort)) + .then(_ => this.promiseStatus()), trailersPromise = responsePromise + .catch(_ => { + }) + .then(delay(this.afterResponseDelay, options.abort)) + .then(_ => this.promiseTrailers()); + this.maybeSuppressUncaught(statusPromise, trailersPromise); + this.lastInput = new TestInputStream(this.data, options.abort); + return new client_streaming_call_1.ClientStreamingCall(method, requestHeaders, this.lastInput, headersPromise, responsePromise, statusPromise, trailersPromise); + } + duplex(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders() + .then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise + .then(delay(this.responseDelay, options.abort)) + .catch(() => { + }) + .then(() => this.streamResponses(method, outputStream, options.abort)) + .then(delay(this.afterResponseDelay, options.abort)), statusPromise = responseStreamClosedPromise + .then(() => this.promiseStatus()), trailersPromise = responseStreamClosedPromise + .then(() => this.promiseTrailers()); + this.maybeSuppressUncaught(statusPromise, trailersPromise); + this.lastInput = new TestInputStream(this.data, options.abort); + return new duplex_streaming_call_1.DuplexStreamingCall(method, requestHeaders, this.lastInput, headersPromise, outputStream, statusPromise, trailersPromise); + } +} +exports.TestTransport = TestTransport; +TestTransport.defaultHeaders = { + responseHeader: "test" }; - -/** - * [pipe description] - * - * @param {String} destination - * @param {Object} options - * @return this.engine - */ -Tar.prototype.pipe = function(destination, options) { - if (this.compressor) { - return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options); - } else { - return this.engine.pipe.apply(this.engine, arguments); - } +TestTransport.defaultStatus = { + code: "OK", detail: "all good" }; - -/** - * [unpipe description] - * - * @return this.engine - */ -Tar.prototype.unpipe = function() { - if (this.compressor) { - return this.compressor.unpipe.apply(this.compressor, arguments); - } else { - return this.engine.unpipe.apply(this.engine, arguments); - } +TestTransport.defaultTrailers = { + responseTrailer: "test" }; +function delay(ms, abort) { + return (v) => new Promise((resolve, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + } + else { + const id = setTimeout(() => resolve(v), ms); + if (abort) { + abort.addEventListener("abort", ev => { + clearTimeout(id); + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + }); + } + } + }); +} +class TestInputStream { + constructor(data, abort) { + this._completed = false; + this._sent = []; + this.data = data; + this.abort = abort; + } + get sent() { + return this._sent; + } + get completed() { + return this._completed; + } + send(message) { + if (this.data.inputMessage instanceof rpc_error_1.RpcError) { + return Promise.reject(this.data.inputMessage); + } + const delayMs = this.data.inputMessage === undefined + ? 10 + : this.data.inputMessage; + return Promise.resolve(undefined) + .then(() => { + this._sent.push(message); + }) + .then(delay(delayMs, this.abort)); + } + complete() { + if (this.data.inputComplete instanceof rpc_error_1.RpcError) { + return Promise.reject(this.data.inputComplete); + } + const delayMs = this.data.inputComplete === undefined + ? 10 + : this.data.inputComplete; + return Promise.resolve(undefined) + .then(() => { + this._completed = true; + }) + .then(delay(delayMs, this.abort)); + } +} -module.exports = Tar; -/** - * @typedef {Object} TarOptions - * @global - * @property {Boolean} [gzip=false] Compress the tar archive using gzip. - * @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} - * to control compression. - * @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties. - */ +/***/ }), -/** - * @typedef {Object} TarEntryData - * @global - * @property {String} name Sets the entry name including internal path. - * @property {(String|Date)} [date=NOW()] Sets the entry date. - * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. - * @property {String} [prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - */ +/***/ 29288: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UnaryCall = void 0; /** - * TarStream Module - * @external TarStream - * @see {@link https://github.com/mafintosh/tar-stream} + * A unary RPC call. Unary means there is exactly one input message and + * exactly one output message unless an error occurred. */ +class UnaryCall { + constructor(method, requestHeaders, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.response = response; + this.status = status; + this.trailers = trailers; + } + /** + * If you are only interested in the final outcome of this call, + * you can await it to receive a `FinishedUnaryCall`. + */ + then(onfulfilled, onrejected) { + return this.promiseFinished().then(value => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, reason => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); + } + promiseFinished() { + return __awaiter(this, void 0, void 0, function* () { + let [headers, response, status, trailers] = yield Promise.all([this.headers, this.response, this.status, this.trailers]); + return { + method: this.method, + requestHeaders: this.requestHeaders, + request: this.request, + headers, + response, + status, + trailers + }; + }); + } +} +exports.UnaryCall = UnaryCall; /***/ }), -/***/ 22836: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 8602: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.assertFloat32 = exports.assertUInt32 = exports.assertInt32 = exports.assertNever = exports.assert = void 0; /** - * ZIP Format Plugin - * - * @module plugins/zip - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. + * assert that condition is true or throw error (with message) */ -var engine = __nccwpck_require__(41622); -var util = __nccwpck_require__(53296); - +function assert(condition, msg) { + if (!condition) { + throw new Error(msg); + } +} +exports.assert = assert; /** - * @constructor - * @param {ZipOptions} [options] - * @param {String} [options.comment] Sets the zip archive comment. - * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC. - * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers. - * @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths. - * @param {Boolean} [options.store=false] Sets the compression method to STORE. - * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + * assert that value cannot exist = type `never`. throw runtime error if it does. */ -var Zip = function(options) { - if (!(this instanceof Zip)) { - return new Zip(options); - } +function assertNever(value, msg) { + throw new Error(msg !== null && msg !== void 0 ? msg : 'Unexpected object: ' + value); +} +exports.assertNever = assertNever; +const FLOAT32_MAX = 3.4028234663852886e+38, FLOAT32_MIN = -3.4028234663852886e+38, UINT32_MAX = 0xFFFFFFFF, INT32_MAX = 0X7FFFFFFF, INT32_MIN = -0X80000000; +function assertInt32(arg) { + if (typeof arg !== "number") + throw new Error('invalid int 32: ' + typeof arg); + if (!Number.isInteger(arg) || arg > INT32_MAX || arg < INT32_MIN) + throw new Error('invalid int 32: ' + arg); +} +exports.assertInt32 = assertInt32; +function assertUInt32(arg) { + if (typeof arg !== "number") + throw new Error('invalid uint 32: ' + typeof arg); + if (!Number.isInteger(arg) || arg > UINT32_MAX || arg < 0) + throw new Error('invalid uint 32: ' + arg); +} +exports.assertUInt32 = assertUInt32; +function assertFloat32(arg) { + if (typeof arg !== "number") + throw new Error('invalid float 32: ' + typeof arg); + if (!Number.isFinite(arg)) + return; + if (arg > FLOAT32_MAX || arg < FLOAT32_MIN) + throw new Error('invalid float 32: ' + arg); +} +exports.assertFloat32 = assertFloat32; - options = this.options = util.defaults(options, { - comment: '', - forceUTC: false, - namePrependSlash: false, - store: false - }); - this.supports = { - directory: true, - symlink: true - }; +/***/ }), - this.engine = new engine(options); -}; +/***/ 26335: +/***/ ((__unused_webpack_module, exports) => { -/** - * @param {(Buffer|Stream)} source - * @param {ZipEntryData} data - * @param {String} data.name Sets the entry name including internal path. - * @param {(String|Date)} [data.date=NOW()] Sets the entry date. - * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. - * @param {String} [data.prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - * @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE. - * @param {Function} callback - * @return void - */ -Zip.prototype.append = function(source, data, callback) { - this.engine.entry(source, data, callback); -}; +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.base64encode = exports.base64decode = void 0; +// lookup table from base64 character to byte +let encTable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); +// lookup table from base64 character *code* to byte because lookup by number is fast +let decTable = []; +for (let i = 0; i < encTable.length; i++) + decTable[encTable[i].charCodeAt(0)] = i; +// support base64url variants +decTable["-".charCodeAt(0)] = encTable.indexOf("+"); +decTable["_".charCodeAt(0)] = encTable.indexOf("/"); /** - * @return void + * Decodes a base64 string to a byte array. + * + * - ignores white-space, including line breaks and tabs + * - allows inner padding (can decode concatenated base64 strings) + * - does not require padding + * - understands base64url encoding: + * "-" instead of "+", + * "_" instead of "/", + * no padding */ -Zip.prototype.finalize = function() { - this.engine.finalize(); -}; - +function base64decode(base64Str) { + // estimate byte size, not accounting for inner padding and whitespace + let es = base64Str.length * 3 / 4; + // if (es % 3 !== 0) + // throw new Error('invalid base64 string'); + if (base64Str[base64Str.length - 2] == '=') + es -= 2; + else if (base64Str[base64Str.length - 1] == '=') + es -= 1; + let bytes = new Uint8Array(es), bytePos = 0, // position in byte array + groupPos = 0, // position in base64 group + b, // current byte + p = 0 // previous byte + ; + for (let i = 0; i < base64Str.length; i++) { + b = decTable[base64Str.charCodeAt(i)]; + if (b === undefined) { + // noinspection FallThroughInSwitchStatementJS + switch (base64Str[i]) { + case '=': + groupPos = 0; // reset state when padding found + case '\n': + case '\r': + case '\t': + case ' ': + continue; // skip white-space, and padding + default: + throw Error(`invalid base64 string.`); + } + } + switch (groupPos) { + case 0: + p = b; + groupPos = 1; + break; + case 1: + bytes[bytePos++] = p << 2 | (b & 48) >> 4; + p = b; + groupPos = 2; + break; + case 2: + bytes[bytePos++] = (p & 15) << 4 | (b & 60) >> 2; + p = b; + groupPos = 3; + break; + case 3: + bytes[bytePos++] = (p & 3) << 6 | b; + groupPos = 0; + break; + } + } + if (groupPos == 1) + throw Error(`invalid base64 string.`); + return bytes.subarray(0, bytePos); +} +exports.base64decode = base64decode; /** - * @return this.engine + * Encodes a byte array to a base64 string. + * Adds padding at the end. + * Does not insert newlines. */ -Zip.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); -}; +function base64encode(bytes) { + let base64 = '', groupPos = 0, // position in base64 group + b, // current byte + p = 0; // carry over from previous byte + for (let i = 0; i < bytes.length; i++) { + b = bytes[i]; + switch (groupPos) { + case 0: + base64 += encTable[b >> 2]; + p = (b & 3) << 4; + groupPos = 1; + break; + case 1: + base64 += encTable[p | b >> 4]; + p = (b & 15) << 2; + groupPos = 2; + break; + case 2: + base64 += encTable[p | b >> 6]; + base64 += encTable[b & 63]; + groupPos = 0; + break; + } + } + // padding required? + if (groupPos) { + base64 += encTable[p]; + base64 += '='; + if (groupPos == 1) + base64 += '='; + } + return base64; +} +exports.base64encode = base64encode; -/** - * @return this.engine - */ -Zip.prototype.pipe = function() { - return this.engine.pipe.apply(this.engine, arguments); -}; -/** - * @return this.engine - */ -Zip.prototype.unpipe = function() { - return this.engine.unpipe.apply(this.engine, arguments); -}; +/***/ }), -module.exports = Zip; +/***/ 54816: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WireType = exports.mergeBinaryOptions = exports.UnknownFieldHandler = void 0; /** - * @typedef {Object} ZipOptions - * @global - * @property {String} [comment] Sets the zip archive comment. - * @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC. - * @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers. - * @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths. - * @property {Boolean} [store=false] Sets the compression method to STORE. - * @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} - * to control compression. - * @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties. + * This handler implements the default behaviour for unknown fields. + * When reading data, unknown fields are stored on the message, in a + * symbol property. + * When writing data, the symbol property is queried and unknown fields + * are serialized into the output again. */ - +var UnknownFieldHandler; +(function (UnknownFieldHandler) { + /** + * The symbol used to store unknown fields for a message. + * The property must conform to `UnknownFieldContainer`. + */ + UnknownFieldHandler.symbol = Symbol.for("protobuf-ts/unknown"); + /** + * Store an unknown field during binary read directly on the message. + * This method is compatible with `BinaryReadOptions.readUnknownField`. + */ + UnknownFieldHandler.onRead = (typeName, message, fieldNo, wireType, data) => { + let container = is(message) ? message[UnknownFieldHandler.symbol] : message[UnknownFieldHandler.symbol] = []; + container.push({ no: fieldNo, wireType, data }); + }; + /** + * Write unknown fields stored for the message to the writer. + * This method is compatible with `BinaryWriteOptions.writeUnknownFields`. + */ + UnknownFieldHandler.onWrite = (typeName, message, writer) => { + for (let { no, wireType, data } of UnknownFieldHandler.list(message)) + writer.tag(no, wireType).raw(data); + }; + /** + * List unknown fields stored for the message. + * Note that there may be multiples fields with the same number. + */ + UnknownFieldHandler.list = (message, fieldNo) => { + if (is(message)) { + let all = message[UnknownFieldHandler.symbol]; + return fieldNo ? all.filter(uf => uf.no == fieldNo) : all; + } + return []; + }; + /** + * Returns the last unknown field by field number. + */ + UnknownFieldHandler.last = (message, fieldNo) => UnknownFieldHandler.list(message, fieldNo).slice(-1)[0]; + const is = (message) => message && Array.isArray(message[UnknownFieldHandler.symbol]); +})(UnknownFieldHandler = exports.UnknownFieldHandler || (exports.UnknownFieldHandler = {})); /** - * @typedef {Object} ZipEntryData - * @global - * @property {String} name Sets the entry name including internal path. - * @property {(String|Date)} [date=NOW()] Sets the entry date. - * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. - * @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths. - * @property {String} [prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - * @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE. + * Merges binary write or read options. Later values override earlier values. */ - +function mergeBinaryOptions(a, b) { + return Object.assign(Object.assign({}, a), b); +} +exports.mergeBinaryOptions = mergeBinaryOptions; /** - * ZipStream Module - * @external ZipStream - * @see {@link https://www.archiverjs.com/zip-stream/ZipStream.html} + * Protobuf binary format wire types. + * + * A wire type provides just enough information to find the length of the + * following value. + * + * See https://developers.google.com/protocol-buffers/docs/encoding#structure */ - - -/***/ }), - -/***/ 97329: -/***/ (function(__unused_webpack_module, exports) { - -(function (global, factory) { - true ? factory(exports) : - 0; -})(this, (function (exports) { 'use strict'; - +var WireType; +(function (WireType) { /** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three + * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum */ - function apply(fn, ...args) { - return (...callArgs) => fn(...args,...callArgs); - } - - function initialParams (fn) { - return function (...args/*, callback*/) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; - } - - /* istanbul ignore file */ - - var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; - var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; - var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - - function fallback(fn) { - setTimeout(fn, 0); - } - - function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); - } - - var _defer$1; - - if (hasQueueMicrotask) { - _defer$1 = queueMicrotask; - } else if (hasSetImmediate) { - _defer$1 = setImmediate; - } else if (hasNextTick) { - _defer$1 = process.nextTick; - } else { - _defer$1 = fallback; - } - - var setImmediate$1 = wrap(_defer$1); - + WireType[WireType["Varint"] = 0] = "Varint"; /** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); + * Used for fixed64, sfixed64, double. + * Always 8 bytes with little-endian byte order. + */ + WireType[WireType["Bit64"] = 1] = "Bit64"; + /** + * Used for string, bytes, embedded messages, packed repeated fields * - * q.push(files); + * Only repeated numeric types (types which use the varint, 32-bit, + * or 64-bit wire types) can be packed. In proto3, such fields are + * packed by default. */ - function asyncify(func) { - if (isAsync(func)) { - return function (...args/*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback) - } - } + WireType[WireType["LengthDelimited"] = 2] = "LengthDelimited"; + /** + * Used for groups + * @deprecated + */ + WireType[WireType["StartGroup"] = 3] = "StartGroup"; + /** + * Used for groups + * @deprecated + */ + WireType[WireType["EndGroup"] = 4] = "EndGroup"; + /** + * Used for fixed32, sfixed32, float. + * Always 4 bytes with little-endian byte order. + */ + WireType[WireType["Bit32"] = 5] = "Bit32"; +})(WireType = exports.WireType || (exports.WireType = {})); - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback) - } else { - callback(null, result); - } - }); - } - function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); +/***/ }), + +/***/ 92889: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BinaryReader = exports.binaryReadOptions = void 0; +const binary_format_contract_1 = __nccwpck_require__(54816); +const pb_long_1 = __nccwpck_require__(61753); +const goog_varint_1 = __nccwpck_require__(93223); +const defaultsRead = { + readUnknownField: true, + readerFactory: bytes => new BinaryReader(bytes), +}; +/** + * Make options for reading binary data form partial options. + */ +function binaryReadOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead; +} +exports.binaryReadOptions = binaryReadOptions; +class BinaryReader { + constructor(buf, textDecoder) { + this.varint64 = goog_varint_1.varint64read; // dirty cast for `this` + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + this.uint32 = goog_varint_1.varint32read; // dirty cast for `this` and access to protected `buf` + this.buf = buf; + this.len = buf.length; + this.pos = 0; + this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + this.textDecoder = textDecoder !== null && textDecoder !== void 0 ? textDecoder : new TextDecoder("utf-8", { + fatal: true, + ignoreBOM: true, }); } - - function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - setImmediate$1(e => { throw e }, err); + /** + * Reads a tag - field number and wire type. + */ + tag() { + let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); + return [fieldNo, wireType]; + } + /** + * Skip one element on the wire and return the skipped data. + * Supports WireType.StartGroup since v2.0.0-alpha.23. + */ + skip(wireType) { + let start = this.pos; + // noinspection FallThroughInSwitchStatementJS + switch (wireType) { + case binary_format_contract_1.WireType.Varint: + while (this.buf[this.pos++] & 0x80) { + // ignore + } + break; + case binary_format_contract_1.WireType.Bit64: + this.pos += 4; + case binary_format_contract_1.WireType.Bit32: + this.pos += 4; + break; + case binary_format_contract_1.WireType.LengthDelimited: + let len = this.uint32(); + this.pos += len; + break; + case binary_format_contract_1.WireType.StartGroup: + // From descriptor.proto: Group type is deprecated, not supported in proto3. + // But we must still be able to parse and treat as unknown. + let t; + while ((t = this.tag()[1]) !== binary_format_contract_1.WireType.EndGroup) { + this.skip(t); + } + break; + default: + throw new Error("cant skip wire type " + wireType); } + this.assertBounds(); + return this.buf.subarray(start, this.pos); } - - function isAsync(fn) { - return fn[Symbol.toStringTag] === 'AsyncFunction'; + /** + * Throws error if position in byte array is out of range. + */ + assertBounds() { + if (this.pos > this.len) + throw new RangeError("premature EOF"); } - - function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === 'AsyncGenerator'; + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32() { + return this.uint32() | 0; } - - function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === 'function'; + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32() { + let zze = this.uint32(); + // decode zigzag + return (zze >>> 1) ^ -(zze & 1); } - - function wrapAsync(asyncFn) { - if (typeof asyncFn !== 'function') throw new Error('expected a function') - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64() { + return new pb_long_1.PbLong(...this.varint64()); } - - // conditionally promisify a function. - // only return a promise if a callback is omitted - function awaitify (asyncFn, arity) { - if (!arity) arity = asyncFn.length; - if (!arity) throw new Error('arity is undefined') - function awaitable (...args) { - if (typeof args[arity - 1] === 'function') { - return asyncFn.apply(this, args) - } - - return new Promise((resolve, reject) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject(err) - resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }) - } - - return awaitable + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64() { + return new pb_long_1.PbULong(...this.varint64()); } - - function applyEach$1 (eachfn) { - return function applyEach(fns, ...callArgs) { - const go = awaitify(function (callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - wrapAsync(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64() { + let [lo, hi] = this.varint64(); + // decode zig zag + let s = -(lo & 1); + lo = ((lo >>> 1 | (hi & 1) << 31) ^ s); + hi = (hi >>> 1 ^ s); + return new pb_long_1.PbLong(lo, hi); } - - function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - - return eachfn(arr, (value, _, iterCb) => { - var index = counter++; - _iteratee(value, (err, v) => { - results[index] = v; - iterCb(err); - }); - }, err => { - callback(err, results); - }); + /** + * Read a `bool` field, a variant. + */ + bool() { + let [lo, hi] = this.varint64(); + return lo !== 0 || hi !== 0; } - - function isArrayLike(value) { - return value && - typeof value.length === 'number' && - value.length >= 0 && - value.length % 1 === 0; + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, true); } - - // A temporary value used to identify if the loop should be broken. - // See #1064, #1293 - const breakLoop = {}; - var breakLoop$1 = breakLoop; - - function once(fn) { - function wrapper (...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, true); } - - function getIterator (coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return new pb_long_1.PbULong(this.sfixed32(), this.sfixed32()); } - - function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return new pb_long_1.PbLong(this.sfixed32(), this.sfixed32()); } - - function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; - } + /** + * Read a `float` field, 32-bit floating point number. + */ + float() { + return this.view.getFloat32((this.pos += 4) - 4, true); } - - function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === '__proto__') { - return next(); - } - return i < len ? {value: obj[key], key} : null; - }; + /** + * Read a `double` field, a 64-bit floating point number. + */ + double() { + return this.view.getFloat64((this.pos += 8) - 8, true); } - - function createIterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); - } - - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes() { + let len = this.uint32(); + let start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); } - - function onlyOnce(fn) { - return function (...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. + */ + string() { + return this.textDecoder.decode(this.bytes()); } +} +exports.BinaryReader = BinaryReader; - // for async generators - function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - - function replenish() { - //console.log('replenish') - if (running >= limit || awaiting || done) return - //console.log('replenish awaiting') - awaiting = true; - generator.next().then(({value, done: iterDone}) => { - //console.log('got value', value) - if (canceled || done) return - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - //console.log('done nextCb') - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - - function iterateeCallback(err, result) { - //console.log('iterateeCallback') - running -= 1; - if (canceled) return - if (err) return handleError(err) - if (err === false) { - done = true; - canceled = true; - return - } +/***/ }), - if (result === breakLoop$1 || (done && running <= 0)) { - done = true; - //console.log('done iterCb') - return callback(null); - } - replenish(); - } +/***/ 23957: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - function handleError(err) { - if (canceled) return - awaiting = false; - done = true; - callback(err); - } +"use strict"; - replenish(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BinaryWriter = exports.binaryWriteOptions = void 0; +const pb_long_1 = __nccwpck_require__(61753); +const goog_varint_1 = __nccwpck_require__(93223); +const assert_1 = __nccwpck_require__(8602); +const defaultsWrite = { + writeUnknownFields: true, + writerFactory: () => new BinaryWriter(), +}; +/** + * Make options for writing binary data form partial options. + */ +function binaryWriteOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; +} +exports.binaryWriteOptions = binaryWriteOptions; +class BinaryWriter { + constructor(textEncoder) { + /** + * Previous fork states. + */ + this.stack = []; + this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder(); + this.chunks = []; + this.buf = []; + } + /** + * Return all bytes written and reset this writer. + */ + finish() { + this.chunks.push(new Uint8Array(this.buf)); // flush the buffer + let len = 0; + for (let i = 0; i < this.chunks.length; i++) + len += this.chunks[i].length; + let bytes = new Uint8Array(len); + let offset = 0; + for (let i = 0; i < this.chunks.length; i++) { + bytes.set(this.chunks[i], offset); + offset += this.chunks[i].length; + } + this.chunks = []; + return bytes; } - - var eachOfLimit$2 = (limit) => { - return (obj, iteratee, callback) => { - callback = once(callback); - if (limit <= 0) { - throw new RangeError('concurrency limit cannot be less than 1') - } - if (!obj) { - return callback(null); - } - if (isAsyncGenerator(obj)) { - return asyncEachOfLimit(obj, limit, iteratee, callback) - } - if (isAsyncIterable(obj)) { - return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) - } - var nextElem = createIterator(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - - function iterateeCallback(err, value) { - if (canceled) return - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (err === false) { - done = true; - canceled = true; - } - else if (value === breakLoop$1 || (done && running <= 0)) { - done = true; - return callback(null); - } - else if (!looping) { - replenish(); - } - } - - function replenish () { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; - } - - replenish(); - }; - }; - /** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. + * Start a new fork for length-delimited data like a message + * or a packed repeated field. * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted + * Must be joined later with `join()`. */ - function eachOfLimit(coll, limit, iteratee, callback) { - return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); + fork() { + this.stack.push({ chunks: this.chunks, buf: this.buf }); + this.chunks = []; + this.buf = []; + return this; } - - var eachOfLimit$1 = awaitify(eachOfLimit, 4); - - // eachOf implementation optimized for array-likes - function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback); - var index = 0, - completed = 0, - {length} = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop$1) { - callback(null); - } + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join() { + // get chunk of fork + let chunk = this.finish(); + // restore previous state + let prev = this.stack.pop(); + if (!prev) + throw new Error('invalid state, fork stack empty'); + this.chunks = prev.chunks; + this.buf = prev.buf; + // write length of chunk as varint + this.uint32(chunk.byteLength); + return this.raw(chunk); + } + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo, type) { + return this.uint32((fieldNo << 3 | type) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(chunk) { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; } - - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); + this.chunks.push(chunk); + return this; + } + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value) { + assert_1.assertUInt32(value); + // write value as varint 32, inlined for speed + while (value > 0x7f) { + this.buf.push((value & 0x7f) | 0x80); + value = value >>> 7; } + this.buf.push(value); + return this; } - - // a generic version of eachOf which can handle array, object, and iterator cases. - function eachOfGeneric (coll, iteratee, callback) { - return eachOfLimit$1(coll, Infinity, iteratee, callback); + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value) { + assert_1.assertInt32(value); + goog_varint_1.varint32write(value, this.buf); + return this; } - /** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * + * Write a `bool` value, a variant. */ - function eachOf(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, wrapAsync(iteratee), callback); + bool(value) { + this.buf.push(value ? 1 : 0); + return this; } - - var eachOf$1 = awaitify(eachOf, 3); - /** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callbacks - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.map(fileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.map(fileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.map(fileList, getFileSizeInBytes); - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.map(withMissingFileList, getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * + * Write a `bytes` value, length-delimited arbitrary data. */ - function map (coll, iteratee, callback) { - return _asyncMap(eachOf$1, coll, iteratee, callback) + bytes(value) { + this.uint32(value.byteLength); // write length of chunk as varint + return this.raw(value); } - var map$1 = awaitify(map, 3); - /** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. The results - * for each of the applied async functions are passed to the final callback - * as an array. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - Returns a function that takes no args other than - * an optional callback, that is the result of applying the `args` to each - * of the functions. - * @example - * - * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') - * - * appliedFn((err, results) => { - * // results[0] is the results for `enableSearch` - * // results[1] is the results for `updateSchema` - * }); - * - * // partial application example: - * async.each( - * buckets, - * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), - * callback - * ); + * Write a `string` value, length-delimited data converted to UTF-8 text. */ - var applyEach = applyEach$1(map$1); - + string(value) { + let chunk = this.textEncoder.encode(value); + this.uint32(chunk.byteLength); // write length of chunk as varint + return this.raw(chunk); + } /** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted + * Write a `float` value, 32-bit floating point number. */ - function eachOfSeries(coll, iteratee, callback) { - return eachOfLimit$1(coll, 1, iteratee, callback) + float(value) { + assert_1.assertFloat32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setFloat32(0, value, true); + return this.raw(chunk); } - var eachOfSeries$1 = awaitify(eachOfSeries, 3); - /** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed + * Write a `double` value, a 64-bit floating point number. */ - function mapSeries (coll, iteratee, callback) { - return _asyncMap(eachOfSeries$1, coll, iteratee, callback) + double(value) { + let chunk = new Uint8Array(8); + new DataView(chunk.buffer).setFloat64(0, value, true); + return this.raw(chunk); + } + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value) { + assert_1.assertUInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setUint32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value) { + assert_1.assertInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setInt32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value) { + assert_1.assertInt32(value); + // zigzag encode + value = ((value << 1) ^ (value >> 31)) >>> 0; + goog_varint_1.varint32write(value, this.buf); + return this; + } + /** + * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value) { + let chunk = new Uint8Array(8); + let view = new DataView(chunk.buffer); + let long = pb_long_1.PbLong.from(value); + view.setInt32(0, long.lo, true); + view.setInt32(4, long.hi, true); + return this.raw(chunk); + } + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value) { + let chunk = new Uint8Array(8); + let view = new DataView(chunk.buffer); + let long = pb_long_1.PbULong.from(value); + view.setInt32(0, long.lo, true); + view.setInt32(4, long.hi, true); + return this.raw(chunk); + } + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value) { + let long = pb_long_1.PbLong.from(value); + goog_varint_1.varint64write(long.lo, long.hi, this.buf); + return this; } - var mapSeries$1 = awaitify(mapSeries, 3); - /** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - A function, that when called, is the result of - * appling the `args` to the list of functions. It takes no args, other than - * a callback. + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. */ - var applyEachSeries = applyEach$1(mapSeries$1); - - const PROMISE_SYMBOL = Symbol('promiseCallback'); - - function promiseCallback () { - let resolve, reject; - function callback (err, ...args) { - if (err) return reject(err) - resolve(args.length > 1 ? args : args[0]); - } - - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve = res, - reject = rej; - }); - - return callback + sint64(value) { + let long = pb_long_1.PbLong.from(value), + // zigzag encode + sign = long.hi >> 31, lo = (long.lo << 1) ^ sign, hi = ((long.hi << 1) | (long.lo >>> 31)) ^ sign; + goog_varint_1.varint64write(lo, hi, this.buf); + return this; } - /** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * @example - * - * //Using Callbacks - * async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * if (err) { - * console.log('err = ', err); - * } - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }); - * - * //Using Promises - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }).then(results => { - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }).catch(err => { - * console.log('err = ', err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }); - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * + * Write a `uint64` value, an unsigned 64-bit varint. */ - function auto(tasks, concurrency, callback) { - if (typeof concurrency !== 'number') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || promiseCallback()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; + uint64(value) { + let long = pb_long_1.PbULong.from(value); + goog_varint_1.varint64write(long.lo, long.hi, this.buf); + return this; + } +} +exports.BinaryWriter = BinaryWriter; - var listeners = Object.create(null); - var readyTasks = []; +/***/ }), - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; +/***/ 70257: +/***/ ((__unused_webpack_module, exports) => { - Object.keys(tasks).forEach(key => { - var task = tasks[key]; - if (!Array.isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } +"use strict"; - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.listEnumNumbers = exports.listEnumNames = exports.listEnumValues = exports.isEnumObject = void 0; +/** + * Is this a lookup object generated by Typescript, for a Typescript enum + * generated by protobuf-ts? + * + * - No `const enum` (enum must not be inlined, we need reverse mapping). + * - No string enum (we need int32 for protobuf). + * - Must have a value for 0 (otherwise, we would need to support custom default values). + */ +function isEnumObject(arg) { + if (typeof arg != 'object' || arg === null) { + return false; + } + if (!arg.hasOwnProperty(0)) { + return false; + } + for (let k of Object.keys(arg)) { + let num = parseInt(k); + if (!Number.isNaN(num)) { + // is there a name for the number? + let nam = arg[num]; + if (nam === undefined) + return false; + // does the name resolve back to the number? + if (arg[nam] !== num) + return false; + } + else { + // is there a number for the name? + let num = arg[k]; + if (num === undefined) + return false; + // is it a string enum? + if (typeof num !== 'number') + return false; + // do we know the number? + if (arg[num] === undefined) + return false; + } + } + return true; +} +exports.isEnumObject = isEnumObject; +/** + * Lists all values of a Typescript enum, as an array of objects with a "name" + * property and a "number" property. + * + * Note that it is possible that a number appears more than once, because it is + * possible to have aliases in an enum. + * + * Throws if the enum does not adhere to the rules of enums generated by + * protobuf-ts. See `isEnumObject()`. + */ +function listEnumValues(enumObject) { + if (!isEnumObject(enumObject)) + throw new Error("not a typescript enum object"); + let values = []; + for (let [name, number] of Object.entries(enumObject)) + if (typeof number == "number") + values.push({ name, number }); + return values; +} +exports.listEnumValues = listEnumValues; +/** + * Lists the names of a Typescript enum. + * + * Throws if the enum does not adhere to the rules of enums generated by + * protobuf-ts. See `isEnumObject()`. + */ +function listEnumNames(enumObject) { + return listEnumValues(enumObject).map(val => val.name); +} +exports.listEnumNames = listEnumNames; +/** + * Lists the numbers of a Typescript enum. + * + * Throws if the enum does not adhere to the rules of enums generated by + * protobuf-ts. See `isEnumObject()`. + */ +function listEnumNumbers(enumObject) { + return listEnumValues(enumObject) + .map(val => val.number) + .filter((num, index, arr) => arr.indexOf(num) == index); +} +exports.listEnumNumbers = listEnumNumbers; - dependencies.forEach(dependencyName => { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - checkForDeadlocks(); - processQueue(); +/***/ }), - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } +/***/ 93223: +/***/ ((__unused_webpack_module, exports) => { - function processQueue() { - if (canceled) return - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } +"use strict"; +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.varint32read = exports.varint32write = exports.int64toString = exports.int64fromString = exports.varint64write = exports.varint64read = void 0; +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [0]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +function varint64read() { + let lowBits = 0; + let highBits = 0; + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7F) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); + } + let middleByte = this.buf[this.pos++]; + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0F) << 28; + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7F) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach(fn => fn()); - processQueue(); + } + throw new Error('invalid varint'); +} +exports.varint64read = varint64read; +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +function varint64write(lo, hi, bytes) { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !((shift >>> 7) == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xFF; + bytes.push(byte); + if (!hasNext) { + return; } - - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = onlyOnce((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach(rkey => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - if (canceled) return - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } + } + const splitBits = ((lo >>> 28) & 0x0F) | ((hi & 0x07) << 4); + const hasMoreBits = !((hi >> 3) == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xFF); + if (!hasMoreBits) { + return; + } + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !((shift >>> 7) == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xFF; + bytes.push(byte); + if (!hasNext) { + return; } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach(dependent => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); - } + } + bytes.push((hi >>> 31) & 0x01); +} +exports.varint64write = varint64write; +// constants for binary math +const TWO_PWR_32_DBL = (1 << 16) * (1 << 16); +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Returns tuple: + * [0]: minus sign? + * [1]: low bits + * [2]: high bits + * + * Copyright 2008 Google Inc. + */ +function int64fromString(dec) { + // Check for minus sign. + let minus = dec[0] == '-'; + if (minus) + dec = dec.slice(1); + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + function add1e6digit(begin, end) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to highBits + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; } - - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach(key => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; + } + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return [minus, lowBits, highBits]; +} +exports.int64fromString = int64fromString; +/** + * Format 64 bit integer value (as two JS numbers) to decimal string. + * + * Copyright 2008 Google Inc. + */ +function int64toString(bitsLow, bitsHigh) { + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + if ((bitsHigh >>> 0) <= 0x1FFFFF) { + return '' + (TWO_PWR_32_DBL * bitsHigh + (bitsLow >>> 0)); + } + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + let low = bitsLow & 0xFFFFFF; + let mid = (((bitsLow >>> 24) | (bitsHigh << 8)) >>> 0) & 0xFFFFFF; + let high = (bitsHigh >> 16) & 0xFFFF; + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + (mid * 6777216) + (high * 6710656); + let digitB = mid + (high * 8147497); + let digitC = (high * 2); + // Apply carries from A to B and from B to C. + let base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + // Convert base-1e7 digits to base-10, with optional leading zeroes. + function decimalFrom1e7(digit1e7, needLeadingZeros) { + let partial = digit1e7 ? String(digit1e7) : ''; + if (needLeadingZeros) { + return '0000000'.slice(partial.length) + partial; } - - return callback[PROMISE_SYMBOL] + return partial; } - - var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; - var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; - var FN_ARG_SPLIT = /,/; - var FN_ARG = /(=.+)?(\s*)$/; - - function stripComments(string) { - let stripped = ''; - let index = 0; - let endBlockComment = string.indexOf('*/'); - while (index < string.length) { - if (string[index] === '/' && string[index+1] === '/') { - // inline comment - let endIndex = string.indexOf('\n', index); - index = (endIndex === -1) ? string.length : endIndex; - } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { - // block comment - let endIndex = string.indexOf('*/', index); - if (endIndex !== -1) { - index = endIndex + 2; - endBlockComment = string.indexOf('*/', index); - } else { - stripped += string[index]; - index++; - } - } else { - stripped += string[index]; - index++; - } + return decimalFrom1e7(digitC, /*needLeadingZeros=*/ 0) + + decimalFrom1e7(digitB, /*needLeadingZeros=*/ digitC) + + // If the final 1e7 digit didn't need leading zeros, we would have + // returned via the trivial code path at the top. + decimalFrom1e7(digitA, /*needLeadingZeros=*/ 1); +} +exports.int64toString = int64toString; +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +function varint32write(value, bytes) { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; } - return stripped; + bytes.push(value); } - - function parseParams(func) { - const src = stripComments(func.toString()); - let match = src.match(FN_ARGS); - if (!match) { - match = src.match(ARROW_FN_ARGS); + else { + for (let i = 0; i < 9; i++) { + bytes.push(value & 127 | 128); + value = value >> 7; } - if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) - let [, args] = match; - return args - .replace(/\s/g, '') - .split(FN_ARG_SPLIT) - .map((arg) => arg.replace(FN_ARG, '').trim()); + bytes.push(1); } +} +exports.varint32write = varint32write; +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +function varint32read() { + let b = this.buf[this.pos++]; + let result = b & 0x7F; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7F) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7F) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7F) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0F) << 28; + for (let readBytes = 5; ((b & 0x80) !== 0) && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + if ((b & 0x80) != 0) + throw new Error('invalid varint'); + this.assertBounds(); + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} +exports.varint32read = varint32read; - /** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ - function autoInject(tasks, callback) { - var newTasks = {}; - - Object.keys(tasks).forEach(key => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - // remove callback param - if (!fnIsAsync) params.pop(); +/***/ }), - newTasks[key] = params.concat(newTask); - } +/***/ 68886: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - function newTask(results, taskCb) { - var newArgs = params.map(name => results[name]); - newArgs.push(taskCb); - wrapAsync(taskFn)(...newArgs); - } - }); +"use strict"; - return auto(newTasks, callback); - } +// Public API of the protobuf-ts runtime. +// Note: we do not use `export * from ...` to help tree shakers, +// webpack verbose output hints that this should be useful +Object.defineProperty(exports, "__esModule", ({ value: true })); +// Convenience JSON typings and corresponding type guards +var json_typings_1 = __nccwpck_require__(49999); +Object.defineProperty(exports, "typeofJsonValue", ({ enumerable: true, get: function () { return json_typings_1.typeofJsonValue; } })); +Object.defineProperty(exports, "isJsonObject", ({ enumerable: true, get: function () { return json_typings_1.isJsonObject; } })); +// Base 64 encoding +var base64_1 = __nccwpck_require__(26335); +Object.defineProperty(exports, "base64decode", ({ enumerable: true, get: function () { return base64_1.base64decode; } })); +Object.defineProperty(exports, "base64encode", ({ enumerable: true, get: function () { return base64_1.base64encode; } })); +// UTF8 encoding +var protobufjs_utf8_1 = __nccwpck_require__(58950); +Object.defineProperty(exports, "utf8read", ({ enumerable: true, get: function () { return protobufjs_utf8_1.utf8read; } })); +// Binary format contracts, options for reading and writing, for example +var binary_format_contract_1 = __nccwpck_require__(54816); +Object.defineProperty(exports, "WireType", ({ enumerable: true, get: function () { return binary_format_contract_1.WireType; } })); +Object.defineProperty(exports, "mergeBinaryOptions", ({ enumerable: true, get: function () { return binary_format_contract_1.mergeBinaryOptions; } })); +Object.defineProperty(exports, "UnknownFieldHandler", ({ enumerable: true, get: function () { return binary_format_contract_1.UnknownFieldHandler; } })); +// Standard IBinaryReader implementation +var binary_reader_1 = __nccwpck_require__(92889); +Object.defineProperty(exports, "BinaryReader", ({ enumerable: true, get: function () { return binary_reader_1.BinaryReader; } })); +Object.defineProperty(exports, "binaryReadOptions", ({ enumerable: true, get: function () { return binary_reader_1.binaryReadOptions; } })); +// Standard IBinaryWriter implementation +var binary_writer_1 = __nccwpck_require__(23957); +Object.defineProperty(exports, "BinaryWriter", ({ enumerable: true, get: function () { return binary_writer_1.BinaryWriter; } })); +Object.defineProperty(exports, "binaryWriteOptions", ({ enumerable: true, get: function () { return binary_writer_1.binaryWriteOptions; } })); +// Int64 and UInt64 implementations required for the binary format +var pb_long_1 = __nccwpck_require__(61753); +Object.defineProperty(exports, "PbLong", ({ enumerable: true, get: function () { return pb_long_1.PbLong; } })); +Object.defineProperty(exports, "PbULong", ({ enumerable: true, get: function () { return pb_long_1.PbULong; } })); +// JSON format contracts, options for reading and writing, for example +var json_format_contract_1 = __nccwpck_require__(29367); +Object.defineProperty(exports, "jsonReadOptions", ({ enumerable: true, get: function () { return json_format_contract_1.jsonReadOptions; } })); +Object.defineProperty(exports, "jsonWriteOptions", ({ enumerable: true, get: function () { return json_format_contract_1.jsonWriteOptions; } })); +Object.defineProperty(exports, "mergeJsonOptions", ({ enumerable: true, get: function () { return json_format_contract_1.mergeJsonOptions; } })); +// Message type contract +var message_type_contract_1 = __nccwpck_require__(43785); +Object.defineProperty(exports, "MESSAGE_TYPE", ({ enumerable: true, get: function () { return message_type_contract_1.MESSAGE_TYPE; } })); +// Message type implementation via reflection +var message_type_1 = __nccwpck_require__(15106); +Object.defineProperty(exports, "MessageType", ({ enumerable: true, get: function () { return message_type_1.MessageType; } })); +// Reflection info, generated by the plugin, exposed to the user, used by reflection ops +var reflection_info_1 = __nccwpck_require__(67910); +Object.defineProperty(exports, "ScalarType", ({ enumerable: true, get: function () { return reflection_info_1.ScalarType; } })); +Object.defineProperty(exports, "LongType", ({ enumerable: true, get: function () { return reflection_info_1.LongType; } })); +Object.defineProperty(exports, "RepeatType", ({ enumerable: true, get: function () { return reflection_info_1.RepeatType; } })); +Object.defineProperty(exports, "normalizeFieldInfo", ({ enumerable: true, get: function () { return reflection_info_1.normalizeFieldInfo; } })); +Object.defineProperty(exports, "readFieldOptions", ({ enumerable: true, get: function () { return reflection_info_1.readFieldOptions; } })); +Object.defineProperty(exports, "readFieldOption", ({ enumerable: true, get: function () { return reflection_info_1.readFieldOption; } })); +Object.defineProperty(exports, "readMessageOption", ({ enumerable: true, get: function () { return reflection_info_1.readMessageOption; } })); +// Message operations via reflection +var reflection_type_check_1 = __nccwpck_require__(25167); +Object.defineProperty(exports, "ReflectionTypeCheck", ({ enumerable: true, get: function () { return reflection_type_check_1.ReflectionTypeCheck; } })); +var reflection_create_1 = __nccwpck_require__(75726); +Object.defineProperty(exports, "reflectionCreate", ({ enumerable: true, get: function () { return reflection_create_1.reflectionCreate; } })); +var reflection_scalar_default_1 = __nccwpck_require__(19526); +Object.defineProperty(exports, "reflectionScalarDefault", ({ enumerable: true, get: function () { return reflection_scalar_default_1.reflectionScalarDefault; } })); +var reflection_merge_partial_1 = __nccwpck_require__(98044); +Object.defineProperty(exports, "reflectionMergePartial", ({ enumerable: true, get: function () { return reflection_merge_partial_1.reflectionMergePartial; } })); +var reflection_equals_1 = __nccwpck_require__(4827); +Object.defineProperty(exports, "reflectionEquals", ({ enumerable: true, get: function () { return reflection_equals_1.reflectionEquals; } })); +var reflection_binary_reader_1 = __nccwpck_require__(89611); +Object.defineProperty(exports, "ReflectionBinaryReader", ({ enumerable: true, get: function () { return reflection_binary_reader_1.ReflectionBinaryReader; } })); +var reflection_binary_writer_1 = __nccwpck_require__(66907); +Object.defineProperty(exports, "ReflectionBinaryWriter", ({ enumerable: true, get: function () { return reflection_binary_writer_1.ReflectionBinaryWriter; } })); +var reflection_json_reader_1 = __nccwpck_require__(46790); +Object.defineProperty(exports, "ReflectionJsonReader", ({ enumerable: true, get: function () { return reflection_json_reader_1.ReflectionJsonReader; } })); +var reflection_json_writer_1 = __nccwpck_require__(11094); +Object.defineProperty(exports, "ReflectionJsonWriter", ({ enumerable: true, get: function () { return reflection_json_writer_1.ReflectionJsonWriter; } })); +var reflection_contains_message_type_1 = __nccwpck_require__(59946); +Object.defineProperty(exports, "containsMessageType", ({ enumerable: true, get: function () { return reflection_contains_message_type_1.containsMessageType; } })); +// Oneof helpers +var oneof_1 = __nccwpck_require__(18063); +Object.defineProperty(exports, "isOneofGroup", ({ enumerable: true, get: function () { return oneof_1.isOneofGroup; } })); +Object.defineProperty(exports, "setOneofValue", ({ enumerable: true, get: function () { return oneof_1.setOneofValue; } })); +Object.defineProperty(exports, "getOneofValue", ({ enumerable: true, get: function () { return oneof_1.getOneofValue; } })); +Object.defineProperty(exports, "clearOneofValue", ({ enumerable: true, get: function () { return oneof_1.clearOneofValue; } })); +Object.defineProperty(exports, "getSelectedOneofValue", ({ enumerable: true, get: function () { return oneof_1.getSelectedOneofValue; } })); +// Enum object type guard and reflection util, may be interesting to the user. +var enum_object_1 = __nccwpck_require__(70257); +Object.defineProperty(exports, "listEnumValues", ({ enumerable: true, get: function () { return enum_object_1.listEnumValues; } })); +Object.defineProperty(exports, "listEnumNames", ({ enumerable: true, get: function () { return enum_object_1.listEnumNames; } })); +Object.defineProperty(exports, "listEnumNumbers", ({ enumerable: true, get: function () { return enum_object_1.listEnumNumbers; } })); +Object.defineProperty(exports, "isEnumObject", ({ enumerable: true, get: function () { return enum_object_1.isEnumObject; } })); +// lowerCamelCase() is exported for plugin, rpc-runtime and other rpc packages +var lower_camel_case_1 = __nccwpck_require__(4073); +Object.defineProperty(exports, "lowerCamelCase", ({ enumerable: true, get: function () { return lower_camel_case_1.lowerCamelCase; } })); +// assertion functions are exported for plugin, may also be useful to user +var assert_1 = __nccwpck_require__(8602); +Object.defineProperty(exports, "assert", ({ enumerable: true, get: function () { return assert_1.assert; } })); +Object.defineProperty(exports, "assertNever", ({ enumerable: true, get: function () { return assert_1.assertNever; } })); +Object.defineProperty(exports, "assertInt32", ({ enumerable: true, get: function () { return assert_1.assertInt32; } })); +Object.defineProperty(exports, "assertUInt32", ({ enumerable: true, get: function () { return assert_1.assertUInt32; } })); +Object.defineProperty(exports, "assertFloat32", ({ enumerable: true, get: function () { return assert_1.assertFloat32; } })); - // Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation - // used for queues. This implementation assumes that the node provided by the user can be modified - // to adjust the next and last properties. We implement only the minimal functionality - // for queue support. - class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - removeLink(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; +/***/ }), - node.prev = node.next = null; - this.length -= 1; - return node; - } +/***/ 29367: +/***/ ((__unused_webpack_module, exports) => { - empty () { - while(this.head) this.shift(); - return this; - } +"use strict"; - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.mergeJsonOptions = exports.jsonWriteOptions = exports.jsonReadOptions = void 0; +const defaultsWrite = { + emitDefaultValues: false, + enumAsInteger: false, + useProtoFieldName: false, + prettySpaces: 0, +}, defaultsRead = { + ignoreUnknownFields: false, +}; +/** + * Make options for reading JSON data from partial options. + */ +function jsonReadOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead; +} +exports.jsonReadOptions = jsonReadOptions; +/** + * Make options for writing JSON data from partial options. + */ +function jsonWriteOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; +} +exports.jsonWriteOptions = jsonWriteOptions; +/** + * Merges JSON write or read options. Later values override earlier values. Type registries are merged. + */ +function mergeJsonOptions(a, b) { + var _a, _b; + let c = Object.assign(Object.assign({}, a), b); + c.typeRegistry = [...((_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : []), ...((_b = b === null || b === void 0 ? void 0 : b.typeRegistry) !== null && _b !== void 0 ? _b : [])]; + return c; +} +exports.mergeJsonOptions = mergeJsonOptions; - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - unshift(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); - } +/***/ }), - push(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); - } +/***/ 49999: +/***/ ((__unused_webpack_module, exports) => { - shift() { - return this.head && this.removeLink(this.head); - } +"use strict"; - pop() { - return this.tail && this.removeLink(this.tail); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isJsonObject = exports.typeofJsonValue = void 0; +/** + * Get the type of a JSON value. + * Distinguishes between array, null and object. + */ +function typeofJsonValue(value) { + let t = typeof value; + if (t == "object") { + if (Array.isArray(value)) + return "array"; + if (value === null) + return "null"; + } + return t; +} +exports.typeofJsonValue = typeofJsonValue; +/** + * Is this a JSON object (instead of an array or null)? + */ +function isJsonObject(value) { + return value !== null && typeof value == "object" && !Array.isArray(value); +} +exports.isJsonObject = isJsonObject; - toArray() { - return [...this] - } - *[Symbol.iterator] () { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } +/***/ }), - remove (testFn) { - var curr = this.head; - while(curr) { - var {next} = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } - } +/***/ 4073: +/***/ ((__unused_webpack_module, exports) => { - function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; - } +"use strict"; - function queue$1(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } - else if(concurrency === 0) { - throw new RangeError('Concurrency must not be zero'); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.lowerCamelCase = void 0; +/** + * Converts snake_case to lowerCamelCase. + * + * Should behave like protoc: + * https://github.com/protocolbuffers/protobuf/blob/e8ae137c96444ea313485ed1118c5e43b2099cf1/src/google/protobuf/compiler/java/java_helpers.cc#L118 + */ +function lowerCamelCase(snakeCase) { + let capNext = false; + const sb = []; + for (let i = 0; i < snakeCase.length; i++) { + let next = snakeCase.charAt(i); + if (next == '_') { + capNext = true; } - - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - - function on (event, handler) { - events[event].push(handler); + else if (/\d/.test(next)) { + sb.push(next); + capNext = true; } - - function once (event, handler) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler(...args); - }; - events[event].push(handleAndRemove); + else if (capNext) { + sb.push(next.toUpperCase()); + capNext = false; } - - function off (event, handler) { - if (!event) return Object.keys(events).forEach(ev => events[ev] = []) - if (!handler) return events[event] = [] - events[event] = events[event].filter(ev => ev !== handler); + else if (i == 0) { + sb.push(next.toLowerCase()); } - - function trigger (event, ...args) { - events[event].forEach(handler => handler(...args)); + else { + sb.push(next); } + } + return sb.join(''); +} +exports.lowerCamelCase = lowerCamelCase; - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - - var res, rej; - function promiseCallback (err, ...args) { - // we don't care about the error, let the global error handler - // deal with it - if (err) return rejectOnError ? rej(err) : res() - if (args.length <= 1) return res(args[0]) - res(args); - } - var item = q._createTaskItem( - data, - rejectOnError ? promiseCallback : - (callback || promiseCallback) - ); +/***/ }), - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } +/***/ 43785: +/***/ ((__unused_webpack_module, exports) => { - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(() => { - processingScheduled = false; - q.process(); - }); - } +"use strict"; - if (rejectOnError || !callback) { - return new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }) - } - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MESSAGE_TYPE = void 0; +/** + * The symbol used as a key on message objects to store the message type. + * + * Note that this is an experimental feature - it is here to stay, but + * implementation details may change without notice. + */ +exports.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); - function _createCB(tasks) { - return function (err, ...args) { - numRunning -= 1; - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; +/***/ }), - var index = workersList.indexOf(task); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } +/***/ 15106: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - task.callback(err, ...args); +"use strict"; - if (err != null) { - trigger('error', err, task.data); - } - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MessageType = void 0; +const message_type_contract_1 = __nccwpck_require__(43785); +const reflection_info_1 = __nccwpck_require__(67910); +const reflection_type_check_1 = __nccwpck_require__(25167); +const reflection_json_reader_1 = __nccwpck_require__(46790); +const reflection_json_writer_1 = __nccwpck_require__(11094); +const reflection_binary_reader_1 = __nccwpck_require__(89611); +const reflection_binary_writer_1 = __nccwpck_require__(66907); +const reflection_create_1 = __nccwpck_require__(75726); +const reflection_merge_partial_1 = __nccwpck_require__(98044); +const json_typings_1 = __nccwpck_require__(49999); +const json_format_contract_1 = __nccwpck_require__(29367); +const reflection_equals_1 = __nccwpck_require__(4827); +const binary_writer_1 = __nccwpck_require__(23957); +const binary_reader_1 = __nccwpck_require__(92889); +const baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})); +const messageTypeDescriptor = baseDescriptors[message_type_contract_1.MESSAGE_TYPE] = {}; +/** + * This standard message type provides reflection-based + * operations to work with a message. + */ +class MessageType { + constructor(name, fields, options) { + this.defaultCheckDepth = 16; + this.typeName = name; + this.fields = fields.map(reflection_info_1.normalizeFieldInfo); + this.options = options !== null && options !== void 0 ? options : {}; + messageTypeDescriptor.value = this; + this.messagePrototype = Object.create(null, baseDescriptors); + this.refTypeCheck = new reflection_type_check_1.ReflectionTypeCheck(this); + this.refJsonReader = new reflection_json_reader_1.ReflectionJsonReader(this); + this.refJsonWriter = new reflection_json_writer_1.ReflectionJsonWriter(this); + this.refBinReader = new reflection_binary_reader_1.ReflectionBinaryReader(this); + this.refBinWriter = new reflection_binary_writer_1.ReflectionBinaryWriter(this); + } + create(value) { + let message = reflection_create_1.reflectionCreate(this); + if (value !== undefined) { + reflection_merge_partial_1.reflectionMergePartial(this, message, value); + } + return message; + } + /** + * Clone the message. + * + * Unknown fields are discarded. + */ + clone(message) { + let copy = this.create(); + reflection_merge_partial_1.reflectionMergePartial(this, copy, message); + return copy; + } + /** + * Determines whether two message of the same type have the same field values. + * Checks for deep equality, traversing repeated fields, oneof groups, maps + * and messages recursively. + * Will also return true if both messages are `undefined`. + */ + equals(a, b) { + return reflection_equals_1.reflectionEquals(this, a, b); + } + /** + * Is the given value assignable to our message type + * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? + */ + is(arg, depth = this.defaultCheckDepth) { + return this.refTypeCheck.is(arg, depth, false); + } + /** + * Is the given value assignable to our message type, + * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? + */ + isAssignable(arg, depth = this.defaultCheckDepth) { + return this.refTypeCheck.is(arg, depth, true); + } + /** + * Copy partial data into the target message. + */ + mergePartial(target, source) { + reflection_merge_partial_1.reflectionMergePartial(this, target, source); + } + /** + * Create a new message from binary format. + */ + fromBinary(data, options) { + let opt = binary_reader_1.binaryReadOptions(options); + return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); + } + /** + * Read a new message from a JSON value. + */ + fromJson(json, options) { + return this.internalJsonRead(json, json_format_contract_1.jsonReadOptions(options)); + } + /** + * Read a new message from a JSON string. + * This is equivalent to `T.fromJson(JSON.parse(json))`. + */ + fromJsonString(json, options) { + let value = JSON.parse(json); + return this.fromJson(value, options); + } + /** + * Write the message to canonical JSON value. + */ + toJson(message, options) { + return this.internalJsonWrite(message, json_format_contract_1.jsonWriteOptions(options)); + } + /** + * Convert the message to canonical JSON string. + * This is equivalent to `JSON.stringify(T.toJson(t))` + */ + toJsonString(message, options) { + var _a; + let value = this.toJson(message, options); + return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); + } + /** + * Write the message to binary format. + */ + toBinary(message, options) { + let opt = binary_writer_1.binaryWriteOptions(options); + return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); + } + /** + * This is an internal method. If you just want to read a message from + * JSON, use `fromJson()` or `fromJsonString()`. + * + * Reads JSON value and merges the fields into the target + * according to protobuf rules. If the target is omitted, + * a new instance is created first. + */ + internalJsonRead(json, options, target) { + if (json !== null && typeof json == "object" && !Array.isArray(json)) { + let message = target !== null && target !== void 0 ? target : this.create(); + this.refJsonReader.read(json, message, options); + return message; + } + throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json)}.`); + } + /** + * This is an internal method. If you just want to write a message + * to JSON, use `toJson()` or `toJsonString(). + * + * Writes JSON value and returns it. + */ + internalJsonWrite(message, options) { + return this.refJsonWriter.write(message, options); + } + /** + * This is an internal method. If you just want to write a message + * in binary format, use `toBinary()`. + * + * Serializes the message in binary format and appends it to the given + * writer. Returns passed writer. + */ + internalBinaryWrite(message, writer, options) { + this.refBinWriter.write(message, writer, options); + return writer; + } + /** + * This is an internal method. If you just want to read a message from + * binary data, use `fromBinary()`. + * + * Reads data from binary format and merges the fields into + * the target according to protobuf rules. If the target is + * omitted, a new instance is created first. + */ + internalBinaryRead(reader, length, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(); + this.refBinReader.read(reader, message, options, length); + return message; + } +} +exports.MessageType = MessageType; - if (numRunning <= (q.concurrency - q.buffer) ) { - trigger('unsaturated'); - } - if (q.idle()) { - trigger('drain'); - } - q.process(); - }; - } +/***/ }), - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - setImmediate$1(() => trigger('drain')); - return true - } - return false - } +/***/ 18063: +/***/ ((__unused_webpack_module, exports) => { - const eventMethod = (name) => (handler) => { - if (!handler) { - return new Promise((resolve, reject) => { - once(name, (err, data) => { - if (err) return reject(err) - resolve(data); - }); - }) - } - off(name); - on(name, handler); +"use strict"; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSelectedOneofValue = exports.clearOneofValue = exports.setUnknownOneofValue = exports.setOneofValue = exports.getOneofValue = exports.isOneofGroup = void 0; +/** + * Is the given value a valid oneof group? + * + * We represent protobuf `oneof` as algebraic data types (ADT) in generated + * code. But when working with messages of unknown type, the ADT does not + * help us. + * + * This type guard checks if the given object adheres to the ADT rules, which + * are as follows: + * + * 1) Must be an object. + * + * 2) Must have a "oneofKind" discriminator property. + * + * 3) If "oneofKind" is `undefined`, no member field is selected. The object + * must not have any other properties. + * + * 4) If "oneofKind" is a `string`, the member field with this name is + * selected. + * + * 5) If a member field is selected, the object must have a second property + * with this name. The property must not be `undefined`. + * + * 6) No extra properties are allowed. The object has either one property + * (no selection) or two properties (selection). + * + */ +function isOneofGroup(any) { + if (typeof any != 'object' || any === null || !any.hasOwnProperty('oneofKind')) { + return false; + } + switch (typeof any.oneofKind) { + case "string": + if (any[any.oneofKind] === undefined) + return false; + return Object.keys(any).length == 2; + case "undefined": + return Object.keys(any).length == 1; + default: + return false; + } +} +exports.isOneofGroup = isOneofGroup; +/** + * Returns the value of the given field in a oneof group. + */ +function getOneofValue(oneof, kind) { + return oneof[kind]; +} +exports.getOneofValue = getOneofValue; +function setOneofValue(oneof, kind, value) { + if (oneof.oneofKind !== undefined) { + delete oneof[oneof.oneofKind]; + } + oneof.oneofKind = kind; + if (value !== undefined) { + oneof[kind] = value; + } +} +exports.setOneofValue = setOneofValue; +function setUnknownOneofValue(oneof, kind, value) { + if (oneof.oneofKind !== undefined) { + delete oneof[oneof.oneofKind]; + } + oneof.oneofKind = kind; + if (value !== undefined && kind !== undefined) { + oneof[kind] = value; + } +} +exports.setUnknownOneofValue = setUnknownOneofValue; +/** + * Removes the selected field in a oneof group. + * + * Note that the recommended way to modify a oneof group is to set + * a new object: + * + * ```ts + * message.result = { oneofKind: undefined }; + * ``` + */ +function clearOneofValue(oneof) { + if (oneof.oneofKind !== undefined) { + delete oneof[oneof.oneofKind]; + } + oneof.oneofKind = undefined; +} +exports.clearOneofValue = clearOneofValue; +/** + * Returns the selected value of the given oneof group. + * + * Not that the recommended way to access a oneof group is to check + * the "oneofKind" property and let TypeScript narrow down the union + * type for you: + * + * ```ts + * if (message.result.oneofKind === "error") { + * message.result.error; // string + * } + * ``` + * + * In the rare case you just need the value, and do not care about + * which protobuf field is selected, you can use this function + * for convenience. + */ +function getSelectedOneofValue(oneof) { + if (oneof.oneofKind === undefined) { + return undefined; + } + return oneof[oneof.oneofKind]; +} +exports.getSelectedOneofValue = getSelectedOneofValue; - var isProcessing = false; - var q = { - _tasks: new DLL(), - _createTaskItem (data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator] () { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, false, callback)) - } - return _insert(data, false, false, callback); - }, - pushAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, true, callback)) - } - return _insert(data, false, true, callback); - }, - kill () { - off(); - q._tasks.empty(); - }, - unshift (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, false, callback)) - } - return _insert(data, true, false, callback); - }, - unshiftAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, true, callback)) - } - return _insert(data, true, true, callback); - }, - remove (testFn) { - q._tasks.remove(testFn); - }, - process () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - numRunning += 1; +/***/ }), - if (q._tasks.length === 0) { - trigger('empty'); - } +/***/ 61753: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (numRunning === q.concurrency) { - trigger('saturated'); - } +"use strict"; - var cb = onlyOnce(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length () { - return q._tasks.length; - }, - running () { - return numRunning; - }, - workersList () { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause () { - q.paused = true; - }, - resume () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); - } - }; - // define these as fixed properties, so people get useful errors when updating - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod('saturated') - }, - unsaturated: { - writable: false, - value: eventMethod('unsaturated') - }, - empty: { - writable: false, - value: eventMethod('empty') - }, - drain: { - writable: false, - value: eventMethod('drain') - }, - error: { - writable: false, - value: eventMethod('error') - }, - }); - return q; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PbLong = exports.PbULong = exports.detectBi = void 0; +const goog_varint_1 = __nccwpck_require__(93223); +let BI; +function detectBi() { + const dv = new DataView(new ArrayBuffer(8)); + const ok = globalThis.BigInt !== undefined + && typeof dv.getBigInt64 === "function" + && typeof dv.getBigUint64 === "function" + && typeof dv.setBigInt64 === "function" + && typeof dv.setBigUint64 === "function"; + BI = ok ? { + MIN: BigInt("-9223372036854775808"), + MAX: BigInt("9223372036854775807"), + UMIN: BigInt("0"), + UMAX: BigInt("18446744073709551615"), + C: BigInt, + V: dv, + } : undefined; +} +exports.detectBi = detectBi; +detectBi(); +function assertBi(bi) { + if (!bi) + throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support"); +} +// used to validate from(string) input (when bigint is unavailable) +const RE_DECIMAL_STR = /^-?[0-9]+$/; +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; +const HALF_2_PWR_32 = 0x080000000; +// base class for PbLong and PbULong provides shared code +class SharedPbLong { + /** + * Create a new instance with the given bits. + */ + constructor(lo, hi) { + this.lo = lo | 0; + this.hi = hi | 0; } - /** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i>> 0); + if (!Number.isSafeInteger(result)) + throw new Error("cannot convert to safe number"); + return result; } - +} +/** + * 64-bit unsigned integer as two 32-bit values. + * Converts between `string`, `number` and `bigint` representations. + */ +class PbULong extends SharedPbLong { /** - * Reduces `coll` into a single value using an async `iteratee` to return each - * successive step. `memo` is the initial state of the reduction. This function - * only operates in series. - * - * For performance reasons, it may make sense to split a call to this function - * into a parallel map, and then use the normal `Array.prototype.reduce` on the - * results. This function is for situations where each step in the reduction - * needs to be async; if you can get the data before reducing it, then it's - * probably a good idea to do so. - * - * @name reduce - * @static - * @memberOf module:Collections - * @method - * @alias inject - * @alias foldl - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; - * - * // asynchronous function that computes the file size in bytes - * // file size is added to the memoized value, then returned - * function getFileSizeInBytes(memo, file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, memo + stat.size); - * }); - * } - * - * // Using callbacks - * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.reduce(fileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * + * Create instance from a `string`, `number` or `bigint`. + */ + static from(value) { + if (BI) + // noinspection FallThroughInSwitchStatementJS + switch (typeof value) { + case "string": + if (value == "0") + return this.ZERO; + if (value == "") + throw new Error('string is no integer'); + value = BI.C(value); + case "number": + if (value === 0) + return this.ZERO; + value = BI.C(value); + case "bigint": + if (!value) + return this.ZERO; + if (value < BI.UMIN) + throw new Error('signed value for ulong'); + if (value > BI.UMAX) + throw new Error('ulong too large'); + BI.V.setBigUint64(0, value, true); + return new PbULong(BI.V.getInt32(0, true), BI.V.getInt32(4, true)); + } + else + switch (typeof value) { + case "string": + if (value == "0") + return this.ZERO; + value = value.trim(); + if (!RE_DECIMAL_STR.test(value)) + throw new Error('string is no integer'); + let [minus, lo, hi] = goog_varint_1.int64fromString(value); + if (minus) + throw new Error('signed value for ulong'); + return new PbULong(lo, hi); + case "number": + if (value == 0) + return this.ZERO; + if (!Number.isSafeInteger(value)) + throw new Error('number is no integer'); + if (value < 0) + throw new Error('signed value for ulong'); + return new PbULong(value, value / TWO_PWR_32_DBL); + } + throw new Error('unknown value ' + typeof value); + } + /** + * Convert to decimal string. + */ + toString() { + return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); + } + /** + * Convert to native bigint. + */ + toBigInt() { + assertBi(BI); + BI.V.setInt32(0, this.lo, true); + BI.V.setInt32(4, this.hi, true); + return BI.V.getBigUint64(0, true); + } +} +exports.PbULong = PbULong; +/** + * ulong 0 singleton. + */ +PbULong.ZERO = new PbULong(0, 0); +/** + * 64-bit signed integer as two 32-bit values. + * Converts between `string`, `number` and `bigint` representations. + */ +class PbLong extends SharedPbLong { + /** + * Create instance from a `string`, `number` or `bigint`. */ - function reduce(coll, memo, iteratee, callback) { - callback = once(callback); - var _iteratee = wrapAsync(iteratee); - return eachOfSeries$1(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); + static from(value) { + if (BI) + // noinspection FallThroughInSwitchStatementJS + switch (typeof value) { + case "string": + if (value == "0") + return this.ZERO; + if (value == "") + throw new Error('string is no integer'); + value = BI.C(value); + case "number": + if (value === 0) + return this.ZERO; + value = BI.C(value); + case "bigint": + if (!value) + return this.ZERO; + if (value < BI.MIN) + throw new Error('signed long too small'); + if (value > BI.MAX) + throw new Error('signed long too large'); + BI.V.setBigInt64(0, value, true); + return new PbLong(BI.V.getInt32(0, true), BI.V.getInt32(4, true)); + } + else + switch (typeof value) { + case "string": + if (value == "0") + return this.ZERO; + value = value.trim(); + if (!RE_DECIMAL_STR.test(value)) + throw new Error('string is no integer'); + let [minus, lo, hi] = goog_varint_1.int64fromString(value); + if (minus) { + if (hi > HALF_2_PWR_32 || (hi == HALF_2_PWR_32 && lo != 0)) + throw new Error('signed long too small'); + } + else if (hi >= HALF_2_PWR_32) + throw new Error('signed long too large'); + let pbl = new PbLong(lo, hi); + return minus ? pbl.negate() : pbl; + case "number": + if (value == 0) + return this.ZERO; + if (!Number.isSafeInteger(value)) + throw new Error('number is no integer'); + return value > 0 + ? new PbLong(value, value / TWO_PWR_32_DBL) + : new PbLong(-value, -value / TWO_PWR_32_DBL).negate(); + } + throw new Error('unknown value ' + typeof value); } - var reduce$1 = awaitify(reduce, 4); - /** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); + * Do we have a minus sign? */ - function seq(...functions) { - var _functions = functions.map(wrapAsync); - return function (...args) { - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = promiseCallback(); - } - - reduce$1(_functions, args, (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, - (err, results) => cb(err, ...results)); - - return cb[PROMISE_SYMBOL] - }; + isNegative() { + return (this.hi & HALF_2_PWR_32) !== 0; } - /** - * Creates a function which is a composition of the passed asynchronous - * functions. Each function consumes the return value of the function that - * follows. Composing functions `f()`, `g()`, and `h()` would produce the result - * of `f(g(h()))`, only this version uses callbacks to obtain the return values. - * - * If the last argument to the composed function is not a function, a promise - * is returned when you call it. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name compose - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} an asynchronous function that is the composed - * asynchronous `functions` - * @example - * - * function add1(n, callback) { - * setTimeout(function () { - * callback(null, n + 1); - * }, 10); - * } - * - * function mul3(n, callback) { - * setTimeout(function () { - * callback(null, n * 3); - * }, 10); - * } - * - * var add1mul3 = async.compose(mul3, add1); - * add1mul3(4, function (err, result) { - * // result now equals 15 - * }); + * Negate two's complement. + * Invert all the bits and add one to the result. */ - function compose(...args) { - return seq(...args.reverse()); + negate() { + let hi = ~this.hi, lo = this.lo; + if (lo) + lo = ~lo + 1; + else + hi += 1; + return new PbLong(lo, hi); } - /** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed + * Convert to decimal string. */ - function mapLimit (coll, limit, iteratee, callback) { - return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback) + toString() { + if (BI) + return this.toBigInt().toString(); + if (this.isNegative()) { + let n = this.negate(); + return '-' + goog_varint_1.int64toString(n.lo, n.hi); + } + return goog_varint_1.int64toString(this.lo, this.hi); } - var mapLimit$1 = awaitify(mapLimit, 4); - /** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed + * Convert to native bigint. */ - function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } + toBigInt() { + assertBi(BI); + BI.V.setInt32(0, this.lo, true); + BI.V.setInt32(4, this.hi, true); + return BI.V.getBigInt64(0, true); + } +} +exports.PbLong = PbLong; +/** + * long 0 singleton. + */ +PbLong.ZERO = new PbLong(0, 0); - return callback(err, result); - }); + +/***/ }), + +/***/ 58950: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.utf8read = void 0; +const fromCharCodes = (chunk) => String.fromCharCode.apply(String, chunk); +/** + * @deprecated This function will no longer be exported with the next major + * release, since protobuf-ts has switch to TextDecoder API. If you need this + * function, please migrate to @protobufjs/utf8. For context, see + * https://github.com/timostamm/protobuf-ts/issues/184 + * + * Reads UTF8 bytes as a string. + * + * See [protobufjs / utf8](https://github.com/protobufjs/protobuf.js/blob/9893e35b854621cce64af4bf6be2cff4fb892796/lib/utf8/index.js#L40) + * + * Copyright (c) 2016, Daniel Wirtz + */ +function utf8read(bytes) { + if (bytes.length < 1) + return ""; + let pos = 0, // position in bytes + parts = [], chunk = [], i = 0, // char offset + t; // temporary + let len = bytes.length; + while (pos < len) { + t = bytes[pos++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | bytes[pos++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (bytes[pos++] & 63) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } + else + chunk[i++] = (t & 15) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63; + if (i > 8191) { + parts.push(fromCharCodes(chunk)); + i = 0; + } } - var concatLimit$1 = awaitify(concatLimit, 4); + if (parts.length) { + if (i) + parts.push(fromCharCodes(chunk.slice(0, i))); + return parts.join(""); + } + return fromCharCodes(chunk.slice(0, i)); +} +exports.utf8read = utf8read; + + +/***/ }), +/***/ 89611: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReflectionBinaryReader = void 0; +const binary_format_contract_1 = __nccwpck_require__(54816); +const reflection_info_1 = __nccwpck_require__(67910); +const reflection_long_convert_1 = __nccwpck_require__(63402); +const reflection_scalar_default_1 = __nccwpck_require__(19526); +/** + * Reads proto3 messages in binary format using reflection information. + * + * https://developers.google.com/protocol-buffers/docs/encoding + */ +class ReflectionBinaryReader { + constructor(info) { + this.info = info; + } + prepare() { + var _a; + if (!this.fieldNoToField) { + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + this.fieldNoToField = new Map(fieldsInput.map(field => [field.no, field])); + } + } /** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. The results array will be returned in - * the original order of `coll` passed to the `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @alias flatMap - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * let directoryList = ['dir1','dir2','dir3']; - * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; - * - * // Using callbacks - * async.concat(directoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.concat(directoryList, fs.readdir) - * .then(results => { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } + * Reads a message from binary format into the target message. * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. * + * If a message field is already present, it will be merged with the + * new data. */ - function concat(coll, iteratee, callback) { - return concatLimit$1(coll, Infinity, iteratee, callback) + read(reader, message, options, length) { + this.prepare(); + const end = length === undefined ? reader.len : reader.pos + length; + while (reader.pos < end) { + // read the tag and find the field + const [fieldNo, wireType] = reader.tag(), field = this.fieldNoToField.get(fieldNo); + if (!field) { + let u = options.readUnknownField; + if (u == "throw") + throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.info.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? binary_format_contract_1.UnknownFieldHandler.onRead : u)(this.info.typeName, message, fieldNo, wireType, d); + continue; + } + // target object for the field we are reading + let target = message, repeated = field.repeat, localName = field.localName; + // if field is member of oneof ADT, use ADT as target + if (field.oneof) { + target = target[field.oneof]; + // if other oneof member selected, set new ADT + if (target.oneofKind !== localName) + target = message[field.oneof] = { + oneofKind: localName + }; + } + // we have handled oneof above, we just have read the value into `target[localName]` + switch (field.kind) { + case "scalar": + case "enum": + let T = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; + let L = field.kind == "scalar" ? field.L : undefined; + if (repeated) { + let arr = target[localName]; // safe to assume presence of array, oneof cannot contain repeated values + if (wireType == binary_format_contract_1.WireType.LengthDelimited && T != reflection_info_1.ScalarType.STRING && T != reflection_info_1.ScalarType.BYTES) { + let e = reader.uint32() + reader.pos; + while (reader.pos < e) + arr.push(this.scalar(reader, T, L)); + } + else + arr.push(this.scalar(reader, T, L)); + } + else + target[localName] = this.scalar(reader, T, L); + break; + case "message": + if (repeated) { + let arr = target[localName]; // safe to assume presence of array, oneof cannot contain repeated values + let msg = field.T().internalBinaryRead(reader, reader.uint32(), options); + arr.push(msg); + } + else + target[localName] = field.T().internalBinaryRead(reader, reader.uint32(), options, target[localName]); + break; + case "map": + let [mapKey, mapVal] = this.mapEntry(field, reader, options); + // safe to assume presence of map object, oneof cannot contain repeated values + target[localName][mapKey] = mapVal; + break; + } + } } - var concat$1 = awaitify(concat, 3); - /** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed + * Read a map field, expecting key field = 1, value field = 2 */ - function concatSeries(coll, iteratee, callback) { - return concatLimit$1(coll, 1, iteratee, callback) + mapEntry(field, reader, options) { + let length = reader.uint32(); + let end = reader.pos + length; + let key = undefined; // javascript only allows number or string for object properties + let val = undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + if (field.K == reflection_info_1.ScalarType.BOOL) + key = reader.bool().toString(); + else + // long types are read as string, number types are okay as number + key = this.scalar(reader, field.K, reflection_info_1.LongType.STRING); + break; + case 2: + switch (field.V.kind) { + case "scalar": + val = this.scalar(reader, field.V.T, field.V.L); + break; + case "enum": + val = reader.int32(); + break; + case "message": + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + break; + } + break; + default: + throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) in map entry for ${this.info.typeName}#${field.name}`); + } + } + if (key === undefined) { + let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); + key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; + } + if (val === undefined) + switch (field.V.kind) { + case "scalar": + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + break; + case "enum": + val = 0; + break; + case "message": + val = field.V.T().create(); + break; + } + return [key, val]; } - var concatSeries$1 = awaitify(concatSeries, 3); - - /** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ - function constant$1(...args) { - return function (...ignoredArgs/*, callback*/) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; + scalar(reader, type, longType) { + switch (type) { + case reflection_info_1.ScalarType.INT32: + return reader.int32(); + case reflection_info_1.ScalarType.STRING: + return reader.string(); + case reflection_info_1.ScalarType.BOOL: + return reader.bool(); + case reflection_info_1.ScalarType.DOUBLE: + return reader.double(); + case reflection_info_1.ScalarType.FLOAT: + return reader.float(); + case reflection_info_1.ScalarType.INT64: + return reflection_long_convert_1.reflectionLongConvert(reader.int64(), longType); + case reflection_info_1.ScalarType.UINT64: + return reflection_long_convert_1.reflectionLongConvert(reader.uint64(), longType); + case reflection_info_1.ScalarType.FIXED64: + return reflection_long_convert_1.reflectionLongConvert(reader.fixed64(), longType); + case reflection_info_1.ScalarType.FIXED32: + return reader.fixed32(); + case reflection_info_1.ScalarType.BYTES: + return reader.bytes(); + case reflection_info_1.ScalarType.UINT32: + return reader.uint32(); + case reflection_info_1.ScalarType.SFIXED32: + return reader.sfixed32(); + case reflection_info_1.ScalarType.SFIXED64: + return reflection_long_convert_1.reflectionLongConvert(reader.sfixed64(), longType); + case reflection_info_1.ScalarType.SINT32: + return reader.sint32(); + case reflection_info_1.ScalarType.SINT64: + return reflection_long_convert_1.reflectionLongConvert(reader.sint64(), longType); + } } +} +exports.ReflectionBinaryReader = ReflectionBinaryReader; - function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = wrapAsync(_iteratee); - eachfn(arr, (value, _, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, breakLoop$1); +/***/ }), + +/***/ 66907: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReflectionBinaryWriter = void 0; +const binary_format_contract_1 = __nccwpck_require__(54816); +const reflection_info_1 = __nccwpck_require__(67910); +const assert_1 = __nccwpck_require__(8602); +const pb_long_1 = __nccwpck_require__(61753); +/** + * Writes proto3 messages in binary format using reflection information. + * + * https://developers.google.com/protocol-buffers/docs/encoding + */ +class ReflectionBinaryWriter { + constructor(info) { + this.info = info; + } + prepare() { + if (!this.fields) { + const fieldsInput = this.info.fields ? this.info.fields.concat() : []; + this.fields = fieldsInput.sort((a, b) => a.no - b.no); + } + } + /** + * Writes the message to binary format. + */ + write(message, writer, options) { + this.prepare(); + for (const field of this.fields) { + let value, // this will be our field value, whether it is member of a oneof or not + emitDefault, // whether we emit the default value (only true for oneof members) + repeated = field.repeat, localName = field.localName; + // handle oneof ADT + if (field.oneof) { + const group = message[field.oneof]; + if (group.oneofKind !== localName) + continue; // if field is not selected, skip + value = group[localName]; + emitDefault = true; + } + else { + value = message[localName]; + emitDefault = false; + } + // we have handled oneof above. we just have to honor `emitDefault`. + switch (field.kind) { + case "scalar": + case "enum": + let T = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; + if (repeated) { + assert_1.assert(Array.isArray(value)); + if (repeated == reflection_info_1.RepeatType.PACKED) + this.packed(writer, T, field.no, value); + else + for (const item of value) + this.scalar(writer, T, field.no, item, true); } - callback(); - }); - }, err => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; + else if (value === undefined) + assert_1.assert(field.opt); + else + this.scalar(writer, T, field.no, value, emitDefault || field.opt); + break; + case "message": + if (repeated) { + assert_1.assert(Array.isArray(value)); + for (const item of value) + this.message(writer, options, field.T(), field.no, item); + } + else { + this.message(writer, options, field.T(), field.no, value); + } + break; + case "map": + assert_1.assert(typeof value == 'object' && value !== null); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); + break; + } + } + let u = options.writeUnknownFields; + if (u !== false) + (u === true ? binary_format_contract_1.UnknownFieldHandler.onWrite : u)(this.info.typeName, message, writer); + } + mapEntry(writer, options, field, key, value) { + writer.tag(field.no, binary_format_contract_1.WireType.LengthDelimited); + writer.fork(); + // javascript only allows number or string for object properties + // we convert from our representation to the protobuf type + let keyValue = key; + switch (field.K) { + case reflection_info_1.ScalarType.INT32: + case reflection_info_1.ScalarType.FIXED32: + case reflection_info_1.ScalarType.UINT32: + case reflection_info_1.ScalarType.SFIXED32: + case reflection_info_1.ScalarType.SINT32: + keyValue = Number.parseInt(key); + break; + case reflection_info_1.ScalarType.BOOL: + assert_1.assert(key == 'true' || key == 'false'); + keyValue = key == 'true'; + break; + } + // write key, expecting key field number = 1 + this.scalar(writer, field.K, 1, keyValue, true); + // write value, expecting value field number = 2 + switch (field.V.kind) { + case 'scalar': + this.scalar(writer, field.V.T, 2, value, true); + break; + case 'enum': + this.scalar(writer, reflection_info_1.ScalarType.INT32, 2, value, true); + break; + case 'message': + this.message(writer, options, field.V.T(), 2, value); + break; + } + writer.join(); + } + message(writer, options, handler, fieldNo, value) { + if (value === undefined) + return; + handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); + writer.join(); } - /** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * + * Write a single scalar value. */ - function detect(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) + scalar(writer, type, fieldNo, value, emitDefault) { + let [wireType, method, isDefault] = this.scalarInfo(type, value); + if (!isDefault || emitDefault) { + writer.tag(fieldNo, wireType); + writer[method](value); + } } - var detect$1 = awaitify(detect, 3); - /** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted + * Write an array of scalar values in packed format. */ - function detectLimit(coll, limit, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback) + packed(writer, type, fieldNo, value) { + if (!value.length) + return; + assert_1.assert(type !== reflection_info_1.ScalarType.BYTES && type !== reflection_info_1.ScalarType.STRING); + // write tag + writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); + // begin length-delimited + writer.fork(); + // write values without tags + let [, method,] = this.scalarInfo(type); + for (let i = 0; i < value.length; i++) + writer[method](value[i]); + // end length delimited + writer.join(); } - var detectLimit$1 = awaitify(detectLimit, 4); - /** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * Get information for writing a scalar value. * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted + * Returns tuple: + * [0]: appropriate WireType + * [1]: name of the appropriate method of IBinaryWriter + * [2]: whether the given value is a default value + * + * If argument `value` is omitted, [2] is always false. */ - function detectSeries(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback) + scalarInfo(type, value) { + let t = binary_format_contract_1.WireType.Varint; + let m; + let i = value === undefined; + let d = value === 0; + switch (type) { + case reflection_info_1.ScalarType.INT32: + m = "int32"; + break; + case reflection_info_1.ScalarType.STRING: + d = i || !value.length; + t = binary_format_contract_1.WireType.LengthDelimited; + m = "string"; + break; + case reflection_info_1.ScalarType.BOOL: + d = value === false; + m = "bool"; + break; + case reflection_info_1.ScalarType.UINT32: + m = "uint32"; + break; + case reflection_info_1.ScalarType.DOUBLE: + t = binary_format_contract_1.WireType.Bit64; + m = "double"; + break; + case reflection_info_1.ScalarType.FLOAT: + t = binary_format_contract_1.WireType.Bit32; + m = "float"; + break; + case reflection_info_1.ScalarType.INT64: + d = i || pb_long_1.PbLong.from(value).isZero(); + m = "int64"; + break; + case reflection_info_1.ScalarType.UINT64: + d = i || pb_long_1.PbULong.from(value).isZero(); + m = "uint64"; + break; + case reflection_info_1.ScalarType.FIXED64: + d = i || pb_long_1.PbULong.from(value).isZero(); + t = binary_format_contract_1.WireType.Bit64; + m = "fixed64"; + break; + case reflection_info_1.ScalarType.BYTES: + d = i || !value.byteLength; + t = binary_format_contract_1.WireType.LengthDelimited; + m = "bytes"; + break; + case reflection_info_1.ScalarType.FIXED32: + t = binary_format_contract_1.WireType.Bit32; + m = "fixed32"; + break; + case reflection_info_1.ScalarType.SFIXED32: + t = binary_format_contract_1.WireType.Bit32; + m = "sfixed32"; + break; + case reflection_info_1.ScalarType.SFIXED64: + d = i || pb_long_1.PbLong.from(value).isZero(); + t = binary_format_contract_1.WireType.Bit64; + m = "sfixed64"; + break; + case reflection_info_1.ScalarType.SINT32: + m = "sint32"; + break; + case reflection_info_1.ScalarType.SINT64: + d = i || pb_long_1.PbLong.from(value).isZero(); + m = "sint64"; + break; + } + return [t, m, i || d]; } +} +exports.ReflectionBinaryWriter = ReflectionBinaryWriter; - var detectSeries$1 = awaitify(detectSeries, 3); - function consoleFunc(name) { - return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { - /* istanbul ignore else */ - if (typeof console === 'object') { - /* istanbul ignore else */ - if (err) { - /* istanbul ignore else */ - if (console.error) { - console.error(err); - } - } else if (console[name]) { /* istanbul ignore else */ - resultArgs.forEach(x => console[name](x)); - } - } - }) - } +/***/ }), - /** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ - var dir = consoleFunc('dir'); +/***/ 59946: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ - function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results; +"use strict"; - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.containsMessageType = void 0; +const message_type_contract_1 = __nccwpck_require__(43785); +/** + * Check if the provided object is a proto message. + * + * Note that this is an experimental feature - it is here to stay, but + * implementation details may change without notice. + */ +function containsMessageType(msg) { + return msg[message_type_contract_1.MESSAGE_TYPE] != null; +} +exports.containsMessageType = containsMessageType; - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - return check(null, true); - } +/***/ }), - var doWhilst$1 = awaitify(doWhilst, 3); +/***/ 75726: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reflectionCreate = void 0; +const reflection_scalar_default_1 = __nccwpck_require__(19526); +const message_type_contract_1 = __nccwpck_require__(43785); +/** + * Creates an instance of the generic message, using the field + * information. + */ +function reflectionCreate(type) { /** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee` - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed + * This ternary can be removed in the next major version. + * The `Object.create()` code path utilizes a new `messagePrototype` + * property on the `IMessageType` which has this same `MESSAGE_TYPE` + * non-enumerable property on it. Doing it this way means that we only + * pay the cost of `Object.defineProperty()` once per `IMessageType` + * class of once per "instance". The falsy code path is only provided + * for backwards compatibility in cases where the runtime library is + * updated without also updating the generated code. */ - function doUntil(iteratee, test, callback) { - const _test = wrapAsync(test); - return doWhilst$1(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb (err, !truth)); - }, callback); + const msg = type.messagePrototype + ? Object.create(type.messagePrototype) + : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type }); + for (let field of type.fields) { + let name = field.localName; + if (field.opt) + continue; + if (field.oneof) + msg[field.oneof] = { oneofKind: undefined }; + else if (field.repeat) + msg[name] = []; + else + switch (field.kind) { + case "scalar": + msg[name] = reflection_scalar_default_1.reflectionScalarDefault(field.T, field.L); + break; + case "enum": + // we require 0 to be default value for all enums + msg[name] = 0; + break; + case "map": + msg[name] = {}; + break; + } } + return msg; +} +exports.reflectionCreate = reflectionCreate; - function _withoutIndex(iteratee) { - return (value, index, callback) => iteratee(value, callback); + +/***/ }), + +/***/ 4827: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reflectionEquals = void 0; +const reflection_info_1 = __nccwpck_require__(67910); +/** + * Determines whether two message of the same type have the same field values. + * Checks for deep equality, traversing repeated fields, oneof groups, maps + * and messages recursively. + * Will also return true if both messages are `undefined`. + */ +function reflectionEquals(info, a, b) { + if (a === b) + return true; + if (!a || !b) + return false; + for (let field of info.fields) { + let localName = field.localName; + let val_a = field.oneof ? a[field.oneof][localName] : a[localName]; + let val_b = field.oneof ? b[field.oneof][localName] : b[localName]; + switch (field.kind) { + case "enum": + case "scalar": + let t = field.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.T; + if (!(field.repeat + ? repeatedPrimitiveEq(t, val_a, val_b) + : primitiveEq(t, val_a, val_b))) + return false; + break; + case "map": + if (!(field.V.kind == "message" + ? repeatedMsgEq(field.V.T(), objectValues(val_a), objectValues(val_b)) + : repeatedPrimitiveEq(field.V.kind == "enum" ? reflection_info_1.ScalarType.INT32 : field.V.T, objectValues(val_a), objectValues(val_b)))) + return false; + break; + case "message": + let T = field.T(); + if (!(field.repeat + ? repeatedMsgEq(T, val_a, val_b) + : T.equals(val_a, val_b))) + return false; + break; + } } + return true; +} +exports.reflectionEquals = reflectionEquals; +const objectValues = Object.values; +function primitiveEq(type, a, b) { + if (a === b) + return true; + if (type !== reflection_info_1.ScalarType.BYTES) + return false; + let ba = a; + let bb = b; + if (ba.length !== bb.length) + return false; + for (let i = 0; i < ba.length; i++) + if (ba[i] != bb[i]) + return false; + return true; +} +function repeatedPrimitiveEq(type, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!primitiveEq(type, a[i], b[i])) + return false; + return true; +} +function repeatedMsgEq(type, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!type.equals(a[i], b[i])) + return false; + return true; +} + + +/***/ }), + +/***/ 67910: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.readMessageOption = exports.readFieldOption = exports.readFieldOptions = exports.normalizeFieldInfo = exports.RepeatType = exports.LongType = exports.ScalarType = void 0; +const lower_camel_case_1 = __nccwpck_require__(4073); +/** + * Scalar value types. This is a subset of field types declared by protobuf + * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE + * are omitted, but the numerical values are identical. + */ +var ScalarType; +(function (ScalarType) { + // 0 is reserved for errors. + // Order is weird for historical reasons. + ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE"; + ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT"; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + ScalarType[ScalarType["INT64"] = 3] = "INT64"; + ScalarType[ScalarType["UINT64"] = 4] = "UINT64"; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + ScalarType[ScalarType["INT32"] = 5] = "INT32"; + ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64"; + ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32"; + ScalarType[ScalarType["BOOL"] = 8] = "BOOL"; + ScalarType[ScalarType["STRING"] = 9] = "STRING"; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + // TYPE_GROUP = 10, + // TYPE_MESSAGE = 11, // Length-delimited aggregate. + // New in version 2. + ScalarType[ScalarType["BYTES"] = 12] = "BYTES"; + ScalarType[ScalarType["UINT32"] = 13] = "UINT32"; + // TYPE_ENUM = 14, + ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32"; + ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64"; + ScalarType[ScalarType["SINT32"] = 17] = "SINT32"; + ScalarType[ScalarType["SINT64"] = 18] = "SINT64"; +})(ScalarType = exports.ScalarType || (exports.ScalarType = {})); +/** + * JavaScript representation of 64 bit integral types. Equivalent to the + * field option "jstype". + * + * By default, protobuf-ts represents 64 bit types as `bigint`. + * + * You can change the default behaviour by enabling the plugin parameter + * `long_type_string`, which will represent 64 bit types as `string`. + * + * Alternatively, you can change the behaviour for individual fields + * with the field option "jstype": + * + * ```protobuf + * uint64 my_field = 1 [jstype = JS_STRING]; + * uint64 other_field = 2 [jstype = JS_NUMBER]; + * ``` + */ +var LongType; +(function (LongType) { /** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); + * Use JavaScript `bigint`. * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); + * Field option `[jstype = JS_NORMAL]`. + */ + LongType[LongType["BIGINT"] = 0] = "BIGINT"; + /** + * Use JavaScript `string`. * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } + * Field option `[jstype = JS_STRING]`. + */ + LongType[LongType["STRING"] = 1] = "STRING"; + /** + * Use JavaScript `number`. * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } + * Large values will loose precision. * + * Field option `[jstype = JS_NUMBER]`. */ - function eachLimit$2(coll, iteratee, callback) { - return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); + LongType[LongType["NUMBER"] = 2] = "NUMBER"; +})(LongType = exports.LongType || (exports.LongType = {})); +/** + * Protobuf 2.1.0 introduced packed repeated fields. + * Setting the field option `[packed = true]` enables packing. + * + * In proto3, all repeated fields are packed by default. + * Setting the field option `[packed = false]` disables packing. + * + * Packed repeated fields are encoded with a single tag, + * then a length-delimiter, then the element values. + * + * Unpacked repeated fields are encoded with a tag and + * value for each element. + * + * `bytes` and `string` cannot be packed. + */ +var RepeatType; +(function (RepeatType) { + /** + * The field is not repeated. + */ + RepeatType[RepeatType["NO"] = 0] = "NO"; + /** + * The field is repeated and should be packed. + * Invalid for `bytes` and `string`, they cannot be packed. + */ + RepeatType[RepeatType["PACKED"] = 1] = "PACKED"; + /** + * The field is repeated but should not be packed. + * The only valid repeat type for repeated `bytes` and `string`. + */ + RepeatType[RepeatType["UNPACKED"] = 2] = "UNPACKED"; +})(RepeatType = exports.RepeatType || (exports.RepeatType = {})); +/** + * Turns PartialFieldInfo into FieldInfo. + */ +function normalizeFieldInfo(field) { + var _a, _b, _c, _d; + field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : lower_camel_case_1.lowerCamelCase(field.name); + field.jsonName = (_b = field.jsonName) !== null && _b !== void 0 ? _b : lower_camel_case_1.lowerCamelCase(field.name); + field.repeat = (_c = field.repeat) !== null && _c !== void 0 ? _c : RepeatType.NO; + field.opt = (_d = field.opt) !== null && _d !== void 0 ? _d : (field.repeat ? false : field.oneof ? false : field.kind == "message"); + return field; +} +exports.normalizeFieldInfo = normalizeFieldInfo; +/** + * Read custom field options from a generated message type. + * + * @deprecated use readFieldOption() + */ +function readFieldOptions(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : undefined; +} +exports.readFieldOptions = readFieldOptions; +function readFieldOption(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return undefined; + } + const optionVal = options[extensionName]; + if (optionVal === undefined) { + return optionVal; + } + return extensionType ? extensionType.fromJson(optionVal) : optionVal; +} +exports.readFieldOption = readFieldOption; +function readMessageOption(messageType, extensionName, extensionType) { + const options = messageType.options; + const optionVal = options[extensionName]; + if (optionVal === undefined) { + return optionVal; } + return extensionType ? extensionType.fromJson(optionVal) : optionVal; +} +exports.readMessageOption = readMessageOption; - var each = awaitify(eachLimit$2, 3); - /** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachLimit(coll, limit, iteratee, callback) { - return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); - } - var eachLimit$1 = awaitify(eachLimit, 4); +/***/ }), - /** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. +/***/ 46790: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachSeries(coll, iteratee, callback) { - return eachLimit$1(coll, 1, iteratee, callback) - } - var eachSeries$1 = awaitify(eachSeries, 3); +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReflectionJsonReader = void 0; +const json_typings_1 = __nccwpck_require__(49999); +const base64_1 = __nccwpck_require__(26335); +const reflection_info_1 = __nccwpck_require__(67910); +const pb_long_1 = __nccwpck_require__(61753); +const assert_1 = __nccwpck_require__(8602); +const reflection_long_convert_1 = __nccwpck_require__(63402); +/** + * Reads proto3 messages in canonical JSON format using reflection information. + * + * https://developers.google.com/protocol-buffers/docs/proto3#json + */ +class ReflectionJsonReader { + constructor(info) { + this.info = info; + } + prepare() { + var _a; + if (this.fMap === undefined) { + this.fMap = {}; + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + for (const field of fieldsInput) { + this.fMap[field.name] = field; + this.fMap[field.jsonName] = field; + this.fMap[field.localName] = field; + } + } + } + // Cannot parse JSON for #. + assert(condition, fieldName, jsonValue) { + if (!condition) { + let what = json_typings_1.typeofJsonValue(jsonValue); + if (what == "number" || what == "boolean") + what = jsonValue.toString(); + throw new Error(`Cannot parse JSON ${what} for ${this.info.typeName}#${fieldName}`); + } + } /** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } + * Reads a message from canonical JSON format into the target message. * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + * If a message field is already present, it will be merged with the + * new data. */ - function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return function (...args/*, callback*/) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - setImmediate$1(() => callback(...innerArgs)); - } else { - callback(...innerArgs); + read(input, message, options) { + this.prepare(); + const oneofsHandled = []; + for (const [jsonKey, jsonValue] of Object.entries(input)) { + const field = this.fMap[jsonKey]; + if (!field) { + if (!options.ignoreUnknownFields) + throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${jsonKey}`); + continue; + } + const localName = field.localName; + // handle oneof ADT + let target; // this will be the target for the field value, whether it is member of a oneof or not + if (field.oneof) { + if (jsonValue === null && (field.kind !== 'enum' || field.T()[0] !== 'google.protobuf.NullValue')) { + continue; } - }); - fn.apply(this, args); - sync = false; - }; + // since json objects are unordered by specification, it is not possible to take the last of multiple oneofs + if (oneofsHandled.includes(field.oneof)) + throw new Error(`Multiple members of the oneof group "${field.oneof}" of ${this.info.typeName} are present in JSON.`); + oneofsHandled.push(field.oneof); + target = message[field.oneof] = { + oneofKind: localName + }; + } + else { + target = message; + } + // we have handled oneof above. we just have read the value into `target`. + if (field.kind == 'map') { + if (jsonValue === null) { + continue; + } + // check input + this.assert(json_typings_1.isJsonObject(jsonValue), field.name, jsonValue); + // our target to put map entries into + const fieldObj = target[localName]; + // read entries + for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { + this.assert(jsonObjValue !== null, field.name + " map value", null); + // read value + let val; + switch (field.V.kind) { + case "message": + val = field.V.T().internalJsonRead(jsonObjValue, options); + break; + case "enum": + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) + continue; + break; + case "scalar": + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + break; + } + this.assert(val !== undefined, field.name + " map value", jsonObjValue); + // read key + let key = jsonObjKey; + if (field.K == reflection_info_1.ScalarType.BOOL) + key = key == "true" ? true : key == "false" ? false : key; + key = this.scalar(key, field.K, reflection_info_1.LongType.STRING, field.name).toString(); + fieldObj[key] = val; + } + } + else if (field.repeat) { + if (jsonValue === null) + continue; + // check input + this.assert(Array.isArray(jsonValue), field.name, jsonValue); + // our target to put array entries into + const fieldArr = target[localName]; + // read array entries + for (const jsonItem of jsonValue) { + this.assert(jsonItem !== null, field.name, null); + let val; + switch (field.kind) { + case "message": + val = field.T().internalJsonRead(jsonItem, options); + break; + case "enum": + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) + continue; + break; + case "scalar": + val = this.scalar(jsonItem, field.T, field.L, field.name); + break; + } + this.assert(val !== undefined, field.name, jsonValue); + fieldArr.push(val); + } + } + else { + switch (field.kind) { + case "message": + if (jsonValue === null && field.T().typeName != 'google.protobuf.Value') { + this.assert(field.oneof === undefined, field.name + " (oneof member)", null); + continue; + } + target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]); + break; + case "enum": + if (jsonValue === null) + continue; + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) + continue; + target[localName] = val; + break; + case "scalar": + if (jsonValue === null) + continue; + target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); + break; + } + } + } } - /** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } + * Returns `false` for unrecognized string representations. * + * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). */ - function every(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) + enum(type, json, fieldName, ignoreUnknownFields) { + if (type[0] == 'google.protobuf.NullValue') + assert_1.assert(json === null || json === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} only accepts null.`); + if (json === null) + // we require 0 to be default value for all enums + return 0; + switch (typeof json) { + case "number": + assert_1.assert(Number.isInteger(json), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json}.`); + return json; + case "string": + let localEnumName = json; + if (type[2] && json.substring(0, type[2].length) === type[2]) + // lookup without the shared prefix + localEnumName = json.substring(type[2].length); + let enumNumber = type[1][localEnumName]; + if (typeof enumNumber === 'undefined' && ignoreUnknownFields) { + return false; + } + assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} has no value for "${json}".`); + return enumNumber; + } + assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json}".`); + } + scalar(json, type, longType, fieldName) { + let e; + try { + switch (type) { + // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". + // Either numbers or strings are accepted. Exponent notation is also accepted. + case reflection_info_1.ScalarType.DOUBLE: + case reflection_info_1.ScalarType.FLOAT: + if (json === null) + return .0; + if (json === "NaN") + return Number.NaN; + if (json === "Infinity") + return Number.POSITIVE_INFINITY; + if (json === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (json === "") { + e = "empty string"; + break; + } + if (typeof json == "string" && json.trim().length !== json.length) { + e = "extra whitespace"; + break; + } + if (typeof json != "string" && typeof json != "number") { + break; + } + let float = Number(json); + if (Number.isNaN(float)) { + e = "not a number"; + break; + } + if (!Number.isFinite(float)) { + // infinity and -infinity are handled by string representation above, so this is an error + e = "too large or small"; + break; + } + if (type == reflection_info_1.ScalarType.FLOAT) + assert_1.assertFloat32(float); + return float; + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case reflection_info_1.ScalarType.INT32: + case reflection_info_1.ScalarType.FIXED32: + case reflection_info_1.ScalarType.SFIXED32: + case reflection_info_1.ScalarType.SINT32: + case reflection_info_1.ScalarType.UINT32: + if (json === null) + return 0; + let int32; + if (typeof json == "number") + int32 = json; + else if (json === "") + e = "empty string"; + else if (typeof json == "string") { + if (json.trim().length !== json.length) + e = "extra whitespace"; + else + int32 = Number(json); + } + if (int32 === undefined) + break; + if (type == reflection_info_1.ScalarType.UINT32) + assert_1.assertUInt32(int32); + else + assert_1.assertInt32(int32); + return int32; + // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted. + case reflection_info_1.ScalarType.INT64: + case reflection_info_1.ScalarType.SFIXED64: + case reflection_info_1.ScalarType.SINT64: + if (json === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); + if (typeof json != "number" && typeof json != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json), longType); + case reflection_info_1.ScalarType.FIXED64: + case reflection_info_1.ScalarType.UINT64: + if (json === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); + if (typeof json != "number" && typeof json != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json), longType); + // bool: + case reflection_info_1.ScalarType.BOOL: + if (json === null) + return false; + if (typeof json !== "boolean") + break; + return json; + // string: + case reflection_info_1.ScalarType.STRING: + if (json === null) + return ""; + if (typeof json !== "string") { + e = "extra whitespace"; + break; + } + try { + encodeURIComponent(json); + } + catch (e) { + e = "invalid UTF8"; + break; + } + return json; + // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. + // Either standard or URL-safe base64 encoding with/without paddings are accepted. + case reflection_info_1.ScalarType.BYTES: + if (json === null || json === "") + return new Uint8Array(0); + if (typeof json !== 'string') + break; + return base64_1.base64decode(json); + } + } + catch (error) { + e = error.message; + } + this.assert(false, fieldName + (e ? " - " + e : ""), json); } - var every$1 = awaitify(every, 3); +} +exports.ReflectionJsonReader = ReflectionJsonReader; + + +/***/ }), + +/***/ 11094: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReflectionJsonWriter = void 0; +const base64_1 = __nccwpck_require__(26335); +const pb_long_1 = __nccwpck_require__(61753); +const reflection_info_1 = __nccwpck_require__(67910); +const assert_1 = __nccwpck_require__(8602); +/** + * Writes proto3 messages in canonical JSON format using reflection + * information. + * + * https://developers.google.com/protocol-buffers/docs/proto3#json + */ +class ReflectionJsonWriter { + constructor(info) { + var _a; + this.fields = (_a = info.fields) !== null && _a !== void 0 ? _a : []; + } /** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided + * Converts the message to a JSON object, based on the field descriptors. */ - function everyLimit(coll, limit, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback) + write(message, options) { + const json = {}, source = message; + for (const field of this.fields) { + // field is not part of a oneof, simply write as is + if (!field.oneof) { + let jsonValue = this.field(field, source[field.localName], options); + if (jsonValue !== undefined) + json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; + continue; + } + // field is part of a oneof + const group = source[field.oneof]; + if (group.oneofKind !== field.localName) + continue; // not selected, skip + const opt = field.kind == 'scalar' || field.kind == 'enum' + ? Object.assign(Object.assign({}, options), { emitDefaultValues: true }) : options; + let jsonValue = this.field(field, group[field.localName], opt); + assert_1.assert(jsonValue !== undefined); + json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; + } + return json; + } + field(field, value, options) { + let jsonValue = undefined; + if (field.kind == 'map') { + assert_1.assert(typeof value == "object" && value !== null); + const jsonObj = {}; + switch (field.V.kind) { + case "scalar": + for (const [entryKey, entryValue] of Object.entries(value)) { + const val = this.scalar(field.V.T, entryValue, field.name, false, true); + assert_1.assert(val !== undefined); + jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key + } + break; + case "message": + const messageType = field.V.T(); + for (const [entryKey, entryValue] of Object.entries(value)) { + const val = this.message(messageType, entryValue, field.name, options); + assert_1.assert(val !== undefined); + jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key + } + break; + case "enum": + const enumInfo = field.V.T(); + for (const [entryKey, entryValue] of Object.entries(value)) { + assert_1.assert(entryValue === undefined || typeof entryValue == 'number'); + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== undefined); + jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key + } + break; + } + if (options.emitDefaultValues || Object.keys(jsonObj).length > 0) + jsonValue = jsonObj; + } + else if (field.repeat) { + assert_1.assert(Array.isArray(value)); + const jsonArr = []; + switch (field.kind) { + case "scalar": + for (let i = 0; i < value.length; i++) { + const val = this.scalar(field.T, value[i], field.name, field.opt, true); + assert_1.assert(val !== undefined); + jsonArr.push(val); + } + break; + case "enum": + const enumInfo = field.T(); + for (let i = 0; i < value.length; i++) { + assert_1.assert(value[i] === undefined || typeof value[i] == 'number'); + const val = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); + assert_1.assert(val !== undefined); + jsonArr.push(val); + } + break; + case "message": + const messageType = field.T(); + for (let i = 0; i < value.length; i++) { + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== undefined); + jsonArr.push(val); + } + break; + } + // add converted array to json output + if (options.emitDefaultValues || jsonArr.length > 0 || options.emitDefaultValues) + jsonValue = jsonArr; + } + else { + switch (field.kind) { + case "scalar": + jsonValue = this.scalar(field.T, value, field.name, field.opt, options.emitDefaultValues); + break; + case "enum": + jsonValue = this.enum(field.T(), value, field.name, field.opt, options.emitDefaultValues, options.enumAsInteger); + break; + case "message": + jsonValue = this.message(field.T(), value, field.name, options); + break; + } + } + return jsonValue; } - var everyLimit$1 = awaitify(everyLimit, 4); - /** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided + * Returns `null` as the default for google.protobuf.NullValue. */ - function everySeries(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) + enum(type, value, fieldName, optional, emitDefaultValues, enumAsInteger) { + if (type[0] == 'google.protobuf.NullValue') + return !emitDefaultValues && !optional ? undefined : null; + if (value === undefined) { + assert_1.assert(optional); + return undefined; + } + if (value === 0 && !emitDefaultValues && !optional) + // we require 0 to be default value for all enums + return undefined; + assert_1.assert(typeof value == 'number'); + assert_1.assert(Number.isInteger(value)); + if (enumAsInteger || !type[1].hasOwnProperty(value)) + // if we don't now the enum value, just return the number + return value; + if (type[2]) + // restore the dropped prefix + return type[2] + type[1][value]; + return type[1][value]; } - var everySeries$1 = awaitify(everySeries, 3); - - function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index] = !!v; - iterCb(err); - }); - }, err => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); + message(type, value, fieldName, options) { + if (value === undefined) + return options.emitDefaultValues ? null : undefined; + return type.internalJsonWrite(value, options); } - - function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({index, value: x}); - } - iterCb(err); - }); - }, err => { - if (err) return callback(err); - callback(null, results - .sort((a, b) => a.index - b.index) - .map(v => v.value)); - }); + scalar(type, value, fieldName, optional, emitDefaultValues) { + if (value === undefined) { + assert_1.assert(optional); + return undefined; + } + const ed = emitDefaultValues || optional; + // noinspection FallThroughInSwitchStatementJS + switch (type) { + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case reflection_info_1.ScalarType.INT32: + case reflection_info_1.ScalarType.SFIXED32: + case reflection_info_1.ScalarType.SINT32: + if (value === 0) + return ed ? 0 : undefined; + assert_1.assertInt32(value); + return value; + case reflection_info_1.ScalarType.FIXED32: + case reflection_info_1.ScalarType.UINT32: + if (value === 0) + return ed ? 0 : undefined; + assert_1.assertUInt32(value); + return value; + // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". + // Either numbers or strings are accepted. Exponent notation is also accepted. + case reflection_info_1.ScalarType.FLOAT: + assert_1.assertFloat32(value); + case reflection_info_1.ScalarType.DOUBLE: + if (value === 0) + return ed ? 0 : undefined; + assert_1.assert(typeof value == 'number'); + if (Number.isNaN(value)) + return 'NaN'; + if (value === Number.POSITIVE_INFINITY) + return 'Infinity'; + if (value === Number.NEGATIVE_INFINITY) + return '-Infinity'; + return value; + // string: + case reflection_info_1.ScalarType.STRING: + if (value === "") + return ed ? '' : undefined; + assert_1.assert(typeof value == 'string'); + return value; + // bool: + case reflection_info_1.ScalarType.BOOL: + if (value === false) + return ed ? false : undefined; + assert_1.assert(typeof value == 'boolean'); + return value; + // JSON value will be a decimal string. Either numbers or strings are accepted. + case reflection_info_1.ScalarType.UINT64: + case reflection_info_1.ScalarType.FIXED64: + assert_1.assert(typeof value == 'number' || typeof value == 'string' || typeof value == 'bigint'); + let ulong = pb_long_1.PbULong.from(value); + if (ulong.isZero() && !ed) + return undefined; + return ulong.toString(); + // JSON value will be a decimal string. Either numbers or strings are accepted. + case reflection_info_1.ScalarType.INT64: + case reflection_info_1.ScalarType.SFIXED64: + case reflection_info_1.ScalarType.SINT64: + assert_1.assert(typeof value == 'number' || typeof value == 'string' || typeof value == 'bigint'); + let long = pb_long_1.PbLong.from(value); + if (long.isZero() && !ed) + return undefined; + return long.toString(); + // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. + // Either standard or URL-safe base64 encoding with/without paddings are accepted. + case reflection_info_1.ScalarType.BYTES: + assert_1.assert(value instanceof Uint8Array); + if (!value.byteLength) + return ed ? "" : undefined; + return base64_1.base64encode(value); + } } +} +exports.ReflectionJsonWriter = ReflectionJsonWriter; - function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - return filter(eachfn, coll, wrapAsync(iteratee), callback); + +/***/ }), + +/***/ 63402: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reflectionLongConvert = void 0; +const reflection_info_1 = __nccwpck_require__(67910); +/** + * Utility method to convert a PbLong or PbUlong to a JavaScript + * representation during runtime. + * + * Works with generated field information, `undefined` is equivalent + * to `STRING`. + */ +function reflectionLongConvert(long, type) { + switch (type) { + case reflection_info_1.LongType.BIGINT: + return long.toBigInt(); + case reflection_info_1.LongType.NUMBER: + return long.toNumber(); + default: + // case undefined: + // case LongType.STRING: + return long.toString(); } +} +exports.reflectionLongConvert = reflectionLongConvert; - /** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function filter (coll, iteratee, callback) { - return _filter(eachOf$1, coll, iteratee, callback) + +/***/ }), + +/***/ 98044: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reflectionMergePartial = void 0; +/** + * Copy partial data into the target message. + * + * If a singular scalar or enum field is present in the source, it + * replaces the field in the target. + * + * If a singular message field is present in the source, it is merged + * with the target field by calling mergePartial() of the responsible + * message type. + * + * If a repeated field is present in the source, its values replace + * all values in the target array, removing extraneous values. + * Repeated message fields are copied, not merged. + * + * If a map field is present in the source, entries are added to the + * target map, replacing entries with the same key. Entries that only + * exist in the target remain. Entries with message values are copied, + * not merged. + * + * Note that this function differs from protobuf merge semantics, + * which appends repeated fields. + */ +function reflectionMergePartial(info, target, source) { + let fieldValue, // the field value we are working with + input = source, output; // where we want our field value to go + for (let field of info.fields) { + let name = field.localName; + if (field.oneof) { + const group = input[field.oneof]; // this is the oneof`s group in the source + if ((group === null || group === void 0 ? void 0 : group.oneofKind) == undefined) { // the user is free to omit + continue; // we skip this field, and all other members too + } + fieldValue = group[name]; // our value comes from the the oneof group of the source + output = target[field.oneof]; // and our output is the oneof group of the target + output.oneofKind = group.oneofKind; // always update discriminator + if (fieldValue == undefined) { + delete output[name]; // remove any existing value + continue; // skip further work on field + } + } + else { + fieldValue = input[name]; // we are using the source directly + output = target; // we want our field value to go directly into the target + if (fieldValue == undefined) { + continue; // skip further work on field, existing value is used as is + } + } + if (field.repeat) + output[name].length = fieldValue.length; // resize target array to match source array + // now we just work with `fieldValue` and `output` to merge the value + switch (field.kind) { + case "scalar": + case "enum": + if (field.repeat) + for (let i = 0; i < fieldValue.length; i++) + output[name][i] = fieldValue[i]; // not a reference type + else + output[name] = fieldValue; // not a reference type + break; + case "message": + let T = field.T(); + if (field.repeat) + for (let i = 0; i < fieldValue.length; i++) + output[name][i] = T.create(fieldValue[i]); + else if (output[name] === undefined) + output[name] = T.create(fieldValue); // nothing to merge with + else + T.mergePartial(output[name], fieldValue); + break; + case "map": + // Map and repeated fields are simply overwritten, not appended or merged + switch (field.V.kind) { + case "scalar": + case "enum": + Object.assign(output[name], fieldValue); // elements are not reference types + break; + case "message": + let T = field.V.T(); + for (let k of Object.keys(fieldValue)) + output[name][k] = T.create(fieldValue[k]); + break; + } + break; + } } - var filter$1 = awaitify(filter, 3); +} +exports.reflectionMergePartial = reflectionMergePartial; - /** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ - function filterLimit (coll, limit, iteratee, callback) { - return _filter(eachOfLimit$2(limit), coll, iteratee, callback) - } - var filterLimit$1 = awaitify(filterLimit, 4); - /** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ - function filterSeries (coll, iteratee, callback) { - return _filter(eachOfSeries$1, coll, iteratee, callback) - } - var filterSeries$1 = awaitify(filterSeries, 3); +/***/ }), - /** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. +/***/ 19526: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @returns {Promise} a promise that rejects if an error occurs and an errback - * is not passed - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ - function forever(fn, errback) { - var done = onlyOnce(errback); - var task = wrapAsync(ensureAsync(fn)); +"use strict"; - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reflectionScalarDefault = void 0; +const reflection_info_1 = __nccwpck_require__(67910); +const reflection_long_convert_1 = __nccwpck_require__(63402); +const pb_long_1 = __nccwpck_require__(61753); +/** + * Creates the default value for a scalar type. + */ +function reflectionScalarDefault(type, longType = reflection_info_1.LongType.STRING) { + switch (type) { + case reflection_info_1.ScalarType.BOOL: + return false; + case reflection_info_1.ScalarType.UINT64: + case reflection_info_1.ScalarType.FIXED64: + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); + case reflection_info_1.ScalarType.INT64: + case reflection_info_1.ScalarType.SFIXED64: + case reflection_info_1.ScalarType.SINT64: + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); + case reflection_info_1.ScalarType.DOUBLE: + case reflection_info_1.ScalarType.FLOAT: + return 0.0; + case reflection_info_1.ScalarType.BYTES: + return new Uint8Array(0); + case reflection_info_1.ScalarType.STRING: + return ""; + default: + // case ScalarType.INT32: + // case ScalarType.UINT32: + // case ScalarType.SINT32: + // case ScalarType.FIXED32: + // case ScalarType.SFIXED32: + return 0; } - var forever$1 = awaitify(forever, 2); +} +exports.reflectionScalarDefault = reflectionScalarDefault; - /** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ - function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, {key, val}); - }); - }, (err, mapResults) => { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var {hasOwnProperty} = Object.prototype; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var {key} = mapResults[i]; - var {val} = mapResults[i]; +/***/ }), - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } +/***/ 25167: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReflectionTypeCheck = void 0; +const reflection_info_1 = __nccwpck_require__(67910); +const oneof_1 = __nccwpck_require__(18063); +// noinspection JSMethodCanBeStatic +class ReflectionTypeCheck { + constructor(info) { + var _a; + this.fields = (_a = info.fields) !== null && _a !== void 0 ? _a : []; + } + prepare() { + if (this.data) + return; + const req = [], known = [], oneofs = []; + for (let field of this.fields) { + if (field.oneof) { + if (!oneofs.includes(field.oneof)) { + oneofs.push(field.oneof); + req.push(field.oneof); + known.push(field.oneof); } } - - return callback(err, result); - }); + else { + known.push(field.localName); + switch (field.kind) { + case "scalar": + case "enum": + if (!field.opt || field.repeat) + req.push(field.localName); + break; + case "message": + if (field.repeat) + req.push(field.localName); + break; + case "map": + req.push(field.localName); + break; + } + } + } + this.data = { req, known, oneofs: Object.values(oneofs) }; } - - var groupByLimit$1 = awaitify(groupByLimit, 4); - /** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist + * Is the argument a valid message as specified by the + * reflection information? * - * const files = ['dir1/file1.txt','dir2','dir4'] + * Checks all field types recursively. The `depth` + * specifies how deep into the structure the check will be. * - * // asynchronous function that detects file type as none, file, or directory - * function detectFile(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(null, 'none'); - * } - * callback(null, stat.isDirectory() ? 'directory' : 'file'); - * }); - * } + * With a depth of 0, only the presence of fields + * is checked. * - * //Using callbacks - * async.groupBy(files, detectFile, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * }); + * With a depth of 1 or more, the field types are checked. * - * // Using Promises - * async.groupBy(files, detectFile) - * .then( result => { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * }).catch( err => { - * console.log(err); - * }); + * With a depth of 2 or more, the members of map, repeated + * and message fields are checked. * - * // Using async/await - * async () => { - * try { - * let result = await async.groupBy(files, detectFile); - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * catch (err) { - * console.log(err); - * } - * } + * Message fields will be checked recursively with depth - 1. * + * The number of map entries / repeated values being checked + * is < depth. */ - function groupBy (coll, iteratee, callback) { - return groupByLimit$1(coll, Infinity, iteratee, callback) + is(message, depth, allowExcessProperties = false) { + if (depth < 0) + return true; + if (message === null || message === undefined || typeof message != 'object') + return false; + this.prepare(); + let keys = Object.keys(message), data = this.data; + // if a required field is missing in arg, this cannot be a T + if (keys.length < data.req.length || data.req.some(n => !keys.includes(n))) + return false; + if (!allowExcessProperties) { + // if the arg contains a key we dont know, this is not a literal T + if (keys.some(k => !data.known.includes(k))) + return false; + } + // "With a depth of 0, only the presence and absence of fields is checked." + // "With a depth of 1 or more, the field types are checked." + if (depth < 1) { + return true; + } + // check oneof group + for (const name of data.oneofs) { + const group = message[name]; + if (!oneof_1.isOneofGroup(group)) + return false; + if (group.oneofKind === undefined) + continue; + const field = this.fields.find(f => f.localName === group.oneofKind); + if (!field) + return false; // we found no field, but have a kind, something is wrong + if (!this.field(group[group.oneofKind], field, allowExcessProperties, depth)) + return false; + } + // check types + for (const field of this.fields) { + if (field.oneof !== undefined) + continue; + if (!this.field(message[field.localName], field, allowExcessProperties, depth)) + return false; + } + return true; + } + field(arg, field, allowExcessProperties, depth) { + let repeated = field.repeat; + switch (field.kind) { + case "scalar": + if (arg === undefined) + return field.opt; + if (repeated) + return this.scalars(arg, field.T, depth, field.L); + return this.scalar(arg, field.T, field.L); + case "enum": + if (arg === undefined) + return field.opt; + if (repeated) + return this.scalars(arg, reflection_info_1.ScalarType.INT32, depth); + return this.scalar(arg, reflection_info_1.ScalarType.INT32); + case "message": + if (arg === undefined) + return true; + if (repeated) + return this.messages(arg, field.T(), allowExcessProperties, depth); + return this.message(arg, field.T(), allowExcessProperties, depth); + case "map": + if (typeof arg != 'object' || arg === null) + return false; + if (depth < 2) + return true; + if (!this.mapKeys(arg, field.K, depth)) + return false; + switch (field.V.kind) { + case "scalar": + return this.scalars(Object.values(arg), field.V.T, depth, field.V.L); + case "enum": + return this.scalars(Object.values(arg), reflection_info_1.ScalarType.INT32, depth); + case "message": + return this.messages(Object.values(arg), field.V.T(), allowExcessProperties, depth); + } + break; + } + return true; + } + message(arg, type, allowExcessProperties, depth) { + if (allowExcessProperties) { + return type.isAssignable(arg, depth); + } + return type.is(arg, depth); + } + messages(arg, type, allowExcessProperties, depth) { + if (!Array.isArray(arg)) + return false; + if (depth < 2) + return true; + if (allowExcessProperties) { + for (let i = 0; i < arg.length && i < depth; i++) + if (!type.isAssignable(arg[i], depth - 1)) + return false; + } + else { + for (let i = 0; i < arg.length && i < depth; i++) + if (!type.is(arg[i], depth - 1)) + return false; + } + return true; + } + scalar(arg, type, longType) { + let argType = typeof arg; + switch (type) { + case reflection_info_1.ScalarType.UINT64: + case reflection_info_1.ScalarType.FIXED64: + case reflection_info_1.ScalarType.INT64: + case reflection_info_1.ScalarType.SFIXED64: + case reflection_info_1.ScalarType.SINT64: + switch (longType) { + case reflection_info_1.LongType.BIGINT: + return argType == "bigint"; + case reflection_info_1.LongType.NUMBER: + return argType == "number" && !isNaN(arg); + default: + return argType == "string"; + } + case reflection_info_1.ScalarType.BOOL: + return argType == 'boolean'; + case reflection_info_1.ScalarType.STRING: + return argType == 'string'; + case reflection_info_1.ScalarType.BYTES: + return arg instanceof Uint8Array; + case reflection_info_1.ScalarType.DOUBLE: + case reflection_info_1.ScalarType.FLOAT: + return argType == 'number' && !isNaN(arg); + default: + // case ScalarType.UINT32: + // case ScalarType.FIXED32: + // case ScalarType.INT32: + // case ScalarType.SINT32: + // case ScalarType.SFIXED32: + return argType == 'number' && Number.isInteger(arg); + } + } + scalars(arg, type, depth, longType) { + if (!Array.isArray(arg)) + return false; + if (depth < 2) + return true; + if (Array.isArray(arg)) + for (let i = 0; i < arg.length && i < depth; i++) + if (!this.scalar(arg[i], type, longType)) + return false; + return true; + } + mapKeys(map, type, depth) { + let keys = Object.keys(map); + switch (type) { + case reflection_info_1.ScalarType.INT32: + case reflection_info_1.ScalarType.FIXED32: + case reflection_info_1.ScalarType.SFIXED32: + case reflection_info_1.ScalarType.SINT32: + case reflection_info_1.ScalarType.UINT32: + return this.scalars(keys.slice(0, depth).map(k => parseInt(k)), type, depth); + case reflection_info_1.ScalarType.BOOL: + return this.scalars(keys.slice(0, depth).map(k => k == 'true' ? true : k == 'false' ? false : k), type, depth); + default: + return this.scalars(keys, type, depth, reflection_info_1.LongType.STRING); + } + } +} +exports.ReflectionTypeCheck = ReflectionTypeCheck; + + +/***/ }), + +/***/ 90868: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.req = exports.json = exports.toBuffer = void 0; +const http = __importStar(__nccwpck_require__(58611)); +const https = __importStar(__nccwpck_require__(65692)); +async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); } - - /** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whose - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ - function groupBySeries (coll, iteratee, callback) { - return groupByLimit$1(coll, 1, iteratee, callback) + return Buffer.concat(chunks, length); +} +exports.toBuffer = toBuffer; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +async function json(stream) { + const buf = await toBuffer(stream); + const str = buf.toString('utf8'); + try { + return JSON.parse(str); + } + catch (_err) { + const err = _err; + err.message += ` (input: ${str})`; + throw err; } +} +exports.json = json; +function req(url, opts = {}) { + const href = typeof url === 'string' ? url : url.href; + const req = (href.startsWith('https:') ? https : http).request(url, opts); + const promise = new Promise((resolve, reject) => { + req + .once('response', resolve) + .once('error', reject) + .end(); + }); + req.then = promise.then.bind(promise); + return req; +} +exports.req = req; +//# sourceMappingURL=helpers.js.map - /** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ - var log = consoleFunc('log'); +/***/ }), - /** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - return eachOfLimit$2(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, err => callback(err, newObj)); - } +/***/ 35209: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); +"use strict"; - /** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file3.txt' - * }; - * - * const withMissingFileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file4.txt' - * }; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, key, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * }); - * - * // Error handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.mapValues(fileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * }).catch (err => { - * console.log(err); - * }); - * - * // Error Handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch (err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.mapValues(fileMap, getFileSizeInBytes); - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function mapValues(obj, iteratee, callback) { - return mapValuesLimit$1(obj, Infinity, iteratee, callback) +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Agent = void 0; +const net = __importStar(__nccwpck_require__(69278)); +const http = __importStar(__nccwpck_require__(58611)); +const https_1 = __nccwpck_require__(65692); +__exportStar(__nccwpck_require__(90868), exports); +const INTERNAL = Symbol('AgentBaseInternalState'); +class Agent extends http.Agent { + constructor(opts) { + super(opts); + this[INTERNAL] = {}; } - /** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed + * Determine whether this is an `http` or `https` request. */ - function mapValuesSeries(obj, iteratee, callback) { - return mapValuesLimit$1(obj, 1, iteratee, callback) + isSecureEndpoint(options) { + if (options) { + // First check the `secureEndpoint` property explicitly, since this + // means that a parent `Agent` is "passing through" to this instance. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (typeof options.secureEndpoint === 'boolean') { + return options.secureEndpoint; + } + // If no explicit `secure` endpoint, check if `protocol` property is + // set. This will usually be the case since using a full string URL + // or `URL` instance should be the most common usage. + if (typeof options.protocol === 'string') { + return options.protocol === 'https:'; + } + } + // Finally, if no `protocol` property was set, then fall back to + // checking the stack trace of the current call stack, and try to + // detect the "https" module. + const { stack } = new Error(); + if (typeof stack !== 'string') + return false; + return stack + .split('\n') + .some((l) => l.indexOf('(https.js:') !== -1 || + l.indexOf('node:https:') !== -1); + } + // In order to support async signatures in `connect()` and Node's native + // connection pooling in `http.Agent`, the array of sockets for each origin + // has to be updated synchronously. This is so the length of the array is + // accurate when `addRequest()` is next called. We achieve this by creating a + // fake socket and adding it to `sockets[origin]` and incrementing + // `totalSocketCount`. + incrementSockets(name) { + // If `maxSockets` and `maxTotalSockets` are both Infinity then there is no + // need to create a fake socket because Node.js native connection pooling + // will never be invoked. + if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { + return null; + } + // All instances of `sockets` are expected TypeScript errors. The + // alternative is to add it as a private property of this class but that + // will break TypeScript subclassing. + if (!this.sockets[name]) { + // @ts-expect-error `sockets` is readonly in `@types/node` + this.sockets[name] = []; + } + const fakeSocket = new net.Socket({ writable: false }); + this.sockets[name].push(fakeSocket); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount++; + return fakeSocket; + } + decrementSockets(name, socket) { + if (!this.sockets[name] || socket === null) { + return; + } + const sockets = this.sockets[name]; + const index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount--; + if (sockets.length === 0) { + // @ts-expect-error `sockets` is readonly in `@types/node` + delete this.sockets[name]; + } + } + } + // In order to properly update the socket pool, we need to call `getName()` on + // the core `https.Agent` if it is a secureEndpoint. + getName(options) { + const secureEndpoint = this.isSecureEndpoint(options); + if (secureEndpoint) { + // @ts-expect-error `getName()` isn't defined in `@types/node` + return https_1.Agent.prototype.getName.call(this, options); + } + // @ts-expect-error `getName()` isn't defined in `@types/node` + return super.getName(options); + } + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options), + }; + const name = this.getName(connectOpts); + const fakeSocket = this.incrementSockets(name); + Promise.resolve() + .then(() => this.connect(req, connectOpts)) + .then((socket) => { + this.decrementSockets(name, fakeSocket); + if (socket instanceof http.Agent) { + try { + // @ts-expect-error `addRequest()` isn't defined in `@types/node` + return socket.addRequest(req, connectOpts); + } + catch (err) { + return cb(err); + } + } + this[INTERNAL].currentSocket = socket; + // @ts-expect-error `createSocket()` isn't defined in `@types/node` + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); + } + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = undefined; + if (!socket) { + throw new Error('No socket was returned in the `connect()` function'); + } + return socket; + } + get defaultPort() { + return (this[INTERNAL].defaultPort ?? + (this.protocol === 'https:' ? 443 : 80)); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; + } + } + get protocol() { + return (this[INTERNAL].protocol ?? + (this.isSecureEndpoint() ? 'https:' : 'http:')); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; + } } +} +exports.Agent = Agent; +//# sourceMappingURL=index.js.map + +/***/ }), +/***/ 15588: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpsProxyAgent = void 0; +const net = __importStar(__nccwpck_require__(69278)); +const tls = __importStar(__nccwpck_require__(64756)); +const assert_1 = __importDefault(__nccwpck_require__(42613)); +const debug_1 = __importDefault(__nccwpck_require__(2830)); +const agent_base_1 = __nccwpck_require__(35209); +const url_1 = __nccwpck_require__(87016); +const parse_proxy_response_1 = __nccwpck_require__(51632); +const debug = (0, debug_1.default)('https-proxy-agent'); +const setServernameFromNonIpHost = (options) => { + if (options.servername === undefined && + options.host && + !net.isIP(options.host)) { + return { + ...options, + servername: options.host, + }; + } + return options; +}; +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + */ +class HttpsProxyAgent extends agent_base_1.Agent { + constructor(proxy, opts) { + super(opts); + this.options = { path: undefined }; + this.proxy = typeof proxy === 'string' ? new url_1.URL(proxy) : proxy; + this.proxyHeaders = opts?.headers ?? {}; + debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href); + // Trim off the brackets from IPv6 addresses + const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ''); + const port = this.proxy.port + ? parseInt(this.proxy.port, 10) + : this.proxy.protocol === 'https:' + ? 443 + : 80; + this.connectOpts = { + // Attempt to negotiate http/1.1 for proxy servers that support http/2 + ALPNProtocols: ['http/1.1'], + ...(opts ? omit(opts, 'headers') : null), + host, + port, + }; + } /** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * **Note: if the async function errs, the result will not be cached and - * subsequent calls will call the wrapped function.** - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); + * Called when the node-core HTTP client library is creating a + * new HTTP request. */ - function memoize(fn, hasher = v => v) { - var memo = Object.create(null); - var queues = Object.create(null); - var _fn = wrapAsync(fn); - var memoized = initialParams((args, callback) => { - var key = hasher(...args); - if (key in memo) { - setImmediate$1(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - // #1465 don't memoize if an error occurred - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } + async connect(req, opts) { + const { proxy } = this; + if (!opts.host) { + throw new TypeError('No "host" provided'); + } + // Create a socket connection to the proxy server. + let socket; + if (proxy.protocol === 'https:') { + debug('Creating `tls.Socket`: %o', this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + } + else { + debug('Creating `net.Socket`: %o', this.connectOpts); + socket = net.connect(this.connectOpts); + } + const headers = typeof this.proxyHeaders === 'function' + ? this.proxyHeaders() + : { ...this.proxyHeaders }; + const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; + let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; + } + headers.Host = `${host}:${opts.port}`; + if (!headers['Proxy-Connection']) { + headers['Proxy-Connection'] = this.keepAlive + ? 'Keep-Alive' + : 'close'; + } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r\n`; + } + const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket); + socket.write(`${payload}\r\n`); + const { connect, buffered } = await proxyResponsePromise; + req.emit('proxyConnect', connect); + this.emit('proxyConnect', connect, req); + if (connect.statusCode === 200) { + req.once('socket', resume); + if (opts.secureEndpoint) { + // The proxy is connecting to a TLS server, so upgrade + // this socket connection to a TLS connection. + debug('Upgrading socket connection to TLS'); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'), + socket, }); } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - } + return socket; + } + // Some other status code that's not 200... need to re-play the HTTP + // header "data" events onto the socket once the HTTP machinery is + // attached so that the node core `http` can parse and handle the + // error status code. + // Close the original socket, and a new "fake" socket is returned + // instead, so that the proxy doesn't get the HTTP request + // written to it (which may contain `Authorization` headers or other + // sensitive data). + // + // See: https://hackerone.com/reports/541502 + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + // Need to wait for the "socket" event to re-play the "data" events. + req.once('socket', (s) => { + debug('Replaying proxy buffer for failed request'); + (0, assert_1.default)(s.listenerCount('data') > 0); + // Replay the "buffered" Buffer onto the fake `socket`, since at + // this point the HTTP module machinery has been hooked up for + // the user. + s.push(buffered); + s.push(null); + }); + return fakeSocket; + } +} +HttpsProxyAgent.protocols = ['http', 'https']; +exports.HttpsProxyAgent = HttpsProxyAgent; +function resume(socket) { + socket.resume(); +} +function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; +} +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 51632: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseProxyResponse = void 0; +const debug_1 = __importDefault(__nccwpck_require__(2830)); +const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response'); +function parseProxyResponse(socket) { + return new Promise((resolve, reject) => { + // we need to buffer any HTTP traffic that happens with the proxy before we get + // the CONNECT response, so that if the response is anything other than an "200" + // response code, then we can re-play the "data" events on the socket once the + // HTTP parser is hooked up... + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once('readable', read); + } + function cleanup() { + socket.removeListener('end', onend); + socket.removeListener('error', onerror); + socket.removeListener('readable', read); + } + function onend() { + cleanup(); + debug('onend'); + reject(new Error('Proxy connection ended before receiving CONNECT response')); + } + function onerror(err) { + cleanup(); + debug('onerror %o', err); + reject(err); + } + function ondata(b) { + buffers.push(b); + buffersLength += b.length; + const buffered = Buffer.concat(buffers, buffersLength); + const endOfHeaders = buffered.indexOf('\r\n\r\n'); + if (endOfHeaders === -1) { + // keep buffering + debug('have not received end of HTTP headers yet...'); + read(); + return; + } + const headerParts = buffered + .slice(0, endOfHeaders) + .toString('ascii') + .split('\r\n'); + const firstLine = headerParts.shift(); + if (!firstLine) { + socket.destroy(); + return reject(new Error('No header received from proxy CONNECT response')); + } + const firstLineParts = firstLine.split(' '); + const statusCode = +firstLineParts[1]; + const statusText = firstLineParts.slice(2).join(' '); + const headers = {}; + for (const header of headerParts) { + if (!header) + continue; + const firstColon = header.indexOf(':'); + if (firstColon === -1) { + socket.destroy(); + return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); + } + const key = header.slice(0, firstColon).toLowerCase(); + const value = header.slice(firstColon + 1).trimStart(); + const current = headers[key]; + if (typeof current === 'string') { + headers[key] = [current, value]; + } + else if (Array.isArray(current)) { + current.push(value); + } + else { + headers[key] = value; + } + } + debug('got proxy server response: %o %o', firstLine, headers); + cleanup(); + resolve({ + connect: { + statusCode, + statusText, + headers, + }, + buffered, + }); + } + socket.on('error', onerror); + socket.on('end', onend); + read(); + }); +} +exports.parseProxyResponse = parseProxyResponse; +//# sourceMappingURL=parse-proxy-response.js.map - /* istanbul ignore file */ +/***/ }), - /** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ - var _defer; +/***/ 17413: +/***/ ((module, exports, __nccwpck_require__) => { - if (hasNextTick) { - _defer = process.nextTick; - } else if (hasSetImmediate) { - _defer = setImmediate; - } else { - _defer = fallback; - } +"use strict"; +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ - var nextTick = wrap(_defer); - var _parallel = awaitify((eachfn, tasks, callback) => { - var results = isArrayLike(tasks) ? [] : {}; +Object.defineProperty(exports, "__esModule", ({ value: true })); - eachfn(tasks, (task, key, taskCb) => { - wrapAsync(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, err => callback(err, results)); - }, 3); +var eventTargetShim = __nccwpck_require__(16577); +/** + * The signal class. + * @see https://dom.spec.whatwg.org/#abortsignal + */ +class AbortSignal extends eventTargetShim.EventTarget { /** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * - * //Using Callbacks - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * + * AbortSignal cannot be constructed directly. */ - function parallel(tasks, callback) { - return _parallel(eachOf$1, tasks, callback); + constructor() { + super(); + throw new TypeError("AbortSignal cannot be constructed directly"); } - /** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed + * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise. */ - function parallelLimit(tasks, limit, callback) { - return _parallel(eachOfLimit$2(limit), tasks, callback); + get aborted() { + const aborted = abortedFlags.get(this); + if (typeof aborted !== "boolean") { + throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); + } + return aborted; + } +} +eventTargetShim.defineEventAttribute(AbortSignal.prototype, "abort"); +/** + * Create an AbortSignal object. + */ +function createAbortSignal() { + const signal = Object.create(AbortSignal.prototype); + eventTargetShim.EventTarget.call(signal); + abortedFlags.set(signal, false); + return signal; +} +/** + * Abort a given signal. + */ +function abortSignal(signal) { + if (abortedFlags.get(signal) !== false) { + return; } + abortedFlags.set(signal, true); + signal.dispatchEvent({ type: "abort" }); +} +/** + * Aborted flag for each instances. + */ +const abortedFlags = new WeakMap(); +// Properties should be enumerable. +Object.defineProperties(AbortSignal.prototype, { + aborted: { enumerable: true }, +}); +// `toString()` should return `"[object AbortSignal]"` +if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { + Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { + configurable: true, + value: "AbortSignal", + }); +} +/** + * The AbortController. + * @see https://dom.spec.whatwg.org/#abortcontroller + */ +class AbortController { /** - * A queue of tasks for the worker function to complete. - * @typedef {Iterable} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {number} payload - an integer that specifies how many items are - * passed to the worker function at a time. only applies if this is a - * [cargo]{@link module:ControlFlow.cargo} object - * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns - * a promise that rejects if an error occurs. - * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns - * a promise that rejects if an error occurs. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a function that sets a callback that is - * called when the number of running workers hits the `concurrency` limit, and - * further tasks will be queued. If the callback is omitted, `q.saturated()` - * returns a promise for the next occurrence. - * @property {Function} unsaturated - a function that sets a callback that is - * called when the number of running workers is less than the `concurrency` & - * `buffer` limits, and further tasks will not be queued. If the callback is - * omitted, `q.unsaturated()` returns a promise for the next occurrence. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a function that sets a callback that is called - * when the last item from the `queue` is given to a `worker`. If the callback - * is omitted, `q.empty()` returns a promise for the next occurrence. - * @property {Function} drain - a function that sets a callback that is called - * when the last item from the `queue` has returned from the `worker`. If the - * callback is omitted, `q.drain()` returns a promise for the next occurrence. - * @property {Function} error - a function that sets a callback that is called - * when a task errors. Has the signature `function(error, task)`. If the - * callback is omitted, `error()` returns a promise that rejects on the next - * error. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - * - * @example - * const q = async.queue(worker, 2) - * q.push(item1) - * q.push(item2) - * q.push(item3) - * // queues are iterable, spread into an array to inspect - * const items = [...q] // [item1, item2, item3] - * // or use for of - * for (let item of q) { - * console.log(item) - * } - * - * q.drain(() => { - * console.log('all done') - * }) - * // or - * await q.drain() + * Initialize this controller. */ - + constructor() { + signals.set(this, createAbortSignal()); + } /** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain(function() { - * console.log('all items have been processed'); - * }); - * // or await the end - * await q.drain() - * - * // assign an error callback - * q.error(function(err, task) { - * console.error('task experienced an error'); - * }); - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * // callback is optional - * q.push({name: 'bar'}); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); + * Returns the `AbortSignal` object associated with this object. */ - function queue (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue$1((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); + get signal() { + return getSignal(this); } + /** + * Abort and signal to any observers that the associated activity is to be aborted. + */ + abort() { + abortSignal(getSignal(this)); + } +} +/** + * Associated signals. + */ +const signals = new WeakMap(); +/** + * Get the associated signal of a given controller. + */ +function getSignal(controller) { + const signal = signals.get(controller); + if (signal == null) { + throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); + } + return signal; +} +// Properties should be enumerable. +Object.defineProperties(AbortController.prototype, { + signal: { enumerable: true }, + abort: { enumerable: true }, +}); +if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { + Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { + configurable: true, + value: "AbortController", + }); +} - // Binary min-heap implementation used for priority queue. - // Implementation is stable, i.e. push time is considered for equal priorities - class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; +exports.AbortController = AbortController; +exports.AbortSignal = AbortSignal; +exports["default"] = AbortController; + +module.exports = AbortController +module.exports.AbortController = module.exports["default"] = AbortController +module.exports.AbortSignal = AbortSignal +//# sourceMappingURL=abort-controller.js.map + + +/***/ }), + +/***/ 8207: +/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const events_1 = __nccwpck_require__(24434); +const debug_1 = __importDefault(__nccwpck_require__(2830)); +const promisify_1 = __importDefault(__nccwpck_require__(98067)); +const debug = debug_1.default('agent-base'); +function isAgent(v) { + return Boolean(v) && typeof v.addRequest === 'function'; +} +function isSecureEndpoint() { + const { stack } = new Error(); + if (typeof stack !== 'string') + return false; + return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); +} +function createAgent(callback, opts) { + return new createAgent.Agent(callback, opts); +} +(function (createAgent) { + /** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ + class Agent extends events_1.EventEmitter { + constructor(callback, _opts) { + super(); + let opts = _opts; + if (typeof callback === 'function') { + this.callback = callback; + } + else if (callback) { + opts = callback; + } + // Timeout for the socket to be returned from the callback + this.timeout = null; + if (opts && typeof opts.timeout === 'number') { + this.timeout = opts.timeout; + } + // These aren't actually used by `agent-base`, but are required + // for the TypeScript definition files in `@types/node` :/ + this.maxFreeSockets = 1; + this.maxSockets = 1; + this.maxTotalSockets = Infinity; + this.sockets = {}; + this.freeSockets = {}; + this.requests = {}; + this.options = {}; } - - get length() { - return this.heap.length; + get defaultPort() { + if (typeof this.explicitDefaultPort === 'number') { + return this.explicitDefaultPort; + } + return isSecureEndpoint() ? 443 : 80; } - - empty () { - this.heap = []; - return this; + set defaultPort(v) { + this.explicitDefaultPort = v; } - - percUp(index) { - let p; - - while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { - let t = this.heap[index]; - this.heap[index] = this.heap[p]; - this.heap[p] = t; - - index = p; + get protocol() { + if (typeof this.explicitProtocol === 'string') { + return this.explicitProtocol; + } + return isSecureEndpoint() ? 'https:' : 'http:'; + } + set protocol(v) { + this.explicitProtocol = v; + } + callback(req, opts, fn) { + throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); + } + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req, _opts) { + const opts = Object.assign({}, _opts); + if (typeof opts.secureEndpoint !== 'boolean') { + opts.secureEndpoint = isSecureEndpoint(); + } + if (opts.host == null) { + opts.host = 'localhost'; + } + if (opts.port == null) { + opts.port = opts.secureEndpoint ? 443 : 80; + } + if (opts.protocol == null) { + opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; + } + if (opts.host && opts.path) { + // If both a `host` and `path` are specified then it's most + // likely the result of a `url.parse()` call... we need to + // remove the `path` portion so that `net.connect()` doesn't + // attempt to open that as a unix socket file. + delete opts.path; + } + delete opts.agent; + delete opts.hostname; + delete opts._defaultAgent; + delete opts.defaultPort; + delete opts.createConnection; + // Hint to use "Connection: close" + // XXX: non-documented `http` module API :( + req._last = true; + req.shouldKeepAlive = false; + let timedOut = false; + let timeoutId = null; + const timeoutMs = opts.timeout || this.timeout; + const onerror = (err) => { + if (req._hadError) + return; + req.emit('error', err); + // For Safety. Some additional errors might fire later on + // and we need to make sure we don't double-fire the error event. + req._hadError = true; + }; + const ontimeout = () => { + timeoutId = null; + timedOut = true; + const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); + err.code = 'ETIMEOUT'; + onerror(err); + }; + const callbackError = (err) => { + if (timedOut) + return; + if (timeoutId !== null) { + clearTimeout(timeoutId); + timeoutId = null; + } + onerror(err); + }; + const onsocket = (socket) => { + if (timedOut) + return; + if (timeoutId != null) { + clearTimeout(timeoutId); + timeoutId = null; + } + if (isAgent(socket)) { + // `socket` is actually an `http.Agent` instance, so + // relinquish responsibility for this `req` to the Agent + // from here on + debug('Callback returned another Agent instance %o', socket.constructor.name); + socket.addRequest(req, opts); + return; + } + if (socket) { + socket.once('free', () => { + this.freeSocket(socket, opts); + }); + req.onSocket(socket); + return; + } + const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); + onerror(err); + }; + if (typeof this.callback !== 'function') { + onerror(new Error('`callback` is not defined')); + return; + } + if (!this.promisifiedCallback) { + if (this.callback.length >= 3) { + debug('Converting legacy callback function to promise'); + this.promisifiedCallback = promisify_1.default(this.callback); + } + else { + this.promisifiedCallback = this.callback; + } + } + if (typeof timeoutMs === 'number' && timeoutMs > 0) { + timeoutId = setTimeout(ontimeout, timeoutMs); + } + if ('port' in opts && typeof opts.port !== 'number') { + opts.port = Number(opts.port); + } + try { + debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); + Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); + } + catch (err) { + Promise.reject(err).catch(callbackError); } } + freeSocket(socket, opts) { + debug('Freeing socket %o %o', socket.constructor.name, opts); + socket.destroy(); + } + destroy() { + debug('Destroying agent %o', this.constructor.name); + } + } + createAgent.Agent = Agent; + // So that `instanceof` works correctly + createAgent.prototype = createAgent.Agent.prototype; +})(createAgent || (createAgent = {})); +module.exports = createAgent; +//# sourceMappingURL=index.js.map - percDown(index) { - let l; +/***/ }), - while ((l=leftChi(index)) < this.heap.length) { - if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { - l = l+1; - } +/***/ 98067: +/***/ ((__unused_webpack_module, exports) => { - if (smaller(this.heap[index], this.heap[l])) { - break; +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +function promisify(fn) { + return function (req, opts) { + return new Promise((resolve, reject) => { + fn.call(this, req, opts, (err, rtn) => { + if (err) { + reject(err); + } + else { + resolve(rtn); } + }); + }); + }; +} +exports["default"] = promisify; +//# sourceMappingURL=promisify.js.map - let t = this.heap[index]; - this.heap[index] = this.heap[l]; - this.heap[l] = t; +/***/ }), - index = l; - } - } +/***/ 38816: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length-1); - } +/** + * archiver-utils + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-archiver/blob/master/LICENSE-MIT + */ +var fs = __nccwpck_require__(35744); +var path = __nccwpck_require__(16928); - unshift(node) { - return this.heap.push(node); - } +var flatten = __nccwpck_require__(97047); +var difference = __nccwpck_require__(57294); +var union = __nccwpck_require__(73270); +var isPlainObject = __nccwpck_require__(36542); - shift() { - let [top] = this.heap; +var glob = __nccwpck_require__(21363); - this.heap[0] = this.heap[this.heap.length-1]; - this.heap.pop(); - this.percDown(0); +var file = module.exports = {}; - return top; - } +var pathSeparatorRe = /[\/\\]/g; - toArray() { - return [...this]; - } +// Process specified wildcard glob patterns or filenames against a +// callback, excluding and uniquing files in the result set. +var processPatterns = function(patterns, fn) { + // Filepaths to return. + var result = []; + // Iterate over flattened patterns array. + flatten(patterns).forEach(function(pattern) { + // If the first character is ! it should be omitted + var exclusion = pattern.indexOf('!') === 0; + // If the pattern is an exclusion, remove the ! + if (exclusion) { pattern = pattern.slice(1); } + // Find all matching files for this pattern. + var matches = fn(pattern); + if (exclusion) { + // If an exclusion, remove matching files. + result = difference(result, matches); + } else { + // Otherwise add matching files. + result = union(result, matches); + } + }); + return result; +}; - *[Symbol.iterator] () { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } +// True if the file path exists. +file.exists = function() { + var filepath = path.join.apply(path, arguments); + return fs.existsSync(filepath); +}; - remove (testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } +// Return an array of all file paths that match the given wildcard patterns. +file.expand = function(...args) { + // If the first argument is an options object, save those options to pass + // into the File.prototype.glob.sync method. + var options = isPlainObject(args[0]) ? args.shift() : {}; + // Use the first argument if it's an Array, otherwise convert the arguments + // object to an array and use that. + var patterns = Array.isArray(args[0]) ? args[0] : args; + // Return empty set if there are no patterns or filepaths. + if (patterns.length === 0) { return []; } + // Return all matching filepaths. + var matches = processPatterns(patterns, function(pattern) { + // Find all matching files for this pattern. + return glob.sync(pattern, options); + }); + // Filter result set? + if (options.filter) { + matches = matches.filter(function(filepath) { + filepath = path.join(options.cwd || '', filepath); + try { + if (typeof options.filter === 'function') { + return options.filter(filepath); + } else { + // If the file is of the right type and exists, this should work. + return fs.statSync(filepath)[options.filter](); + } + } catch(e) { + // Otherwise, it's probably not the right type. + return false; + } + }); + } + return matches; +}; - this.heap.splice(j); +// Build a multi task "files" object dynamically. +file.expandMapping = function(patterns, destBase, options) { + options = Object.assign({ + rename: function(destBase, destPath) { + return path.join(destBase || '', destPath); + } + }, options); + var files = []; + var fileByDest = {}; + // Find all files matching pattern, using passed-in options. + file.expand(options, patterns).forEach(function(src) { + var destPath = src; + // Flatten? + if (options.flatten) { + destPath = path.basename(destPath); + } + // Change the extension? + if (options.ext) { + destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); + } + // Generate destination filename. + var dest = options.rename(destBase, destPath, options); + // Prepend cwd to src path if necessary. + if (options.cwd) { src = path.join(options.cwd, src); } + // Normalize filepaths to be unix-style. + dest = dest.replace(pathSeparatorRe, '/'); + src = src.replace(pathSeparatorRe, '/'); + // Map correct src path to dest path. + if (fileByDest[dest]) { + // If dest already exists, push this src onto that dest's src array. + fileByDest[dest].src.push(src); + } else { + // Otherwise create a new src-dest file mapping object. + files.push({ + src: [src], + dest: dest, + }); + // And store a reference for later use. + fileByDest[dest] = files[files.length - 1]; + } + }); + return files; +}; - for (let i = parent(this.heap.length-1); i >= 0; i--) { - this.percDown(i); - } +// reusing bits of grunt's multi-task source normalization +file.normalizeFilesArray = function(data) { + var files = []; - return this; - } + data.forEach(function(obj) { + var prop; + if ('src' in obj || 'dest' in obj) { + files.push(obj); } + }); - function leftChi(i) { - return (i<<1)+1; + if (files.length === 0) { + return []; + } + + files = _(files).chain().forEach(function(obj) { + if (!('src' in obj) || !obj.src) { return; } + // Normalize .src properties to flattened array. + if (Array.isArray(obj.src)) { + obj.src = flatten(obj.src); + } else { + obj.src = [obj.src]; } + }).map(function(obj) { + // Build options object, removing unwanted properties. + var expandOptions = Object.assign({}, obj); + delete expandOptions.src; + delete expandOptions.dest; - function parent(i) { - return ((i+1)>>1)-1; + // Expand file mappings. + if (obj.expand) { + return file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) { + // Copy obj properties to result. + var result = Object.assign({}, obj); + // Make a clone of the orig obj available. + result.orig = Object.assign({}, obj); + // Set .src and .dest, processing both as templates. + result.src = mapObj.src; + result.dest = mapObj.dest; + // Remove unwanted properties. + ['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) { + delete result[prop]; + }); + return result; + }); } - function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } - else { - return x.pushCount < y.pushCount; + // Copy obj properties to result, adding an .orig property. + var result = Object.assign({}, obj); + // Make a clone of the orig obj available. + result.orig = Object.assign({}, obj); + + if ('src' in result) { + // Expose an expand-on-demand getter method as .src. + Object.defineProperty(result, 'src', { + enumerable: true, + get: function fn() { + var src; + if (!('result' in fn)) { + src = obj.src; + // If src is an array, flatten it. Otherwise, make it into an array. + src = Array.isArray(src) ? flatten(src) : [src]; + // Expand src files, memoizing result. + fn.result = file.expand(expandOptions, src); + } + return fn.result; } + }); } - /** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, - * except this returns a promise that rejects if an error occurs. - * * The `unshift` and `unshiftAsync` methods were removed. - */ - function priorityQueue(worker, concurrency) { - // Start with a normal queue - var q = queue(worker, concurrency); + if ('dest' in result) { + result.dest = obj.dest; + } - var { - push, - pushAsync - } = q; + return result; + }).flatten().value(); + + return files; +}; + + +/***/ }), + +/***/ 53296: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * archiver-utils + * + * Copyright (c) 2015 Chris Talkington. + * Licensed under the MIT license. + * https://github.com/archiverjs/archiver-utils/blob/master/LICENSE + */ +var fs = __nccwpck_require__(35744); +var path = __nccwpck_require__(16928); +var isStream = __nccwpck_require__(96543); +var lazystream = __nccwpck_require__(32126); +var normalizePath = __nccwpck_require__(56133); +var defaults = __nccwpck_require__(7511); + +var Stream = (__nccwpck_require__(2203).Stream); +var PassThrough = (__nccwpck_require__(29963).PassThrough); + +var utils = module.exports = {}; +utils.file = __nccwpck_require__(38816); + +utils.collectStream = function(source, callback) { + var collection = []; + var size = 0; + + source.on('error', callback); + + source.on('data', function(chunk) { + collection.push(chunk); + size += chunk.length; + }); + + source.on('end', function() { + var buf = Buffer.alloc(size); + var offset = 0; + + collection.forEach(function(data) { + data.copy(buf, offset); + offset += data.length; + }); + + callback(null, buf); + }); +}; - q._tasks = new Heap(); - q._createTaskItem = ({data, priority}, callback) => { - return { - data, - priority, - callback - }; - }; +utils.dateify = function(dateish) { + dateish = dateish || new Date(); - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return {data: tasks, priority}; - } - return tasks.map(data => { return {data, priority}; }); - } + if (dateish instanceof Date) { + dateish = dateish; + } else if (typeof dateish === 'string') { + dateish = new Date(dateish); + } else { + dateish = new Date(); + } - // Override push to accept second parameter representing priority - q.push = function(data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; + return dateish; +}; - q.pushAsync = function(data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; +// this is slightly different from lodash version +utils.defaults = function(object, source, guard) { + var args = arguments; + args[0] = args[0] || {}; - // Remove unshift functions - delete q.unshift; - delete q.unshiftAsync; + return defaults(...args); +}; - return q; - } +utils.isStream = function(source) { + return isStream(source); +}; - /** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ - function race(tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } - } +utils.lazyReadStream = function(filepath) { + return new lazystream.Readable(function() { + return fs.createReadStream(filepath); + }); +}; - var race$1 = awaitify(race, 2); +utils.normalizeInputSource = function(source) { + if (source === null) { + return Buffer.alloc(0); + } else if (typeof source === 'string') { + return Buffer.from(source); + } else if (utils.isStream(source)) { + // Always pipe through a PassThrough stream to guarantee pausing the stream if it's already flowing, + // since it will only be processed in a (distant) future iteration of the event loop, and will lose + // data if already flowing now. + return source.pipe(new PassThrough()); + } - /** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function reduceRight (array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return reduce$1(reversed, memo, iteratee, callback); - } + return source; +}; - /** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ - function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push((error, ...cbArgs) => { - let retVal = {}; - if (error) { - retVal.error = error; - } - if (cbArgs.length > 0){ - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); +utils.sanitizePath = function(filepath) { + return normalizePath(filepath, false).replace(/^\w+:/, '').replace(/^(\.\.\/|\/)+/, ''); +}; - return _fn.apply(this, args); - }); - } +utils.trailingSlashIt = function(str) { + return str.slice(-1) !== '/' ? str + '/' : str; +}; - /** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ - function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(reflect); - } else { - results = {}; - Object.keys(tasks).forEach(key => { - results[key] = reflect.call(this, tasks[key]); - }); - } - return results; - } +utils.unixifyPath = function(filepath) { + return normalizePath(filepath, false).replace(/^\w+:/, ''); +}; - function reject$2(eachfn, arr, _iteratee, callback) { - const iteratee = wrapAsync(_iteratee); - return _filter(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); - } +utils.walkdir = function(dirpath, base, callback) { + var results = []; - /** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.reject(fileList, fileExists, function(err, results) { - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }); - * - * // Using Promises - * async.reject(fileList, fileExists) - * .then( results => { - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.reject(fileList, fileExists); - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function reject (coll, iteratee, callback) { - return reject$2(eachOf$1, coll, iteratee, callback) - } - var reject$1 = awaitify(reject, 3); + if (typeof base === 'function') { + callback = base; + base = dirpath; + } - /** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function rejectLimit (coll, limit, iteratee, callback) { - return reject$2(eachOfLimit$2(limit), coll, iteratee, callback) - } - var rejectLimit$1 = awaitify(rejectLimit, 4); + fs.readdir(dirpath, function(err, list) { + var i = 0; + var file; + var filepath; - /** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function rejectSeries (coll, iteratee, callback) { - return reject$2(eachOfSeries$1, coll, iteratee, callback) + if (err) { + return callback(err); } - var rejectSeries$1 = awaitify(rejectSeries, 3); - function constant(value) { - return function () { - return value; - } - } + (function next() { + file = list[i++]; - /** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * @returns {Promise} a promise if no callback provided - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ - const DEFAULT_TIMES = 5; - const DEFAULT_INTERVAL = 0; + if (!file) { + return callback(null, results); + } + + filepath = path.join(dirpath, file); - function retry(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant(DEFAULT_INTERVAL) - }; + fs.stat(filepath, function(err, stats) { + results.push({ + path: filepath, + relative: path.relative(base, filepath).replace(/\\/g, '/'), + stats: stats + }); - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || promiseCallback(); - task = opts; + if (stats && stats.isDirectory()) { + utils.walkdir(filepath, base, function(err, res) { + if(err){ + return callback(err); + } + + res.forEach(function(dirEntry) { + results.push(dirEntry); + }); + + next(); + }); } else { - parseTimes(options, opts); - callback = callback || promiseCallback(); + next(); } + }); + })(); + }); +}; - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - var _task = wrapAsync(task); +/***/ }), - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } +/***/ 99392: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - retryAttempt(); - return callback[PROMISE_SYMBOL] - } +/** + * Archiver Vending + * + * @ignore + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var Archiver = __nccwpck_require__(50549); - function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; +var formats = {}; - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant(+t.interval || DEFAULT_INTERVAL); +/** + * Dispenses a new Archiver instance. + * + * @constructor + * @param {String} format The archive format to use. + * @param {Object} options See [Archiver]{@link Archiver} + * @return {Archiver} + */ +var vending = function(format, options) { + return vending.create(format, options); +}; - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } - } +/** + * Creates a new Archiver instance. + * + * @param {String} format The archive format to use. + * @param {Object} options See [Archiver]{@link Archiver} + * @return {Archiver} + */ +vending.create = function(format, options) { + if (formats[format]) { + var instance = new Archiver(format, options); + instance.setFormat(format); + instance.setModule(new formats[format](options)); - /** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry`, except for a `opts.arity` that - * is the arity of the `task` function, defaulting to `task.length` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ - function retryable (opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = (opts && opts.arity) || task.length; - if (isAsync(task)) { - arity += 1; - } - var _task = wrapAsync(task); - return initialParams((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = promiseCallback(); - } - function taskFn(cb) { - _task(...args, cb); - } + return instance; + } else { + throw new Error('create(' + format + '): format not registered'); + } +}; - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); +/** + * Registers a format for use with archiver. + * + * @param {String} format The name of the format. + * @param {Function} module The function for archiver to interact with. + * @return void + */ +vending.registerFormat = function(format, module) { + if (formats[format]) { + throw new Error('register(' + format + '): format already registered'); + } - return callback[PROMISE_SYMBOL] - }); - } + if (typeof module !== 'function') { + throw new Error('register(' + format + '): format module invalid'); + } - /** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @return {Promise} a promise, if no callback is passed - * @example - * - * //Using Callbacks - * async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] - * }); - * - * // an example using objects instead of arrays - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.series([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function series(tasks, callback) { - return _parallel(eachOfSeries$1, tasks, callback); - } + if (typeof module.prototype.append !== 'function' || typeof module.prototype.finalize !== 'function') { + throw new Error('register(' + format + '): format module missing methods'); + } - /** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function some(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) + formats[format] = module; +}; + +/** + * Check if the format is already registered. + * + * @param {String} format the name of the format. + * @return boolean + */ +vending.isRegisteredFormat = function (format) { + if (formats[format]) { + return true; + } + + return false; +}; + +vending.registerFormat('zip', __nccwpck_require__(22836)); +vending.registerFormat('tar', __nccwpck_require__(10396)); +vending.registerFormat('json', __nccwpck_require__(54693)); + +module.exports = vending; + +/***/ }), + +/***/ 50549: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * Archiver Core + * + * @ignore + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var fs = __nccwpck_require__(79896); +var glob = __nccwpck_require__(51364); +var async = __nccwpck_require__(97329); +var path = __nccwpck_require__(16928); +var util = __nccwpck_require__(53296); + +var inherits = (__nccwpck_require__(39023).inherits); +var ArchiverError = __nccwpck_require__(13110); +var Transform = (__nccwpck_require__(29963).Transform); + +var win32 = process.platform === 'win32'; + +/** + * @constructor + * @param {String} format The archive format to use. + * @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}. + */ +var Archiver = function(format, options) { + if (!(this instanceof Archiver)) { + return new Archiver(format, options); + } + + if (typeof format !== 'string') { + options = format; + format = 'zip'; + } + + options = this.options = util.defaults(options, { + highWaterMark: 1024 * 1024, + statConcurrency: 4 + }); + + Transform.call(this, options); + + this._format = false; + this._module = false; + this._pending = 0; + this._pointer = 0; + + this._entriesCount = 0; + this._entriesProcessedCount = 0; + this._fsEntriesTotalBytes = 0; + this._fsEntriesProcessedBytes = 0; + + this._queue = async.queue(this._onQueueTask.bind(this), 1); + this._queue.drain(this._onQueueDrain.bind(this)); + + this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency); + this._statQueue.drain(this._onQueueDrain.bind(this)); + + this._state = { + aborted: false, + finalize: false, + finalizing: false, + finalized: false, + modulePiped: false + }; + + this._streams = []; +}; + +inherits(Archiver, Transform); + +/** + * Internal logic for `abort`. + * + * @private + * @return void + */ +Archiver.prototype._abort = function() { + this._state.aborted = true; + this._queue.kill(); + this._statQueue.kill(); + + if (this._queue.idle()) { + this._shutdown(); + } +}; + +/** + * Internal helper for appending files. + * + * @private + * @param {String} filepath The source filepath. + * @param {EntryData} data The entry data. + * @return void + */ +Archiver.prototype._append = function(filepath, data) { + data = data || {}; + + var task = { + source: null, + filepath: filepath + }; + + if (!data.name) { + data.name = filepath; + } + + data.sourcePath = filepath; + task.data = data; + this._entriesCount++; + + if (data.stats && data.stats instanceof fs.Stats) { + task = this._updateQueueTaskWithStats(task, data.stats); + if (task) { + if (data.stats.size) { + this._fsEntriesTotalBytes += data.stats.size; + } + + this._queue.push(task); } - var some$1 = awaitify(some, 3); + } else { + this._statQueue.push(task); + } +}; - /** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function someLimit(coll, limit, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback) +/** + * Internal logic for `finalize`. + * + * @private + * @return void + */ +Archiver.prototype._finalize = function() { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + return; + } + + this._state.finalizing = true; + + this._moduleFinalize(); + + this._state.finalizing = false; + this._state.finalized = true; +}; + +/** + * Checks the various state variables to determine if we can `finalize`. + * + * @private + * @return {Boolean} + */ +Archiver.prototype._maybeFinalize = function() { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + return false; + } + + if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { + this._finalize(); + return true; + } + + return false; +}; + +/** + * Appends an entry to the module. + * + * @private + * @fires Archiver#entry + * @param {(Buffer|Stream)} source + * @param {EntryData} data + * @param {Function} callback + * @return void + */ +Archiver.prototype._moduleAppend = function(source, data, callback) { + if (this._state.aborted) { + callback(); + return; + } + + this._module.append(source, data, function(err) { + this._task = null; + + if (this._state.aborted) { + this._shutdown(); + return; } - var someLimit$1 = awaitify(someLimit, 4); - /** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function someSeries(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) + if (err) { + this.emit('error', err); + setImmediate(callback); + return; } - var someSeries$1 = awaitify(someSeries, 3); /** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @returns {Promise} a promise, if no callback passed - * @example - * - * // bigfile.txt is a file that is 251100 bytes in size - * // mediumfile.txt is a file that is 11000 bytes in size - * // smallfile.txt is a file that is 121 bytes in size - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) return callback(getFileSizeErr); - * callback(null, fileSize); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // descending order - * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) { - * return callback(getFileSizeErr); - * } - * callback(null, fileSize * -1); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] - * } - * } - * ); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * } - * ); - * - * // Using Promises - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * (async () => { - * try { - * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * // Error handling - * async () => { - * try { - * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } + * Fires when the entry's input has been processed and appended to the archive. * + * @event Archiver#entry + * @type {EntryData} */ - function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return map$1(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, {value: x, criteria}); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map(v => v.value)); - }); + this.emit('entry', data); + this._entriesProcessedCount++; - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } + if (data.stats && data.stats.size) { + this._fsEntriesProcessedBytes += data.stats.size; } - var sortBy$1 = awaitify(sortBy, 3); /** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); + * @event Archiver#progress + * @type {ProgressData} */ - function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); + this.emit('progress', { + entries: { + total: this._entriesCount, + processed: this._entriesProcessedCount + }, + fs: { + totalBytes: this._fsEntriesTotalBytes, + processedBytes: this._fsEntriesProcessedBytes + } + }); - return initialParams((args, callback) => { - var timedOut = false; - var timer; + setImmediate(callback); + }.bind(this)); +}; - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } +/** + * Finalizes the module. + * + * @private + * @return void + */ +Archiver.prototype._moduleFinalize = function() { + if (typeof this._module.finalize === 'function') { + this._module.finalize(); + } else if (typeof this._module.end === 'function') { + this._module.end(); + } else { + this.emit('error', new ArchiverError('NOENDMETHOD')); + } +}; - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); +/** + * Pipes the module to our internal stream with error bubbling. + * + * @private + * @return void + */ +Archiver.prototype._modulePipe = function() { + this._module.on('error', this._onModuleError.bind(this)); + this._module.pipe(this); + this._state.modulePiped = true; +}; + +/** + * Determines if the current module supports a defined feature. + * + * @private + * @param {String} key + * @return {Boolean} + */ +Archiver.prototype._moduleSupports = function(key) { + if (!this._module.supports || !this._module.supports[key]) { + return false; + } + + return this._module.supports[key]; +}; + +/** + * Unpipes the module from our internal stream. + * + * @private + * @return void + */ +Archiver.prototype._moduleUnpipe = function() { + this._module.unpipe(this); + this._state.modulePiped = false; +}; + +/** + * Normalizes entry data with fallbacks for key properties. + * + * @private + * @param {Object} data + * @param {fs.Stats} stats + * @return {Object} + */ +Archiver.prototype._normalizeEntryData = function(data, stats) { + data = util.defaults(data, { + type: 'file', + name: null, + date: null, + mode: null, + prefix: null, + sourcePath: null, + stats: false + }); + + if (stats && data.stats === false) { + data.stats = stats; + } + + var isDir = data.type === 'directory'; - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); + if (data.name) { + if (typeof data.prefix === 'string' && '' !== data.prefix) { + data.name = data.prefix + '/' + data.name; + data.prefix = null; } - function range(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; + data.name = util.sanitizePath(data.name); + + if (data.type !== 'symlink' && data.name.slice(-1) === '/') { + isDir = true; + data.type = 'directory'; + } else if (isDir) { + data.name += '/'; } + } - /** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ - function timesLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(range(count), limit, _iteratee, callback); + // 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644 + if (typeof data.mode === 'number') { + if (win32) { + data.mode &= 511; + } else { + data.mode &= 4095 + } + } else if (data.stats && data.mode === null) { + if (win32) { + data.mode = data.stats.mode & 511; + } else { + data.mode = data.stats.mode & 4095; } - /** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ - function times (n, iteratee, callback) { - return timesLimit(n, Infinity, iteratee, callback) + // stat isn't reliable on windows; force 0755 for dir + if (win32 && isDir) { + data.mode = 493; } + } else if (data.mode === null) { + data.mode = isDir ? 493 : 420; + } - /** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ - function timesSeries (n, iteratee, callback) { - return timesLimit(n, 1, iteratee, callback) + if (data.stats && data.date === null) { + data.date = data.stats.mtime; + } else { + data.date = util.dateify(data.date); + } + + return data; +}; + +/** + * Error listener that re-emits error on to our internal stream. + * + * @private + * @param {Error} err + * @return void + */ +Archiver.prototype._onModuleError = function(err) { + /** + * @event Archiver#error + * @type {ErrorData} + */ + this.emit('error', err); +}; + +/** + * Checks the various state variables after queue has drained to determine if + * we need to `finalize`. + * + * @private + * @return void + */ +Archiver.prototype._onQueueDrain = function() { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + return; + } + + if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { + this._finalize(); + } +}; + +/** + * Appends each queue task to the module. + * + * @private + * @param {Object} task + * @param {Function} callback + * @return void + */ +Archiver.prototype._onQueueTask = function(task, callback) { + var fullCallback = () => { + if(task.data.callback) { + task.data.callback(); } + callback(); + } - /** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in parallel, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileList, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * }); - * - * // Using Promises - * async.transform(fileList, transformFileSize) - * .then(result => { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * (async () => { - * try { - * let result = await async.transform(fileList, transformFileSize); - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileMap, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * }); - * - * // Using Promises - * async.transform(fileMap, transformFileSize) - * .then(result => { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.transform(fileMap, transformFileSize); - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === 'function') { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = once(callback || promiseCallback()); - var _iteratee = wrapAsync(iteratee); + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + fullCallback(); + return; + } - eachOf$1(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, err => callback(err, accumulator)); - return callback[PROMISE_SYMBOL] + this._task = task; + this._moduleAppend(task.source, task.data, fullCallback); +}; + +/** + * Performs a file stat and reinjects the task back into the queue. + * + * @private + * @param {Object} task + * @param {Function} callback + * @return void + */ +Archiver.prototype._onStatQueueTask = function(task, callback) { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + callback(); + return; + } + + fs.lstat(task.filepath, function(err, stats) { + if (this._state.aborted) { + setImmediate(callback); + return; } - /** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ - function tryEach(tasks, callback) { - var error = null; - var result; - return eachSeries$1(tasks, (task, taskCb) => { - wrapAsync(task)((err, ...args) => { - if (err === false) return taskCb(err); + if (err) { + this._entriesCount--; - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error = err; - taskCb(err ? null : {}); - }); - }, () => callback(error, result)); + /** + * @event Archiver#warning + * @type {ErrorData} + */ + this.emit('warning', err); + setImmediate(callback); + return; } - var tryEach$1 = awaitify(tryEach); + task = this._updateQueueTaskWithStats(task, stats); - /** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ - function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; + if (task) { + if (stats.size) { + this._fsEntriesTotalBytes += stats.size; + } + + this._queue.push(task); } - /** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ - function whilst(test, iteratee, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results = []; + setImmediate(callback); + }.bind(this)); +}; + +/** + * Unpipes the module and ends our internal stream. + * + * @private + * @return void + */ +Archiver.prototype._shutdown = function() { + this._moduleUnpipe(); + this.end(); +}; + +/** + * Tracks the bytes emitted by our internal stream. + * + * @private + * @param {Buffer} chunk + * @param {String} encoding + * @param {Function} callback + * @return void + */ +Archiver.prototype._transform = function(chunk, encoding, callback) { + if (chunk) { + this._pointer += chunk.length; + } + + callback(null, chunk); +}; + +/** + * Updates and normalizes a queue task using stats data. + * + * @private + * @param {Object} task + * @param {fs.Stats} stats + * @return {Object} + */ +Archiver.prototype._updateQueueTaskWithStats = function(task, stats) { + if (stats.isFile()) { + task.data.type = 'file'; + task.data.sourceType = 'stream'; + task.source = util.lazyReadStream(task.filepath); + } else if (stats.isDirectory() && this._moduleSupports('directory')) { + task.data.name = util.trailingSlashIt(task.data.name); + task.data.type = 'directory'; + task.data.sourcePath = util.trailingSlashIt(task.filepath); + task.data.sourceType = 'buffer'; + task.source = Buffer.concat([]); + } else if (stats.isSymbolicLink() && this._moduleSupports('symlink')) { + var linkPath = fs.readlinkSync(task.filepath); + var dirName = path.dirname(task.filepath); + task.data.type = 'symlink'; + task.data.linkname = path.relative(dirName, path.resolve(dirName, linkPath)); + task.data.sourceType = 'buffer'; + task.source = Buffer.concat([]); + } else { + if (stats.isDirectory()) { + this.emit('warning', new ArchiverError('DIRECTORYNOTSUPPORTED', task.data)); + } else if (stats.isSymbolicLink()) { + this.emit('warning', new ArchiverError('SYMLINKNOTSUPPORTED', task.data)); + } else { + this.emit('warning', new ArchiverError('ENTRYNOTSUPPORTED', task.data)); + } - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } + return null; + } - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } + task.data = this._normalizeEntryData(task.data, stats); - return _test(check); - } - var whilst$1 = awaitify(whilst, 3); + return task; +}; - /** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * const results = [] - * let finished = false - * async.until(function test(cb) { - * cb(null, finished) - * }, function iter(next) { - * fetchPage(url, (err, body) => { - * if (err) return next(err) - * results = results.concat(body.objects) - * finished = !!body.next - * next(err) - * }) - * }, function done (err) { - * // all pages have been fetched - * }) - */ - function until(test, iteratee, callback) { - const _test = wrapAsync(test); - return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); - } +/** + * Aborts the archiving process, taking a best-effort approach, by: + * + * - removing any pending queue tasks + * - allowing any active queue workers to finish + * - detaching internal module pipes + * - ending both sides of the Transform stream + * + * It will NOT drain any remaining sources. + * + * @return {this} + */ +Archiver.prototype.abort = function() { + if (this._state.aborted || this._state.finalized) { + return this; + } - /** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ - function waterfall (tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; + this._abort(); - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - task(...args, onlyOnce(next)); - } + return this; +}; - function next(err, ...args) { - if (err === false) return - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } +/** + * Appends an input source (text string, buffer, or stream) to the instance. + * + * When the instance has received, processed, and emitted the input, the `entry` + * event is fired. + * + * @fires Archiver#entry + * @param {(Buffer|Stream|String)} source The input source. + * @param {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}. + * @return {this} + */ +Archiver.prototype.append = function(source, data) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; + } - nextTask([]); - } + data = this._normalizeEntryData(data); - var waterfall$1 = awaitify(waterfall); + if (typeof data.name !== 'string' || data.name.length === 0) { + this.emit('error', new ArchiverError('ENTRYNAMEREQUIRED')); + return this; + } - /** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ + if (data.type === 'directory' && !this._moduleSupports('directory')) { + this.emit('error', new ArchiverError('DIRECTORYNOTSUPPORTED', { name: data.name })); + return this; + } + source = util.normalizeInputSource(source); - var index = { - apply, - applyEach, - applyEachSeries, - asyncify, - auto, - autoInject, - cargo: cargo$1, - cargoQueue: cargo, - compose, - concat: concat$1, - concatLimit: concatLimit$1, - concatSeries: concatSeries$1, - constant: constant$1, - detect: detect$1, - detectLimit: detectLimit$1, - detectSeries: detectSeries$1, - dir, - doUntil, - doWhilst: doWhilst$1, - each, - eachLimit: eachLimit$1, - eachOf: eachOf$1, - eachOfLimit: eachOfLimit$1, - eachOfSeries: eachOfSeries$1, - eachSeries: eachSeries$1, - ensureAsync, - every: every$1, - everyLimit: everyLimit$1, - everySeries: everySeries$1, - filter: filter$1, - filterLimit: filterLimit$1, - filterSeries: filterSeries$1, - forever: forever$1, - groupBy, - groupByLimit: groupByLimit$1, - groupBySeries, - log, - map: map$1, - mapLimit: mapLimit$1, - mapSeries: mapSeries$1, - mapValues, - mapValuesLimit: mapValuesLimit$1, - mapValuesSeries, - memoize, - nextTick, - parallel, - parallelLimit, - priorityQueue, - queue, - race: race$1, - reduce: reduce$1, - reduceRight, - reflect, - reflectAll, - reject: reject$1, - rejectLimit: rejectLimit$1, - rejectSeries: rejectSeries$1, - retry, - retryable, - seq, - series, - setImmediate: setImmediate$1, - some: some$1, - someLimit: someLimit$1, - someSeries: someSeries$1, - sortBy: sortBy$1, - timeout, - times, - timesLimit, - timesSeries, - transform, - tryEach: tryEach$1, - unmemoize, - until, - waterfall: waterfall$1, - whilst: whilst$1, + if (Buffer.isBuffer(source)) { + data.sourceType = 'buffer'; + } else if (util.isStream(source)) { + data.sourceType = 'stream'; + } else { + this.emit('error', new ArchiverError('INPUTSTEAMBUFFERREQUIRED', { name: data.name })); + return this; + } - // aliases - all: every$1, - allLimit: everyLimit$1, - allSeries: everySeries$1, - any: some$1, - anyLimit: someLimit$1, - anySeries: someSeries$1, - find: detect$1, - findLimit: detectLimit$1, - findSeries: detectSeries$1, - flatMap: concat$1, - flatMapLimit: concatLimit$1, - flatMapSeries: concatSeries$1, - forEach: each, - forEachSeries: eachSeries$1, - forEachLimit: eachLimit$1, - forEachOf: eachOf$1, - forEachOfSeries: eachOfSeries$1, - forEachOfLimit: eachOfLimit$1, - inject: reduce$1, - foldl: reduce$1, - foldr: reduceRight, - select: filter$1, - selectLimit: filterLimit$1, - selectSeries: filterSeries$1, - wrapSync: asyncify, - during: whilst$1, - doDuring: doWhilst$1 - }; + this._entriesCount++; + this._queue.push({ + data: data, + source: source + }); - exports.all = every$1; - exports.allLimit = everyLimit$1; - exports.allSeries = everySeries$1; - exports.any = some$1; - exports.anyLimit = someLimit$1; - exports.anySeries = someSeries$1; - exports.apply = apply; - exports.applyEach = applyEach; - exports.applyEachSeries = applyEachSeries; - exports.asyncify = asyncify; - exports.auto = auto; - exports.autoInject = autoInject; - exports.cargo = cargo$1; - exports.cargoQueue = cargo; - exports.compose = compose; - exports.concat = concat$1; - exports.concatLimit = concatLimit$1; - exports.concatSeries = concatSeries$1; - exports.constant = constant$1; - exports.default = index; - exports.detect = detect$1; - exports.detectLimit = detectLimit$1; - exports.detectSeries = detectSeries$1; - exports.dir = dir; - exports.doDuring = doWhilst$1; - exports.doUntil = doUntil; - exports.doWhilst = doWhilst$1; - exports.during = whilst$1; - exports.each = each; - exports.eachLimit = eachLimit$1; - exports.eachOf = eachOf$1; - exports.eachOfLimit = eachOfLimit$1; - exports.eachOfSeries = eachOfSeries$1; - exports.eachSeries = eachSeries$1; - exports.ensureAsync = ensureAsync; - exports.every = every$1; - exports.everyLimit = everyLimit$1; - exports.everySeries = everySeries$1; - exports.filter = filter$1; - exports.filterLimit = filterLimit$1; - exports.filterSeries = filterSeries$1; - exports.find = detect$1; - exports.findLimit = detectLimit$1; - exports.findSeries = detectSeries$1; - exports.flatMap = concat$1; - exports.flatMapLimit = concatLimit$1; - exports.flatMapSeries = concatSeries$1; - exports.foldl = reduce$1; - exports.foldr = reduceRight; - exports.forEach = each; - exports.forEachLimit = eachLimit$1; - exports.forEachOf = eachOf$1; - exports.forEachOfLimit = eachOfLimit$1; - exports.forEachOfSeries = eachOfSeries$1; - exports.forEachSeries = eachSeries$1; - exports.forever = forever$1; - exports.groupBy = groupBy; - exports.groupByLimit = groupByLimit$1; - exports.groupBySeries = groupBySeries; - exports.inject = reduce$1; - exports.log = log; - exports.map = map$1; - exports.mapLimit = mapLimit$1; - exports.mapSeries = mapSeries$1; - exports.mapValues = mapValues; - exports.mapValuesLimit = mapValuesLimit$1; - exports.mapValuesSeries = mapValuesSeries; - exports.memoize = memoize; - exports.nextTick = nextTick; - exports.parallel = parallel; - exports.parallelLimit = parallelLimit; - exports.priorityQueue = priorityQueue; - exports.queue = queue; - exports.race = race$1; - exports.reduce = reduce$1; - exports.reduceRight = reduceRight; - exports.reflect = reflect; - exports.reflectAll = reflectAll; - exports.reject = reject$1; - exports.rejectLimit = rejectLimit$1; - exports.rejectSeries = rejectSeries$1; - exports.retry = retry; - exports.retryable = retryable; - exports.select = filter$1; - exports.selectLimit = filterLimit$1; - exports.selectSeries = filterSeries$1; - exports.seq = seq; - exports.series = series; - exports.setImmediate = setImmediate$1; - exports.some = some$1; - exports.someLimit = someLimit$1; - exports.someSeries = someSeries$1; - exports.sortBy = sortBy$1; - exports.timeout = timeout; - exports.times = times; - exports.timesLimit = timesLimit; - exports.timesSeries = timesSeries; - exports.transform = transform; - exports.tryEach = tryEach$1; - exports.unmemoize = unmemoize; - exports.until = until; - exports.waterfall = waterfall$1; - exports.whilst = whilst$1; - exports.wrapSync = asyncify; + return this; +}; - Object.defineProperty(exports, '__esModule', { value: true }); +/** + * Appends a directory and its files, recursively, given its dirpath. + * + * @param {String} dirpath The source directory path. + * @param {String} destpath The destination path within the archive. + * @param {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and + * [TarEntryData]{@link TarEntryData}. + * @return {this} + */ +Archiver.prototype.directory = function(dirpath, destpath, data) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; + } -})); + if (typeof dirpath !== 'string' || dirpath.length === 0) { + this.emit('error', new ArchiverError('DIRECTORYDIRPATHREQUIRED')); + return this; + } + + this._pending++; + + if (destpath === false) { + destpath = ''; + } else if (typeof destpath !== 'string'){ + destpath = dirpath; + } + + var dataFunction = false; + if (typeof data === 'function') { + dataFunction = data; + data = {}; + } else if (typeof data !== 'object') { + data = {}; + } + + var globOptions = { + stat: true, + dot: true + }; + function onGlobEnd() { + this._pending--; + this._maybeFinalize(); + } -/***/ }), + function onGlobError(err) { + this.emit('error', err); + } -/***/ 31324: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + function onGlobMatch(match){ + globber.pause(); -module.exports = -{ - parallel : __nccwpck_require__(83857), - serial : __nccwpck_require__(31054), - serialOrdered : __nccwpck_require__(53961) -}; + var ignoreMatch = false; + var entryData = Object.assign({}, data); + entryData.name = match.relative; + entryData.prefix = destpath; + entryData.stats = match.stat; + entryData.callback = globber.resume.bind(globber); + try { + if (dataFunction) { + entryData = dataFunction(entryData); -/***/ }), + if (entryData === false) { + ignoreMatch = true; + } else if (typeof entryData !== 'object') { + throw new ArchiverError('DIRECTORYFUNCTIONINVALIDDATA', { dirpath: dirpath }); + } + } + } catch(e) { + this.emit('error', e); + return; + } -/***/ 24818: -/***/ ((module) => { + if (ignoreMatch) { + globber.resume(); + return; + } -// API -module.exports = abort; + this._append(match.absolute, entryData); + } -/** - * Aborts leftover active jobs - * - * @param {object} state - current state object - */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); + var globber = glob(dirpath, globOptions); + globber.on('error', onGlobError.bind(this)); + globber.on('match', onGlobMatch.bind(this)); + globber.on('end', onGlobEnd.bind(this)); - // reset leftover jobs - state.jobs = {}; -} + return this; +}; /** - * Cleans up leftover job by invoking abort function for the provided job id + * Appends a file given its filepath using a + * [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to + * prevent issues with open file limits. * - * @this state - * @param {string|number} key - job id to abort + * When the instance has received, processed, and emitted the file, the `entry` + * event is fired. + * + * @param {String} filepath The source filepath. + * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and + * [TarEntryData]{@link TarEntryData}. + * @return {this} */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); +Archiver.prototype.file = function(filepath, data) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; } -} + if (typeof filepath !== 'string' || filepath.length === 0) { + this.emit('error', new ArchiverError('FILEFILEPATHREQUIRED')); + return this; + } -/***/ }), - -/***/ 78452: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var defer = __nccwpck_require__(29200); + this._append(filepath, data); -// API -module.exports = async; + return this; +}; /** - * Runs provided callback asynchronously - * even if callback itself is not + * Appends multiple files that match a glob pattern. * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback + * @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/minimatch} to match. + * @param {Object} options See [node-readdir-glob]{@link https://github.com/yqnn/node-readdir-glob#options}. + * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and + * [TarEntryData]{@link TarEntryData}. + * @return {this} */ -function async(callback) -{ - var isAsync = false; +Archiver.prototype.glob = function(pattern, options, data) { + this._pending++; - // check if async happened - defer(function() { isAsync = true; }); + options = util.defaults(options, { + stat: true, + pattern: pattern + }); - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); - } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); - } - }; -} + function onGlobEnd() { + this._pending--; + this._maybeFinalize(); + } + function onGlobError(err) { + this.emit('error', err); + } -/***/ }), + function onGlobMatch(match){ + globber.pause(); + var entryData = Object.assign({}, data); + entryData.callback = globber.resume.bind(globber); + entryData.stats = match.stat; + entryData.name = match.relative; -/***/ 29200: -/***/ ((module) => { + this._append(match.absolute, entryData); + } -module.exports = defer; + var globber = glob(options.cwd || '.', options); + globber.on('error', onGlobError.bind(this)); + globber.on('match', onGlobMatch.bind(this)); + globber.on('end', onGlobEnd.bind(this)); + + return this; +}; /** - * Runs provided function on next iteration of the event loop + * Finalizes the instance and prevents further appending to the archive + * structure (queue will continue til drained). * - * @param {function} fn - function to run + * The `end`, `close` or `finish` events on the destination stream may fire + * right after calling this method so you should set listeners beforehand to + * properly detect stream completion. + * + * @return {Promise} */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); - - if (nextTick) - { - nextTick(fn); +Archiver.prototype.finalize = function() { + if (this._state.aborted) { + var abortedError = new ArchiverError('ABORTED'); + this.emit('error', abortedError); + return Promise.reject(abortedError); } - else - { - setTimeout(fn, 0); + + if (this._state.finalize) { + var finalizingError = new ArchiverError('FINALIZING'); + this.emit('error', finalizingError); + return Promise.reject(finalizingError); } -} + this._state.finalize = true; -/***/ }), + if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { + this._finalize(); + } -/***/ 24902: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var self = this; -var async = __nccwpck_require__(78452) - , abort = __nccwpck_require__(24818) - ; + return new Promise(function(resolve, reject) { + var errored; -// API -module.exports = iterate; + self._module.on('end', function() { + if (!errored) { + resolve(); + } + }) + + self._module.on('error', function(err) { + errored = true; + reject(err); + }) + }) +}; /** - * Iterates over each job object + * Sets the module format name used for archiving. * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed + * @param {String} format The name of the format. + * @return {this} */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } - - // clean up jobs - delete state.jobs[key]; +Archiver.prototype.setFormat = function(format) { + if (this._format) { + this.emit('error', new ArchiverError('FORMATSET')); + return this; + } - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } + this._format = format; - // return salvaged results - callback(error, state.results); - }); -} + return this; +}; /** - * Runs iterator over provided job element + * Sets the module used for archiving. * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else + * @param {Function} module The function for archiver to interact with. + * @return {this} */ -function runJob(iterator, key, item, callback) -{ - var aborter; - - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); +Archiver.prototype.setModule = function(module) { + if (this._state.aborted) { + this.emit('error', new ArchiverError('ABORTED')); + return this; } - return aborter; -} - - -/***/ }), + if (this._state.module) { + this.emit('error', new ArchiverError('MODULESET')); + return this; + } -/***/ 81721: -/***/ ((module) => { + this._module = module; + this._modulePipe(); -// API -module.exports = state; + return this; +}; /** - * Creates initial state object - * for iteration over list + * Appends a symlink to the instance. * - * @param {array|object} list - list to iterate over - * @param {function|null} sortMethod - function to use for keys sort, - * or `null` to keep them as is - * @returns {object} - initial state object + * This does NOT interact with filesystem and is used for programmatically creating symlinks. + * + * @param {String} filepath The symlink path (within archive). + * @param {String} target The target path (within archive). + * @param {Number} mode Sets the entry permissions. + * @return {this} */ -function state(list, sortMethod) -{ - var isNamedList = !Array.isArray(list) - , initState = - { - index : 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs : {}, - results : isNamedList ? {} : [], - size : isNamedList ? Object.keys(list).length : list.length - } - ; +Archiver.prototype.symlink = function(filepath, target, mode) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; + } - if (sortMethod) - { - // sort array keys based on it's values - // sort object's keys just on own merit - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) - { - return sortMethod(list[a], list[b]); - }); + if (typeof filepath !== 'string' || filepath.length === 0) { + this.emit('error', new ArchiverError('SYMLINKFILEPATHREQUIRED')); + return this; } - return initState; -} + if (typeof target !== 'string' || target.length === 0) { + this.emit('error', new ArchiverError('SYMLINKTARGETREQUIRED', { filepath: filepath })); + return this; + } + if (!this._moduleSupports('symlink')) { + this.emit('error', new ArchiverError('SYMLINKNOTSUPPORTED', { filepath: filepath })); + return this; + } -/***/ }), + var data = {}; + data.type = 'symlink'; + data.name = filepath.replace(/\\/g, '/'); + data.linkname = target.replace(/\\/g, '/'); + data.sourceType = 'buffer'; -/***/ 33351: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (typeof mode === "number") { + data.mode = mode; + } -var abort = __nccwpck_require__(24818) - , async = __nccwpck_require__(78452) - ; + this._entriesCount++; + this._queue.push({ + data: data, + source: Buffer.concat([]) + }); -// API -module.exports = terminator; + return this; +}; /** - * Terminates jobs in the attached state context + * Returns the current length (in bytes) that has been emitted. * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination + * @return {Number} */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } - - // fast forward iteration index - this.index = this.size; - - // abort jobs - abort(this); - - // send back results we have so far - async(callback)(null, this.results); -} - - -/***/ }), - -/***/ 83857: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +Archiver.prototype.pointer = function() { + return this._pointer; +}; -var iterate = __nccwpck_require__(24902) - , initState = __nccwpck_require__(81721) - , terminator = __nccwpck_require__(33351) - ; +/** + * Middleware-like helper that has yet to be fully implemented. + * + * @private + * @param {Function} plugin + * @return {this} + */ +Archiver.prototype.use = function(plugin) { + this._streams.push(plugin); + return this; +}; -// Public API -module.exports = parallel; +module.exports = Archiver; /** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator + * @typedef {Object} CoreOptions + * @global + * @property {Number} [statConcurrency=4] Sets the number of workers used to + * process the internal fs stat queue. */ -function parallel(list, iterator, callback) -{ - var state = initState(list); - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } +/** + * @typedef {Object} TransformOptions + * @property {Boolean} [allowHalfOpen=true] If set to false, then the stream + * will automatically end the readable side when the writable side ends and vice + * versa. + * @property {Boolean} [readableObjectMode=false] Sets objectMode for readable + * side of the stream. Has no effect if objectMode is true. + * @property {Boolean} [writableObjectMode=false] Sets objectMode for writable + * side of the stream. Has no effect if objectMode is true. + * @property {Boolean} [decodeStrings=true] Whether or not to decode strings + * into Buffers before passing them to _write(). `Writable` + * @property {String} [encoding=NULL] If specified, then buffers will be decoded + * to strings using the specified encoding. `Readable` + * @property {Number} [highWaterMark=16kb] The maximum number of bytes to store + * in the internal buffer before ceasing to read from the underlying resource. + * `Readable` `Writable` + * @property {Boolean} [objectMode=false] Whether this stream should behave as a + * stream of objects. Meaning that stream.read(n) returns a single value instead + * of a Buffer of size n. `Readable` `Writable` + */ - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); +/** + * @typedef {Object} EntryData + * @property {String} name Sets the entry name including internal path. + * @property {(String|Date)} [date=NOW()] Sets the entry date. + * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. + * @property {String} [prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + */ - state.index++; - } +/** + * @typedef {Object} ErrorData + * @property {String} message The message of the error. + * @property {String} code The error code assigned to this error. + * @property {String} data Additional data provided for reporting or debugging (where available). + */ - return terminator.bind(state, callback); -} +/** + * @typedef {Object} ProgressData + * @property {Object} entries + * @property {Number} entries.total Number of entries that have been appended. + * @property {Number} entries.processed Number of entries that have been processed. + * @property {Object} fs + * @property {Number} fs.totalBytes Number of bytes that have been appended. Calculated asynchronously and might not be accurate: it growth while entries are added. (based on fs.Stats) + * @property {Number} fs.processedBytes Number of bytes that have been processed. (based on fs.Stats) + */ /***/ }), -/***/ 31054: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var serialOrdered = __nccwpck_require__(53961); - -// Public API -module.exports = serial; +/***/ 13110: +/***/ ((module, exports, __nccwpck_require__) => { /** - * Runs iterator over provided array elements in series + * Archiver Core * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator + * @ignore + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); + +var util = __nccwpck_require__(39023); + +const ERROR_CODES = { + 'ABORTED': 'archive was aborted', + 'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value', + 'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function', + 'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value', + 'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value', + 'FINALIZING': 'archive already finalizing', + 'QUEUECLOSED': 'queue closed', + 'NOENDMETHOD': 'no suitable finalize/end method defined by module', + 'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module', + 'FORMATSET': 'archive format already set', + 'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance', + 'MODULESET': 'module already set', + 'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module', + 'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value', + 'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value', + 'ENTRYNOTSUPPORTED': 'entry not supported' +}; + +function ArchiverError(code, data) { + Error.captureStackTrace(this, this.constructor); + //this.name = this.constructor.name; + this.message = ERROR_CODES[code] || code; + this.code = code; + this.data = data; } +util.inherits(ArchiverError, Error); + +exports = module.exports = ArchiverError; /***/ }), -/***/ 53961: +/***/ 54693: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var iterate = __nccwpck_require__(24902) - , initState = __nccwpck_require__(81721) - , terminator = __nccwpck_require__(33351) - ; +/** + * JSON Format Plugin + * + * @module plugins/json + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var inherits = (__nccwpck_require__(39023).inherits); +var Transform = (__nccwpck_require__(29963).Transform); -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; +var crc32 = __nccwpck_require__(84928); +var util = __nccwpck_require__(53296); /** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator + * @constructor + * @param {(JsonOptions|TransformOptions)} options */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); +var Json = function(options) { + if (!(this instanceof Json)) { + return new Json(options); + } - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; - } + options = this.options = util.defaults(options, {}); - state.index++; + Transform.call(this, options); - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; - } + this.supports = { + directory: true, + symlink: true + }; - // done here - callback(null, state.results); - }); + this.files = []; +}; - return terminator.bind(state, callback); -} +inherits(Json, Transform); -/* - * -- Sort methods +/** + * [_transform description] + * + * @private + * @param {Buffer} chunk + * @param {String} encoding + * @param {Function} callback + * @return void */ +Json.prototype._transform = function(chunk, encoding, callback) { + callback(null, chunk); +}; /** - * sort helper to sort array elements in ascending order + * [_writeStringified description] * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result + * @private + * @return void */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} +Json.prototype._writeStringified = function() { + var fileString = JSON.stringify(this.files); + this.write(fileString); +}; /** - * sort helper to sort array elements in descending order + * [append description] * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result + * @param {(Buffer|Stream)} source + * @param {EntryData} data + * @param {Function} callback + * @return void */ -function descending(a, b) -{ - return -1 * ascending(a, b); -} - - -/***/ }), - -/***/ 59380: -/***/ ((module) => { - -"use strict"; - -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} +Json.prototype.append = function(source, data, callback) { + var self = this; -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; + data.crc32 = 0; - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; + function onend(err, sourceBuffer) { + if (err) { + callback(err); + return; } - begs = []; - left = str.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } + data.size = sourceBuffer.length || 0; + data.crc32 = crc32.unsigned(sourceBuffer); - bi = str.indexOf(b, i + 1); - } + self.files.push(data); - i = ai < bi && ai >= 0 ? ai : bi; - } + callback(null, data); + } - if (begs.length) { - result = [ left, right ]; - } + if (data.sourceType === 'buffer') { + onend(null, source); + } else if (data.sourceType === 'stream') { + util.collectStream(source, onend); } +}; - return result; -} +/** + * [finalize description] + * + * @return void + */ +Json.prototype.finalize = function() { + this._writeStringified(); + this.end(); +}; + +module.exports = Json; + +/** + * @typedef {Object} JsonOptions + * @global + */ /***/ }), -/***/ 52732: +/***/ 10396: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var register = __nccwpck_require__(11063); -var addHook = __nccwpck_require__(22027); -var removeHook = __nccwpck_require__(59934); +/** + * TAR Format Plugin + * + * @module plugins/tar + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var zlib = __nccwpck_require__(43106); -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind; -var bindable = bind.bind(bind); +var engine = __nccwpck_require__(56118); +var util = __nccwpck_require__(53296); -function bindApi(hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply( - null, - name ? [state, name] : [state] - ); - hook.api = { remove: removeHookRef }; - hook.remove = removeHookRef; - ["before", "error", "after", "wrap"].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind]; - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); +/** + * @constructor + * @param {TarOptions} options + */ +var Tar = function(options) { + if (!(this instanceof Tar)) { + return new Tar(options); + } + + options = this.options = util.defaults(options, { + gzip: false }); -} -function HookSingular() { - var singularHookName = "h"; - var singularHookState = { - registry: {}, - }; - var singularHook = register.bind(null, singularHookState, singularHookName); - bindApi(singularHook, singularHookState, singularHookName); - return singularHook; -} + if (typeof options.gzipOptions !== 'object') { + options.gzipOptions = {}; + } -function HookCollection() { - var state = { - registry: {}, + this.supports = { + directory: true, + symlink: true }; - var hook = register.bind(null, state); - bindApi(hook, state); - - return hook; -} + this.engine = engine.pack(options); + this.compressor = false; -var collectionHookDeprecationMessageDisplayed = false; -function Hook() { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn( - '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' - ); - collectionHookDeprecationMessageDisplayed = true; + if (options.gzip) { + this.compressor = zlib.createGzip(options.gzipOptions); + this.compressor.on('error', this._onCompressorError.bind(this)); } - return HookCollection(); -} +}; -Hook.Singular = HookSingular.bind(); -Hook.Collection = HookCollection.bind(); +/** + * [_onCompressorError description] + * + * @private + * @param {Error} err + * @return void + */ +Tar.prototype._onCompressorError = function(err) { + this.engine.emit('error', err); +}; -module.exports = Hook; -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook; -module.exports.Singular = Hook.Singular; -module.exports.Collection = Hook.Collection; +/** + * [append description] + * + * @param {(Buffer|Stream)} source + * @param {TarEntryData} data + * @param {Function} callback + * @return void + */ +Tar.prototype.append = function(source, data, callback) { + var self = this; + data.mtime = data.date; -/***/ }), + function append(err, sourceBuffer) { + if (err) { + callback(err); + return; + } -/***/ 22027: -/***/ ((module) => { + self.engine.entry(data, sourceBuffer, function(err) { + callback(err, data); + }); + } -module.exports = addHook; + if (data.sourceType === 'buffer') { + append(null, source); + } else if (data.sourceType === 'stream' && data.stats) { + data.size = data.stats.size; -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } + var entry = self.engine.entry(data, function(err) { + callback(err, data); + }); - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; + source.pipe(entry); + } else if (data.sourceType === 'stream') { + util.collectStream(source, append); } +}; - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; - }); - }; +/** + * [finalize description] + * + * @return void + */ +Tar.prototype.finalize = function() { + this.engine.finalize(); +}; + +/** + * [on description] + * + * @return this.engine + */ +Tar.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); +}; + +/** + * [pipe description] + * + * @param {String} destination + * @param {Object} options + * @return this.engine + */ +Tar.prototype.pipe = function(destination, options) { + if (this.compressor) { + return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options); + } else { + return this.engine.pipe.apply(this.engine, arguments); } +}; - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; +/** + * [unpipe description] + * + * @return this.engine + */ +Tar.prototype.unpipe = function() { + if (this.compressor) { + return this.compressor.unpipe.apply(this.compressor, arguments); + } else { + return this.engine.unpipe.apply(this.engine, arguments); } +}; - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} +module.exports = Tar; +/** + * @typedef {Object} TarOptions + * @global + * @property {Boolean} [gzip=false] Compress the tar archive using gzip. + * @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + * to control compression. + * @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties. + */ -/***/ }), +/** + * @typedef {Object} TarEntryData + * @global + * @property {String} name Sets the entry name including internal path. + * @property {(String|Date)} [date=NOW()] Sets the entry date. + * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. + * @property {String} [prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + */ -/***/ 11063: -/***/ ((module) => { +/** + * TarStream Module + * @external TarStream + * @see {@link https://github.com/mafintosh/tar-stream} + */ -module.exports = register; -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } +/***/ }), - if (!options) { - options = {}; - } +/***/ 22836: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); - } +/** + * ZIP Format Plugin + * + * @module plugins/zip + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var engine = __nccwpck_require__(41622); +var util = __nccwpck_require__(53296); - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); - } +/** + * @constructor + * @param {ZipOptions} [options] + * @param {String} [options.comment] Sets the zip archive comment. + * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC. + * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers. + * @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths. + * @param {Boolean} [options.store=false] Sets the compression method to STORE. + * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + */ +var Zip = function(options) { + if (!(this instanceof Zip)) { + return new Zip(options); + } - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); + options = this.options = util.defaults(options, { + comment: '', + forceUTC: false, + namePrependSlash: false, + store: false }); -} + this.supports = { + directory: true, + symlink: true + }; -/***/ }), + this.engine = new engine(options); +}; -/***/ 59934: -/***/ ((module) => { +/** + * @param {(Buffer|Stream)} source + * @param {ZipEntryData} data + * @param {String} data.name Sets the entry name including internal path. + * @param {(String|Date)} [data.date=NOW()] Sets the entry date. + * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. + * @param {String} [data.prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + * @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE. + * @param {Function} callback + * @return void + */ +Zip.prototype.append = function(source, data, callback) { + this.engine.entry(source, data, callback); +}; -module.exports = removeHook; +/** + * @return void + */ +Zip.prototype.finalize = function() { + this.engine.finalize(); +}; -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } +/** + * @return this.engine + */ +Zip.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); +}; - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); +/** + * @return this.engine + */ +Zip.prototype.pipe = function() { + return this.engine.pipe.apply(this.engine, arguments); +}; - if (index === -1) { - return; - } +/** + * @return this.engine + */ +Zip.prototype.unpipe = function() { + return this.engine.unpipe.apply(this.engine, arguments); +}; - state.registry[name].splice(index, 1); -} +module.exports = Zip; +/** + * @typedef {Object} ZipOptions + * @global + * @property {String} [comment] Sets the zip archive comment. + * @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC. + * @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers. + * @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths. + * @property {Boolean} [store=false] Sets the compression method to STORE. + * @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + * to control compression. + * @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties. + */ -/***/ }), +/** + * @typedef {Object} ZipEntryData + * @global + * @property {String} name Sets the entry name including internal path. + * @property {(String|Date)} [date=NOW()] Sets the entry date. + * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. + * @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths. + * @property {String} [prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + * @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE. + */ -/***/ 58769: -/***/ ((module, exports, __nccwpck_require__) => { +/** + * ZipStream Module + * @external ZipStream + * @see {@link https://www.archiverjs.com/zip-stream/ZipStream.html} + */ -var Chainsaw = __nccwpck_require__(71710); -var EventEmitter = (__nccwpck_require__(24434).EventEmitter); -var Buffers = __nccwpck_require__(86627); -var Vars = __nccwpck_require__(91259); -var Stream = (__nccwpck_require__(2203).Stream); -exports = module.exports = function (bufOrEm, eventName) { - if (Buffer.isBuffer(bufOrEm)) { - return exports.parse(bufOrEm); - } - - var s = exports.stream(); - if (bufOrEm && bufOrEm.pipe) { - bufOrEm.pipe(s); - } - else if (bufOrEm) { - bufOrEm.on(eventName || 'data', function (buf) { - s.write(buf); - }); - - bufOrEm.on('end', function () { - s.end(); - }); - } - return s; -}; +/***/ }), -exports.stream = function (input) { - if (input) return exports.apply(null, arguments); - - var pending = null; - function getBytes (bytes, cb, skip) { - pending = { - bytes : bytes, - skip : skip, - cb : function (buf) { - pending = null; - cb(buf); - }, - }; - dispatch(); - } - - var offset = null; - function dispatch () { - if (!pending) { - if (caughtEnd) done = true; - return; - } - if (typeof pending === 'function') { - pending(); - } - else { - var bytes = offset + pending.bytes; - - if (buffers.length >= bytes) { - var buf; - if (offset == null) { - buf = buffers.splice(0, bytes); - if (!pending.skip) { - buf = buf.slice(); - } - } - else { - if (!pending.skip) { - buf = buffers.slice(offset, bytes); - } - offset = bytes; - } - - if (pending.skip) { - pending.cb(); - } - else { - pending.cb(buf); - } - } - } - } - - function builder (saw) { - function next () { if (!done) saw.next() } - - var self = words(function (bytes, cb) { - return function (name) { - getBytes(bytes, function (buf) { - vars.set(name, cb(buf)); - next(); - }); - }; - }); - - self.tap = function (cb) { - saw.nest(cb, vars.store); - }; - - self.into = function (key, cb) { - if (!vars.get(key)) vars.set(key, {}); - var parent = vars; - vars = Vars(parent.get(key)); - - saw.nest(function () { - cb.apply(this, arguments); - this.tap(function () { - vars = parent; - }); - }, vars.store); - }; - - self.flush = function () { - vars.store = {}; - next(); - }; - - self.loop = function (cb) { - var end = false; - - saw.nest(false, function loop () { - this.vars = vars.store; - cb.call(this, function () { - end = true; - next(); - }, vars.store); - this.tap(function () { - if (end) saw.next() - else loop.call(this) - }.bind(this)); - }, vars.store); - }; - - self.buffer = function (name, bytes) { - if (typeof bytes === 'string') { - bytes = vars.get(bytes); - } - - getBytes(bytes, function (buf) { - vars.set(name, buf); - next(); - }); - }; - - self.skip = function (bytes) { - if (typeof bytes === 'string') { - bytes = vars.get(bytes); - } - - getBytes(bytes, function () { - next(); - }); - }; - - self.scan = function find (name, search) { - if (typeof search === 'string') { - search = new Buffer(search); - } - else if (!Buffer.isBuffer(search)) { - throw new Error('search must be a Buffer or a string'); - } - - var taken = 0; - pending = function () { - var pos = buffers.indexOf(search, offset + taken); - var i = pos-offset-taken; - if (pos !== -1) { - pending = null; - if (offset != null) { - vars.set( - name, - buffers.slice(offset, offset + taken + i) - ); - offset += taken + i + search.length; - } - else { - vars.set( - name, - buffers.slice(0, taken + i) - ); - buffers.splice(0, taken + i + search.length); - } - next(); - dispatch(); - } else { - i = Math.max(buffers.length - search.length - offset - taken, 0); - } - taken += i; - }; - dispatch(); - }; - - self.peek = function (cb) { - offset = 0; - saw.nest(function () { - cb.call(this, vars.store); - this.tap(function () { - offset = null; - }); - }); - }; - - return self; - }; - - var stream = Chainsaw.light(builder); - stream.writable = true; - - var buffers = Buffers(); - - stream.write = function (buf) { - buffers.push(buf); - dispatch(); - }; - - var vars = Vars(); - - var done = false, caughtEnd = false; - stream.end = function () { - caughtEnd = true; - }; - - stream.pipe = Stream.prototype.pipe; - Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function (name) { - stream[name] = EventEmitter.prototype[name]; - }); - - return stream; -}; +/***/ 97329: +/***/ (function(__unused_webpack_module, exports) { -exports.parse = function parse (buffer) { - var self = words(function (bytes, cb) { - return function (name) { - if (offset + bytes <= buffer.length) { - var buf = buffer.slice(offset, offset + bytes); - offset += bytes; - vars.set(name, cb(buf)); - } - else { - vars.set(name, null); - } - return self; - }; - }); - - var offset = 0; - var vars = Vars(); - self.vars = vars.store; - - self.tap = function (cb) { - cb.call(self, vars.store); - return self; - }; - - self.into = function (key, cb) { - if (!vars.get(key)) { - vars.set(key, {}); - } - var parent = vars; - vars = Vars(parent.get(key)); - cb.call(self, vars.store); - vars = parent; - return self; - }; - - self.loop = function (cb) { - var end = false; - var ender = function () { end = true }; - while (end === false) { - cb.call(self, ender, vars.store); - } - return self; - }; - - self.buffer = function (name, size) { - if (typeof size === 'string') { - size = vars.get(size); - } - var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); - offset += size; - vars.set(name, buf); - - return self; - }; - - self.skip = function (bytes) { - if (typeof bytes === 'string') { - bytes = vars.get(bytes); - } - offset += bytes; - - return self; - }; - - self.scan = function (name, search) { - if (typeof search === 'string') { - search = new Buffer(search); - } - else if (!Buffer.isBuffer(search)) { - throw new Error('search must be a Buffer or a string'); - } - vars.set(name, null); - - // simple but slow string search - for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) { - for ( - var j = 0; - j < search.length && buffer[offset+i+j] === search[j]; - j++ - ); - if (j === search.length) break; - } - - vars.set(name, buffer.slice(offset, offset + i)); - offset += i + search.length; - return self; - }; - - self.peek = function (cb) { - var was = offset; - cb.call(self, vars.store); - offset = was; - return self; - }; - - self.flush = function () { - vars.store = {}; - return self; - }; - - self.eof = function () { - return offset >= buffer.length; - }; - - return self; -}; +(function (global, factory) { + true ? factory(exports) : + 0; +})(this, (function (exports) { 'use strict'; -// convert byte strings to unsigned little endian numbers -function decodeLEu (bytes) { - var acc = 0; - for (var i = 0; i < bytes.length; i++) { - acc += Math.pow(256,i) * bytes[i]; + /** + * Creates a continuation function with some arguments already applied. + * + * Useful as a shorthand when combined with other control flow functions. Any + * arguments passed to the returned function are added to the arguments + * originally passed to apply. + * + * @name apply + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {Function} fn - The function you want to eventually apply all + * arguments to. Invokes with (arguments...). + * @param {...*} arguments... - Any number of arguments to automatically apply + * when the continuation is called. + * @returns {Function} the partially-applied function + * @example + * + * // using apply + * async.parallel([ + * async.apply(fs.writeFile, 'testfile1', 'test1'), + * async.apply(fs.writeFile, 'testfile2', 'test2') + * ]); + * + * + * // the same process without using apply + * async.parallel([ + * function(callback) { + * fs.writeFile('testfile1', 'test1', callback); + * }, + * function(callback) { + * fs.writeFile('testfile2', 'test2', callback); + * } + * ]); + * + * // It's possible to pass any number of additional arguments when calling the + * // continuation: + * + * node> var fn = async.apply(sys.puts, 'one'); + * node> fn('two', 'three'); + * one + * two + * three + */ + function apply(fn, ...args) { + return (...callArgs) => fn(...args,...callArgs); } - return acc; -} -// convert byte strings to unsigned big endian numbers -function decodeBEu (bytes) { - var acc = 0; - for (var i = 0; i < bytes.length; i++) { - acc += Math.pow(256, bytes.length - i - 1) * bytes[i]; + function initialParams (fn) { + return function (...args/*, callback*/) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; } - return acc; -} -// convert byte strings to signed big endian numbers -function decodeBEs (bytes) { - var val = decodeBEu(bytes); - if ((bytes[0] & 0x80) == 0x80) { - val -= Math.pow(256, bytes.length); + /* istanbul ignore file */ + + var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; + var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; + var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + + function fallback(fn) { + setTimeout(fn, 0); } - return val; -} -// convert byte strings to signed little endian numbers -function decodeLEs (bytes) { - var val = decodeLEu(bytes); - if ((bytes[bytes.length - 1] & 0x80) == 0x80) { - val -= Math.pow(256, bytes.length); + function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); } - return val; -} -function words (decode) { - var self = {}; - - [ 1, 2, 4, 8 ].forEach(function (bytes) { - var bits = bytes * 8; - - self['word' + bits + 'le'] - = self['word' + bits + 'lu'] - = decode(bytes, decodeLEu); - - self['word' + bits + 'ls'] - = decode(bytes, decodeLEs); - - self['word' + bits + 'be'] - = self['word' + bits + 'bu'] - = decode(bytes, decodeBEu); - - self['word' + bits + 'bs'] - = decode(bytes, decodeBEs); - }); - - // word8be(n) == word8le(n) for all n - self.word8 = self.word8u = self.word8be; - self.word8s = self.word8bs; - - return self; -} + var _defer$1; + if (hasQueueMicrotask) { + _defer$1 = queueMicrotask; + } else if (hasSetImmediate) { + _defer$1 = setImmediate; + } else if (hasNextTick) { + _defer$1 = process.nextTick; + } else { + _defer$1 = fallback; + } -/***/ }), + var setImmediate$1 = wrap(_defer$1); -/***/ 91259: -/***/ ((module) => { + /** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ + function asyncify(func) { + if (isAsync(func)) { + return function (...args/*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback) + } + } -module.exports = function (store) { - function getset (name, value) { - var node = vars.store; - var keys = name.split('.'); - keys.slice(0,-1).forEach(function (k) { - if (node[k] === undefined) node[k] = {}; - node = node[k] + return initialParams(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback) + } else { + callback(null, result); + } }); - var key = keys[keys.length - 1]; - if (arguments.length == 1) { - return node[key]; - } - else { - return node[key] = value; - } } - - var vars = { - get : function (name) { - return getset(name); - }, - set : function (name, value) { - return getset(name, value); - }, - store : store || {}, - }; - return vars; -}; + function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); + } -/***/ }), - -/***/ 85234: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; + function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + setImmediate$1(e => { throw e }, err); + } + } + function isAsync(fn) { + return fn[Symbol.toStringTag] === 'AsyncFunction'; + } -const { Buffer } = __nccwpck_require__(20181) -const symbol = Symbol.for('BufferList') + function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === 'AsyncGenerator'; + } -function BufferList (buf) { - if (!(this instanceof BufferList)) { - return new BufferList(buf) - } + function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === 'function'; + } - BufferList._init.call(this, buf) -} + function wrapAsync(asyncFn) { + if (typeof asyncFn !== 'function') throw new Error('expected a function') + return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; + } -BufferList._init = function _init (buf) { - Object.defineProperty(this, symbol, { value: true }) + // conditionally promisify a function. + // only return a promise if a callback is omitted + function awaitify (asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error('arity is undefined') + function awaitable (...args) { + if (typeof args[arity - 1] === 'function') { + return asyncFn.apply(this, args) + } - this._bufs = [] - this.length = 0 + return new Promise((resolve, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err) + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }) + } - if (buf) { - this.append(buf) - } -} + return awaitable + } -BufferList.prototype._new = function _new (buf) { - return new BufferList(buf) -} + function applyEach$1 (eachfn) { + return function applyEach(fns, ...callArgs) { + const go = awaitify(function (callback) { + var that = this; + return eachfn(fns, (fn, cb) => { + wrapAsync(fn).apply(that, callArgs.concat(cb)); + }, callback); + }); + return go; + }; + } -BufferList.prototype._offset = function _offset (offset) { - if (offset === 0) { - return [0, 0] - } + function _asyncMap(eachfn, arr, iteratee, callback) { + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = wrapAsync(iteratee); - let tot = 0 + return eachfn(arr, (value, _, iterCb) => { + var index = counter++; + _iteratee(value, (err, v) => { + results[index] = v; + iterCb(err); + }); + }, err => { + callback(err, results); + }); + } - for (let i = 0; i < this._bufs.length; i++) { - const _t = tot + this._bufs[i].length - if (offset < _t || i === this._bufs.length - 1) { - return [i, offset - tot] + function isArrayLike(value) { + return value && + typeof value.length === 'number' && + value.length >= 0 && + value.length % 1 === 0; } - tot = _t - } -} -BufferList.prototype._reverseOffset = function (blOffset) { - const bufferId = blOffset[0] - let offset = blOffset[1] + // A temporary value used to identify if the loop should be broken. + // See #1064, #1293 + const breakLoop = {}; - for (let i = 0; i < bufferId; i++) { - offset += this._bufs[i].length - } + function once(fn) { + function wrapper (...args) { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper + } - return offset -} + function getIterator (coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); + } -BufferList.prototype.get = function get (index) { - if (index > this.length || index < 0) { - return undefined - } + function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? {value: coll[i], key: i} : null; + } + } - const offset = this._offset(index) + function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) + return null; + i++; + return {value: item.value, key: i}; + } + } - return this._bufs[offset[0]][offset[1]] -} + function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === '__proto__') { + return next(); + } + return i < len ? {value: obj[key], key} : null; + }; + } -BufferList.prototype.slice = function slice (start, end) { - if (typeof start === 'number' && start < 0) { - start += this.length - } + function createIterator(coll) { + if (isArrayLike(coll)) { + return createArrayIterator(coll); + } - if (typeof end === 'number' && end < 0) { - end += this.length - } + var iterator = getIterator(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); + } - return this.copy(null, 0, start, end) -} + function onlyOnce(fn) { + return function (...args) { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, args); + }; + } -BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart !== 'number' || srcStart < 0) { - srcStart = 0 - } + // for async generators + function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; - if (typeof srcEnd !== 'number' || srcEnd > this.length) { - srcEnd = this.length - } + function replenish() { + //console.log('replenish') + if (running >= limit || awaiting || done) return + //console.log('replenish awaiting') + awaiting = true; + generator.next().then(({value, done: iterDone}) => { + //console.log('got value', value) + if (canceled || done) return + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + //console.log('done nextCb') + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError); + } - if (srcStart >= this.length) { - return dst || Buffer.alloc(0) - } + function iterateeCallback(err, result) { + //console.log('iterateeCallback') + running -= 1; + if (canceled) return + if (err) return handleError(err) - if (srcEnd <= 0) { - return dst || Buffer.alloc(0) - } + if (err === false) { + done = true; + canceled = true; + return + } - const copy = !!dst - const off = this._offset(srcStart) - const len = srcEnd - srcStart - let bytes = len - let bufoff = (copy && dstStart) || 0 - let start = off[1] + if (result === breakLoop || (done && running <= 0)) { + done = true; + //console.log('done iterCb') + return callback(null); + } + replenish(); + } - // copy/slice everything - if (srcStart === 0 && srcEnd === this.length) { - if (!copy) { - // slice, but full concat if multiple buffers - return this._bufs.length === 1 - ? this._bufs[0] - : Buffer.concat(this._bufs, this.length) - } + function handleError(err) { + if (canceled) return + awaiting = false; + done = true; + callback(err); + } - // copy, need to copy individual buffers - for (let i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff) - bufoff += this._bufs[i].length + replenish(); } - return dst - } + var eachOfLimit$2 = (limit) => { + return (obj, iteratee, callback) => { + callback = once(callback); + if (limit <= 0) { + throw new RangeError('concurrency limit cannot be less than 1') + } + if (!obj) { + return callback(null); + } + if (isAsyncGenerator(obj)) { + return asyncEachOfLimit(obj, limit, iteratee, callback) + } + if (isAsyncIterable(obj)) { + return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) + } + var nextElem = createIterator(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; - // easy, cheap case where it's a subset of one of the buffers - if (bytes <= this._bufs[off[0]].length - start) { - return copy - ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) - : this._bufs[off[0]].slice(start, start + bytes) - } + function iterateeCallback(err, value) { + if (canceled) return + running -= 1; + if (err) { + done = true; + callback(err); + } + else if (err === false) { + done = true; + canceled = true; + } + else if (value === breakLoop || (done && running <= 0)) { + done = true; + return callback(null); + } + else if (!looping) { + replenish(); + } + } - if (!copy) { - // a slice, we need something to copy in to - dst = Buffer.allocUnsafe(len) - } + function replenish () { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); + } + looping = false; + } - for (let i = off[0]; i < this._bufs.length; i++) { - const l = this._bufs[i].length - start + replenish(); + }; + }; - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start) - bufoff += l - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes) - bufoff += l - break + /** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachOfLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); } - bytes -= l + var eachOfLimit$1 = awaitify(eachOfLimit, 4); + + // eachOf implementation optimized for array-likes + function eachOfArrayLike(coll, iteratee, callback) { + callback = once(callback); + var index = 0, + completed = 0, + {length} = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return + if (err) { + callback(err); + } else if ((++completed === length) || value === breakLoop) { + callback(null); + } + } - if (start) { - start = 0 + for (; index < length; index++) { + iteratee(coll[index], index, onlyOnce(iteratorCallback)); + } } - } - // safeguard so that we don't return uninitialized memory - if (dst.length > bufoff) return dst.slice(0, bufoff) - - return dst -} + // a generic version of eachOf which can handle array, object, and iterator cases. + function eachOfGeneric (coll, iteratee, callback) { + return eachOfLimit$1(coll, Infinity, iteratee, callback); + } -BufferList.prototype.shallowSlice = function shallowSlice (start, end) { - start = start || 0 - end = typeof end !== 'number' ? this.length : end + /** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ + function eachOf(coll, iteratee, callback) { + var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, wrapAsync(iteratee), callback); + } - if (start < 0) { - start += this.length - } + var eachOf$1 = awaitify(eachOf, 3); - if (end < 0) { - end += this.length - } + /** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callbacks + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.map(fileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.map(fileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.map(fileList, getFileSizeInBytes); + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.map(withMissingFileList, getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function map (coll, iteratee, callback) { + return _asyncMap(eachOf$1, coll, iteratee, callback) + } + var map$1 = awaitify(map, 3); - if (start === end) { - return this._new() - } + /** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. The results + * for each of the applied async functions are passed to the final callback + * as an array. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - Returns a function that takes no args other than + * an optional callback, that is the result of applying the `args` to each + * of the functions. + * @example + * + * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') + * + * appliedFn((err, results) => { + * // results[0] is the results for `enableSearch` + * // results[1] is the results for `updateSchema` + * }); + * + * // partial application example: + * async.each( + * buckets, + * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), + * callback + * ); + */ + var applyEach = applyEach$1(map$1); - const startOffset = this._offset(start) - const endOffset = this._offset(end) - const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) + /** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachOfSeries(coll, iteratee, callback) { + return eachOfLimit$1(coll, 1, iteratee, callback) + } + var eachOfSeries$1 = awaitify(eachOfSeries, 3); - if (endOffset[1] === 0) { - buffers.pop() - } else { - buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]) - } + /** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function mapSeries (coll, iteratee, callback) { + return _asyncMap(eachOfSeries$1, coll, iteratee, callback) + } + var mapSeries$1 = awaitify(mapSeries, 3); - if (startOffset[1] !== 0) { - buffers[0] = buffers[0].slice(startOffset[1]) - } + /** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - A function, that when called, is the result of + * appling the `args` to the list of functions. It takes no args, other than + * a callback. + */ + var applyEachSeries = applyEach$1(mapSeries$1); - return this._new(buffers) -} + const PROMISE_SYMBOL = Symbol('promiseCallback'); -BufferList.prototype.toString = function toString (encoding, start, end) { - return this.slice(start, end).toString(encoding) -} + function promiseCallback () { + let resolve, reject; + function callback (err, ...args) { + if (err) return reject(err) + resolve(args.length > 1 ? args : args[0]); + } -BufferList.prototype.consume = function consume (bytes) { - // first, normalize the argument, in accordance with how Buffer does it - bytes = Math.trunc(bytes) - // do nothing if not a positive number - if (Number.isNaN(bytes) || bytes <= 0) return this + callback[PROMISE_SYMBOL] = new Promise((res, rej) => { + resolve = res, + reject = rej; + }); - while (this._bufs.length) { - if (bytes >= this._bufs[0].length) { - bytes -= this._bufs[0].length - this.length -= this._bufs[0].length - this._bufs.shift() - } else { - this._bufs[0] = this._bufs[0].slice(bytes) - this.length -= bytes - break + return callback } - } - return this -} + /** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * @example + * + * //Using Callbacks + * async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * if (err) { + * console.log('err = ', err); + * } + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }); + * + * //Using Promises + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }).then(results => { + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }).catch(err => { + * console.log('err = ', err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }); + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function auto(tasks, concurrency, callback) { + if (typeof concurrency !== 'number') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = once(callback || promiseCallback()); + var numTasks = Object.keys(tasks).length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } -BufferList.prototype.duplicate = function duplicate () { - const copy = this._new() + var results = {}; + var runningTasks = 0; + var canceled = false; + var hasError = false; - for (let i = 0; i < this._bufs.length; i++) { - copy.append(this._bufs[i]) - } + var listeners = Object.create(null); - return copy -} + var readyTasks = []; -BufferList.prototype.append = function append (buf) { - if (buf == null) { - return this - } + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; - if (buf.buffer) { - // append a view of the underlying ArrayBuffer - this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)) - } else if (Array.isArray(buf)) { - for (let i = 0; i < buf.length; i++) { - this.append(buf[i]) - } - } else if (this._isBufferList(buf)) { - // unwrap argument into individual BufferLists - for (let i = 0; i < buf._bufs.length; i++) { - this.append(buf._bufs[i]) - } - } else { - // coerce number arguments to strings, since Buffer(number) does - // uninitialized memory allocation - if (typeof buf === 'number') { - buf = buf.toString() - } + Object.keys(tasks).forEach(key => { + var task = tasks[key]; + if (!Array.isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } - this._appendBuffer(Buffer.from(buf)) - } + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; - return this -} + dependencies.forEach(dependencyName => { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + + '` has a non-existent dependency `' + + dependencyName + '` in ' + + dependencies.join(', ')); + } + addListener(dependencyName, () => { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); -BufferList.prototype._appendBuffer = function appendBuffer (buf) { - this._bufs.push(buf) - this.length += buf.length -} + checkForDeadlocks(); + processQueue(); -BufferList.prototype.indexOf = function (search, offset, encoding) { - if (encoding === undefined && typeof offset === 'string') { - encoding = offset - offset = undefined - } + function enqueueTask(key, task) { + readyTasks.push(() => runTask(key, task)); + } - if (typeof search === 'function' || Array.isArray(search)) { - throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.') - } else if (typeof search === 'number') { - search = Buffer.from([search]) - } else if (typeof search === 'string') { - search = Buffer.from(search, encoding) - } else if (this._isBufferList(search)) { - search = search.slice() - } else if (Array.isArray(search.buffer)) { - search = Buffer.from(search.buffer, search.byteOffset, search.byteLength) - } else if (!Buffer.isBuffer(search)) { - search = Buffer.from(search) - } + function processQueue() { + if (canceled) return + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while(readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } - offset = Number(offset || 0) + } - if (isNaN(offset)) { - offset = 0 - } + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } - if (offset < 0) { - offset = this.length + offset - } + taskListeners.push(fn); + } - if (offset < 0) { - offset = 0 - } + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + taskListeners.forEach(fn => fn()); + processQueue(); + } - if (search.length === 0) { - return offset > this.length ? this.length : offset - } - const blOffset = this._offset(offset) - let blIndex = blOffset[0] // index of which internal buffer we're working on - let buffOffset = blOffset[1] // offset of the internal buffer we're working on + function runTask(key, task) { + if (hasError) return; - // scan over each buffer - for (; blIndex < this._bufs.length; blIndex++) { - const buff = this._bufs[blIndex] + var taskCallback = onlyOnce((err, ...result) => { + runningTasks--; + if (err === false) { + canceled = true; + return + } + if (result.length < 2) { + [result] = result; + } + if (err) { + var safeResults = {}; + Object.keys(results).forEach(rkey => { + safeResults[rkey] = results[rkey]; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + if (canceled) return + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); - while (buffOffset < buff.length) { - const availableWindow = buff.length - buffOffset + runningTasks++; + var taskFn = wrapAsync(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } - if (availableWindow >= search.length) { - const nativeSearchResult = buff.indexOf(search, buffOffset) + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + getDependents(currentTask).forEach(dependent => { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } - if (nativeSearchResult !== -1) { - return this._reverseOffset([blIndex, nativeSearchResult]) + if (counter !== numTasks) { + throw new Error( + 'async.auto cannot execute tasks due to a recursive dependency' + ); + } } - buffOffset = buff.length - search.length + 1 // end of native search window - } else { - const revOffset = this._reverseOffset([blIndex, buffOffset]) - - if (this._match(revOffset, search)) { - return revOffset + function getDependents(taskName) { + var result = []; + Object.keys(tasks).forEach(key => { + const task = tasks[key]; + if (Array.isArray(task) && task.indexOf(taskName) >= 0) { + result.push(key); + } + }); + return result; } - buffOffset++ - } + return callback[PROMISE_SYMBOL] } - buffOffset = 0 - } - - return -1 -} - -BufferList.prototype._match = function (offset, search) { - if (this.length - offset < search.length) { - return false - } + var FN_ARGS = /^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/; + var ARROW_FN_ARGS = /^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/; + var FN_ARG_SPLIT = /,/; + var FN_ARG = /(=.+)?(\s*)$/; - for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { - if (this.get(offset + searchOffset) !== search[searchOffset]) { - return false + function stripComments(string) { + let stripped = ''; + let index = 0; + let endBlockComment = string.indexOf('*/'); + while (index < string.length) { + if (string[index] === '/' && string[index+1] === '/') { + // inline comment + let endIndex = string.indexOf('\n', index); + index = (endIndex === -1) ? string.length : endIndex; + } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { + // block comment + let endIndex = string.indexOf('*/', index); + if (endIndex !== -1) { + index = endIndex + 2; + endBlockComment = string.indexOf('*/', index); + } else { + stripped += string[index]; + index++; + } + } else { + stripped += string[index]; + index++; + } + } + return stripped; } - } - return true -} -;(function () { - const methods = { - readDoubleBE: 8, - readDoubleLE: 8, - readFloatBE: 4, - readFloatLE: 4, - readInt32BE: 4, - readInt32LE: 4, - readUInt32BE: 4, - readUInt32LE: 4, - readInt16BE: 2, - readInt16LE: 2, - readUInt16BE: 2, - readUInt16LE: 2, - readInt8: 1, - readUInt8: 1, - readIntBE: null, - readIntLE: null, - readUIntBE: null, - readUIntLE: null - } - - for (const m in methods) { - (function (m) { - if (methods[m] === null) { - BufferList.prototype[m] = function (offset, byteLength) { - return this.slice(offset, offset + byteLength)[m](0, byteLength) - } - } else { - BufferList.prototype[m] = function (offset = 0) { - return this.slice(offset, offset + methods[m])[m](0) + function parseParams(func) { + const src = stripComments(func.toString()); + let match = src.match(FN_ARGS); + if (!match) { + match = src.match(ARROW_FN_ARGS); } - } - }(m)) - } -}()) - -// Used internally by the class and also as an indicator of this object being -// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser -// environment because there could be multiple different copies of the -// BufferList class and some `BufferList`s might be `BufferList`s. -BufferList.prototype._isBufferList = function _isBufferList (b) { - return b instanceof BufferList || BufferList.isBufferList(b) -} - -BufferList.isBufferList = function isBufferList (b) { - return b != null && b[symbol] -} - -module.exports = BufferList - - -/***/ }), - -/***/ 80794: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const DuplexStream = (__nccwpck_require__(86131).Duplex) -const inherits = __nccwpck_require__(39598) -const BufferList = __nccwpck_require__(85234) - -function BufferListStream (callback) { - if (!(this instanceof BufferListStream)) { - return new BufferListStream(callback) - } - - if (typeof callback === 'function') { - this._callback = callback - - const piper = function piper (err) { - if (this._callback) { - this._callback(err) - this._callback = null - } - }.bind(this) - - this.on('pipe', function onPipe (src) { - src.on('error', piper) - }) - this.on('unpipe', function onUnpipe (src) { - src.removeListener('error', piper) - }) - - callback = null - } - - BufferList._init.call(this, callback) - DuplexStream.call(this) -} - -inherits(BufferListStream, DuplexStream) -Object.assign(BufferListStream.prototype, BufferList.prototype) - -BufferListStream.prototype._new = function _new (callback) { - return new BufferListStream(callback) -} - -BufferListStream.prototype._write = function _write (buf, encoding, callback) { - this._appendBuffer(buf) - - if (typeof callback === 'function') { - callback() - } -} - -BufferListStream.prototype._read = function _read (size) { - if (!this.length) { - return this.push(null) - } - - size = Math.min(size, this.length) - this.push(this.slice(0, size)) - this.consume(size) -} - -BufferListStream.prototype.end = function end (chunk) { - DuplexStream.prototype.end.call(this, chunk) - - if (this._callback) { - this._callback(null, this.slice()) - this._callback = null - } -} - -BufferListStream.prototype._destroy = function _destroy (err, cb) { - this._bufs.length = 0 - this.length = 0 - cb(err) -} - -BufferListStream.prototype._isBufferList = function _isBufferList (b) { - return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b) -} - -BufferListStream.isBufferList = BufferList.isBufferList - -module.exports = BufferListStream -module.exports.BufferListStream = BufferListStream -module.exports.BufferList = BufferList + if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) + let [, args] = match; + return args + .replace(/\s/g, '') + .split(FN_ARG_SPLIT) + .map((arg) => arg.replace(FN_ARG, '').trim()); + } + /** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ + function autoInject(tasks, callback) { + var newTasks = {}; -/***/ }), + Object.keys(tasks).forEach(key => { + var taskFn = tasks[key]; + var params; + var fnIsAsync = isAsync(taskFn); + var hasNoDeps = + (!fnIsAsync && taskFn.length === 1) || + (fnIsAsync && taskFn.length === 0); -/***/ 63251: -/***/ (function(module) { + if (Array.isArray(taskFn)) { + params = [...taskFn]; + taskFn = params.pop(); -/** - * This file contains the Bottleneck library (MIT), compiled to ES2017, and without Clustering support. - * https://github.com/SGrondin/bottleneck - */ -(function (global, factory) { - true ? module.exports = factory() : - 0; -}(this, (function () { 'use strict'; + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + // remove callback param + if (!fnIsAsync) params.pop(); - function getCjsExportFromNamespace (n) { - return n && n['default'] || n; - } + newTasks[key] = params.concat(newTask); + } - var load = function(received, defaults, onto = {}) { - var k, ref, v; - for (k in defaults) { - v = defaults[k]; - onto[k] = (ref = received[k]) != null ? ref : v; - } - return onto; - }; + function newTask(results, taskCb) { + var newArgs = params.map(name => results[name]); + newArgs.push(taskCb); + wrapAsync(taskFn)(...newArgs); + } + }); - var overwrite = function(received, defaults, onto = {}) { - var k, v; - for (k in received) { - v = received[k]; - if (defaults[k] !== void 0) { - onto[k] = v; - } - } - return onto; - }; + return auto(newTasks, callback); + } - var parser = { - load: load, - overwrite: overwrite - }; + // Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation + // used for queues. This implementation assumes that the node provided by the user can be modified + // to adjust the next and last properties. We implement only the minimal functionality + // for queue support. + class DLL { + constructor() { + this.head = this.tail = null; + this.length = 0; + } - var DLList; + removeLink(node) { + if (node.prev) node.prev.next = node.next; + else this.head = node.next; + if (node.next) node.next.prev = node.prev; + else this.tail = node.prev; - DLList = class DLList { - constructor(incr, decr) { - this.incr = incr; - this.decr = decr; - this._first = null; - this._last = null; - this.length = 0; - } + node.prev = node.next = null; + this.length -= 1; + return node; + } - push(value) { - var node; - this.length++; - if (typeof this.incr === "function") { - this.incr(); - } - node = { - value, - prev: this._last, - next: null - }; - if (this._last != null) { - this._last.next = node; - this._last = node; - } else { - this._first = this._last = node; - } - return void 0; - } + empty () { + while(this.head) this.shift(); + return this; + } - shift() { - var value; - if (this._first == null) { - return; - } else { - this.length--; - if (typeof this.decr === "function") { - this.decr(); - } - } - value = this._first.value; - if ((this._first = this._first.next) != null) { - this._first.prev = null; - } else { - this._last = null; - } - return value; - } + insertAfter(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode; + else this.tail = newNode; + node.next = newNode; + this.length += 1; + } - first() { - if (this._first != null) { - return this._first.value; - } - } + insertBefore(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode; + else this.head = newNode; + node.prev = newNode; + this.length += 1; + } - getArray() { - var node, ref, results; - node = this._first; - results = []; - while (node != null) { - results.push((ref = node, node = node.next, ref.value)); - } - return results; - } + unshift(node) { + if (this.head) this.insertBefore(this.head, node); + else setInitial(this, node); + } - forEachShift(cb) { - var node; - node = this.shift(); - while (node != null) { - (cb(node), node = this.shift()); - } - return void 0; - } + push(node) { + if (this.tail) this.insertAfter(this.tail, node); + else setInitial(this, node); + } - debug() { - var node, ref, ref1, ref2, results; - node = this._first; - results = []; - while (node != null) { - results.push((ref = node, node = node.next, { - value: ref.value, - prev: (ref1 = ref.prev) != null ? ref1.value : void 0, - next: (ref2 = ref.next) != null ? ref2.value : void 0 - })); - } - return results; - } + shift() { + return this.head && this.removeLink(this.head); + } - }; + pop() { + return this.tail && this.removeLink(this.tail); + } - var DLList_1 = DLList; + toArray() { + return [...this] + } - var Events; + *[Symbol.iterator] () { + var cur = this.head; + while (cur) { + yield cur.data; + cur = cur.next; + } + } - Events = class Events { - constructor(instance) { - this.instance = instance; - this._events = {}; - if ((this.instance.on != null) || (this.instance.once != null) || (this.instance.removeAllListeners != null)) { - throw new Error("An Emitter already exists for this object"); - } - this.instance.on = (name, cb) => { - return this._addListener(name, "many", cb); - }; - this.instance.once = (name, cb) => { - return this._addListener(name, "once", cb); - }; - this.instance.removeAllListeners = (name = null) => { - if (name != null) { - return delete this._events[name]; - } else { - return this._events = {}; - } - }; - } + remove (testFn) { + var curr = this.head; + while(curr) { + var {next} = curr; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; + } + } - _addListener(name, status, cb) { - var base; - if ((base = this._events)[name] == null) { - base[name] = []; - } - this._events[name].push({cb, status}); - return this.instance; - } + function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; + } - listenerCount(name) { - if (this._events[name] != null) { - return this._events[name].length; - } else { - return 0; - } - } + function queue$1(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new RangeError('Concurrency must not be zero'); + } - async trigger(name, ...args) { - var e, promises; - try { - if (name !== "debug") { - this.trigger("debug", `Event triggered: ${name}`, args); - } - if (this._events[name] == null) { - return; - } - this._events[name] = this._events[name].filter(function(listener) { - return listener.status !== "none"; - }); - promises = this._events[name].map(async(listener) => { - var e, returned; - if (listener.status === "none") { - return; - } - if (listener.status === "once") { - listener.status = "none"; - } - try { - returned = typeof listener.cb === "function" ? listener.cb(...args) : void 0; - if (typeof (returned != null ? returned.then : void 0) === "function") { - return (await returned); - } else { - return returned; - } - } catch (error) { - e = error; - { - this.trigger("error", e); - } - return null; - } - }); - return ((await Promise.all(promises))).find(function(x) { - return x != null; - }); - } catch (error) { - e = error; - { - this.trigger("error", e); - } - return null; - } - } + var _worker = wrapAsync(worker); + var numRunning = 0; + var workersList = []; + const events = { + error: [], + drain: [], + saturated: [], + unsaturated: [], + empty: [] + }; - }; + function on (event, handler) { + events[event].push(handler); + } - var Events_1 = Events; + function once (event, handler) { + const handleAndRemove = (...args) => { + off(event, handleAndRemove); + handler(...args); + }; + events[event].push(handleAndRemove); + } - var DLList$1, Events$1, Queues; + function off (event, handler) { + if (!event) return Object.keys(events).forEach(ev => events[ev] = []) + if (!handler) return events[event] = [] + events[event] = events[event].filter(ev => ev !== handler); + } - DLList$1 = DLList_1; + function trigger (event, ...args) { + events[event].forEach(handler => handler(...args)); + } - Events$1 = Events_1; + var processingScheduled = false; + function _insert(data, insertAtFront, rejectOnError, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; - Queues = class Queues { - constructor(num_priorities) { - var i; - this.Events = new Events$1(this); - this._length = 0; - this._lists = (function() { - var j, ref, results; - results = []; - for (i = j = 1, ref = num_priorities; (1 <= ref ? j <= ref : j >= ref); i = 1 <= ref ? ++j : --j) { - results.push(new DLList$1((() => { - return this.incr(); - }), (() => { - return this.decr(); - }))); - } - return results; - }).call(this); - } + var res, rej; + function promiseCallback (err, ...args) { + // we don't care about the error, let the global error handler + // deal with it + if (err) return rejectOnError ? rej(err) : res() + if (args.length <= 1) return res(args[0]) + res(args); + } - incr() { - if (this._length++ === 0) { - return this.Events.trigger("leftzero"); - } - } + var item = q._createTaskItem( + data, + rejectOnError ? promiseCallback : + (callback || promiseCallback) + ); - decr() { - if (--this._length === 0) { - return this.Events.trigger("zero"); - } - } + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } - push(job) { - return this._lists[job.options.priority].push(job); - } + if (!processingScheduled) { + processingScheduled = true; + setImmediate$1(() => { + processingScheduled = false; + q.process(); + }); + } - queued(priority) { - if (priority != null) { - return this._lists[priority].length; - } else { - return this._length; - } - } + if (rejectOnError || !callback) { + return new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }) + } + } - shiftAll(fn) { - return this._lists.forEach(function(list) { - return list.forEachShift(fn); - }); - } + function _createCB(tasks) { + return function (err, ...args) { + numRunning -= 1; - getFirst(arr = this._lists) { - var j, len, list; - for (j = 0, len = arr.length; j < len; j++) { - list = arr[j]; - if (list.length > 0) { - return list; - } - } - return []; - } + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; - shiftLastFrom(priority) { - return this.getFirst(this._lists.slice(priority).reverse()).shift(); - } + var index = workersList.indexOf(task); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } - }; + task.callback(err, ...args); - var Queues_1 = Queues; + if (err != null) { + trigger('error', err, task.data); + } + } - var BottleneckError; + if (numRunning <= (q.concurrency - q.buffer) ) { + trigger('unsaturated'); + } - BottleneckError = class BottleneckError extends Error {}; + if (q.idle()) { + trigger('drain'); + } + q.process(); + }; + } - var BottleneckError_1 = BottleneckError; + function _maybeDrain(data) { + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + setImmediate$1(() => trigger('drain')); + return true + } + return false + } - var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1; + const eventMethod = (name) => (handler) => { + if (!handler) { + return new Promise((resolve, reject) => { + once(name, (err, data) => { + if (err) return reject(err) + resolve(data); + }); + }) + } + off(name); + on(name, handler); - NUM_PRIORITIES = 10; + }; - DEFAULT_PRIORITY = 5; + var isProcessing = false; + var q = { + _tasks: new DLL(), + _createTaskItem (data, callback) { + return { + data, + callback + }; + }, + *[Symbol.iterator] () { + yield* q._tasks[Symbol.iterator](); + }, + concurrency, + payload, + buffer: concurrency / 4, + started: false, + paused: false, + push (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, false, callback)) + } + return _insert(data, false, false, callback); + }, + pushAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, true, callback)) + } + return _insert(data, false, true, callback); + }, + kill () { + off(); + q._tasks.empty(); + }, + unshift (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, false, callback)) + } + return _insert(data, true, false, callback); + }, + unshiftAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, true, callback)) + } + return _insert(data, true, true, callback); + }, + remove (testFn) { + q._tasks.remove(testFn); + }, + process () { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while(!q.paused && numRunning < q.concurrency && q._tasks.length){ + var tasks = [], data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } - parser$1 = parser; + numRunning += 1; - BottleneckError$1 = BottleneckError_1; + if (q._tasks.length === 0) { + trigger('empty'); + } - Job = class Job { - constructor(task, args, options, jobDefaults, rejectOnDrop, Events, _states, Promise) { - this.task = task; - this.args = args; - this.rejectOnDrop = rejectOnDrop; - this.Events = Events; - this._states = _states; - this.Promise = Promise; - this.options = parser$1.load(options, jobDefaults); - this.options.priority = this._sanitizePriority(this.options.priority); - if (this.options.id === jobDefaults.id) { - this.options.id = `${this.options.id}-${this._randomIndex()}`; - } - this.promise = new this.Promise((_resolve, _reject) => { - this._resolve = _resolve; - this._reject = _reject; - }); - this.retryCount = 0; - } + if (numRunning === q.concurrency) { + trigger('saturated'); + } + + var cb = onlyOnce(_createCB(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length () { + return q._tasks.length; + }, + running () { + return numRunning; + }, + workersList () { + return workersList; + }, + idle() { + return q._tasks.length + numRunning === 0; + }, + pause () { + q.paused = true; + }, + resume () { + if (q.paused === false) { return; } + q.paused = false; + setImmediate$1(q.process); + } + }; + // define these as fixed properties, so people get useful errors when updating + Object.defineProperties(q, { + saturated: { + writable: false, + value: eventMethod('saturated') + }, + unsaturated: { + writable: false, + value: eventMethod('unsaturated') + }, + empty: { + writable: false, + value: eventMethod('empty') + }, + drain: { + writable: false, + value: eventMethod('drain') + }, + error: { + writable: false, + value: eventMethod('error') + }, + }); + return q; + } + + /** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i NUM_PRIORITIES - 1) { - return NUM_PRIORITIES - 1; - } else { - return sProperty; - } - } + /** + * Creates a `cargoQueue` object with the specified payload. Tasks added to the + * cargoQueue will be processed together (up to the `payload` limit) in `concurrency` parallel workers. + * If the all `workers` are in progress, the task is queued until one becomes available. Once + * a `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, and [`cargo`]{@link module:ControlFlow.cargo} passes an array of tasks to a single worker, + * the cargoQueue passes an array of tasks to multiple parallel workers. + * + * @name cargoQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @see [async.cargo]{@link module:ControlFLow.cargo} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargoQueue object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargoQueue and inner queue. + * @example + * + * // create a cargoQueue object with payload 2 and concurrency 2 + * var cargoQueue = async.cargoQueue(function(tasks, callback) { + * for (var i=0; i { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function reduce(coll, memo, iteratee, callback) { + callback = once(callback); + var _iteratee = wrapAsync(iteratee); + return eachOfSeries$1(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); + } + var reduce$1 = awaitify(reduce, 4); - doDrop({error, message = "This job has been dropped by Bottleneck"} = {}) { - if (this._states.remove(this.options.id)) { - if (this.rejectOnDrop) { - this._reject(error != null ? error : new BottleneckError$1(message)); - } - this.Events.trigger("dropped", {args: this.args, options: this.options, task: this.task, promise: this.promise}); - return true; - } else { - return false; - } - } + /** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ + function seq(...functions) { + var _functions = functions.map(wrapAsync); + return function (...args) { + var that = this; - _assertStatus(expected) { - var status; - status = this._states.jobStatus(this.options.id); - if (!(status === expected || (expected === "DONE" && status === null))) { - throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`); - } - } + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = promiseCallback(); + } - doReceive() { - this._states.start(this.options.id); - return this.Events.trigger("received", {args: this.args, options: this.options}); - } + reduce$1(_functions, args, (newargs, fn, iterCb) => { + fn.apply(that, newargs.concat((err, ...nextargs) => { + iterCb(err, nextargs); + })); + }, + (err, results) => cb(err, ...results)); - doQueue(reachedHWM, blocked) { - this._assertStatus("RECEIVED"); - this._states.next(this.options.id); - return this.Events.trigger("queued", {args: this.args, options: this.options, reachedHWM, blocked}); - } + return cb[PROMISE_SYMBOL] + }; + } - doRun() { - if (this.retryCount === 0) { - this._assertStatus("QUEUED"); - this._states.next(this.options.id); - } else { - this._assertStatus("EXECUTING"); - } - return this.Events.trigger("scheduled", {args: this.args, options: this.options}); - } + /** + * Creates a function which is a composition of the passed asynchronous + * functions. Each function consumes the return value of the function that + * follows. Composing functions `f()`, `g()`, and `h()` would produce the result + * of `f(g(h()))`, only this version uses callbacks to obtain the return values. + * + * If the last argument to the composed function is not a function, a promise + * is returned when you call it. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name compose + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} an asynchronous function that is the composed + * asynchronous `functions` + * @example + * + * function add1(n, callback) { + * setTimeout(function () { + * callback(null, n + 1); + * }, 10); + * } + * + * function mul3(n, callback) { + * setTimeout(function () { + * callback(null, n * 3); + * }, 10); + * } + * + * var add1mul3 = async.compose(mul3, add1); + * add1mul3(4, function (err, result) { + * // result now equals 15 + * }); + */ + function compose(...args) { + return seq(...args.reverse()); + } - async doExecute(chained, clearGlobalState, run, free) { - var error, eventInfo, passed; - if (this.retryCount === 0) { - this._assertStatus("RUNNING"); - this._states.next(this.options.id); - } else { - this._assertStatus("EXECUTING"); - } - eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount}; - this.Events.trigger("executing", eventInfo); - try { - passed = (await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args))); - if (clearGlobalState()) { - this.doDone(eventInfo); - await free(this.options, eventInfo); - this._assertStatus("DONE"); - return this._resolve(passed); - } - } catch (error1) { - error = error1; - return this._onFailure(error, eventInfo, clearGlobalState, run, free); - } - } + /** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function mapLimit (coll, limit, iteratee, callback) { + return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback) + } + var mapLimit$1 = awaitify(mapLimit, 4); - doExpire(clearGlobalState, run, free) { - var error, eventInfo; - if (this._states.jobStatus(this.options.id === "RUNNING")) { - this._states.next(this.options.id); - } - this._assertStatus("EXECUTING"); - eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount}; - error = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error, eventInfo, clearGlobalState, run, free); - } + /** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ + function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } - async _onFailure(error, eventInfo, clearGlobalState, run, free) { - var retry, retryAfter; - if (clearGlobalState()) { - retry = (await this.Events.trigger("failed", error, eventInfo)); - if (retry != null) { - retryAfter = ~~retry; - this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); - this.retryCount++; - return run(retryAfter); - } else { - this.doDone(eventInfo); - await free(this.options, eventInfo); - this._assertStatus("DONE"); - return this._reject(error); - } - } - } + return callback(err, result); + }); + } + var concatLimit$1 = awaitify(concatLimit, 4); - doDone(eventInfo) { - this._assertStatus("EXECUTING"); - this._states.next(this.options.id); - return this.Events.trigger("done", eventInfo); - } + /** + * Applies `iteratee` to each item in `coll`, concatenating the results. Returns + * the concatenated list. The `iteratee`s are called in parallel, and the + * results are concatenated as they return. The results array will be returned in + * the original order of `coll` passed to the `iteratee` function. + * + * @name concat + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @alias flatMap + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * let directoryList = ['dir1','dir2','dir3']; + * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; + * + * // Using callbacks + * async.concat(directoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.concat(directoryList, fs.readdir) + * .then(results => { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ + function concat(coll, iteratee, callback) { + return concatLimit$1(coll, Infinity, iteratee, callback) + } + var concat$1 = awaitify(concat, 3); - }; + /** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ + function concatSeries(coll, iteratee, callback) { + return concatLimit$1(coll, 1, iteratee, callback) + } + var concatSeries$1 = awaitify(concatSeries, 3); - var Job_1 = Job; + /** + * Returns a function that when called, calls-back with the values provided. + * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to + * [`auto`]{@link module:ControlFlow.auto}. + * + * @name constant + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {...*} arguments... - Any number of arguments to automatically invoke + * callback with. + * @returns {AsyncFunction} Returns a function that when invoked, automatically + * invokes the callback with the previous given arguments. + * @example + * + * async.waterfall([ + * async.constant(42), + * function (value, next) { + * // value === 42 + * }, + * //... + * ], callback); + * + * async.waterfall([ + * async.constant(filename, "utf8"), + * fs.readFile, + * function (fileData, next) { + * //... + * } + * //... + * ], callback); + * + * async.auto({ + * hostname: async.constant("https://server.net/"), + * port: findFreePort, + * launchServer: ["hostname", "port", function (options, cb) { + * startServer(options, cb); + * }], + * //... + * }, callback); + */ + function constant$1(...args) { + return function (...ignoredArgs/*, callback*/) { + var callback = ignoredArgs.pop(); + return callback(null, ...args); + }; + } - var BottleneckError$2, LocalDatastore, parser$2; + function _createTester(check, getResult) { + return (eachfn, arr, _iteratee, cb) => { + var testPassed = false; + var testResult; + const iteratee = wrapAsync(_iteratee); + eachfn(arr, (value, _, callback) => { + iteratee(value, (err, result) => { + if (err || err === false) return callback(err); - parser$2 = parser; + if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + return callback(null, breakLoop); + } + callback(); + }); + }, err => { + if (err) return cb(err); + cb(null, testPassed ? testResult : getResult(false)); + }); + }; + } - BottleneckError$2 = BottleneckError_1; + /** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. - LocalDatastore = class LocalDatastore { - constructor(instance, storeOptions, storeInstanceOptions) { - this.instance = instance; - this.storeOptions = storeOptions; - this.clientId = this.instance._randomIndex(); - parser$2.load(storeInstanceOptions, storeInstanceOptions, this); - this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now(); - this._running = 0; - this._done = 0; - this._unblockTime = 0; - this.ready = this.Promise.resolve(); - this.clients = {}; - this._startHeartbeat(); - } + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function detect(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) + } + var detect$1 = awaitify(detect, 3); - _startHeartbeat() { - var base; - if ((this.heartbeat == null) && (((this.storeOptions.reservoirRefreshInterval != null) && (this.storeOptions.reservoirRefreshAmount != null)) || ((this.storeOptions.reservoirIncreaseInterval != null) && (this.storeOptions.reservoirIncreaseAmount != null)))) { - return typeof (base = (this.heartbeat = setInterval(() => { - var amount, incr, maximum, now, reservoir; - now = Date.now(); - if ((this.storeOptions.reservoirRefreshInterval != null) && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) { - this._lastReservoirRefresh = now; - this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount; - this.instance._drainAll(this.computeCapacity()); - } - if ((this.storeOptions.reservoirIncreaseInterval != null) && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) { - ({ - reservoirIncreaseAmount: amount, - reservoirIncreaseMaximum: maximum, - reservoir - } = this.storeOptions); - this._lastReservoirIncrease = now; - incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount; - if (incr > 0) { - this.storeOptions.reservoir += incr; - return this.instance._drainAll(this.computeCapacity()); - } - } - }, this.heartbeatInterval))).unref === "function" ? base.unref() : void 0; - } else { - return clearInterval(this.heartbeat); - } - } + /** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ + function detectLimit(coll, limit, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var detectLimit$1 = awaitify(detectLimit, 4); - async __publish__(message) { - await this.yieldLoop(); - return this.instance.Events.trigger("message", message.toString()); - } + /** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ + function detectSeries(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback) + } - async __disconnect__(flush) { - await this.yieldLoop(); - clearInterval(this.heartbeat); - return this.Promise.resolve(); - } + var detectSeries$1 = awaitify(detectSeries, 3); - yieldLoop(t = 0) { - return new this.Promise(function(resolve, reject) { - return setTimeout(resolve, t); - }); - } + function consoleFunc(name) { + return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { + /* istanbul ignore else */ + if (typeof console === 'object') { + /* istanbul ignore else */ + if (err) { + /* istanbul ignore else */ + if (console.error) { + console.error(err); + } + } else if (console[name]) { /* istanbul ignore else */ + resultArgs.forEach(x => console[name](x)); + } + } + }) + } - computePenalty() { - var ref; - return (ref = this.storeOptions.penalty) != null ? ref : (15 * this.storeOptions.minTime) || 5000; - } + /** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ + var dir = consoleFunc('dir'); - async __updateSettings__(options) { - await this.yieldLoop(); - parser$2.overwrite(options, options, this.storeOptions); - this._startHeartbeat(); - this.instance._drainAll(this.computeCapacity()); - return true; - } + /** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ + function doWhilst(iteratee, test, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results; - async __running__() { - await this.yieldLoop(); - return this._running; - } + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } - async __queued__() { - await this.yieldLoop(); - return this.instance.queued(); - } + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } - async __done__() { - await this.yieldLoop(); - return this._done; - } + return check(null, true); + } - async __groupCheck__(time) { - await this.yieldLoop(); - return (this._nextRequest + this.timeout) < time; - } + var doWhilst$1 = awaitify(doWhilst, 3); - computeCapacity() { - var maxConcurrent, reservoir; - ({maxConcurrent, reservoir} = this.storeOptions); - if ((maxConcurrent != null) && (reservoir != null)) { - return Math.min(maxConcurrent - this._running, reservoir); - } else if (maxConcurrent != null) { - return maxConcurrent - this._running; - } else if (reservoir != null) { - return reservoir; - } else { - return null; - } - } + /** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee` + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ + function doUntil(iteratee, test, callback) { + const _test = wrapAsync(test); + return doWhilst$1(iteratee, (...args) => { + const cb = args.pop(); + _test(...args, (err, truth) => cb (err, !truth)); + }, callback); + } - conditionsCheck(weight) { - var capacity; - capacity = this.computeCapacity(); - return (capacity == null) || weight <= capacity; - } + function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); + } - async __incrementReservoir__(incr) { - var reservoir; - await this.yieldLoop(); - reservoir = this.storeOptions.reservoir += incr; - this.instance._drainAll(this.computeCapacity()); - return reservoir; - } + /** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ + function eachLimit$2(coll, iteratee, callback) { + return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); + } - async __currentReservoir__() { - await this.yieldLoop(); - return this.storeOptions.reservoir; - } + var each = awaitify(eachLimit$2, 3); - isBlocked(now) { - return this._unblockTime >= now; - } + /** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); + } + var eachLimit$1 = awaitify(eachLimit, 4); - check(weight, now) { - return this.conditionsCheck(weight) && (this._nextRequest - now) <= 0; - } + /** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. - async __check__(weight) { - var now; - await this.yieldLoop(); - now = Date.now(); - return this.check(weight, now); - } + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachSeries(coll, iteratee, callback) { + return eachLimit$1(coll, 1, iteratee, callback) + } + var eachSeries$1 = awaitify(eachSeries, 3); - async __register__(index, weight, expiration) { - var now, wait; - await this.yieldLoop(); - now = Date.now(); - if (this.conditionsCheck(weight)) { - this._running += weight; - if (this.storeOptions.reservoir != null) { - this.storeOptions.reservoir -= weight; - } - wait = Math.max(this._nextRequest - now, 0); - this._nextRequest = now + wait + this.storeOptions.minTime; - return { - success: true, - wait, - reservoir: this.storeOptions.reservoir - }; - } else { - return { - success: false - }; - } - } + /** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ + function ensureAsync(fn) { + if (isAsync(fn)) return fn; + return function (...args/*, callback*/) { + var callback = args.pop(); + var sync = true; + args.push((...innerArgs) => { + if (sync) { + setImmediate$1(() => callback(...innerArgs)); + } else { + callback(...innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }; + } - strategyIsBlock() { - return this.storeOptions.strategy === 3; - } + /** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function every(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) + } + var every$1 = awaitify(every, 3); - async __submit__(queueLength, weight) { - var blocked, now, reachedHWM; - await this.yieldLoop(); - if ((this.storeOptions.maxConcurrent != null) && weight > this.storeOptions.maxConcurrent) { - 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}`); - } - now = Date.now(); - reachedHWM = (this.storeOptions.highWater != null) && queueLength === this.storeOptions.highWater && !this.check(weight, now); - blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now)); - if (blocked) { - this._unblockTime = now + this.computePenalty(); - this._nextRequest = this._unblockTime + this.storeOptions.minTime; - this.instance._dropAllQueued(); - } - return { - reachedHWM, - blocked, - strategy: this.storeOptions.strategy - }; - } + /** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function everyLimit(coll, limit, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var everyLimit$1 = awaitify(everyLimit, 4); - async __free__(index, weight) { - await this.yieldLoop(); - this._running -= weight; - this._done += weight; - this.instance._drainAll(this.computeCapacity()); - return { - running: this._running - }; - } + /** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function everySeries(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) + } + var everySeries$1 = awaitify(everySeries, 3); - }; + function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, (x, index, iterCb) => { + iteratee(x, (err, v) => { + truthValues[index] = !!v; + iterCb(err); + }); + }, err => { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); + } - var LocalDatastore_1 = LocalDatastore; + function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, (x, index, iterCb) => { + iteratee(x, (err, v) => { + if (err) return iterCb(err); + if (v) { + results.push({index, value: x}); + } + iterCb(err); + }); + }, err => { + if (err) return callback(err); + callback(null, results + .sort((a, b) => a.index - b.index) + .map(v => v.value)); + }); + } + + function _filter(eachfn, coll, iteratee, callback) { + var filter = isArrayLike(coll) ? filterArray : filterGeneric; + return filter(eachfn, coll, wrapAsync(iteratee), callback); + } + + /** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function filter (coll, iteratee, callback) { + return _filter(eachOf$1, coll, iteratee, callback) + } + var filter$1 = awaitify(filter, 3); - var BottleneckError$3, States; + /** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ + function filterLimit (coll, limit, iteratee, callback) { + return _filter(eachOfLimit$2(limit), coll, iteratee, callback) + } + var filterLimit$1 = awaitify(filterLimit, 4); - BottleneckError$3 = BottleneckError_1; + /** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ + function filterSeries (coll, iteratee, callback) { + return _filter(eachOfSeries$1, coll, iteratee, callback) + } + var filterSeries$1 = awaitify(filterSeries, 3); - States = class States { - constructor(status1) { - this.status = status1; - this._jobs = {}; - this.counts = this.status.map(function() { - return 0; - }); - } + /** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. - next(id) { - var current, next; - current = this._jobs[id]; - next = current + 1; - if ((current != null) && next < this.status.length) { - this.counts[current]--; - this.counts[next]++; - return this._jobs[id]++; - } else if (current != null) { - this.counts[current]--; - return delete this._jobs[id]; - } - } + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @returns {Promise} a promise that rejects if an error occurs and an errback + * is not passed + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ + function forever(fn, errback) { + var done = onlyOnce(errback); + var task = wrapAsync(ensureAsync(fn)); - start(id) { - var initial; - initial = 0; - this._jobs[id] = initial; - return this.counts[initial]++; - } + function next(err) { + if (err) return done(err); + if (err === false) return; + task(next); + } + return next(); + } + var forever$1 = awaitify(forever, 2); - remove(id) { - var current; - current = this._jobs[id]; - if (current != null) { - this.counts[current]--; - delete this._jobs[id]; - } - return current != null; - } + /** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ + function groupByLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { + if (err) return iterCb(err); + return iterCb(err, {key, val}); + }); + }, (err, mapResults) => { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var {hasOwnProperty} = Object.prototype; - jobStatus(id) { - var ref; - return (ref = this.status[this._jobs[id]]) != null ? ref : null; - } + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var {key} = mapResults[i]; + var {val} = mapResults[i]; - statusJobs(status) { - var k, pos, ref, results, v; - if (status != null) { - pos = this.status.indexOf(status); - if (pos < 0) { - throw new BottleneckError$3(`status must be one of ${this.status.join(', ')}`); - } - ref = this._jobs; - results = []; - for (k in ref) { - v = ref[k]; - if (v === pos) { - results.push(k); - } - } - return results; - } else { - return Object.keys(this._jobs); - } - } + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } - statusCounts() { - return this.counts.reduce(((acc, v, i) => { - acc[this.status[i]] = v; - return acc; - }), {}); - } + return callback(err, result); + }); + } - }; + var groupByLimit$1 = awaitify(groupByLimit, 4); - var States_1 = States; + /** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const files = ['dir1/file1.txt','dir2','dir4'] + * + * // asynchronous function that detects file type as none, file, or directory + * function detectFile(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(null, 'none'); + * } + * callback(null, stat.isDirectory() ? 'directory' : 'file'); + * }); + * } + * + * //Using callbacks + * async.groupBy(files, detectFile, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * }); + * + * // Using Promises + * async.groupBy(files, detectFile) + * .then( result => { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.groupBy(files, detectFile); + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function groupBy (coll, iteratee, callback) { + return groupByLimit$1(coll, Infinity, iteratee, callback) + } - var DLList$2, Sync; + /** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whose + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ + function groupBySeries (coll, iteratee, callback) { + return groupByLimit$1(coll, 1, iteratee, callback) + } - DLList$2 = DLList_1; + /** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ + var log = consoleFunc('log'); - Sync = class Sync { - constructor(name, Promise) { - this.schedule = this.schedule.bind(this); - this.name = name; - this.Promise = Promise; - this._running = 0; - this._queue = new DLList$2(); - } + /** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function mapValuesLimit(obj, limit, iteratee, callback) { + callback = once(callback); + var newObj = {}; + var _iteratee = wrapAsync(iteratee); + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { + if (err) return next(err); + newObj[key] = result; + next(err); + }); + }, err => callback(err, newObj)); + } - isEmpty() { - return this._queue.length === 0; - } + var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); - async _tryToRun() { - var args, cb, error, reject, resolve, returned, task; - if ((this._running < 1) && this._queue.length > 0) { - this._running++; - ({task, args, resolve, reject} = this._queue.shift()); - cb = (await (async function() { - try { - returned = (await task(...args)); - return function() { - return resolve(returned); - }; - } catch (error1) { - error = error1; - return function() { - return reject(error); - }; - } - })()); - this._running--; - this._tryToRun(); - return cb(); - } - } + /** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file3.txt' + * }; + * + * const withMissingFileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file4.txt' + * }; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, key, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * }); + * + * // Error handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.mapValues(fileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * }).catch (err => { + * console.log(err); + * }); + * + * // Error Handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch (err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.mapValues(fileMap, getFileSizeInBytes); + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function mapValues(obj, iteratee, callback) { + return mapValuesLimit$1(obj, Infinity, iteratee, callback) + } - schedule(task, ...args) { - var promise, reject, resolve; - resolve = reject = null; - promise = new this.Promise(function(_resolve, _reject) { - resolve = _resolve; - return reject = _reject; - }); - this._queue.push({task, args, resolve, reject}); - this._tryToRun(); - return promise; - } + /** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function mapValuesSeries(obj, iteratee, callback) { + return mapValuesLimit$1(obj, 1, iteratee, callback) + } - }; + /** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * **Note: if the async function errs, the result will not be cached and + * subsequent calls will call the wrapped function.** + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ + function memoize(fn, hasher = v => v) { + var memo = Object.create(null); + var queues = Object.create(null); + var _fn = wrapAsync(fn); + var memoized = initialParams((args, callback) => { + var key = hasher(...args); + if (key in memo) { + setImmediate$1(() => callback(null, ...memo[key])); + } else if (key in queues) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn(...args, (err, ...resultArgs) => { + // #1465 don't memoize if an error occurred + if (!err) { + memo[key] = resultArgs; + } + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i](err, ...resultArgs); + } + }); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + } - var Sync_1 = Sync; + /* istanbul ignore file */ - var version = "2.19.5"; - var version$1 = { - version: version - }; + /** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ + var _defer; - var version$2 = /*#__PURE__*/Object.freeze({ - version: version, - default: version$1 - }); + if (hasNextTick) { + _defer = process.nextTick; + } else if (hasSetImmediate) { + _defer = setImmediate; + } else { + _defer = fallback; + } - var require$$2 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); + var nextTick = wrap(_defer); - var require$$3 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); + var _parallel = awaitify((eachfn, tasks, callback) => { + var results = isArrayLike(tasks) ? [] : {}; - var require$$4 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); + eachfn(tasks, (task, key, taskCb) => { + wrapAsync(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, err => callback(err, results)); + }, 3); - var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3; + /** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * + * //Using Callbacks + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function parallel(tasks, callback) { + return _parallel(eachOf$1, tasks, callback); + } - parser$3 = parser; + /** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + */ + function parallelLimit(tasks, limit, callback) { + return _parallel(eachOfLimit$2(limit), tasks, callback); + } - Events$2 = Events_1; + /** + * A queue of tasks for the worker function to complete. + * @typedef {Iterable} QueueObject + * @memberOf module:ControlFlow + * @property {Function} length - a function returning the number of items + * waiting to be processed. Invoke with `queue.length()`. + * @property {boolean} started - a boolean indicating whether or not any + * items have been pushed and processed by the queue. + * @property {Function} running - a function returning the number of items + * currently being processed. Invoke with `queue.running()`. + * @property {Function} workersList - a function returning the array of items + * currently being processed. Invoke with `queue.workersList()`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke with `queue.idle()`. + * @property {number} concurrency - an integer for determining how many `worker` + * functions should be run in parallel. This property can be changed after a + * `queue` is created to alter the concurrency on-the-fly. + * @property {number} payload - an integer that specifies how many items are + * passed to the worker function at a time. only applies if this is a + * [cargo]{@link module:ControlFlow.cargo} object + * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` + * once the `worker` has finished processing the task. Instead of a single task, + * a `tasks` array can be submitted. The respective callback is used for every + * task in the list. Invoke with `queue.push(task, [callback])`, + * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. + * Invoke with `queue.unshift(task, [callback])`. + * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns + * a promise that rejects if an error occurs. + * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns + * a promise that rejects if an error occurs. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. + * @property {Function} saturated - a function that sets a callback that is + * called when the number of running workers hits the `concurrency` limit, and + * further tasks will be queued. If the callback is omitted, `q.saturated()` + * returns a promise for the next occurrence. + * @property {Function} unsaturated - a function that sets a callback that is + * called when the number of running workers is less than the `concurrency` & + * `buffer` limits, and further tasks will not be queued. If the callback is + * omitted, `q.unsaturated()` returns a promise for the next occurrence. + * @property {number} buffer - A minimum threshold buffer in order to say that + * the `queue` is `unsaturated`. + * @property {Function} empty - a function that sets a callback that is called + * when the last item from the `queue` is given to a `worker`. If the callback + * is omitted, `q.empty()` returns a promise for the next occurrence. + * @property {Function} drain - a function that sets a callback that is called + * when the last item from the `queue` has returned from the `worker`. If the + * callback is omitted, `q.drain()` returns a promise for the next occurrence. + * @property {Function} error - a function that sets a callback that is called + * when a task errors. Has the signature `function(error, task)`. If the + * callback is omitted, `error()` returns a promise that rejects on the next + * error. + * @property {boolean} paused - a boolean for determining whether the queue is + * in a paused state. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke with `queue.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke with `queue.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. No more tasks + * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. + * + * @example + * const q = async.queue(worker, 2) + * q.push(item1) + * q.push(item2) + * q.push(item3) + * // queues are iterable, spread into an array to inspect + * const items = [...q] // [item1, item2, item3] + * // or use for of + * for (let item of q) { + * console.log(item) + * } + * + * q.drain(() => { + * console.log('all done') + * }) + * // or + * await q.drain() + */ - RedisConnection$1 = require$$2; + /** + * Creates a `queue` object with the specified `concurrency`. Tasks added to the + * `queue` are processed in parallel (up to the `concurrency` limit). If all + * `worker`s are in progress, the task is queued until one becomes available. + * Once a `worker` completes a `task`, that `task`'s callback is called. + * + * @name queue + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. Invoked with (task, callback). + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be + * attached as certain properties to listen for specific events during the + * lifecycle of the queue. + * @example + * + * // create a queue object with concurrency 2 + * var q = async.queue(function(task, callback) { + * console.log('hello ' + task.name); + * callback(); + * }, 2); + * + * // assign a callback + * q.drain(function() { + * console.log('all items have been processed'); + * }); + * // or await the end + * await q.drain() + * + * // assign an error callback + * q.error(function(err, task) { + * console.error('task experienced an error'); + * }); + * + * // add some items to the queue + * q.push({name: 'foo'}, function(err) { + * console.log('finished processing foo'); + * }); + * // callback is optional + * q.push({name: 'bar'}); + * + * // add some items to the queue (batch-wise) + * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { + * console.log('finished processing item'); + * }); + * + * // add some items to the front of the queue + * q.unshift({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + */ + function queue (worker, concurrency) { + var _worker = wrapAsync(worker); + return queue$1((items, cb) => { + _worker(items[0], cb); + }, concurrency, 1); + } - IORedisConnection$1 = require$$3; + // Binary min-heap implementation used for priority queue. + // Implementation is stable, i.e. push time is considered for equal priorities + class Heap { + constructor() { + this.heap = []; + this.pushCount = Number.MIN_SAFE_INTEGER; + } - Scripts$1 = require$$4; + get length() { + return this.heap.length; + } - Group = (function() { - class Group { - constructor(limiterOptions = {}) { - this.deleteKey = this.deleteKey.bind(this); - this.limiterOptions = limiterOptions; - parser$3.load(this.limiterOptions, this.defaults, this); - this.Events = new Events$2(this); - this.instances = {}; - this.Bottleneck = Bottleneck_1; - this._startAutoCleanup(); - this.sharedConnection = this.connection != null; - if (this.connection == null) { - if (this.limiterOptions.datastore === "redis") { - this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events})); - } else if (this.limiterOptions.datastore === "ioredis") { - this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events})); - } - } - } + empty () { + this.heap = []; + return this; + } - key(key = "") { - var ref; - return (ref = this.instances[key]) != null ? ref : (() => { - var limiter; - limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, { - id: `${this.id}-${key}`, - timeout: this.timeout, - connection: this.connection - })); - this.Events.trigger("created", limiter, key); - return limiter; - })(); - } + percUp(index) { + let p; - async deleteKey(key = "") { - var deleted, instance; - instance = this.instances[key]; - if (this.connection) { - deleted = (await this.connection.__runCommand__(['del', ...Scripts$1.allKeys(`${this.id}-${key}`)])); - } - if (instance != null) { - delete this.instances[key]; - await instance.disconnect(); - } - return (instance != null) || deleted > 0; - } + while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { + let t = this.heap[index]; + this.heap[index] = this.heap[p]; + this.heap[p] = t; - limiters() { - var k, ref, results, v; - ref = this.instances; - results = []; - for (k in ref) { - v = ref[k]; - results.push({ - key: k, - limiter: v - }); - } - return results; - } + index = p; + } + } - keys() { - return Object.keys(this.instances); - } + percDown(index) { + let l; - async clusterKeys() { - var cursor, end, found, i, k, keys, len, next, start; - if (this.connection == null) { - return this.Promise.resolve(this.keys()); - } - keys = []; - cursor = null; - start = `b_${this.id}-`.length; - end = "_settings".length; - while (cursor !== 0) { - [next, found] = (await this.connection.__runCommand__(["scan", cursor != null ? cursor : 0, "match", `b_${this.id}-*_settings`, "count", 10000])); - cursor = ~~next; - for (i = 0, len = found.length; i < len; i++) { - k = found[i]; - keys.push(k.slice(start, -end)); - } - } - return keys; - } + while ((l=leftChi(index)) < this.heap.length) { + if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { + l = l+1; + } - _startAutoCleanup() { - var base; - clearInterval(this.interval); - return typeof (base = (this.interval = setInterval(async() => { - var e, k, ref, results, time, v; - time = Date.now(); - ref = this.instances; - results = []; - for (k in ref) { - v = ref[k]; - try { - if ((await v._store.__groupCheck__(time))) { - results.push(this.deleteKey(k)); - } else { - results.push(void 0); - } - } catch (error) { - e = error; - results.push(v.Events.trigger("error", e)); - } - } - return results; - }, this.timeout / 2))).unref === "function" ? base.unref() : void 0; - } + if (smaller(this.heap[index], this.heap[l])) { + break; + } - updateSettings(options = {}) { - parser$3.overwrite(options, this.defaults, this); - parser$3.overwrite(options, options, this.limiterOptions); - if (options.timeout != null) { - return this._startAutoCleanup(); - } - } + let t = this.heap[index]; + this.heap[index] = this.heap[l]; + this.heap[l] = t; - disconnect(flush = true) { - var ref; - if (!this.sharedConnection) { - return (ref = this.connection) != null ? ref.disconnect(flush) : void 0; - } - } + index = l; + } + } - } - Group.prototype.defaults = { - timeout: 1000 * 60 * 5, - connection: null, - Promise: Promise, - id: "group-key" - }; + push(node) { + node.pushCount = ++this.pushCount; + this.heap.push(node); + this.percUp(this.heap.length-1); + } - return Group; + unshift(node) { + return this.heap.push(node); + } - }).call(commonjsGlobal); + shift() { + let [top] = this.heap; - var Group_1 = Group; + this.heap[0] = this.heap[this.heap.length-1]; + this.heap.pop(); + this.percDown(0); - var Batcher, Events$3, parser$4; + return top; + } - parser$4 = parser; + toArray() { + return [...this]; + } - Events$3 = Events_1; + *[Symbol.iterator] () { + for (let i = 0; i < this.heap.length; i++) { + yield this.heap[i].data; + } + } - Batcher = (function() { - class Batcher { - constructor(options = {}) { - this.options = options; - parser$4.load(this.options, this.defaults, this); - this.Events = new Events$3(this); - this._arr = []; - this._resetPromise(); - this._lastFlush = Date.now(); - } + remove (testFn) { + let j = 0; + for (let i = 0; i < this.heap.length; i++) { + if (!testFn(this.heap[i])) { + this.heap[j] = this.heap[i]; + j++; + } + } - _resetPromise() { - return this._promise = new this.Promise((res, rej) => { - return this._resolve = res; - }); - } + this.heap.splice(j); - _flush() { - clearTimeout(this._timeout); - this._lastFlush = Date.now(); - this._resolve(); - this.Events.trigger("batch", this._arr); - this._arr = []; - return this._resetPromise(); - } + for (let i = parent(this.heap.length-1); i >= 0; i--) { + this.percDown(i); + } - add(data) { - var ret; - this._arr.push(data); - ret = this._promise; - if (this._arr.length === this.maxSize) { - this._flush(); - } else if ((this.maxTime != null) && this._arr.length === 1) { - this._timeout = setTimeout(() => { - return this._flush(); - }, this.maxTime); - } - return ret; - } + return this; + } + } - } - Batcher.prototype.defaults = { - maxTime: null, - maxSize: null, - Promise: Promise - }; + function leftChi(i) { + return (i<<1)+1; + } - return Batcher; + function parent(i) { + return ((i+1)>>1)-1; + } - }).call(commonjsGlobal); + function smaller(x, y) { + if (x.priority !== y.priority) { + return x.priority < y.priority; + } + else { + return x.pushCount < y.pushCount; + } + } - var Batcher_1 = Batcher; + /** + * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and + * completed in ascending priority order. + * + * @name priorityQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. + * Invoked with (task, callback). + * @param {number} concurrency - An `integer` for determining how many `worker` + * functions should be run in parallel. If omitted, the concurrency defaults to + * `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three + * differences between `queue` and `priorityQueue` objects: + * * `push(task, priority, [callback])` - `priority` should be a number. If an + * array of `tasks` is given, all tasks will be assigned the same priority. + * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, + * except this returns a promise that rejects if an error occurs. + * * The `unshift` and `unshiftAsync` methods were removed. + */ + function priorityQueue(worker, concurrency) { + // Start with a normal queue + var q = queue(worker, concurrency); - var require$$4$1 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); + var { + push, + pushAsync + } = q; - var require$$8 = getCjsExportFromNamespace(version$2); + q._tasks = new Heap(); + q._createTaskItem = ({data, priority}, callback) => { + return { + data, + priority, + callback + }; + }; - var Bottleneck, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, - splice = [].splice; + function createDataItems(tasks, priority) { + if (!Array.isArray(tasks)) { + return {data: tasks, priority}; + } + return tasks.map(data => { return {data, priority}; }); + } - NUM_PRIORITIES$1 = 10; + // Override push to accept second parameter representing priority + q.push = function(data, priority = 0, callback) { + return push(createDataItems(data, priority), callback); + }; - DEFAULT_PRIORITY$1 = 5; + q.pushAsync = function(data, priority = 0, callback) { + return pushAsync(createDataItems(data, priority), callback); + }; - parser$5 = parser; + // Remove unshift functions + delete q.unshift; + delete q.unshiftAsync; - Queues$1 = Queues_1; + return q; + } - Job$1 = Job_1; + /** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ + function race(tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + wrapAsync(tasks[i])(callback); + } + } - LocalDatastore$1 = LocalDatastore_1; + var race$1 = awaitify(race, 2); - RedisDatastore$1 = require$$4$1; + /** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function reduceRight (array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return reduce$1(reversed, memo, iteratee, callback); + } - Events$4 = Events_1; + /** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ + function reflect(fn) { + var _fn = wrapAsync(fn); + return initialParams(function reflectOn(args, reflectCallback) { + args.push((error, ...cbArgs) => { + let retVal = {}; + if (error) { + retVal.error = error; + } + if (cbArgs.length > 0){ + var value = cbArgs; + if (cbArgs.length <= 1) { + [value] = cbArgs; + } + retVal.value = value; + } + reflectCallback(null, retVal); + }); - States$1 = States_1; + return _fn.apply(this, args); + }); + } - Sync$1 = Sync_1; + /** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ + function reflectAll(tasks) { + var results; + if (Array.isArray(tasks)) { + results = tasks.map(reflect); + } else { + results = {}; + Object.keys(tasks).forEach(key => { + results[key] = reflect.call(this, tasks[key]); + }); + } + return results; + } - Bottleneck = (function() { - class Bottleneck { - constructor(options = {}, ...invalid) { - var storeInstanceOptions, storeOptions; - this._addToQueue = this._addToQueue.bind(this); - this._validateOptions(options, invalid); - parser$5.load(options, this.instanceDefaults, this); - this._queues = new Queues$1(NUM_PRIORITIES$1); - this._scheduled = {}; - this._states = new States$1(["RECEIVED", "QUEUED", "RUNNING", "EXECUTING"].concat(this.trackDoneStatus ? ["DONE"] : [])); - this._limiter = null; - this.Events = new Events$4(this); - this._submitLock = new Sync$1("submit", this.Promise); - this._registerLock = new Sync$1("register", this.Promise); - storeOptions = parser$5.load(options, this.storeDefaults, {}); - this._store = (function() { - if (this.datastore === "redis" || this.datastore === "ioredis" || (this.connection != null)) { - storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {}); - return new RedisDatastore$1(this, storeOptions, storeInstanceOptions); - } else if (this.datastore === "local") { - storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {}); - return new LocalDatastore$1(this, storeOptions, storeInstanceOptions); - } else { - throw new Bottleneck.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`); - } - }).call(this); - this._queues.on("leftzero", () => { - var ref; - return (ref = this._store.heartbeat) != null ? typeof ref.ref === "function" ? ref.ref() : void 0 : void 0; - }); - this._queues.on("zero", () => { - var ref; - return (ref = this._store.heartbeat) != null ? typeof ref.unref === "function" ? ref.unref() : void 0 : void 0; - }); - } + function reject$2(eachfn, arr, _iteratee, callback) { + const iteratee = wrapAsync(_iteratee); + return _filter(eachfn, arr, (value, cb) => { + iteratee(value, (err, v) => { + cb(err, !v); + }); + }, callback); + } - _validateOptions(options, invalid) { - if (!((options != null) && typeof options === "object" && invalid.length === 0)) { - 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."); - } - } + /** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.reject(fileList, fileExists, function(err, results) { + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }); + * + * // Using Promises + * async.reject(fileList, fileExists) + * .then( results => { + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.reject(fileList, fileExists); + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function reject (coll, iteratee, callback) { + return reject$2(eachOf$1, coll, iteratee, callback) + } + var reject$1 = awaitify(reject, 3); - ready() { - return this._store.ready; - } + /** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function rejectLimit (coll, limit, iteratee, callback) { + return reject$2(eachOfLimit$2(limit), coll, iteratee, callback) + } + var rejectLimit$1 = awaitify(rejectLimit, 4); - clients() { - return this._store.clients; - } + /** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function rejectSeries (coll, iteratee, callback) { + return reject$2(eachOfSeries$1, coll, iteratee, callback) + } + var rejectSeries$1 = awaitify(rejectSeries, 3); - channel() { - return `b_${this.id}`; - } + function constant(value) { + return function () { + return value; + } + } - channel_client() { - return `b_${this.id}_${this._store.clientId}`; - } + /** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * @returns {Promise} a promise if no callback provided + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ + const DEFAULT_TIMES = 5; + const DEFAULT_INTERVAL = 0; - publish(message) { - return this._store.__publish__(message); - } + function retry(opts, task, callback) { + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant(DEFAULT_INTERVAL) + }; - disconnect(flush = true) { - return this._store.__disconnect__(flush); - } + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || promiseCallback(); + task = opts; + } else { + parseTimes(options, opts); + callback = callback || promiseCallback(); + } - chain(_limiter) { - this._limiter = _limiter; - return this; - } + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } - queued(priority) { - return this._queues.queued(priority); - } + var _task = wrapAsync(task); - clusterQueued() { - return this._store.__queued__(); - } + var attempt = 1; + function retryAttempt() { + _task((err, ...args) => { + if (err === false) return + if (err && attempt++ < options.times && + (typeof options.errorFilter != 'function' || + options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); + } else { + callback(err, ...args); + } + }); + } - empty() { - return this.queued() === 0 && this._submitLock.isEmpty(); - } + retryAttempt(); + return callback[PROMISE_SYMBOL] + } - running() { - return this._store.__running__(); - } + function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; - done() { - return this._store.__done__(); - } + acc.intervalFunc = typeof t.interval === 'function' ? + t.interval : + constant(+t.interval || DEFAULT_INTERVAL); - jobStatus(id) { - return this._states.jobStatus(id); - } + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } + } - jobs(status) { - return this._states.statusJobs(status); - } + /** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry`, except for a `opts.arity` that + * is the arity of the `task` function, defaulting to `task.length` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ + function retryable (opts, task) { + if (!task) { + task = opts; + opts = null; + } + let arity = (opts && opts.arity) || task.length; + if (isAsync(task)) { + arity += 1; + } + var _task = wrapAsync(task); + return initialParams((args, callback) => { + if (args.length < arity - 1 || callback == null) { + args.push(callback); + callback = promiseCallback(); + } + function taskFn(cb) { + _task(...args, cb); + } - counts() { - return this._states.statusCounts(); - } + if (opts) retry(opts, taskFn, callback); + else retry(taskFn, callback); - _randomIndex() { - return Math.random().toString(36).slice(2); - } + return callback[PROMISE_SYMBOL] + }); + } - check(weight = 1) { - return this._store.__check__(weight); - } + /** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @return {Promise} a promise, if no callback is passed + * @example + * + * //Using Callbacks + * async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] + * }); + * + * // an example using objects instead of arrays + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.series([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function series(tasks, callback) { + return _parallel(eachOfSeries$1, tasks, callback); + } - _clearGlobalState(index) { - if (this._scheduled[index] != null) { - clearTimeout(this._scheduled[index].expiration); - delete this._scheduled[index]; - return true; - } else { - return false; - } - } + /** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function some(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) + } + var some$1 = awaitify(some, 3); - async _free(index, job, options, eventInfo) { - var e, running; - try { - ({running} = (await this._store.__free__(index, options.weight))); - this.Events.trigger("debug", `Freed ${options.id}`, eventInfo); - if (running === 0 && this.empty()) { - return this.Events.trigger("idle"); - } - } catch (error1) { - e = error1; - return this.Events.trigger("error", e); - } - } + /** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function someLimit(coll, limit, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var someLimit$1 = awaitify(someLimit, 4); - _run(index, job, wait) { - var clearGlobalState, free, run; - job.doRun(); - clearGlobalState = this._clearGlobalState.bind(this, index); - run = this._run.bind(this, index, job); - free = this._free.bind(this, index, job); - return this._scheduled[index] = { - timeout: setTimeout(() => { - return job.doExecute(this._limiter, clearGlobalState, run, free); - }, wait), - expiration: job.options.expiration != null ? setTimeout(function() { - return job.doExpire(clearGlobalState, run, free); - }, wait + job.options.expiration) : void 0, - job: job - }; - } + /** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function someSeries(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) + } + var someSeries$1 = awaitify(someSeries, 3); + + /** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @returns {Promise} a promise, if no callback passed + * @example + * + * // bigfile.txt is a file that is 251100 bytes in size + * // mediumfile.txt is a file that is 11000 bytes in size + * // smallfile.txt is a file that is 121 bytes in size + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) return callback(getFileSizeErr); + * callback(null, fileSize); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // descending order + * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) { + * return callback(getFileSizeErr); + * } + * callback(null, fileSize * -1); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] + * } + * } + * ); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * } + * ); + * + * // Using Promises + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * (async () => { + * try { + * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * // Error handling + * async () => { + * try { + * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function sortBy (coll, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return map$1(coll, (x, iterCb) => { + _iteratee(x, (err, criteria) => { + if (err) return iterCb(err); + iterCb(err, {value: x, criteria}); + }); + }, (err, results) => { + if (err) return callback(err); + callback(null, results.sort(comparator).map(v => v.value)); + }); - _drainOne(capacity) { - return this._registerLock.schedule(() => { - var args, index, next, options, queue; - if (this.queued() === 0) { - return this.Promise.resolve(null); - } - queue = this._queues.getFirst(); - ({options, args} = next = queue.first()); - if ((capacity != null) && options.weight > capacity) { - return this.Promise.resolve(null); - } - this.Events.trigger("debug", `Draining ${options.id}`, {args, options}); - index = this._randomIndex(); - return this._store.__register__(index, options.weight, options.expiration).then(({success, wait, reservoir}) => { - var empty; - this.Events.trigger("debug", `Drained ${options.id}`, {success, args, options}); - if (success) { - queue.shift(); - empty = this.empty(); - if (empty) { - this.Events.trigger("empty"); - } - if (reservoir === 0) { - this.Events.trigger("depleted", empty); - } - this._run(index, next, wait); - return this.Promise.resolve(options.weight); - } else { - return this.Promise.resolve(null); - } - }); - }); - } + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } + } + var sortBy$1 = awaitify(sortBy, 3); - _drainAll(capacity, total = 0) { - return this._drainOne(capacity).then((drained) => { - var newCapacity; - if (drained != null) { - newCapacity = capacity != null ? capacity - drained : capacity; - return this._drainAll(newCapacity, total + drained); - } else { - return this.Promise.resolve(total); - } - }).catch((e) => { - return this.Events.trigger("error", e); - }); - } + /** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ + function timeout(asyncFn, milliseconds, info) { + var fn = wrapAsync(asyncFn); - _dropAllQueued(message) { - return this._queues.shiftAll(function(job) { - return job.doDrop({message}); - }); - } + return initialParams((args, callback) => { + var timedOut = false; + var timer; - stop(options = {}) { - var done, waitForExecuting; - options = parser$5.load(options, this.stopDefaults); - waitForExecuting = (at) => { - var finished; - finished = () => { - var counts; - counts = this._states.counts; - return (counts[0] + counts[1] + counts[2] + counts[3]) === at; - }; - return new this.Promise((resolve, reject) => { - if (finished()) { - return resolve(); - } else { - return this.on("done", () => { - if (finished()) { - this.removeAllListeners("done"); - return resolve(); - } - }); - } - }); - }; - done = options.dropWaitingJobs ? (this._run = function(index, next) { - return next.doDrop({ - message: options.dropErrorMessage - }); - }, this._drainOne = () => { - return this.Promise.resolve(null); - }, this._registerLock.schedule(() => { - return this._submitLock.schedule(() => { - var k, ref, v; - ref = this._scheduled; - for (k in ref) { - v = ref[k]; - if (this.jobStatus(v.job.options.id) === "RUNNING") { - clearTimeout(v.timeout); - clearTimeout(v.expiration); - v.job.doDrop({ - message: options.dropErrorMessage - }); - } - } - this._dropAllQueued(options.dropErrorMessage); - return waitForExecuting(0); - }); - })) : this.schedule({ - priority: NUM_PRIORITIES$1 - 1, - weight: 0 - }, () => { - return waitForExecuting(1); - }); - this._receive = function(job) { - return job._reject(new Bottleneck.prototype.BottleneckError(options.enqueueErrorMessage)); - }; - this.stop = () => { - return this.Promise.reject(new Bottleneck.prototype.BottleneckError("stop() has already been called")); - }; - return done; - } + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } - async _addToQueue(job) { - var args, blocked, error, options, reachedHWM, shifted, strategy; - ({args, options} = job); - try { - ({reachedHWM, blocked, strategy} = (await this._store.__submit__(this.queued(), options.weight))); - } catch (error1) { - error = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, {args, options, error}); - job.doDrop({error}); - return false; - } - if (blocked) { - job.doDrop(); - return true; - } else if (reachedHWM) { - 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; - if (shifted != null) { - shifted.doDrop(); - } - if ((shifted == null) || strategy === Bottleneck.prototype.strategy.OVERFLOW) { - if (shifted == null) { - job.doDrop(); - } - return reachedHWM; - } - } - job.doQueue(reachedHWM, blocked); - this._queues.push(job); - await this._drainAll(); - return reachedHWM; - } + args.push((...cbArgs) => { + if (!timedOut) { + callback(...cbArgs); + clearTimeout(timer); + } + }); - _receive(job) { - if (this._states.jobStatus(job.options.id) != null) { - job._reject(new Bottleneck.prototype.BottleneckError(`A job with the same id already exists (id=${job.options.id})`)); - return false; - } else { - job.doReceive(); - return this._submitLock.schedule(this._addToQueue, job); - } - } + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn(...args); + }); + } - submit(...args) { - var cb, fn, job, options, ref, ref1, task; - if (typeof args[0] === "function") { - ref = args, [fn, ...args] = ref, [cb] = splice.call(args, -1); - options = parser$5.load({}, this.jobDefaults); - } else { - ref1 = args, [options, fn, ...args] = ref1, [cb] = splice.call(args, -1); - options = parser$5.load(options, this.jobDefaults); - } - task = (...args) => { - return new this.Promise(function(resolve, reject) { - return fn(...args, function(...args) { - return (args[0] != null ? reject : resolve)(args); - }); - }); - }; - job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); - job.promise.then(function(args) { - return typeof cb === "function" ? cb(...args) : void 0; - }).catch(function(args) { - if (Array.isArray(args)) { - return typeof cb === "function" ? cb(...args) : void 0; - } else { - return typeof cb === "function" ? cb(args) : void 0; - } - }); - return this._receive(job); - } + function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; + } - schedule(...args) { - var job, options, task; - if (typeof args[0] === "function") { - [task, ...args] = args; - options = {}; - } else { - [options, task, ...args] = args; - } - job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); - this._receive(job); - return job.promise; - } + /** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ + function timesLimit(count, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(range(count), limit, _iteratee, callback); + } - wrap(fn) { - var schedule, wrapped; - schedule = this.schedule.bind(this); - wrapped = function(...args) { - return schedule(fn.bind(this), ...args); - }; - wrapped.withOptions = function(options, ...args) { - return schedule(options, fn, ...args); - }; - return wrapped; - } + /** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ + function times (n, iteratee, callback) { + return timesLimit(n, Infinity, iteratee, callback) + } - async updateSettings(options = {}) { - await this._store.__updateSettings__(parser$5.overwrite(options, this.storeDefaults)); - parser$5.overwrite(options, this.instanceDefaults, this); - return this; - } + /** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ + function timesSeries (n, iteratee, callback) { + return timesLimit(n, 1, iteratee, callback) + } - currentReservoir() { - return this._store.__currentReservoir__(); - } + /** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in parallel, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileList, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * }); + * + * // Using Promises + * async.transform(fileList, transformFileSize) + * .then(result => { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * (async () => { + * try { + * let result = await async.transform(fileList, transformFileSize); + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileMap, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * }); + * + * // Using Promises + * async.transform(fileMap, transformFileSize) + * .then(result => { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.transform(fileMap, transformFileSize); + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function transform (coll, accumulator, iteratee, callback) { + if (arguments.length <= 3 && typeof accumulator === 'function') { + callback = iteratee; + iteratee = accumulator; + accumulator = Array.isArray(coll) ? [] : {}; + } + callback = once(callback || promiseCallback()); + var _iteratee = wrapAsync(iteratee); - incrementReservoir(incr = 0) { - return this._store.__incrementReservoir__(incr); - } + eachOf$1(coll, (v, k, cb) => { + _iteratee(accumulator, v, k, cb); + }, err => callback(err, accumulator)); + return callback[PROMISE_SYMBOL] + } - } - Bottleneck.default = Bottleneck; + /** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ + function tryEach(tasks, callback) { + var error = null; + var result; + return eachSeries$1(tasks, (task, taskCb) => { + wrapAsync(task)((err, ...args) => { + if (err === false) return taskCb(err); - Bottleneck.Events = Events$4; + if (args.length < 2) { + [result] = args; + } else { + result = args; + } + error = err; + taskCb(err ? null : {}); + }); + }, () => callback(error, result)); + } - Bottleneck.version = Bottleneck.prototype.version = require$$8.version; + var tryEach$1 = awaitify(tryEach); - Bottleneck.strategy = Bottleneck.prototype.strategy = { - LEAK: 1, - OVERFLOW: 2, - OVERFLOW_PRIORITY: 4, - BLOCK: 3 - }; + /** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ + function unmemoize(fn) { + return (...args) => { + return (fn.unmemoized || fn)(...args); + }; + } - Bottleneck.BottleneckError = Bottleneck.prototype.BottleneckError = BottleneckError_1; + /** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ + function whilst(test, iteratee, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results = []; - Bottleneck.Group = Bottleneck.prototype.Group = Group_1; + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } - Bottleneck.RedisConnection = Bottleneck.prototype.RedisConnection = require$$2; + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } - Bottleneck.IORedisConnection = Bottleneck.prototype.IORedisConnection = require$$3; + return _test(check); + } + var whilst$1 = awaitify(whilst, 3); - Bottleneck.Batcher = Bottleneck.prototype.Batcher = Batcher_1; + /** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * const results = [] + * let finished = false + * async.until(function test(cb) { + * cb(null, finished) + * }, function iter(next) { + * fetchPage(url, (err, body) => { + * if (err) return next(err) + * results = results.concat(body.objects) + * finished = !!body.next + * next(err) + * }) + * }, function done (err) { + * // all pages have been fetched + * }) + */ + function until(test, iteratee, callback) { + const _test = wrapAsync(test); + return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); + } - Bottleneck.prototype.jobDefaults = { - priority: DEFAULT_PRIORITY$1, - weight: 1, - expiration: null, - id: "" - }; + /** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ + function waterfall (tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; - Bottleneck.prototype.storeDefaults = { - maxConcurrent: null, - minTime: 0, - highWater: null, - strategy: Bottleneck.prototype.strategy.LEAK, - penalty: null, - reservoir: null, - reservoirRefreshInterval: null, - reservoirRefreshAmount: null, - reservoirIncreaseInterval: null, - reservoirIncreaseAmount: null, - reservoirIncreaseMaximum: null - }; + function nextTask(args) { + var task = wrapAsync(tasks[taskIndex++]); + task(...args, onlyOnce(next)); + } - Bottleneck.prototype.localStoreDefaults = { - Promise: Promise, - timeout: null, - heartbeatInterval: 250 - }; + function next(err, ...args) { + if (err === false) return + if (err || taskIndex === tasks.length) { + return callback(err, ...args); + } + nextTask(args); + } - Bottleneck.prototype.redisStoreDefaults = { - Promise: Promise, - timeout: null, - heartbeatInterval: 5000, - clientTimeout: 10000, - Redis: null, - clientOptions: {}, - clusterNodes: null, - clearDatastore: false, - connection: null - }; + nextTask([]); + } - Bottleneck.prototype.instanceDefaults = { - datastore: "local", - connection: null, - id: "", - rejectOnDrop: true, - trackDoneStatus: false, - Promise: Promise - }; + var waterfall$1 = awaitify(waterfall); - Bottleneck.prototype.stopDefaults = { - enqueueErrorMessage: "This limiter has been stopped and cannot accept new jobs.", - dropWaitingJobs: true, - dropErrorMessage: "This limiter has been stopped." - }; + /** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ - return Bottleneck; - }).call(commonjsGlobal); + var index = { + apply, + applyEach, + applyEachSeries, + asyncify, + auto, + autoInject, + cargo: cargo$1, + cargoQueue: cargo, + compose, + concat: concat$1, + concatLimit: concatLimit$1, + concatSeries: concatSeries$1, + constant: constant$1, + detect: detect$1, + detectLimit: detectLimit$1, + detectSeries: detectSeries$1, + dir, + doUntil, + doWhilst: doWhilst$1, + each, + eachLimit: eachLimit$1, + eachOf: eachOf$1, + eachOfLimit: eachOfLimit$1, + eachOfSeries: eachOfSeries$1, + eachSeries: eachSeries$1, + ensureAsync, + every: every$1, + everyLimit: everyLimit$1, + everySeries: everySeries$1, + filter: filter$1, + filterLimit: filterLimit$1, + filterSeries: filterSeries$1, + forever: forever$1, + groupBy, + groupByLimit: groupByLimit$1, + groupBySeries, + log, + map: map$1, + mapLimit: mapLimit$1, + mapSeries: mapSeries$1, + mapValues, + mapValuesLimit: mapValuesLimit$1, + mapValuesSeries, + memoize, + nextTick, + parallel, + parallelLimit, + priorityQueue, + queue, + race: race$1, + reduce: reduce$1, + reduceRight, + reflect, + reflectAll, + reject: reject$1, + rejectLimit: rejectLimit$1, + rejectSeries: rejectSeries$1, + retry, + retryable, + seq, + series, + setImmediate: setImmediate$1, + some: some$1, + someLimit: someLimit$1, + someSeries: someSeries$1, + sortBy: sortBy$1, + timeout, + times, + timesLimit, + timesSeries, + transform, + tryEach: tryEach$1, + unmemoize, + until, + waterfall: waterfall$1, + whilst: whilst$1, - var Bottleneck_1 = Bottleneck; + // aliases + all: every$1, + allLimit: everyLimit$1, + allSeries: everySeries$1, + any: some$1, + anyLimit: someLimit$1, + anySeries: someSeries$1, + find: detect$1, + findLimit: detectLimit$1, + findSeries: detectSeries$1, + flatMap: concat$1, + flatMapLimit: concatLimit$1, + flatMapSeries: concatSeries$1, + forEach: each, + forEachSeries: eachSeries$1, + forEachLimit: eachLimit$1, + forEachOf: eachOf$1, + forEachOfSeries: eachOfSeries$1, + forEachOfLimit: eachOfLimit$1, + inject: reduce$1, + foldl: reduce$1, + foldr: reduceRight, + select: filter$1, + selectLimit: filterLimit$1, + selectSeries: filterSeries$1, + wrapSync: asyncify, + during: whilst$1, + doDuring: doWhilst$1 + }; - var lib = Bottleneck_1; + exports.all = every$1; + exports.allLimit = everyLimit$1; + exports.allSeries = everySeries$1; + exports.any = some$1; + exports.anyLimit = someLimit$1; + exports.anySeries = someSeries$1; + exports.apply = apply; + exports.applyEach = applyEach; + exports.applyEachSeries = applyEachSeries; + exports.asyncify = asyncify; + exports.auto = auto; + exports.autoInject = autoInject; + exports.cargo = cargo$1; + exports.cargoQueue = cargo; + exports.compose = compose; + exports.concat = concat$1; + exports.concatLimit = concatLimit$1; + exports.concatSeries = concatSeries$1; + exports.constant = constant$1; + exports.default = index; + exports.detect = detect$1; + exports.detectLimit = detectLimit$1; + exports.detectSeries = detectSeries$1; + exports.dir = dir; + exports.doDuring = doWhilst$1; + exports.doUntil = doUntil; + exports.doWhilst = doWhilst$1; + exports.during = whilst$1; + exports.each = each; + exports.eachLimit = eachLimit$1; + exports.eachOf = eachOf$1; + exports.eachOfLimit = eachOfLimit$1; + exports.eachOfSeries = eachOfSeries$1; + exports.eachSeries = eachSeries$1; + exports.ensureAsync = ensureAsync; + exports.every = every$1; + exports.everyLimit = everyLimit$1; + exports.everySeries = everySeries$1; + exports.filter = filter$1; + exports.filterLimit = filterLimit$1; + exports.filterSeries = filterSeries$1; + exports.find = detect$1; + exports.findLimit = detectLimit$1; + exports.findSeries = detectSeries$1; + exports.flatMap = concat$1; + exports.flatMapLimit = concatLimit$1; + exports.flatMapSeries = concatSeries$1; + exports.foldl = reduce$1; + exports.foldr = reduceRight; + exports.forEach = each; + exports.forEachLimit = eachLimit$1; + exports.forEachOf = eachOf$1; + exports.forEachOfLimit = eachOfLimit$1; + exports.forEachOfSeries = eachOfSeries$1; + exports.forEachSeries = eachSeries$1; + exports.forever = forever$1; + exports.groupBy = groupBy; + exports.groupByLimit = groupByLimit$1; + exports.groupBySeries = groupBySeries; + exports.inject = reduce$1; + exports.log = log; + exports.map = map$1; + exports.mapLimit = mapLimit$1; + exports.mapSeries = mapSeries$1; + exports.mapValues = mapValues; + exports.mapValuesLimit = mapValuesLimit$1; + exports.mapValuesSeries = mapValuesSeries; + exports.memoize = memoize; + exports.nextTick = nextTick; + exports.parallel = parallel; + exports.parallelLimit = parallelLimit; + exports.priorityQueue = priorityQueue; + exports.queue = queue; + exports.race = race$1; + exports.reduce = reduce$1; + exports.reduceRight = reduceRight; + exports.reflect = reflect; + exports.reflectAll = reflectAll; + exports.reject = reject$1; + exports.rejectLimit = rejectLimit$1; + exports.rejectSeries = rejectSeries$1; + exports.retry = retry; + exports.retryable = retryable; + exports.select = filter$1; + exports.selectLimit = filterLimit$1; + exports.selectSeries = filterSeries$1; + exports.seq = seq; + exports.series = series; + exports.setImmediate = setImmediate$1; + exports.some = some$1; + exports.someLimit = someLimit$1; + exports.someSeries = someSeries$1; + exports.sortBy = sortBy$1; + exports.timeout = timeout; + exports.times = times; + exports.timesLimit = timesLimit; + exports.timesSeries = timesSeries; + exports.transform = transform; + exports.tryEach = tryEach$1; + exports.unmemoize = unmemoize; + exports.until = until; + exports.waterfall = waterfall$1; + exports.whilst = whilst$1; + exports.wrapSync = asyncify; - return lib; + Object.defineProperty(exports, '__esModule', { value: true }); -}))); +})); /***/ }), -/***/ 94691: +/***/ 31324: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var concatMap = __nccwpck_require__(97087); -var balanced = __nccwpck_require__(59380); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; +module.exports = +{ + parallel : __nccwpck_require__(83857), + serial : __nccwpck_require__(31054), + serialOrdered : __nccwpck_require__(53961) +}; - var parts = []; - var m = balanced('{', '}', str); - if (!m) - return str.split(','); +/***/ }), - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); +/***/ 24818: +/***/ ((module) => { - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } +// API +module.exports = abort; - parts.push.apply(parts, p); +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); - return parts; + // reset leftover jobs + state.jobs = {}; } -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); } -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} -function expand(str, isTop) { - var expansions = []; +/***/ }), - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; +/***/ 78452: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } +var defer = __nccwpck_require__(29200); - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } +// API +module.exports = async; - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; + // check if async happened + defer(function() { isAsync = true; }); - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); } - } - - return expansions; + }; } - /***/ }), -/***/ 19776: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var Buffer = (__nccwpck_require__(20181).Buffer); - -var CRC_TABLE = [ - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, - 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, - 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, - 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, - 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, - 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, - 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, - 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, - 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, - 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, - 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, - 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, - 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, - 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, - 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, - 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, - 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, - 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, - 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, - 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, - 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, - 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, - 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, - 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, - 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, - 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, - 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, - 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, - 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, - 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, - 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, - 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, - 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, - 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, - 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, - 0x2d02ef8d -]; - -if (typeof Int32Array !== 'undefined') { - CRC_TABLE = new Int32Array(CRC_TABLE); -} - -function ensureBuffer(input) { - if (Buffer.isBuffer(input)) { - return input; - } - - var hasNewBufferAPI = - typeof Buffer.alloc === "function" && - typeof Buffer.from === "function"; +/***/ 29200: +/***/ ((module) => { - if (typeof input === "number") { - return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); - } - else if (typeof input === "string") { - return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); - } - else { - throw new Error("input must be buffer, number, or string, received " + - typeof input); - } -} +module.exports = defer; -function bufferizeInt(num) { - var tmp = ensureBuffer(4); - tmp.writeInt32BE(num, 0); - return tmp; -} +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); -function _crc32(buf, previous) { - buf = ensureBuffer(buf); - if (Buffer.isBuffer(previous)) { - previous = previous.readUInt32BE(0); + if (nextTick) + { + nextTick(fn); } - var crc = ~~previous ^ -1; - for (var n = 0; n < buf.length; n++) { - crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); + else + { + setTimeout(fn, 0); } - return (crc ^ -1); -} - -function crc32() { - return bufferizeInt(_crc32.apply(null, arguments)); } -crc32.signed = function () { - return _crc32.apply(null, arguments); -}; -crc32.unsigned = function () { - return _crc32.apply(null, arguments) >>> 0; -}; - -module.exports = crc32; /***/ }), -/***/ 86627: -/***/ ((module) => { - -module.exports = Buffers; - -function Buffers (bufs) { - if (!(this instanceof Buffers)) return new Buffers(bufs); - this.buffers = bufs || []; - this.length = this.buffers.reduce(function (size, buf) { - return size + buf.length - }, 0); -} - -Buffers.prototype.push = function () { - for (var i = 0; i < arguments.length; i++) { - if (!Buffer.isBuffer(arguments[i])) { - throw new TypeError('Tried to push a non-buffer'); - } - } - - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.push(buf); - this.length += buf.length; - } - return this.length; -}; - -Buffers.prototype.unshift = function () { - for (var i = 0; i < arguments.length; i++) { - if (!Buffer.isBuffer(arguments[i])) { - throw new TypeError('Tried to unshift a non-buffer'); - } - } - - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.unshift(buf); - this.length += buf.length; - } - return this.length; -}; - -Buffers.prototype.copy = function (dst, dStart, start, end) { - return this.slice(start, end).copy(dst, dStart, 0, end - start); -}; - -Buffers.prototype.splice = function (i, howMany) { - var buffers = this.buffers; - var index = i >= 0 ? i : this.length - i; - var reps = [].slice.call(arguments, 2); - - if (howMany === undefined) { - howMany = this.length - index; - } - else if (howMany > this.length - index) { - howMany = this.length - index; - } - - for (var i = 0; i < reps.length; i++) { - this.length += reps[i].length; - } - - var removed = new Buffers(); - var bytes = 0; - - var startBytes = 0; - for ( - var ii = 0; - ii < buffers.length && startBytes + buffers[ii].length < index; - ii ++ - ) { startBytes += buffers[ii].length } - - if (index - startBytes > 0) { - var start = index - startBytes; - - if (start + howMany < buffers[ii].length) { - removed.push(buffers[ii].slice(start, start + howMany)); - - var orig = buffers[ii]; - //var buf = new Buffer(orig.length - howMany); - var buf0 = new Buffer(start); - for (var i = 0; i < start; i++) { - buf0[i] = orig[i]; - } - - var buf1 = new Buffer(orig.length - start - howMany); - for (var i = start + howMany; i < orig.length; i++) { - buf1[ i - howMany - start ] = orig[i] - } - - if (reps.length > 0) { - var reps_ = reps.slice(); - reps_.unshift(buf0); - reps_.push(buf1); - buffers.splice.apply(buffers, [ ii, 1 ].concat(reps_)); - ii += reps_.length; - reps = []; - } - else { - buffers.splice(ii, 1, buf0, buf1); - //buffers[ii] = buf; - ii += 2; - } - } - else { - removed.push(buffers[ii].slice(start)); - buffers[ii] = buffers[ii].slice(0, start); - ii ++; - } - } - - if (reps.length > 0) { - buffers.splice.apply(buffers, [ ii, 0 ].concat(reps)); - ii += reps.length; - } - - while (removed.length < howMany) { - var buf = buffers[ii]; - var len = buf.length; - var take = Math.min(len, howMany - removed.length); - - if (take === len) { - removed.push(buf); - buffers.splice(ii, 1); - } - else { - removed.push(buf.slice(0, take)); - buffers[ii] = buffers[ii].slice(take); - } - } - - this.length -= removed.length; - - return removed; -}; - -Buffers.prototype.slice = function (i, j) { - var buffers = this.buffers; - if (j === undefined) j = this.length; - if (i === undefined) i = 0; - - if (j > this.length) j = this.length; - - var startBytes = 0; - for ( - var si = 0; - si < buffers.length && startBytes + buffers[si].length <= i; - si ++ - ) { startBytes += buffers[si].length } - - var target = new Buffer(j - i); - - var ti = 0; - for (var ii = si; ti < j - i && ii < buffers.length; ii++) { - var len = buffers[ii].length; - - var start = ti === 0 ? i - startBytes : 0; - var end = ti + len >= j - i - ? Math.min(start + (j - i) - ti, len) - : len - ; - - buffers[ii].copy(target, ti, start, end); - ti += end - start; - } - - return target; -}; +/***/ 24902: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Buffers.prototype.pos = function (i) { - if (i < 0 || i >= this.length) throw new Error('oob'); - var l = i, bi = 0, bu = null; - for (;;) { - bu = this.buffers[bi]; - if (l < bu.length) { - return {buf: bi, offset: l}; - } else { - l -= bu.length; - } - bi++; - } -}; +var async = __nccwpck_require__(78452) + , abort = __nccwpck_require__(24818) + ; -Buffers.prototype.get = function get (i) { - var pos = this.pos(i); +// API +module.exports = iterate; - return this.buffers[pos.buf].get(pos.offset); -}; +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; -Buffers.prototype.set = function set (i, b) { - var pos = this.pos(i); + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } - return this.buffers[pos.buf].set(pos.offset, b); -}; + // clean up jobs + delete state.jobs[key]; -Buffers.prototype.indexOf = function (needle, offset) { - if ("string" === typeof needle) { - needle = new Buffer(needle); - } else if (needle instanceof Buffer) { - // already a buffer - } else { - throw new Error('Invalid type for a search string'); + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); } - - if (!needle.length) { - return 0; + else + { + state.results[key] = output; } - if (!this.length) { - return -1; - } + // return salvaged results + callback(error, state.results); + }); +} - var i = 0, j = 0, match = 0, mstart, pos = 0; +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; - // start search from a particular point in the virtual buffer - if (offset) { - var p = this.pos(offset); - i = p.buf; - j = p.offset; - pos = offset; - } + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } - // for each character in virtual buffer - for (;;) { - while (j >= this.buffers[i].length) { - j = 0; - i++; + return aborter; +} - if (i >= this.buffers.length) { - // search string not found - return -1; - } - } - var char = this.buffers[i][j]; +/***/ }), - if (char == needle[match]) { - // keep track where match started - if (match == 0) { - mstart = { - i: i, - j: j, - pos: pos - }; - } - match++; - if (match == needle.length) { - // full match - return mstart.pos; - } - } else if (match != 0) { - // a partial match ended, go back to match starting position - // this will continue the search at the next character - i = mstart.i; - j = mstart.j; - pos = mstart.pos; - match = 0; - } +/***/ 81721: +/***/ ((module) => { - j++; - pos++; +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length } -}; + ; -Buffers.prototype.toBuffer = function() { - return this.slice(); -} + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } -Buffers.prototype.toString = function(encoding, start, end) { - return this.slice(start, end).toString(encoding); + return initState; } /***/ }), -/***/ 22639: +/***/ 33351: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var abort = __nccwpck_require__(24818) + , async = __nccwpck_require__(78452) + ; +// API +module.exports = terminator; -var bind = __nccwpck_require__(37564); +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } -var $apply = __nccwpck_require__(33945); -var $call = __nccwpck_require__(88093); -var $reflectApply = __nccwpck_require__(31330); + // fast forward iteration index + this.index = this.size; -/** @type {import('./actualApply')} */ -module.exports = $reflectApply || bind.call($call, $apply); + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} /***/ }), -/***/ 33945: -/***/ ((module) => { +/***/ 83857: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var iterate = __nccwpck_require__(24902) + , initState = __nccwpck_require__(81721) + , terminator = __nccwpck_require__(33351) + ; +// Public API +module.exports = parallel; -/** @type {import('./functionApply')} */ -module.exports = Function.prototype.apply; +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} /***/ }), -/***/ 88093: -/***/ ((module) => { +/***/ 31054: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var serialOrdered = __nccwpck_require__(53961); +// Public API +module.exports = serial; -/** @type {import('./functionCall')} */ -module.exports = Function.prototype.call; +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} /***/ }), -/***/ 88705: +/***/ 53961: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var iterate = __nccwpck_require__(24902) + , initState = __nccwpck_require__(81721) + , terminator = __nccwpck_require__(33351) + ; +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; -var bind = __nccwpck_require__(37564); -var $TypeError = __nccwpck_require__(73314); +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); -var $call = __nccwpck_require__(88093); -var $actualApply = __nccwpck_require__(22639); + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } -/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ -module.exports = function callBindBasic(args) { - if (args.length < 1 || typeof args[0] !== 'function') { - throw new $TypeError('a function is required'); - } - return $actualApply(bind, $call, args); -}; + state.index++; + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } -/***/ }), + // done here + callback(null, state.results); + }); -/***/ 31330: -/***/ ((module) => { + return terminator.bind(state, callback); +} -"use strict"; +/* + * -- Sort methods + */ +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} -/** @type {import('./reflectApply')} */ -module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} /***/ }), -/***/ 71710: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 73057: +/***/ ((module) => { -var Traverse = __nccwpck_require__(62958); -var EventEmitter = (__nccwpck_require__(24434).EventEmitter); +function isBuffer(value) { + return Buffer.isBuffer(value) || value instanceof Uint8Array +} -module.exports = Chainsaw; -function Chainsaw (builder) { - var saw = Chainsaw.saw(builder, {}); - var r = builder.call(saw.handlers, saw); - if (r !== undefined) saw.handlers = r; - saw.record(); - return saw.chain(); -}; +function isEncoding(encoding) { + return Buffer.isEncoding(encoding) +} -Chainsaw.light = function ChainsawLight (builder) { - var saw = Chainsaw.saw(builder, {}); - var r = builder.call(saw.handlers, saw); - if (r !== undefined) saw.handlers = r; - return saw.chain(); -}; +function alloc(size, fill, encoding) { + return Buffer.alloc(size, fill, encoding) +} -Chainsaw.saw = function (builder, handlers) { - var saw = new EventEmitter; - saw.handlers = handlers; - saw.actions = []; +function allocUnsafe(size) { + return Buffer.allocUnsafe(size) +} - saw.chain = function () { - var ch = Traverse(saw.handlers).map(function (node) { - if (this.isRoot) return node; - var ps = this.path; +function allocUnsafeSlow(size) { + return Buffer.allocUnsafeSlow(size) +} - if (typeof node === 'function') { - this.update(function () { - saw.actions.push({ - path : ps, - args : [].slice.call(arguments) - }); - return ch; - }); - } - }); +function byteLength(string, encoding) { + return Buffer.byteLength(string, encoding) +} - process.nextTick(function () { - saw.emit('begin'); - saw.next(); - }); +function compare(a, b) { + return Buffer.compare(a, b) +} - return ch; - }; +function concat(buffers, totalLength) { + return Buffer.concat(buffers, totalLength) +} - saw.pop = function () { - return saw.actions.shift(); - }; +function copy(source, target, targetStart, start, end) { + return toBuffer(source).copy(target, targetStart, start, end) +} - saw.next = function () { - var action = saw.pop(); +function equals(a, b) { + return toBuffer(a).equals(b) +} - if (!action) { - saw.emit('end'); - } - else if (!action.trap) { - var node = saw.handlers; - action.path.forEach(function (key) { node = node[key] }); - node.apply(saw.handlers, action.args); - } - }; +function fill(buffer, value, offset, end, encoding) { + return toBuffer(buffer).fill(value, offset, end, encoding) +} - saw.nest = function (cb) { - var args = [].slice.call(arguments, 1); - var autonext = true; +function from(value, encodingOrOffset, length) { + return Buffer.from(value, encodingOrOffset, length) +} - if (typeof cb === 'boolean') { - var autonext = cb; - cb = args.shift(); - } +function includes(buffer, value, byteOffset, encoding) { + return toBuffer(buffer).includes(value, byteOffset, encoding) +} - var s = Chainsaw.saw(builder, {}); - var r = builder.call(s.handlers, s); +function indexOf(buffer, value, byfeOffset, encoding) { + return toBuffer(buffer).indexOf(value, byfeOffset, encoding) +} - if (r !== undefined) s.handlers = r; +function lastIndexOf(buffer, value, byteOffset, encoding) { + return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding) +} - // If we are recording... - if ("undefined" !== typeof saw.step) { - // ... our children should, too - s.record(); - } +function swap16(buffer) { + return toBuffer(buffer).swap16() +} - cb.apply(s.chain(), args); - if (autonext !== false) s.on('end', saw.next); - }; +function swap32(buffer) { + return toBuffer(buffer).swap32() +} - saw.record = function () { - upgradeChainsaw(saw); - }; +function swap64(buffer) { + return toBuffer(buffer).swap64() +} - ['trap', 'down', 'jump'].forEach(function (method) { - saw[method] = function () { - throw new Error("To use the trap, down and jump features, please "+ - "call record() first to start recording actions."); - }; - }); +function toBuffer(buffer) { + if (Buffer.isBuffer(buffer)) return buffer + return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength) +} - return saw; -}; +function toString(buffer, encoding, start, end) { + return toBuffer(buffer).toString(encoding, start, end) +} -function upgradeChainsaw(saw) { - saw.step = 0; +function write(buffer, string, offset, length, encoding) { + return toBuffer(buffer).write(string, offset, length, encoding) +} - // override pop - saw.pop = function () { - return saw.actions[saw.step++]; - }; +function readDoubleBE(buffer, offset) { + return toBuffer(buffer).readDoubleBE(offset) +} - saw.trap = function (name, cb) { - var ps = Array.isArray(name) ? name : [name]; - saw.actions.push({ - path : ps, - step : saw.step, - cb : cb, - trap : true - }); - }; +function readDoubleLE(buffer, offset) { + return toBuffer(buffer).readDoubleLE(offset) +} - saw.down = function (name) { - var ps = (Array.isArray(name) ? name : [name]).join('/'); - var i = saw.actions.slice(saw.step).map(function (x) { - if (x.trap && x.step <= saw.step) return false; - return x.path.join('/') == ps; - }).indexOf(true); +function readFloatBE(buffer, offset) { + return toBuffer(buffer).readFloatBE(offset) +} - if (i >= 0) saw.step += i; - else saw.step = saw.actions.length; +function readFloatLE(buffer, offset) { + return toBuffer(buffer).readFloatLE(offset) +} - var act = saw.actions[saw.step - 1]; - if (act && act.trap) { - // It's a trap! - saw.step = act.step; - act.cb(); - } - else saw.next(); - }; +function readInt32BE(buffer, offset) { + return toBuffer(buffer).readInt32BE(offset) +} - saw.jump = function (step) { - saw.step = step; - saw.next(); - }; -}; +function readInt32LE(buffer, offset) { + return toBuffer(buffer).readInt32LE(offset) +} + +function readUInt32BE(buffer, offset) { + return toBuffer(buffer).readUInt32BE(offset) +} +function readUInt32LE(buffer, offset) { + return toBuffer(buffer).readUInt32LE(offset) +} -/***/ }), +function writeDoubleBE(buffer, value, offset) { + return toBuffer(buffer).writeDoubleBE(value, offset) +} -/***/ 35630: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function writeDoubleLE(buffer, value, offset) { + return toBuffer(buffer).writeDoubleLE(value, offset) +} -var util = __nccwpck_require__(39023); -var Stream = (__nccwpck_require__(2203).Stream); -var DelayedStream = __nccwpck_require__(72710); +function writeFloatBE(buffer, value, offset) { + return toBuffer(buffer).writeFloatBE(value, offset) +} -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; +function writeFloatLE(buffer, value, offset) { + return toBuffer(buffer).writeFloatLE(value, offset) +} - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; +function writeInt32BE(buffer, value, offset) { + return toBuffer(buffer).writeInt32BE(value, offset) } -util.inherits(CombinedStream, Stream); -CombinedStream.create = function(options) { - var combinedStream = new this(); +function writeInt32LE(buffer, value, offset) { + return toBuffer(buffer).writeInt32LE(value, offset) +} + +function writeUInt32BE(buffer, value, offset) { + return toBuffer(buffer).writeUInt32BE(value, offset) +} + +function writeUInt32LE(buffer, value, offset) { + return toBuffer(buffer).writeUInt32LE(value, offset) +} - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } +module.exports = { + isBuffer, + isEncoding, + alloc, + allocUnsafe, + allocUnsafeSlow, + byteLength, + compare, + concat, + copy, + equals, + fill, + from, + includes, + indexOf, + lastIndexOf, + swap16, + swap32, + swap64, + toBuffer, + toString, + write, + readDoubleBE, + readDoubleLE, + readFloatBE, + readFloatLE, + readInt32BE, + readInt32LE, + readUInt32BE, + readUInt32LE, + writeDoubleBE, + writeDoubleLE, + writeFloatBE, + writeFloatLE, + writeInt32BE, + writeInt32LE, + writeUInt32BE, + writeUInt32LE +} - return combinedStream; -}; -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; +/***/ }), -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); +/***/ 59380: +/***/ ((module) => { - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; - } +"use strict"; - this._handleErrors(stream); +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); - if (this.pauseStreams) { - stream.pause(); - } - } + var r = range(a, b, str); - this._streams.push(stream); - return this; -}; + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; -}; +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} -CombinedStream.prototype._getNext = function() { - this._currentStream = null; +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; - if (this._insideLoop) { - this._pendingNext = true; - return; // defer call - } + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } -}; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } -CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } - if (typeof stream == 'undefined') { - this.end(); - return; + if (begs.length) { + result = [ left, right ]; + } } - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } + return result; +} - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - this._pipeNext(stream); - }.bind(this)); -}; +/***/ }), -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; +/***/ 52732: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } +var register = __nccwpck_require__(11063); +var addHook = __nccwpck_require__(22027); +var removeHook = __nccwpck_require__(59934); - var value = stream; - this.write(value); - this._getNext(); -}; +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind; +var bindable = bind.bind(bind); -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); +function bindApi(hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply( + null, + name ? [state, name] : [state] + ); + hook.api = { remove: removeHookRef }; + hook.remove = removeHookRef; + ["before", "error", "after", "wrap"].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind]; + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); }); -}; +} -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; +function HookSingular() { + var singularHookName = "h"; + var singularHookState = { + registry: {}, + }; + var singularHook = register.bind(null, singularHookState, singularHookName); + bindApi(singularHook, singularHookState, singularHookName); + return singularHook; +} -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } +function HookCollection() { + var state = { + registry: {}, + }; - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; + var hook = register.bind(null, state); + bindApi(hook, state); -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); + return hook; +} + +var collectionHookDeprecationMessageDisplayed = false; +function Hook() { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn( + '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' + ); + collectionHookDeprecationMessageDisplayed = true; } + return HookCollection(); +} - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; +Hook.Singular = HookSingular.bind(); +Hook.Collection = HookCollection.bind(); -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; +module.exports = Hook; +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook; +module.exports.Singular = Hook.Singular; +module.exports.Collection = Hook.Collection; -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; +/***/ }), -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } +/***/ 22027: +/***/ ((module) => { - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; +module.exports = addHook; -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; + } - self.dataSize += stream.dataSize; - }); + if (kind === "after") { + hook = function (method, options) { + var result; + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_; + return orig(result, options); + }) + .then(function () { + return result; + }); + }; + } - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; } -}; -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; + state.registry[name].push({ + hook: hook, + orig: orig, + }); +} /***/ }), -/***/ 96070: +/***/ 11063: /***/ ((module) => { -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var ArchiveEntry = module.exports = function() {}; +module.exports = register; -ArchiveEntry.prototype.getName = function() {}; +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); + } -ArchiveEntry.prototype.getSize = function() {}; + if (!options) { + options = {}; + } -ArchiveEntry.prototype.getLastModifiedDate = function() {}; + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); + } -ArchiveEntry.prototype.isDirectory = function() {}; + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); + } -/***/ }), + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); +} -/***/ 36306: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var inherits = (__nccwpck_require__(39023).inherits); -var Transform = (__nccwpck_require__(86131).Transform); +/***/ }), -var ArchiveEntry = __nccwpck_require__(96070); -var util = __nccwpck_require__(18300); +/***/ 59934: +/***/ ((module) => { -var ArchiveOutputStream = module.exports = function(options) { - if (!(this instanceof ArchiveOutputStream)) { - return new ArchiveOutputStream(options); +module.exports = removeHook; + +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; } - Transform.call(this, options); + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); - this.offset = 0; - this._archive = { - finish: false, - finished: false, - processing: false - }; -}; + if (index === -1) { + return; + } -inherits(ArchiveOutputStream, Transform); + state.registry[name].splice(index, 1); +} -ArchiveOutputStream.prototype._appendBuffer = function(zae, source, callback) { - // scaffold only -}; -ArchiveOutputStream.prototype._appendStream = function(zae, source, callback) { - // scaffold only -}; +/***/ }), -ArchiveOutputStream.prototype._emitErrorCallback = function(err) { - if (err) { - this.emit('error', err); - } -}; +/***/ 58769: +/***/ ((module, exports, __nccwpck_require__) => { -ArchiveOutputStream.prototype._finish = function(ae) { - // scaffold only +var Chainsaw = __nccwpck_require__(71710); +var EventEmitter = (__nccwpck_require__(24434).EventEmitter); +var Buffers = __nccwpck_require__(86627); +var Vars = __nccwpck_require__(91259); +var Stream = (__nccwpck_require__(2203).Stream); + +exports = module.exports = function (bufOrEm, eventName) { + if (Buffer.isBuffer(bufOrEm)) { + return exports.parse(bufOrEm); + } + + var s = exports.stream(); + if (bufOrEm && bufOrEm.pipe) { + bufOrEm.pipe(s); + } + else if (bufOrEm) { + bufOrEm.on(eventName || 'data', function (buf) { + s.write(buf); + }); + + bufOrEm.on('end', function () { + s.end(); + }); + } + return s; }; -ArchiveOutputStream.prototype._normalizeEntry = function(ae) { - // scaffold only +exports.stream = function (input) { + if (input) return exports.apply(null, arguments); + + var pending = null; + function getBytes (bytes, cb, skip) { + pending = { + bytes : bytes, + skip : skip, + cb : function (buf) { + pending = null; + cb(buf); + }, + }; + dispatch(); + } + + var offset = null; + function dispatch () { + if (!pending) { + if (caughtEnd) done = true; + return; + } + if (typeof pending === 'function') { + pending(); + } + else { + var bytes = offset + pending.bytes; + + if (buffers.length >= bytes) { + var buf; + if (offset == null) { + buf = buffers.splice(0, bytes); + if (!pending.skip) { + buf = buf.slice(); + } + } + else { + if (!pending.skip) { + buf = buffers.slice(offset, bytes); + } + offset = bytes; + } + + if (pending.skip) { + pending.cb(); + } + else { + pending.cb(buf); + } + } + } + } + + function builder (saw) { + function next () { if (!done) saw.next() } + + var self = words(function (bytes, cb) { + return function (name) { + getBytes(bytes, function (buf) { + vars.set(name, cb(buf)); + next(); + }); + }; + }); + + self.tap = function (cb) { + saw.nest(cb, vars.store); + }; + + self.into = function (key, cb) { + if (!vars.get(key)) vars.set(key, {}); + var parent = vars; + vars = Vars(parent.get(key)); + + saw.nest(function () { + cb.apply(this, arguments); + this.tap(function () { + vars = parent; + }); + }, vars.store); + }; + + self.flush = function () { + vars.store = {}; + next(); + }; + + self.loop = function (cb) { + var end = false; + + saw.nest(false, function loop () { + this.vars = vars.store; + cb.call(this, function () { + end = true; + next(); + }, vars.store); + this.tap(function () { + if (end) saw.next() + else loop.call(this) + }.bind(this)); + }, vars.store); + }; + + self.buffer = function (name, bytes) { + if (typeof bytes === 'string') { + bytes = vars.get(bytes); + } + + getBytes(bytes, function (buf) { + vars.set(name, buf); + next(); + }); + }; + + self.skip = function (bytes) { + if (typeof bytes === 'string') { + bytes = vars.get(bytes); + } + + getBytes(bytes, function () { + next(); + }); + }; + + self.scan = function find (name, search) { + if (typeof search === 'string') { + search = new Buffer(search); + } + else if (!Buffer.isBuffer(search)) { + throw new Error('search must be a Buffer or a string'); + } + + var taken = 0; + pending = function () { + var pos = buffers.indexOf(search, offset + taken); + var i = pos-offset-taken; + if (pos !== -1) { + pending = null; + if (offset != null) { + vars.set( + name, + buffers.slice(offset, offset + taken + i) + ); + offset += taken + i + search.length; + } + else { + vars.set( + name, + buffers.slice(0, taken + i) + ); + buffers.splice(0, taken + i + search.length); + } + next(); + dispatch(); + } else { + i = Math.max(buffers.length - search.length - offset - taken, 0); + } + taken += i; + }; + dispatch(); + }; + + self.peek = function (cb) { + offset = 0; + saw.nest(function () { + cb.call(this, vars.store); + this.tap(function () { + offset = null; + }); + }); + }; + + return self; + }; + + var stream = Chainsaw.light(builder); + stream.writable = true; + + var buffers = Buffers(); + + stream.write = function (buf) { + buffers.push(buf); + dispatch(); + }; + + var vars = Vars(); + + var done = false, caughtEnd = false; + stream.end = function () { + caughtEnd = true; + }; + + stream.pipe = Stream.prototype.pipe; + Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function (name) { + stream[name] = EventEmitter.prototype[name]; + }); + + return stream; }; -ArchiveOutputStream.prototype._transform = function(chunk, encoding, callback) { - callback(null, chunk); +exports.parse = function parse (buffer) { + var self = words(function (bytes, cb) { + return function (name) { + if (offset + bytes <= buffer.length) { + var buf = buffer.slice(offset, offset + bytes); + offset += bytes; + vars.set(name, cb(buf)); + } + else { + vars.set(name, null); + } + return self; + }; + }); + + var offset = 0; + var vars = Vars(); + self.vars = vars.store; + + self.tap = function (cb) { + cb.call(self, vars.store); + return self; + }; + + self.into = function (key, cb) { + if (!vars.get(key)) { + vars.set(key, {}); + } + var parent = vars; + vars = Vars(parent.get(key)); + cb.call(self, vars.store); + vars = parent; + return self; + }; + + self.loop = function (cb) { + var end = false; + var ender = function () { end = true }; + while (end === false) { + cb.call(self, ender, vars.store); + } + return self; + }; + + self.buffer = function (name, size) { + if (typeof size === 'string') { + size = vars.get(size); + } + var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); + offset += size; + vars.set(name, buf); + + return self; + }; + + self.skip = function (bytes) { + if (typeof bytes === 'string') { + bytes = vars.get(bytes); + } + offset += bytes; + + return self; + }; + + self.scan = function (name, search) { + if (typeof search === 'string') { + search = new Buffer(search); + } + else if (!Buffer.isBuffer(search)) { + throw new Error('search must be a Buffer or a string'); + } + vars.set(name, null); + + // simple but slow string search + for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) { + for ( + var j = 0; + j < search.length && buffer[offset+i+j] === search[j]; + j++ + ); + if (j === search.length) break; + } + + vars.set(name, buffer.slice(offset, offset + i)); + offset += i + search.length; + return self; + }; + + self.peek = function (cb) { + var was = offset; + cb.call(self, vars.store); + offset = was; + return self; + }; + + self.flush = function () { + vars.store = {}; + return self; + }; + + self.eof = function () { + return offset >= buffer.length; + }; + + return self; }; -ArchiveOutputStream.prototype.entry = function(ae, source, callback) { - source = source || null; - - if (typeof callback !== 'function') { - callback = this._emitErrorCallback.bind(this); - } - - if (!(ae instanceof ArchiveEntry)) { - callback(new Error('not a valid instance of ArchiveEntry')); - return; - } - - if (this._archive.finish || this._archive.finished) { - callback(new Error('unacceptable entry after finish')); - return; - } - - if (this._archive.processing) { - callback(new Error('already processing an entry')); - return; - } - - this._archive.processing = true; - this._normalizeEntry(ae); - this._entry = ae; - - source = util.normalizeInputSource(source); - - if (Buffer.isBuffer(source)) { - this._appendBuffer(ae, source, callback); - } else if (util.isStream(source)) { - this._appendStream(ae, source, callback); - } else { - this._archive.processing = false; - callback(new Error('input source must be valid Stream or Buffer instance')); - return; - } - - return this; -}; +// convert byte strings to unsigned little endian numbers +function decodeLEu (bytes) { + var acc = 0; + for (var i = 0; i < bytes.length; i++) { + acc += Math.pow(256,i) * bytes[i]; + } + return acc; +} -ArchiveOutputStream.prototype.finish = function() { - if (this._archive.processing) { - this._archive.finish = true; - return; - } +// convert byte strings to unsigned big endian numbers +function decodeBEu (bytes) { + var acc = 0; + for (var i = 0; i < bytes.length; i++) { + acc += Math.pow(256, bytes.length - i - 1) * bytes[i]; + } + return acc; +} - this._finish(); -}; +// convert byte strings to signed big endian numbers +function decodeBEs (bytes) { + var val = decodeBEu(bytes); + if ((bytes[0] & 0x80) == 0x80) { + val -= Math.pow(256, bytes.length); + } + return val; +} -ArchiveOutputStream.prototype.getBytesWritten = function() { - return this.offset; -}; +// convert byte strings to signed little endian numbers +function decodeLEs (bytes) { + var val = decodeLEu(bytes); + if ((bytes[bytes.length - 1] & 0x80) == 0x80) { + val -= Math.pow(256, bytes.length); + } + return val; +} -ArchiveOutputStream.prototype.write = function(chunk, cb) { - if (chunk) { - this.offset += chunk.length; - } +function words (decode) { + var self = {}; + + [ 1, 2, 4, 8 ].forEach(function (bytes) { + var bits = bytes * 8; + + self['word' + bits + 'le'] + = self['word' + bits + 'lu'] + = decode(bytes, decodeLEu); + + self['word' + bits + 'ls'] + = decode(bytes, decodeLEs); + + self['word' + bits + 'be'] + = self['word' + bits + 'bu'] + = decode(bytes, decodeBEu); + + self['word' + bits + 'bs'] + = decode(bytes, decodeBEs); + }); + + // word8be(n) == word8le(n) for all n + self.word8 = self.word8u = self.word8be; + self.word8s = self.word8bs; + + return self; +} - return Transform.prototype.write.call(this, chunk, cb); -}; /***/ }), -/***/ 94908: +/***/ 91259: /***/ ((module) => { -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -module.exports = { - WORD: 4, - DWORD: 8, - EMPTY: Buffer.alloc(0), - - SHORT: 2, - SHORT_MASK: 0xffff, - SHORT_SHIFT: 16, - SHORT_ZERO: Buffer.from(Array(2)), - LONG: 4, - LONG_ZERO: Buffer.from(Array(4)), - - MIN_VERSION_INITIAL: 10, - MIN_VERSION_DATA_DESCRIPTOR: 20, - MIN_VERSION_ZIP64: 45, - VERSION_MADEBY: 45, - - METHOD_STORED: 0, - METHOD_DEFLATED: 8, - - PLATFORM_UNIX: 3, - PLATFORM_FAT: 0, - - SIG_LFH: 0x04034b50, - SIG_DD: 0x08074b50, - SIG_CFH: 0x02014b50, - SIG_EOCD: 0x06054b50, - SIG_ZIP64_EOCD: 0x06064B50, - SIG_ZIP64_EOCD_LOC: 0x07064B50, - - ZIP64_MAGIC_SHORT: 0xffff, - ZIP64_MAGIC: 0xffffffff, - ZIP64_EXTRA_ID: 0x0001, - - ZLIB_NO_COMPRESSION: 0, - ZLIB_BEST_SPEED: 1, - ZLIB_BEST_COMPRESSION: 9, - ZLIB_DEFAULT_COMPRESSION: -1, - - MODE_MASK: 0xFFF, - DEFAULT_FILE_MODE: 33188, // 010644 = -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH - DEFAULT_DIR_MODE: 16877, // 040755 = drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH - - EXT_FILE_ATTR_DIR: 1106051088, // 010173200020 = drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D) - EXT_FILE_ATTR_FILE: 2175008800, // 020151000040 = -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0 - - // Unix file types - S_IFMT: 61440, // 0170000 type of file mask - S_IFIFO: 4096, // 010000 named pipe (fifo) - S_IFCHR: 8192, // 020000 character special - S_IFDIR: 16384, // 040000 directory - S_IFBLK: 24576, // 060000 block special - S_IFREG: 32768, // 0100000 regular - S_IFLNK: 40960, // 0120000 symbolic link - S_IFSOCK: 49152, // 0140000 socket - - // DOS file type flags - S_DOS_A: 32, // 040 Archive - S_DOS_D: 16, // 020 Directory - S_DOS_V: 8, // 010 Volume - S_DOS_S: 4, // 04 System - S_DOS_H: 2, // 02 Hidden - S_DOS_R: 1 // 01 Read Only +module.exports = function (store) { + function getset (name, value) { + var node = vars.store; + var keys = name.split('.'); + keys.slice(0,-1).forEach(function (k) { + if (node[k] === undefined) node[k] = {}; + node = node[k] + }); + var key = keys[keys.length - 1]; + if (arguments.length == 1) { + return node[key]; + } + else { + return node[key] = value; + } + } + + var vars = { + get : function (name) { + return getset(name); + }, + set : function (name, value) { + return getset(name, value); + }, + store : store || {}, + }; + return vars; }; /***/ }), -/***/ 97632: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 63251: +/***/ (function(module) { /** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var zipUtil = __nccwpck_require__(6453); - -var DATA_DESCRIPTOR_FLAG = 1 << 3; -var ENCRYPTION_FLAG = 1 << 0; -var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; -var SLIDING_DICTIONARY_SIZE_FLAG = 1 << 1; -var STRONG_ENCRYPTION_FLAG = 1 << 6; -var UFT8_NAMES_FLAG = 1 << 11; - -var GeneralPurposeBit = module.exports = function() { - if (!(this instanceof GeneralPurposeBit)) { - return new GeneralPurposeBit(); - } + * This file contains the Bottleneck library (MIT), compiled to ES2017, and without Clustering support. + * https://github.com/SGrondin/bottleneck + */ +(function (global, factory) { + true ? module.exports = factory() : + 0; +}(this, (function () { 'use strict'; - this.descriptor = false; - this.encryption = false; - this.utf8 = false; - this.numberOfShannonFanoTrees = 0; - this.strongEncryption = false; - this.slidingDictionarySize = 0; + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - return this; -}; + function getCjsExportFromNamespace (n) { + return n && n['default'] || n; + } -GeneralPurposeBit.prototype.encode = function() { - return zipUtil.getShortBytes( - (this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) | - (this.utf8 ? UFT8_NAMES_FLAG : 0) | - (this.encryption ? ENCRYPTION_FLAG : 0) | - (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0) - ); -}; + var load = function(received, defaults, onto = {}) { + var k, ref, v; + for (k in defaults) { + v = defaults[k]; + onto[k] = (ref = received[k]) != null ? ref : v; + } + return onto; + }; -GeneralPurposeBit.prototype.parse = function(buf, offset) { - var flag = zipUtil.getShortBytesValue(buf, offset); - var gbp = new GeneralPurposeBit(); + var overwrite = function(received, defaults, onto = {}) { + var k, v; + for (k in received) { + v = received[k]; + if (defaults[k] !== void 0) { + onto[k] = v; + } + } + return onto; + }; - gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG) !== 0); - gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG) !== 0); - gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG) !== 0); - gbp.useEncryption((flag & ENCRYPTION_FLAG) !== 0); - gbp.setSlidingDictionarySize((flag & SLIDING_DICTIONARY_SIZE_FLAG) !== 0 ? 8192 : 4096); - gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2); + var parser = { + load: load, + overwrite: overwrite + }; - return gbp; -}; + var DLList; -GeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n) { - this.numberOfShannonFanoTrees = n; -}; + DLList = class DLList { + constructor(incr, decr) { + this.incr = incr; + this.decr = decr; + this._first = null; + this._last = null; + this.length = 0; + } -GeneralPurposeBit.prototype.getNumberOfShannonFanoTrees = function() { - return this.numberOfShannonFanoTrees; -}; + push(value) { + var node; + this.length++; + if (typeof this.incr === "function") { + this.incr(); + } + node = { + value, + prev: this._last, + next: null + }; + if (this._last != null) { + this._last.next = node; + this._last = node; + } else { + this._first = this._last = node; + } + return void 0; + } -GeneralPurposeBit.prototype.setSlidingDictionarySize = function(n) { - this.slidingDictionarySize = n; -}; + shift() { + var value; + if (this._first == null) { + return; + } else { + this.length--; + if (typeof this.decr === "function") { + this.decr(); + } + } + value = this._first.value; + if ((this._first = this._first.next) != null) { + this._first.prev = null; + } else { + this._last = null; + } + return value; + } -GeneralPurposeBit.prototype.getSlidingDictionarySize = function() { - return this.slidingDictionarySize; -}; + first() { + if (this._first != null) { + return this._first.value; + } + } -GeneralPurposeBit.prototype.useDataDescriptor = function(b) { - this.descriptor = b; -}; + getArray() { + var node, ref, results; + node = this._first; + results = []; + while (node != null) { + results.push((ref = node, node = node.next, ref.value)); + } + return results; + } -GeneralPurposeBit.prototype.usesDataDescriptor = function() { - return this.descriptor; -}; + forEachShift(cb) { + var node; + node = this.shift(); + while (node != null) { + (cb(node), node = this.shift()); + } + return void 0; + } -GeneralPurposeBit.prototype.useEncryption = function(b) { - this.encryption = b; -}; + debug() { + var node, ref, ref1, ref2, results; + node = this._first; + results = []; + while (node != null) { + results.push((ref = node, node = node.next, { + value: ref.value, + prev: (ref1 = ref.prev) != null ? ref1.value : void 0, + next: (ref2 = ref.next) != null ? ref2.value : void 0 + })); + } + return results; + } -GeneralPurposeBit.prototype.usesEncryption = function() { - return this.encryption; -}; + }; -GeneralPurposeBit.prototype.useStrongEncryption = function(b) { - this.strongEncryption = b; -}; + var DLList_1 = DLList; -GeneralPurposeBit.prototype.usesStrongEncryption = function() { - return this.strongEncryption; -}; + var Events; -GeneralPurposeBit.prototype.useUTF8ForNames = function(b) { - this.utf8 = b; -}; + Events = class Events { + constructor(instance) { + this.instance = instance; + this._events = {}; + if ((this.instance.on != null) || (this.instance.once != null) || (this.instance.removeAllListeners != null)) { + throw new Error("An Emitter already exists for this object"); + } + this.instance.on = (name, cb) => { + return this._addListener(name, "many", cb); + }; + this.instance.once = (name, cb) => { + return this._addListener(name, "once", cb); + }; + this.instance.removeAllListeners = (name = null) => { + if (name != null) { + return delete this._events[name]; + } else { + return this._events = {}; + } + }; + } -GeneralPurposeBit.prototype.usesUTF8ForNames = function() { - return this.utf8; -}; + _addListener(name, status, cb) { + var base; + if ((base = this._events)[name] == null) { + base[name] = []; + } + this._events[name].push({cb, status}); + return this.instance; + } -/***/ }), + listenerCount(name) { + if (this._events[name] != null) { + return this._events[name].length; + } else { + return 0; + } + } -/***/ 23810: -/***/ ((module) => { + async trigger(name, ...args) { + var e, promises; + try { + if (name !== "debug") { + this.trigger("debug", `Event triggered: ${name}`, args); + } + if (this._events[name] == null) { + return; + } + this._events[name] = this._events[name].filter(function(listener) { + return listener.status !== "none"; + }); + promises = this._events[name].map(async(listener) => { + var e, returned; + if (listener.status === "none") { + return; + } + if (listener.status === "once") { + listener.status = "none"; + } + try { + returned = typeof listener.cb === "function" ? listener.cb(...args) : void 0; + if (typeof (returned != null ? returned.then : void 0) === "function") { + return (await returned); + } else { + return returned; + } + } catch (error) { + e = error; + { + this.trigger("error", e); + } + return null; + } + }); + return ((await Promise.all(promises))).find(function(x) { + return x != null; + }); + } catch (error) { + e = error; + { + this.trigger("error", e); + } + return null; + } + } -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -module.exports = { - /** - * Bits used for permissions (and sticky bit) - */ - PERM_MASK: 4095, // 07777 + }; - /** - * Bits used to indicate the filesystem object type. - */ - FILE_TYPE_FLAG: 61440, // 0170000 + var Events_1 = Events; - /** - * Indicates symbolic links. - */ - LINK_FLAG: 40960, // 0120000 + var DLList$1, Events$1, Queues; - /** - * Indicates plain files. - */ - FILE_FLAG: 32768, // 0100000 + DLList$1 = DLList_1; - /** - * Indicates directories. - */ - DIR_FLAG: 16384, // 040000 + Events$1 = Events_1; - // ---------------------------------------------------------- - // somewhat arbitrary choices that are quite common for shared - // installations - // ----------------------------------------------------------- + Queues = class Queues { + constructor(num_priorities) { + var i; + this.Events = new Events$1(this); + this._length = 0; + this._lists = (function() { + var j, ref, results; + results = []; + for (i = j = 1, ref = num_priorities; (1 <= ref ? j <= ref : j >= ref); i = 1 <= ref ? ++j : --j) { + results.push(new DLList$1((() => { + return this.incr(); + }), (() => { + return this.decr(); + }))); + } + return results; + }).call(this); + } - /** - * Default permissions for symbolic links. - */ - DEFAULT_LINK_PERM: 511, // 0777 + incr() { + if (this._length++ === 0) { + return this.Events.trigger("leftzero"); + } + } - /** - * Default permissions for directories. - */ - DEFAULT_DIR_PERM: 493, // 0755 + decr() { + if (--this._length === 0) { + return this.Events.trigger("zero"); + } + } - /** - * Default permissions for plain files. - */ - DEFAULT_FILE_PERM: 420 // 0644 -}; + push(job) { + return this._lists[job.options.priority].push(job); + } -/***/ }), + queued(priority) { + if (priority != null) { + return this._lists[priority].length; + } else { + return this._length; + } + } -/***/ 6453: -/***/ ((module) => { + shiftAll(fn) { + return this._lists.forEach(function(list) { + return list.forEachShift(fn); + }); + } -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var util = module.exports = {}; + getFirst(arr = this._lists) { + var j, len, list; + for (j = 0, len = arr.length; j < len; j++) { + list = arr[j]; + if (list.length > 0) { + return list; + } + } + return []; + } -util.dateToDos = function(d, forceLocalTime) { - forceLocalTime = forceLocalTime || false; + shiftLastFrom(priority) { + return this.getFirst(this._lists.slice(priority).reverse()).shift(); + } - var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear(); + }; - if (year < 1980) { - return 2162688; // 1980-1-1 00:00:00 - } else if (year >= 2044) { - return 2141175677; // 2043-12-31 23:59:58 - } + var Queues_1 = Queues; - var val = { - year: year, - month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), - date: forceLocalTime ? d.getDate() : d.getUTCDate(), - hours: forceLocalTime ? d.getHours() : d.getUTCHours(), - minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), - seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() - }; + var BottleneckError; - return ((val.year - 1980) << 25) | ((val.month + 1) << 21) | (val.date << 16) | - (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2); -}; + BottleneckError = class BottleneckError extends Error {}; -util.dosToDate = function(dos) { - return new Date(((dos >> 25) & 0x7f) + 1980, ((dos >> 21) & 0x0f) - 1, (dos >> 16) & 0x1f, (dos >> 11) & 0x1f, (dos >> 5) & 0x3f, (dos & 0x1f) << 1); -}; + var BottleneckError_1 = BottleneckError; -util.fromDosTime = function(buf) { - return util.dosToDate(buf.readUInt32LE(0)); -}; + var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1; -util.getEightBytes = function(v) { - var buf = Buffer.alloc(8); - buf.writeUInt32LE(v % 0x0100000000, 0); - buf.writeUInt32LE((v / 0x0100000000) | 0, 4); + NUM_PRIORITIES = 10; - return buf; -}; + DEFAULT_PRIORITY = 5; -util.getShortBytes = function(v) { - var buf = Buffer.alloc(2); - buf.writeUInt16LE((v & 0xFFFF) >>> 0, 0); + parser$1 = parser; - return buf; -}; + BottleneckError$1 = BottleneckError_1; -util.getShortBytesValue = function(buf, offset) { - return buf.readUInt16LE(offset); -}; + Job = class Job { + constructor(task, args, options, jobDefaults, rejectOnDrop, Events, _states, Promise) { + this.task = task; + this.args = args; + this.rejectOnDrop = rejectOnDrop; + this.Events = Events; + this._states = _states; + this.Promise = Promise; + this.options = parser$1.load(options, jobDefaults); + this.options.priority = this._sanitizePriority(this.options.priority); + if (this.options.id === jobDefaults.id) { + this.options.id = `${this.options.id}-${this._randomIndex()}`; + } + this.promise = new this.Promise((_resolve, _reject) => { + this._resolve = _resolve; + this._reject = _reject; + }); + this.retryCount = 0; + } -util.getLongBytes = function(v) { - var buf = Buffer.alloc(4); - buf.writeUInt32LE((v & 0xFFFFFFFF) >>> 0, 0); + _sanitizePriority(priority) { + var sProperty; + sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority; + if (sProperty < 0) { + return 0; + } else if (sProperty > NUM_PRIORITIES - 1) { + return NUM_PRIORITIES - 1; + } else { + return sProperty; + } + } - return buf; -}; + _randomIndex() { + return Math.random().toString(36).slice(2); + } -util.getLongBytesValue = function(buf, offset) { - return buf.readUInt32LE(offset); -}; + doDrop({error, message = "This job has been dropped by Bottleneck"} = {}) { + if (this._states.remove(this.options.id)) { + if (this.rejectOnDrop) { + this._reject(error != null ? error : new BottleneckError$1(message)); + } + this.Events.trigger("dropped", {args: this.args, options: this.options, task: this.task, promise: this.promise}); + return true; + } else { + return false; + } + } -util.toDosTime = function(d) { - return util.getLongBytes(util.dateToDos(d)); -}; + _assertStatus(expected) { + var status; + status = this._states.jobStatus(this.options.id); + if (!(status === expected || (expected === "DONE" && status === null))) { + throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`); + } + } -/***/ }), + doReceive() { + this._states.start(this.options.id); + return this.Events.trigger("received", {args: this.args, options: this.options}); + } -/***/ 73380: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + doQueue(reachedHWM, blocked) { + this._assertStatus("RECEIVED"); + this._states.next(this.options.id); + return this.Events.trigger("queued", {args: this.args, options: this.options, reachedHWM, blocked}); + } -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var inherits = (__nccwpck_require__(39023).inherits); -var normalizePath = __nccwpck_require__(56133); + doRun() { + if (this.retryCount === 0) { + this._assertStatus("QUEUED"); + this._states.next(this.options.id); + } else { + this._assertStatus("EXECUTING"); + } + return this.Events.trigger("scheduled", {args: this.args, options: this.options}); + } -var ArchiveEntry = __nccwpck_require__(96070); -var GeneralPurposeBit = __nccwpck_require__(97632); -var UnixStat = __nccwpck_require__(23810); + async doExecute(chained, clearGlobalState, run, free) { + var error, eventInfo, passed; + if (this.retryCount === 0) { + this._assertStatus("RUNNING"); + this._states.next(this.options.id); + } else { + this._assertStatus("EXECUTING"); + } + eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount}; + this.Events.trigger("executing", eventInfo); + try { + passed = (await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args))); + if (clearGlobalState()) { + this.doDone(eventInfo); + await free(this.options, eventInfo); + this._assertStatus("DONE"); + return this._resolve(passed); + } + } catch (error1) { + error = error1; + return this._onFailure(error, eventInfo, clearGlobalState, run, free); + } + } -var constants = __nccwpck_require__(94908); -var zipUtil = __nccwpck_require__(6453); + doExpire(clearGlobalState, run, free) { + var error, eventInfo; + if (this._states.jobStatus(this.options.id === "RUNNING")) { + this._states.next(this.options.id); + } + this._assertStatus("EXECUTING"); + eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount}; + error = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error, eventInfo, clearGlobalState, run, free); + } -var ZipArchiveEntry = module.exports = function(name) { - if (!(this instanceof ZipArchiveEntry)) { - return new ZipArchiveEntry(name); - } + async _onFailure(error, eventInfo, clearGlobalState, run, free) { + var retry, retryAfter; + if (clearGlobalState()) { + retry = (await this.Events.trigger("failed", error, eventInfo)); + if (retry != null) { + retryAfter = ~~retry; + this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); + this.retryCount++; + return run(retryAfter); + } else { + this.doDone(eventInfo); + await free(this.options, eventInfo); + this._assertStatus("DONE"); + return this._reject(error); + } + } + } - ArchiveEntry.call(this); + doDone(eventInfo) { + this._assertStatus("EXECUTING"); + this._states.next(this.options.id); + return this.Events.trigger("done", eventInfo); + } - this.platform = constants.PLATFORM_FAT; - this.method = -1; + }; - this.name = null; - this.size = 0; - this.csize = 0; - this.gpb = new GeneralPurposeBit(); - this.crc = 0; - this.time = -1; + var Job_1 = Job; - this.minver = constants.MIN_VERSION_INITIAL; - this.mode = -1; - this.extra = null; - this.exattr = 0; - this.inattr = 0; - this.comment = null; + var BottleneckError$2, LocalDatastore, parser$2; - if (name) { - this.setName(name); - } -}; + parser$2 = parser; -inherits(ZipArchiveEntry, ArchiveEntry); + BottleneckError$2 = BottleneckError_1; -/** - * Returns the extra fields related to the entry. - * - * @returns {Buffer} - */ -ZipArchiveEntry.prototype.getCentralDirectoryExtra = function() { - return this.getExtra(); -}; + LocalDatastore = class LocalDatastore { + constructor(instance, storeOptions, storeInstanceOptions) { + this.instance = instance; + this.storeOptions = storeOptions; + this.clientId = this.instance._randomIndex(); + parser$2.load(storeInstanceOptions, storeInstanceOptions, this); + this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now(); + this._running = 0; + this._done = 0; + this._unblockTime = 0; + this.ready = this.Promise.resolve(); + this.clients = {}; + this._startHeartbeat(); + } -/** - * Returns the comment set for the entry. - * - * @returns {string} - */ -ZipArchiveEntry.prototype.getComment = function() { - return this.comment !== null ? this.comment : ''; -}; + _startHeartbeat() { + var base; + if ((this.heartbeat == null) && (((this.storeOptions.reservoirRefreshInterval != null) && (this.storeOptions.reservoirRefreshAmount != null)) || ((this.storeOptions.reservoirIncreaseInterval != null) && (this.storeOptions.reservoirIncreaseAmount != null)))) { + return typeof (base = (this.heartbeat = setInterval(() => { + var amount, incr, maximum, now, reservoir; + now = Date.now(); + if ((this.storeOptions.reservoirRefreshInterval != null) && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) { + this._lastReservoirRefresh = now; + this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount; + this.instance._drainAll(this.computeCapacity()); + } + if ((this.storeOptions.reservoirIncreaseInterval != null) && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) { + ({ + reservoirIncreaseAmount: amount, + reservoirIncreaseMaximum: maximum, + reservoir + } = this.storeOptions); + this._lastReservoirIncrease = now; + incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount; + if (incr > 0) { + this.storeOptions.reservoir += incr; + return this.instance._drainAll(this.computeCapacity()); + } + } + }, this.heartbeatInterval))).unref === "function" ? base.unref() : void 0; + } else { + return clearInterval(this.heartbeat); + } + } -/** - * Returns the compressed size of the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getCompressedSize = function() { - return this.csize; -}; + async __publish__(message) { + await this.yieldLoop(); + return this.instance.Events.trigger("message", message.toString()); + } -/** - * Returns the CRC32 digest for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getCrc = function() { - return this.crc; -}; + async __disconnect__(flush) { + await this.yieldLoop(); + clearInterval(this.heartbeat); + return this.Promise.resolve(); + } -/** - * Returns the external file attributes for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getExternalAttributes = function() { - return this.exattr; -}; + yieldLoop(t = 0) { + return new this.Promise(function(resolve, reject) { + return setTimeout(resolve, t); + }); + } -/** - * Returns the extra fields related to the entry. - * - * @returns {Buffer} - */ -ZipArchiveEntry.prototype.getExtra = function() { - return this.extra !== null ? this.extra : constants.EMPTY; -}; + computePenalty() { + var ref; + return (ref = this.storeOptions.penalty) != null ? ref : (15 * this.storeOptions.minTime) || 5000; + } -/** - * Returns the general purpose bits related to the entry. - * - * @returns {GeneralPurposeBit} - */ -ZipArchiveEntry.prototype.getGeneralPurposeBit = function() { - return this.gpb; -}; + async __updateSettings__(options) { + await this.yieldLoop(); + parser$2.overwrite(options, options, this.storeOptions); + this._startHeartbeat(); + this.instance._drainAll(this.computeCapacity()); + return true; + } -/** - * Returns the internal file attributes for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getInternalAttributes = function() { - return this.inattr; -}; + async __running__() { + await this.yieldLoop(); + return this._running; + } -/** - * Returns the last modified date of the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getLastModifiedDate = function() { - return this.getTime(); -}; + async __queued__() { + await this.yieldLoop(); + return this.instance.queued(); + } -/** - * Returns the extra fields related to the entry. - * - * @returns {Buffer} - */ -ZipArchiveEntry.prototype.getLocalFileDataExtra = function() { - return this.getExtra(); -}; + async __done__() { + await this.yieldLoop(); + return this._done; + } -/** - * Returns the compression method used on the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getMethod = function() { - return this.method; -}; + async __groupCheck__(time) { + await this.yieldLoop(); + return (this._nextRequest + this.timeout) < time; + } -/** - * Returns the filename of the entry. - * - * @returns {string} - */ -ZipArchiveEntry.prototype.getName = function() { - return this.name; -}; + computeCapacity() { + var maxConcurrent, reservoir; + ({maxConcurrent, reservoir} = this.storeOptions); + if ((maxConcurrent != null) && (reservoir != null)) { + return Math.min(maxConcurrent - this._running, reservoir); + } else if (maxConcurrent != null) { + return maxConcurrent - this._running; + } else if (reservoir != null) { + return reservoir; + } else { + return null; + } + } -/** - * Returns the platform on which the entry was made. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getPlatform = function() { - return this.platform; -}; + conditionsCheck(weight) { + var capacity; + capacity = this.computeCapacity(); + return (capacity == null) || weight <= capacity; + } -/** - * Returns the size of the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getSize = function() { - return this.size; -}; + async __incrementReservoir__(incr) { + var reservoir; + await this.yieldLoop(); + reservoir = this.storeOptions.reservoir += incr; + this.instance._drainAll(this.computeCapacity()); + return reservoir; + } -/** - * Returns a date object representing the last modified date of the entry. - * - * @returns {number|Date} - */ -ZipArchiveEntry.prototype.getTime = function() { - return this.time !== -1 ? zipUtil.dosToDate(this.time) : -1; -}; + async __currentReservoir__() { + await this.yieldLoop(); + return this.storeOptions.reservoir; + } -/** - * Returns the DOS timestamp for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getTimeDos = function() { - return this.time !== -1 ? this.time : 0; -}; + isBlocked(now) { + return this._unblockTime >= now; + } -/** - * Returns the UNIX file permissions for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getUnixMode = function() { - return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK); -}; + check(weight, now) { + return this.conditionsCheck(weight) && (this._nextRequest - now) <= 0; + } -/** - * Returns the version of ZIP needed to extract the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getVersionNeededToExtract = function() { - return this.minver; -}; + async __check__(weight) { + var now; + await this.yieldLoop(); + now = Date.now(); + return this.check(weight, now); + } -/** - * Sets the comment of the entry. - * - * @param comment - */ -ZipArchiveEntry.prototype.setComment = function(comment) { - if (Buffer.byteLength(comment) !== comment.length) { - this.getGeneralPurposeBit().useUTF8ForNames(true); - } + async __register__(index, weight, expiration) { + var now, wait; + await this.yieldLoop(); + now = Date.now(); + if (this.conditionsCheck(weight)) { + this._running += weight; + if (this.storeOptions.reservoir != null) { + this.storeOptions.reservoir -= weight; + } + wait = Math.max(this._nextRequest - now, 0); + this._nextRequest = now + wait + this.storeOptions.minTime; + return { + success: true, + wait, + reservoir: this.storeOptions.reservoir + }; + } else { + return { + success: false + }; + } + } - this.comment = comment; -}; + strategyIsBlock() { + return this.storeOptions.strategy === 3; + } -/** - * Sets the compressed size of the entry. - * - * @param size - */ -ZipArchiveEntry.prototype.setCompressedSize = function(size) { - if (size < 0) { - throw new Error('invalid entry compressed size'); - } + async __submit__(queueLength, weight) { + var blocked, now, reachedHWM; + await this.yieldLoop(); + if ((this.storeOptions.maxConcurrent != null) && weight > this.storeOptions.maxConcurrent) { + 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}`); + } + now = Date.now(); + reachedHWM = (this.storeOptions.highWater != null) && queueLength === this.storeOptions.highWater && !this.check(weight, now); + blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now)); + if (blocked) { + this._unblockTime = now + this.computePenalty(); + this._nextRequest = this._unblockTime + this.storeOptions.minTime; + this.instance._dropAllQueued(); + } + return { + reachedHWM, + blocked, + strategy: this.storeOptions.strategy + }; + } - this.csize = size; -}; + async __free__(index, weight) { + await this.yieldLoop(); + this._running -= weight; + this._done += weight; + this.instance._drainAll(this.computeCapacity()); + return { + running: this._running + }; + } -/** - * Sets the checksum of the entry. - * - * @param crc - */ -ZipArchiveEntry.prototype.setCrc = function(crc) { - if (crc < 0) { - throw new Error('invalid entry crc32'); - } + }; - this.crc = crc; -}; + var LocalDatastore_1 = LocalDatastore; -/** - * Sets the external file attributes of the entry. - * - * @param attr - */ -ZipArchiveEntry.prototype.setExternalAttributes = function(attr) { - this.exattr = attr >>> 0; -}; + var BottleneckError$3, States; -/** - * Sets the extra fields related to the entry. - * - * @param extra - */ -ZipArchiveEntry.prototype.setExtra = function(extra) { - this.extra = extra; -}; + BottleneckError$3 = BottleneckError_1; -/** - * Sets the general purpose bits related to the entry. - * - * @param gpb - */ -ZipArchiveEntry.prototype.setGeneralPurposeBit = function(gpb) { - if (!(gpb instanceof GeneralPurposeBit)) { - throw new Error('invalid entry GeneralPurposeBit'); - } + States = class States { + constructor(status1) { + this.status = status1; + this._jobs = {}; + this.counts = this.status.map(function() { + return 0; + }); + } - this.gpb = gpb; -}; + next(id) { + var current, next; + current = this._jobs[id]; + next = current + 1; + if ((current != null) && next < this.status.length) { + this.counts[current]--; + this.counts[next]++; + return this._jobs[id]++; + } else if (current != null) { + this.counts[current]--; + return delete this._jobs[id]; + } + } -/** - * Sets the internal file attributes of the entry. - * - * @param attr - */ -ZipArchiveEntry.prototype.setInternalAttributes = function(attr) { - this.inattr = attr; -}; + start(id) { + var initial; + initial = 0; + this._jobs[id] = initial; + return this.counts[initial]++; + } -/** - * Sets the compression method of the entry. - * - * @param method - */ -ZipArchiveEntry.prototype.setMethod = function(method) { - if (method < 0) { - throw new Error('invalid entry compression method'); - } + remove(id) { + var current; + current = this._jobs[id]; + if (current != null) { + this.counts[current]--; + delete this._jobs[id]; + } + return current != null; + } - this.method = method; -}; + jobStatus(id) { + var ref; + return (ref = this.status[this._jobs[id]]) != null ? ref : null; + } -/** - * Sets the name of the entry. - * - * @param name - * @param prependSlash - */ -ZipArchiveEntry.prototype.setName = function(name, prependSlash = false) { - name = normalizePath(name, false) - .replace(/^\w+:/, '') - .replace(/^(\.\.\/|\/)+/, ''); + statusJobs(status) { + var k, pos, ref, results, v; + if (status != null) { + pos = this.status.indexOf(status); + if (pos < 0) { + throw new BottleneckError$3(`status must be one of ${this.status.join(', ')}`); + } + ref = this._jobs; + results = []; + for (k in ref) { + v = ref[k]; + if (v === pos) { + results.push(k); + } + } + return results; + } else { + return Object.keys(this._jobs); + } + } - if (prependSlash) { - name = `/${name}`; - } + statusCounts() { + return this.counts.reduce(((acc, v, i) => { + acc[this.status[i]] = v; + return acc; + }), {}); + } - if (Buffer.byteLength(name) !== name.length) { - this.getGeneralPurposeBit().useUTF8ForNames(true); - } + }; - this.name = name; -}; + var States_1 = States; -/** - * Sets the platform on which the entry was made. - * - * @param platform - */ -ZipArchiveEntry.prototype.setPlatform = function(platform) { - this.platform = platform; -}; + var DLList$2, Sync; -/** - * Sets the size of the entry. - * - * @param size - */ -ZipArchiveEntry.prototype.setSize = function(size) { - if (size < 0) { - throw new Error('invalid entry size'); - } + DLList$2 = DLList_1; - this.size = size; -}; + Sync = class Sync { + constructor(name, Promise) { + this.schedule = this.schedule.bind(this); + this.name = name; + this.Promise = Promise; + this._running = 0; + this._queue = new DLList$2(); + } -/** - * Sets the time of the entry. - * - * @param time - * @param forceLocalTime - */ -ZipArchiveEntry.prototype.setTime = function(time, forceLocalTime) { - if (!(time instanceof Date)) { - throw new Error('invalid entry time'); - } + isEmpty() { + return this._queue.length === 0; + } - this.time = zipUtil.dateToDos(time, forceLocalTime); -}; + async _tryToRun() { + var args, cb, error, reject, resolve, returned, task; + if ((this._running < 1) && this._queue.length > 0) { + this._running++; + ({task, args, resolve, reject} = this._queue.shift()); + cb = (await (async function() { + try { + returned = (await task(...args)); + return function() { + return resolve(returned); + }; + } catch (error1) { + error = error1; + return function() { + return reject(error); + }; + } + })()); + this._running--; + this._tryToRun(); + return cb(); + } + } -/** - * Sets the UNIX file permissions for the entry. - * - * @param mode - */ -ZipArchiveEntry.prototype.setUnixMode = function(mode) { - mode |= this.isDirectory() ? constants.S_IFDIR : constants.S_IFREG; + schedule(task, ...args) { + var promise, reject, resolve; + resolve = reject = null; + promise = new this.Promise(function(_resolve, _reject) { + resolve = _resolve; + return reject = _reject; + }); + this._queue.push({task, args, resolve, reject}); + this._tryToRun(); + return promise; + } - var extattr = 0; - extattr |= (mode << constants.SHORT_SHIFT) | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A); + }; - this.setExternalAttributes(extattr); - this.mode = mode & constants.MODE_MASK; - this.platform = constants.PLATFORM_UNIX; -}; + var Sync_1 = Sync; -/** - * Sets the version of ZIP needed to extract this entry. - * - * @param minver - */ -ZipArchiveEntry.prototype.setVersionNeededToExtract = function(minver) { - this.minver = minver; -}; + var version = "2.19.5"; + var version$1 = { + version: version + }; -/** - * Returns true if this entry represents a directory. - * - * @returns {boolean} - */ -ZipArchiveEntry.prototype.isDirectory = function() { - return this.getName().slice(-1) === '/'; -}; + var version$2 = /*#__PURE__*/Object.freeze({ + version: version, + default: version$1 + }); -/** - * Returns true if this entry represents a unix symlink, - * in which case the entry's content contains the target path - * for the symlink. - * - * @returns {boolean} - */ -ZipArchiveEntry.prototype.isUnixSymlink = function() { - return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG; -}; + var require$$2 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); -/** - * Returns true if this entry is using the ZIP64 extension of ZIP. - * - * @returns {boolean} - */ -ZipArchiveEntry.prototype.isZip64 = function() { - return this.csize > constants.ZIP64_MAGIC || this.size > constants.ZIP64_MAGIC; -}; + var require$$3 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); + var require$$4 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); -/***/ }), + var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3; -/***/ 82132: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + parser$3 = parser; -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var inherits = (__nccwpck_require__(39023).inherits); -var crc32 = __nccwpck_require__(19776); -var {CRC32Stream} = __nccwpck_require__(82770); -var {DeflateCRC32Stream} = __nccwpck_require__(82770); + Events$2 = Events_1; -var ArchiveOutputStream = __nccwpck_require__(36306); -var ZipArchiveEntry = __nccwpck_require__(73380); -var GeneralPurposeBit = __nccwpck_require__(97632); + RedisConnection$1 = require$$2; -var constants = __nccwpck_require__(94908); -var util = __nccwpck_require__(18300); -var zipUtil = __nccwpck_require__(6453); + IORedisConnection$1 = require$$3; -var ZipArchiveOutputStream = module.exports = function(options) { - if (!(this instanceof ZipArchiveOutputStream)) { - return new ZipArchiveOutputStream(options); - } + Scripts$1 = require$$4; - options = this.options = this._defaults(options); + Group = (function() { + class Group { + constructor(limiterOptions = {}) { + this.deleteKey = this.deleteKey.bind(this); + this.limiterOptions = limiterOptions; + parser$3.load(this.limiterOptions, this.defaults, this); + this.Events = new Events$2(this); + this.instances = {}; + this.Bottleneck = Bottleneck_1; + this._startAutoCleanup(); + this.sharedConnection = this.connection != null; + if (this.connection == null) { + if (this.limiterOptions.datastore === "redis") { + this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events})); + } else if (this.limiterOptions.datastore === "ioredis") { + this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events})); + } + } + } - ArchiveOutputStream.call(this, options); + key(key = "") { + var ref; + return (ref = this.instances[key]) != null ? ref : (() => { + var limiter; + limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, { + id: `${this.id}-${key}`, + timeout: this.timeout, + connection: this.connection + })); + this.Events.trigger("created", limiter, key); + return limiter; + })(); + } - this._entry = null; - this._entries = []; - this._archive = { - centralLength: 0, - centralOffset: 0, - comment: '', - finish: false, - finished: false, - processing: false, - forceZip64: options.forceZip64, - forceLocalTime: options.forceLocalTime - }; -}; + async deleteKey(key = "") { + var deleted, instance; + instance = this.instances[key]; + if (this.connection) { + deleted = (await this.connection.__runCommand__(['del', ...Scripts$1.allKeys(`${this.id}-${key}`)])); + } + if (instance != null) { + delete this.instances[key]; + await instance.disconnect(); + } + return (instance != null) || deleted > 0; + } -inherits(ZipArchiveOutputStream, ArchiveOutputStream); + limiters() { + var k, ref, results, v; + ref = this.instances; + results = []; + for (k in ref) { + v = ref[k]; + results.push({ + key: k, + limiter: v + }); + } + return results; + } -ZipArchiveOutputStream.prototype._afterAppend = function(ae) { - this._entries.push(ae); + keys() { + return Object.keys(this.instances); + } - if (ae.getGeneralPurposeBit().usesDataDescriptor()) { - this._writeDataDescriptor(ae); - } + async clusterKeys() { + var cursor, end, found, i, k, keys, len, next, start; + if (this.connection == null) { + return this.Promise.resolve(this.keys()); + } + keys = []; + cursor = null; + start = `b_${this.id}-`.length; + end = "_settings".length; + while (cursor !== 0) { + [next, found] = (await this.connection.__runCommand__(["scan", cursor != null ? cursor : 0, "match", `b_${this.id}-*_settings`, "count", 10000])); + cursor = ~~next; + for (i = 0, len = found.length; i < len; i++) { + k = found[i]; + keys.push(k.slice(start, -end)); + } + } + return keys; + } - this._archive.processing = false; - this._entry = null; + _startAutoCleanup() { + var base; + clearInterval(this.interval); + return typeof (base = (this.interval = setInterval(async() => { + var e, k, ref, results, time, v; + time = Date.now(); + ref = this.instances; + results = []; + for (k in ref) { + v = ref[k]; + try { + if ((await v._store.__groupCheck__(time))) { + results.push(this.deleteKey(k)); + } else { + results.push(void 0); + } + } catch (error) { + e = error; + results.push(v.Events.trigger("error", e)); + } + } + return results; + }, this.timeout / 2))).unref === "function" ? base.unref() : void 0; + } - if (this._archive.finish && !this._archive.finished) { - this._finish(); - } -}; + updateSettings(options = {}) { + parser$3.overwrite(options, this.defaults, this); + parser$3.overwrite(options, options, this.limiterOptions); + if (options.timeout != null) { + return this._startAutoCleanup(); + } + } -ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) { - if (source.length === 0) { - ae.setMethod(constants.METHOD_STORED); - } + disconnect(flush = true) { + var ref; + if (!this.sharedConnection) { + return (ref = this.connection) != null ? ref.disconnect(flush) : void 0; + } + } - var method = ae.getMethod(); + } + Group.prototype.defaults = { + timeout: 1000 * 60 * 5, + connection: null, + Promise: Promise, + id: "group-key" + }; - if (method === constants.METHOD_STORED) { - ae.setSize(source.length); - ae.setCompressedSize(source.length); - ae.setCrc(crc32.unsigned(source)); - } + return Group; - this._writeLocalFileHeader(ae); + }).call(commonjsGlobal); - if (method === constants.METHOD_STORED) { - this.write(source); - this._afterAppend(ae); - callback(null, ae); - return; - } else if (method === constants.METHOD_DEFLATED) { - this._smartStream(ae, callback).end(source); - return; - } else { - callback(new Error('compression method ' + method + ' not implemented')); - return; - } -}; + var Group_1 = Group; -ZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) { - ae.getGeneralPurposeBit().useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); + var Batcher, Events$3, parser$4; - this._writeLocalFileHeader(ae); + parser$4 = parser; - var smart = this._smartStream(ae, callback); - source.once('error', function(err) { - smart.emit('error', err); - smart.end(); - }) - source.pipe(smart); -}; + Events$3 = Events_1; -ZipArchiveOutputStream.prototype._defaults = function(o) { - if (typeof o !== 'object') { - o = {}; - } + Batcher = (function() { + class Batcher { + constructor(options = {}) { + this.options = options; + parser$4.load(this.options, this.defaults, this); + this.Events = new Events$3(this); + this._arr = []; + this._resetPromise(); + this._lastFlush = Date.now(); + } - if (typeof o.zlib !== 'object') { - o.zlib = {}; - } + _resetPromise() { + return this._promise = new this.Promise((res, rej) => { + return this._resolve = res; + }); + } - if (typeof o.zlib.level !== 'number') { - o.zlib.level = constants.ZLIB_BEST_SPEED; - } + _flush() { + clearTimeout(this._timeout); + this._lastFlush = Date.now(); + this._resolve(); + this.Events.trigger("batch", this._arr); + this._arr = []; + return this._resetPromise(); + } - o.forceZip64 = !!o.forceZip64; - o.forceLocalTime = !!o.forceLocalTime; + add(data) { + var ret; + this._arr.push(data); + ret = this._promise; + if (this._arr.length === this.maxSize) { + this._flush(); + } else if ((this.maxTime != null) && this._arr.length === 1) { + this._timeout = setTimeout(() => { + return this._flush(); + }, this.maxTime); + } + return ret; + } - return o; -}; + } + Batcher.prototype.defaults = { + maxTime: null, + maxSize: null, + Promise: Promise + }; -ZipArchiveOutputStream.prototype._finish = function() { - this._archive.centralOffset = this.offset; + return Batcher; - this._entries.forEach(function(ae) { - this._writeCentralFileHeader(ae); - }.bind(this)); + }).call(commonjsGlobal); - this._archive.centralLength = this.offset - this._archive.centralOffset; + var Batcher_1 = Batcher; - if (this.isZip64()) { - this._writeCentralDirectoryZip64(); - } + var require$$4$1 = () => console.log('You must import the full version of Bottleneck in order to use this feature.'); - this._writeCentralDirectoryEnd(); + var require$$8 = getCjsExportFromNamespace(version$2); - this._archive.processing = false; - this._archive.finish = true; - this._archive.finished = true; - this.end(); -}; + var Bottleneck, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, + splice = [].splice; -ZipArchiveOutputStream.prototype._normalizeEntry = function(ae) { - if (ae.getMethod() === -1) { - ae.setMethod(constants.METHOD_DEFLATED); - } + NUM_PRIORITIES$1 = 10; - if (ae.getMethod() === constants.METHOD_DEFLATED) { - ae.getGeneralPurposeBit().useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); - } + DEFAULT_PRIORITY$1 = 5; - if (ae.getTime() === -1) { - ae.setTime(new Date(), this._archive.forceLocalTime); - } + parser$5 = parser; - ae._offsets = { - file: 0, - data: 0, - contents: 0, - }; -}; + Queues$1 = Queues_1; -ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { - var deflate = ae.getMethod() === constants.METHOD_DEFLATED; - var process = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); - var error = null; + Job$1 = Job_1; - function handleStuff() { - var digest = process.digest().readUInt32BE(0); - ae.setCrc(digest); - ae.setSize(process.size()); - ae.setCompressedSize(process.size(true)); - this._afterAppend(ae); - callback(error, ae); - } + LocalDatastore$1 = LocalDatastore_1; - process.once('end', handleStuff.bind(this)); - process.once('error', function(err) { - error = err; - }); + RedisDatastore$1 = require$$4$1; - process.pipe(this, { end: false }); + Events$4 = Events_1; - return process; -}; + States$1 = States_1; -ZipArchiveOutputStream.prototype._writeCentralDirectoryEnd = function() { - var records = this._entries.length; - var size = this._archive.centralLength; - var offset = this._archive.centralOffset; + Sync$1 = Sync_1; - if (this.isZip64()) { - records = constants.ZIP64_MAGIC_SHORT; - size = constants.ZIP64_MAGIC; - offset = constants.ZIP64_MAGIC; - } + Bottleneck = (function() { + class Bottleneck { + constructor(options = {}, ...invalid) { + var storeInstanceOptions, storeOptions; + this._addToQueue = this._addToQueue.bind(this); + this._validateOptions(options, invalid); + parser$5.load(options, this.instanceDefaults, this); + this._queues = new Queues$1(NUM_PRIORITIES$1); + this._scheduled = {}; + this._states = new States$1(["RECEIVED", "QUEUED", "RUNNING", "EXECUTING"].concat(this.trackDoneStatus ? ["DONE"] : [])); + this._limiter = null; + this.Events = new Events$4(this); + this._submitLock = new Sync$1("submit", this.Promise); + this._registerLock = new Sync$1("register", this.Promise); + storeOptions = parser$5.load(options, this.storeDefaults, {}); + this._store = (function() { + if (this.datastore === "redis" || this.datastore === "ioredis" || (this.connection != null)) { + storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {}); + return new RedisDatastore$1(this, storeOptions, storeInstanceOptions); + } else if (this.datastore === "local") { + storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {}); + return new LocalDatastore$1(this, storeOptions, storeInstanceOptions); + } else { + throw new Bottleneck.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`); + } + }).call(this); + this._queues.on("leftzero", () => { + var ref; + return (ref = this._store.heartbeat) != null ? typeof ref.ref === "function" ? ref.ref() : void 0 : void 0; + }); + this._queues.on("zero", () => { + var ref; + return (ref = this._store.heartbeat) != null ? typeof ref.unref === "function" ? ref.unref() : void 0 : void 0; + }); + } - // signature - this.write(zipUtil.getLongBytes(constants.SIG_EOCD)); + _validateOptions(options, invalid) { + if (!((options != null) && typeof options === "object" && invalid.length === 0)) { + 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."); + } + } - // disk numbers - this.write(constants.SHORT_ZERO); - this.write(constants.SHORT_ZERO); + ready() { + return this._store.ready; + } - // number of entries - this.write(zipUtil.getShortBytes(records)); - this.write(zipUtil.getShortBytes(records)); + clients() { + return this._store.clients; + } - // length and location of CD - this.write(zipUtil.getLongBytes(size)); - this.write(zipUtil.getLongBytes(offset)); + channel() { + return `b_${this.id}`; + } - // archive comment - var comment = this.getComment(); - var commentLength = Buffer.byteLength(comment); - this.write(zipUtil.getShortBytes(commentLength)); - this.write(comment); -}; + channel_client() { + return `b_${this.id}_${this._store.clientId}`; + } -ZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() { - // signature - this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD)); + publish(message) { + return this._store.__publish__(message); + } - // size of the ZIP64 EOCD record - this.write(zipUtil.getEightBytes(44)); + disconnect(flush = true) { + return this._store.__disconnect__(flush); + } - // version made by - this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); + chain(_limiter) { + this._limiter = _limiter; + return this; + } - // version to extract - this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); + queued(priority) { + return this._queues.queued(priority); + } - // disk numbers - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); + clusterQueued() { + return this._store.__queued__(); + } - // number of entries - this.write(zipUtil.getEightBytes(this._entries.length)); - this.write(zipUtil.getEightBytes(this._entries.length)); + empty() { + return this.queued() === 0 && this._submitLock.isEmpty(); + } - // length and location of CD - this.write(zipUtil.getEightBytes(this._archive.centralLength)); - this.write(zipUtil.getEightBytes(this._archive.centralOffset)); + running() { + return this._store.__running__(); + } - // extensible data sector - // not implemented at this time + done() { + return this._store.__done__(); + } - // end of central directory locator - this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD_LOC)); + jobStatus(id) { + return this._states.jobStatus(id); + } - // disk number holding the ZIP64 EOCD record - this.write(constants.LONG_ZERO); + jobs(status) { + return this._states.statusJobs(status); + } - // relative offset of the ZIP64 EOCD record - this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength)); + counts() { + return this._states.statusCounts(); + } - // total number of disks - this.write(zipUtil.getLongBytes(1)); -}; + _randomIndex() { + return Math.random().toString(36).slice(2); + } -ZipArchiveOutputStream.prototype._writeCentralFileHeader = function(ae) { - var gpb = ae.getGeneralPurposeBit(); - var method = ae.getMethod(); - var offsets = ae._offsets; + check(weight = 1) { + return this._store.__check__(weight); + } - var size = ae.getSize(); - var compressedSize = ae.getCompressedSize(); + _clearGlobalState(index) { + if (this._scheduled[index] != null) { + clearTimeout(this._scheduled[index].expiration); + delete this._scheduled[index]; + return true; + } else { + return false; + } + } - if (ae.isZip64() || offsets.file > constants.ZIP64_MAGIC) { - size = constants.ZIP64_MAGIC; - compressedSize = constants.ZIP64_MAGIC; + async _free(index, job, options, eventInfo) { + var e, running; + try { + ({running} = (await this._store.__free__(index, options.weight))); + this.Events.trigger("debug", `Freed ${options.id}`, eventInfo); + if (running === 0 && this.empty()) { + return this.Events.trigger("idle"); + } + } catch (error1) { + e = error1; + return this.Events.trigger("error", e); + } + } - ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); + _run(index, job, wait) { + var clearGlobalState, free, run; + job.doRun(); + clearGlobalState = this._clearGlobalState.bind(this, index); + run = this._run.bind(this, index, job); + free = this._free.bind(this, index, job); + return this._scheduled[index] = { + timeout: setTimeout(() => { + return job.doExecute(this._limiter, clearGlobalState, run, free); + }, wait), + expiration: job.options.expiration != null ? setTimeout(function() { + return job.doExpire(clearGlobalState, run, free); + }, wait + job.options.expiration) : void 0, + job: job + }; + } - var extraBuf = Buffer.concat([ - zipUtil.getShortBytes(constants.ZIP64_EXTRA_ID), - zipUtil.getShortBytes(24), - zipUtil.getEightBytes(ae.getSize()), - zipUtil.getEightBytes(ae.getCompressedSize()), - zipUtil.getEightBytes(offsets.file) - ], 28); + _drainOne(capacity) { + return this._registerLock.schedule(() => { + var args, index, next, options, queue; + if (this.queued() === 0) { + return this.Promise.resolve(null); + } + queue = this._queues.getFirst(); + ({options, args} = next = queue.first()); + if ((capacity != null) && options.weight > capacity) { + return this.Promise.resolve(null); + } + this.Events.trigger("debug", `Draining ${options.id}`, {args, options}); + index = this._randomIndex(); + return this._store.__register__(index, options.weight, options.expiration).then(({success, wait, reservoir}) => { + var empty; + this.Events.trigger("debug", `Drained ${options.id}`, {success, args, options}); + if (success) { + queue.shift(); + empty = this.empty(); + if (empty) { + this.Events.trigger("empty"); + } + if (reservoir === 0) { + this.Events.trigger("depleted", empty); + } + this._run(index, next, wait); + return this.Promise.resolve(options.weight); + } else { + return this.Promise.resolve(null); + } + }); + }); + } - ae.setExtra(extraBuf); - } + _drainAll(capacity, total = 0) { + return this._drainOne(capacity).then((drained) => { + var newCapacity; + if (drained != null) { + newCapacity = capacity != null ? capacity - drained : capacity; + return this._drainAll(newCapacity, total + drained); + } else { + return this.Promise.resolve(total); + } + }).catch((e) => { + return this.Events.trigger("error", e); + }); + } - // signature - this.write(zipUtil.getLongBytes(constants.SIG_CFH)); + _dropAllQueued(message) { + return this._queues.shiftAll(function(job) { + return job.doDrop({message}); + }); + } - // version made by - this.write(zipUtil.getShortBytes((ae.getPlatform() << 8) | constants.VERSION_MADEBY)); + stop(options = {}) { + var done, waitForExecuting; + options = parser$5.load(options, this.stopDefaults); + waitForExecuting = (at) => { + var finished; + finished = () => { + var counts; + counts = this._states.counts; + return (counts[0] + counts[1] + counts[2] + counts[3]) === at; + }; + return new this.Promise((resolve, reject) => { + if (finished()) { + return resolve(); + } else { + return this.on("done", () => { + if (finished()) { + this.removeAllListeners("done"); + return resolve(); + } + }); + } + }); + }; + done = options.dropWaitingJobs ? (this._run = function(index, next) { + return next.doDrop({ + message: options.dropErrorMessage + }); + }, this._drainOne = () => { + return this.Promise.resolve(null); + }, this._registerLock.schedule(() => { + return this._submitLock.schedule(() => { + var k, ref, v; + ref = this._scheduled; + for (k in ref) { + v = ref[k]; + if (this.jobStatus(v.job.options.id) === "RUNNING") { + clearTimeout(v.timeout); + clearTimeout(v.expiration); + v.job.doDrop({ + message: options.dropErrorMessage + }); + } + } + this._dropAllQueued(options.dropErrorMessage); + return waitForExecuting(0); + }); + })) : this.schedule({ + priority: NUM_PRIORITIES$1 - 1, + weight: 0 + }, () => { + return waitForExecuting(1); + }); + this._receive = function(job) { + return job._reject(new Bottleneck.prototype.BottleneckError(options.enqueueErrorMessage)); + }; + this.stop = () => { + return this.Promise.reject(new Bottleneck.prototype.BottleneckError("stop() has already been called")); + }; + return done; + } - // version to extract and general bit flag - this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); - this.write(gpb.encode()); + async _addToQueue(job) { + var args, blocked, error, options, reachedHWM, shifted, strategy; + ({args, options} = job); + try { + ({reachedHWM, blocked, strategy} = (await this._store.__submit__(this.queued(), options.weight))); + } catch (error1) { + error = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, {args, options, error}); + job.doDrop({error}); + return false; + } + if (blocked) { + job.doDrop(); + return true; + } else if (reachedHWM) { + 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; + if (shifted != null) { + shifted.doDrop(); + } + if ((shifted == null) || strategy === Bottleneck.prototype.strategy.OVERFLOW) { + if (shifted == null) { + job.doDrop(); + } + return reachedHWM; + } + } + job.doQueue(reachedHWM, blocked); + this._queues.push(job); + await this._drainAll(); + return reachedHWM; + } - // compression method - this.write(zipUtil.getShortBytes(method)); + _receive(job) { + if (this._states.jobStatus(job.options.id) != null) { + job._reject(new Bottleneck.prototype.BottleneckError(`A job with the same id already exists (id=${job.options.id})`)); + return false; + } else { + job.doReceive(); + return this._submitLock.schedule(this._addToQueue, job); + } + } - // datetime - this.write(zipUtil.getLongBytes(ae.getTimeDos())); + submit(...args) { + var cb, fn, job, options, ref, ref1, task; + if (typeof args[0] === "function") { + ref = args, [fn, ...args] = ref, [cb] = splice.call(args, -1); + options = parser$5.load({}, this.jobDefaults); + } else { + ref1 = args, [options, fn, ...args] = ref1, [cb] = splice.call(args, -1); + options = parser$5.load(options, this.jobDefaults); + } + task = (...args) => { + return new this.Promise(function(resolve, reject) { + return fn(...args, function(...args) { + return (args[0] != null ? reject : resolve)(args); + }); + }); + }; + job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); + job.promise.then(function(args) { + return typeof cb === "function" ? cb(...args) : void 0; + }).catch(function(args) { + if (Array.isArray(args)) { + return typeof cb === "function" ? cb(...args) : void 0; + } else { + return typeof cb === "function" ? cb(args) : void 0; + } + }); + return this._receive(job); + } - // crc32 checksum - this.write(zipUtil.getLongBytes(ae.getCrc())); + schedule(...args) { + var job, options, task; + if (typeof args[0] === "function") { + [task, ...args] = args; + options = {}; + } else { + [options, task, ...args] = args; + } + job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); + this._receive(job); + return job.promise; + } - // sizes - this.write(zipUtil.getLongBytes(compressedSize)); - this.write(zipUtil.getLongBytes(size)); + wrap(fn) { + var schedule, wrapped; + schedule = this.schedule.bind(this); + wrapped = function(...args) { + return schedule(fn.bind(this), ...args); + }; + wrapped.withOptions = function(options, ...args) { + return schedule(options, fn, ...args); + }; + return wrapped; + } - var name = ae.getName(); - var comment = ae.getComment(); - var extra = ae.getCentralDirectoryExtra(); + async updateSettings(options = {}) { + await this._store.__updateSettings__(parser$5.overwrite(options, this.storeDefaults)); + parser$5.overwrite(options, this.instanceDefaults, this); + return this; + } - if (gpb.usesUTF8ForNames()) { - name = Buffer.from(name); - comment = Buffer.from(comment); - } + currentReservoir() { + return this._store.__currentReservoir__(); + } - // name length - this.write(zipUtil.getShortBytes(name.length)); + incrementReservoir(incr = 0) { + return this._store.__incrementReservoir__(incr); + } - // extra length - this.write(zipUtil.getShortBytes(extra.length)); + } + Bottleneck.default = Bottleneck; - // comments length - this.write(zipUtil.getShortBytes(comment.length)); + Bottleneck.Events = Events$4; - // disk number start - this.write(constants.SHORT_ZERO); + Bottleneck.version = Bottleneck.prototype.version = require$$8.version; - // internal attributes - this.write(zipUtil.getShortBytes(ae.getInternalAttributes())); + Bottleneck.strategy = Bottleneck.prototype.strategy = { + LEAK: 1, + OVERFLOW: 2, + OVERFLOW_PRIORITY: 4, + BLOCK: 3 + }; - // external attributes - this.write(zipUtil.getLongBytes(ae.getExternalAttributes())); + Bottleneck.BottleneckError = Bottleneck.prototype.BottleneckError = BottleneckError_1; - // relative offset of LFH - if (offsets.file > constants.ZIP64_MAGIC) { - this.write(zipUtil.getLongBytes(constants.ZIP64_MAGIC)); - } else { - this.write(zipUtil.getLongBytes(offsets.file)); - } + Bottleneck.Group = Bottleneck.prototype.Group = Group_1; - // name - this.write(name); + Bottleneck.RedisConnection = Bottleneck.prototype.RedisConnection = require$$2; - // extra - this.write(extra); + Bottleneck.IORedisConnection = Bottleneck.prototype.IORedisConnection = require$$3; - // comment - this.write(comment); -}; + Bottleneck.Batcher = Bottleneck.prototype.Batcher = Batcher_1; -ZipArchiveOutputStream.prototype._writeDataDescriptor = function(ae) { - // signature - this.write(zipUtil.getLongBytes(constants.SIG_DD)); + Bottleneck.prototype.jobDefaults = { + priority: DEFAULT_PRIORITY$1, + weight: 1, + expiration: null, + id: "" + }; - // crc32 checksum - this.write(zipUtil.getLongBytes(ae.getCrc())); + Bottleneck.prototype.storeDefaults = { + maxConcurrent: null, + minTime: 0, + highWater: null, + strategy: Bottleneck.prototype.strategy.LEAK, + penalty: null, + reservoir: null, + reservoirRefreshInterval: null, + reservoirRefreshAmount: null, + reservoirIncreaseInterval: null, + reservoirIncreaseAmount: null, + reservoirIncreaseMaximum: null + }; - // sizes - if (ae.isZip64()) { - this.write(zipUtil.getEightBytes(ae.getCompressedSize())); - this.write(zipUtil.getEightBytes(ae.getSize())); - } else { - this.write(zipUtil.getLongBytes(ae.getCompressedSize())); - this.write(zipUtil.getLongBytes(ae.getSize())); - } -}; + Bottleneck.prototype.localStoreDefaults = { + Promise: Promise, + timeout: null, + heartbeatInterval: 250 + }; -ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) { - var gpb = ae.getGeneralPurposeBit(); - var method = ae.getMethod(); - var name = ae.getName(); - var extra = ae.getLocalFileDataExtra(); + Bottleneck.prototype.redisStoreDefaults = { + Promise: Promise, + timeout: null, + heartbeatInterval: 5000, + clientTimeout: 10000, + Redis: null, + clientOptions: {}, + clusterNodes: null, + clearDatastore: false, + connection: null + }; - if (ae.isZip64()) { - gpb.useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); - } + Bottleneck.prototype.instanceDefaults = { + datastore: "local", + connection: null, + id: "", + rejectOnDrop: true, + trackDoneStatus: false, + Promise: Promise + }; - if (gpb.usesUTF8ForNames()) { - name = Buffer.from(name); - } + Bottleneck.prototype.stopDefaults = { + enqueueErrorMessage: "This limiter has been stopped and cannot accept new jobs.", + dropWaitingJobs: true, + dropErrorMessage: "This limiter has been stopped." + }; - ae._offsets.file = this.offset; + return Bottleneck; - // signature - this.write(zipUtil.getLongBytes(constants.SIG_LFH)); + }).call(commonjsGlobal); - // version to extract and general bit flag - this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); - this.write(gpb.encode()); + var Bottleneck_1 = Bottleneck; - // compression method - this.write(zipUtil.getShortBytes(method)); + var lib = Bottleneck_1; - // datetime - this.write(zipUtil.getLongBytes(ae.getTimeDos())); + return lib; - ae._offsets.data = this.offset; +}))); - // crc32 checksum and sizes - if (gpb.usesDataDescriptor()) { - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - } else { - this.write(zipUtil.getLongBytes(ae.getCrc())); - this.write(zipUtil.getLongBytes(ae.getCompressedSize())); - this.write(zipUtil.getLongBytes(ae.getSize())); - } - // name length - this.write(zipUtil.getShortBytes(name.length)); +/***/ }), - // extra length - this.write(zipUtil.getShortBytes(extra.length)); +/***/ 94691: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // name - this.write(name); +var balanced = __nccwpck_require__(59380); - // extra - this.write(extra); +module.exports = expandTop; - ae._offsets.contents = this.offset; -}; +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; -ZipArchiveOutputStream.prototype.getComment = function(comment) { - return this._archive.comment !== null ? this._archive.comment : ''; -}; +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} -ZipArchiveOutputStream.prototype.isZip64 = function() { - return this._archive.forceZip64 || this._entries.length > constants.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants.ZIP64_MAGIC || this._archive.centralOffset > constants.ZIP64_MAGIC; -}; +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} -ZipArchiveOutputStream.prototype.setComment = function(comment) { - this._archive.comment = comment; -}; +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} -/***/ }), +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; -/***/ 47544: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var parts = []; + var m = balanced('{', '}', str); -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -module.exports = { - ArchiveEntry: __nccwpck_require__(96070), - ZipArchiveEntry: __nccwpck_require__(73380), - ArchiveOutputStream: __nccwpck_require__(36306), - ZipArchiveOutputStream: __nccwpck_require__(82132) -}; + if (!m) + return str.split(','); -/***/ }), + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); -/***/ 18300: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var Stream = (__nccwpck_require__(2203).Stream); -var PassThrough = (__nccwpck_require__(86131).PassThrough); + parts.push.apply(parts, p); -var util = module.exports = {}; + return parts; +} -util.isStream = function(source) { - return source instanceof Stream; -}; +function expandTop(str, options) { + if (!str) + return []; -util.normalizeInputSource = function(source) { - if (source === null) { - return Buffer.alloc(0); - } else if (typeof source === 'string') { - return Buffer.from(source); - } else if (util.isStream(source) && !source._readableState) { - var normalized = new PassThrough(); - source.pipe(normalized); + options = options || {}; + var max = options.max == null ? Infinity : options.max; - return normalized; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); } - return source; -}; + return expand(escapeBraces(str), max, true).map(unescapeBraces); +} -/***/ }), +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} -/***/ 97087: -/***/ ((module) => { +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, max, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m) return [str]; -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, max, false) + : ['']; + + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length && k < max; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str, max, true); + } + return [str]; } - return res; -}; -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], max, false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; -/***/ }), + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.max(Math.abs(numeric(n[2])), 1) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); -/***/ 45481: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + N = []; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + for (var i = x; test(i, y) && N.length < max; i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], max, false)); + } + } -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length && expansions.length < max; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; -function isBoolean(arg) { - return typeof arg === 'boolean'; + return expansions; } -exports.isBoolean = isBoolean; -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; +/***/ }), -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; +/***/ 86627: +/***/ ((module) => { -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; +module.exports = Buffers; -function isSymbol(arg) { - return typeof arg === 'symbol'; +function Buffers (bufs) { + if (!(this instanceof Buffers)) return new Buffers(bufs); + this.buffers = bufs || []; + this.length = this.buffers.reduce(function (size, buf) { + return size + buf.length + }, 0); } -exports.isSymbol = isSymbol; -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; +Buffers.prototype.push = function () { + for (var i = 0; i < arguments.length; i++) { + if (!Buffer.isBuffer(arguments[i])) { + throw new TypeError('Tried to push a non-buffer'); + } + } + + for (var i = 0; i < arguments.length; i++) { + var buf = arguments[i]; + this.buffers.push(buf); + this.length += buf.length; + } + return this.length; +}; -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; +Buffers.prototype.unshift = function () { + for (var i = 0; i < arguments.length; i++) { + if (!Buffer.isBuffer(arguments[i])) { + throw new TypeError('Tried to unshift a non-buffer'); + } + } + + for (var i = 0; i < arguments.length; i++) { + var buf = arguments[i]; + this.buffers.unshift(buf); + this.length += buf.length; + } + return this.length; +}; -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; +Buffers.prototype.copy = function (dst, dStart, start, end) { + return this.slice(start, end).copy(dst, dStart, 0, end - start); +}; + +Buffers.prototype.splice = function (i, howMany) { + var buffers = this.buffers; + var index = i >= 0 ? i : this.length - i; + var reps = [].slice.call(arguments, 2); + + if (howMany === undefined) { + howMany = this.length - index; + } + else if (howMany > this.length - index) { + howMany = this.length - index; + } + + for (var i = 0; i < reps.length; i++) { + this.length += reps[i].length; + } + + var removed = new Buffers(); + var bytes = 0; + + var startBytes = 0; + for ( + var ii = 0; + ii < buffers.length && startBytes + buffers[ii].length < index; + ii ++ + ) { startBytes += buffers[ii].length } + + if (index - startBytes > 0) { + var start = index - startBytes; + + if (start + howMany < buffers[ii].length) { + removed.push(buffers[ii].slice(start, start + howMany)); + + var orig = buffers[ii]; + //var buf = new Buffer(orig.length - howMany); + var buf0 = new Buffer(start); + for (var i = 0; i < start; i++) { + buf0[i] = orig[i]; + } + + var buf1 = new Buffer(orig.length - start - howMany); + for (var i = start + howMany; i < orig.length; i++) { + buf1[ i - howMany - start ] = orig[i] + } + + if (reps.length > 0) { + var reps_ = reps.slice(); + reps_.unshift(buf0); + reps_.push(buf1); + buffers.splice.apply(buffers, [ ii, 1 ].concat(reps_)); + ii += reps_.length; + reps = []; + } + else { + buffers.splice(ii, 1, buf0, buf1); + //buffers[ii] = buf; + ii += 2; + } + } + else { + removed.push(buffers[ii].slice(start)); + buffers[ii] = buffers[ii].slice(0, start); + ii ++; + } + } + + if (reps.length > 0) { + buffers.splice.apply(buffers, [ ii, 0 ].concat(reps)); + ii += reps.length; + } + + while (removed.length < howMany) { + var buf = buffers[ii]; + var len = buf.length; + var take = Math.min(len, howMany - removed.length); + + if (take === len) { + removed.push(buf); + buffers.splice(ii, 1); + } + else { + removed.push(buf.slice(0, take)); + buffers[ii] = buffers[ii].slice(take); + } + } + + this.length -= removed.length; + + return removed; +}; + +Buffers.prototype.slice = function (i, j) { + var buffers = this.buffers; + if (j === undefined) j = this.length; + if (i === undefined) i = 0; + + if (j > this.length) j = this.length; + + var startBytes = 0; + for ( + var si = 0; + si < buffers.length && startBytes + buffers[si].length <= i; + si ++ + ) { startBytes += buffers[si].length } + + var target = new Buffer(j - i); + + var ti = 0; + for (var ii = si; ti < j - i && ii < buffers.length; ii++) { + var len = buffers[ii].length; + + var start = ti === 0 ? i - startBytes : 0; + var end = ti + len >= j - i + ? Math.min(start + (j - i) - ti, len) + : len + ; + + buffers[ii].copy(target, ti, start, end); + ti += end - start; + } + + return target; +}; + +Buffers.prototype.pos = function (i) { + if (i < 0 || i >= this.length) throw new Error('oob'); + var l = i, bi = 0, bu = null; + for (;;) { + bu = this.buffers[bi]; + if (l < bu.length) { + return {buf: bi, offset: l}; + } else { + l -= bu.length; + } + bi++; + } +}; -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; +Buffers.prototype.get = function get (i) { + var pos = this.pos(i); -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; + return this.buffers[pos.buf].get(pos.offset); +}; -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; +Buffers.prototype.set = function set (i, b) { + var pos = this.pos(i); -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; + return this.buffers[pos.buf].set(pos.offset, b); +}; -exports.isBuffer = __nccwpck_require__(20181).Buffer.isBuffer; +Buffers.prototype.indexOf = function (needle, offset) { + if ("string" === typeof needle) { + needle = new Buffer(needle); + } else if (needle instanceof Buffer) { + // already a buffer + } else { + throw new Error('Invalid type for a search string'); + } -function objectToString(o) { - return Object.prototype.toString.call(o); -} + if (!needle.length) { + return 0; + } + if (!this.length) { + return -1; + } -/***/ }), + var i = 0, j = 0, match = 0, mstart, pos = 0; -/***/ 84891: -/***/ ((__unused_webpack_module, exports) => { + // start search from a particular point in the virtual buffer + if (offset) { + var p = this.pos(offset); + i = p.buf; + j = p.offset; + pos = offset; + } -/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */ -/* vim: set ts=2: */ -/*exported CRC32 */ -var CRC32; -(function (factory) { - /*jshint ignore:start */ - /*eslint-disable */ - if(typeof DO_NOT_EXPORT_CRC === 'undefined') { - if(true) { - factory(exports); - } else {} - } else { - factory(CRC32 = {}); - } - /*eslint-enable */ - /*jshint ignore:end */ -}(function(CRC32) { -CRC32.version = '1.2.2'; -/*global Int32Array */ -function signed_crc_table() { - var c = 0, table = new Array(256); + // for each character in virtual buffer + for (;;) { + while (j >= this.buffers[i].length) { + j = 0; + i++; - for(var n =0; n != 256; ++n){ - c = n; - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); - table[n] = c; - } + if (i >= this.buffers.length) { + // search string not found + return -1; + } + } - return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table; -} + var char = this.buffers[i][j]; -var T0 = signed_crc_table(); -function slice_by_16_tables(T) { - var c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ; + if (char == needle[match]) { + // keep track where match started + if (match == 0) { + mstart = { + i: i, + j: j, + pos: pos + }; + } + match++; + if (match == needle.length) { + // full match + return mstart.pos; + } + } else if (match != 0) { + // a partial match ended, go back to match starting position + // this will continue the search at the next character + i = mstart.i; + j = mstart.j; + pos = mstart.pos; + match = 0; + } - for(n = 0; n != 256; ++n) table[n] = T[n]; - for(n = 0; n != 256; ++n) { - v = T[n]; - for(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF]; - } - var out = []; - for(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256); - return out; -} -var TT = slice_by_16_tables(T0); -var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4]; -var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; -var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14]; -function crc32_bstr(bstr, seed) { - var C = seed ^ -1; - for(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF]; - return ~C; -} + j++; + pos++; + } +}; -function crc32_buf(B, seed) { - var C = seed ^ -1, L = B.length - 15, i = 0; - for(; i < L;) C = - Tf[B[i++] ^ (C & 255)] ^ - Te[B[i++] ^ ((C >> 8) & 255)] ^ - Td[B[i++] ^ ((C >> 16) & 255)] ^ - Tc[B[i++] ^ (C >>> 24)] ^ - Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ - T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ - T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]]; - L += 15; - while(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF]; - return ~C; +Buffers.prototype.toBuffer = function() { + return this.slice(); } -function crc32_str(str, seed) { - var C = seed ^ -1; - for(var i = 0, L = str.length, c = 0, d = 0; i < L;) { - c = str.charCodeAt(i++); - if(c < 0x80) { - C = (C>>>8) ^ T0[(C^c)&0xFF]; - } else if(c < 0x800) { - C = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF]; - C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; - } else if(c >= 0xD800 && c < 0xE000) { - c = (c&1023)+64; d = str.charCodeAt(i++)&1023; - C = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF]; - C = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF]; - C = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF]; - C = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF]; - } else { - C = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF]; - C = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF]; - C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; - } - } - return ~C; +Buffers.prototype.toString = function(encoding, start, end) { + return this.slice(start, end).toString(encoding); } -CRC32.table = T0; -// $FlowIgnore -CRC32.bstr = crc32_bstr; -// $FlowIgnore -CRC32.buf = crc32_buf; -// $FlowIgnore -CRC32.str = crc32_str; -})); /***/ }), -/***/ 3662: +/***/ 22639: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/** - * node-crc32-stream - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT - */ - - -const {Transform} = __nccwpck_require__(86131); -const crc32 = __nccwpck_require__(84891); +var bind = __nccwpck_require__(37564); -class CRC32Stream extends Transform { - constructor(options) { - super(options); - this.checksum = Buffer.allocUnsafe(4); - this.checksum.writeInt32BE(0, 0); +var $apply = __nccwpck_require__(33945); +var $call = __nccwpck_require__(88093); +var $reflectApply = __nccwpck_require__(31330); - this.rawSize = 0; - } +/** @type {import('./actualApply')} */ +module.exports = $reflectApply || bind.call($call, $apply); - _transform(chunk, encoding, callback) { - if (chunk) { - this.checksum = crc32.buf(chunk, this.checksum) >>> 0; - this.rawSize += chunk.length; - } - callback(null, chunk); - } +/***/ }), - digest(encoding) { - const checksum = Buffer.allocUnsafe(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; - } +/***/ 33945: +/***/ ((module) => { - hex() { - return this.digest('hex').toUpperCase(); - } +"use strict"; - size() { - return this.rawSize; - } -} -module.exports = CRC32Stream; +/** @type {import('./functionApply')} */ +module.exports = Function.prototype.apply; /***/ }), -/***/ 76252: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 88093: +/***/ ((module) => { "use strict"; -/** - * node-crc32-stream - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT - */ - - - -const {DeflateRaw} = __nccwpck_require__(43106); -const crc32 = __nccwpck_require__(84891); - -class DeflateCRC32Stream extends DeflateRaw { - constructor(options) { - super(options); - - this.checksum = Buffer.allocUnsafe(4); - this.checksum.writeInt32BE(0, 0); - this.rawSize = 0; - this.compressedSize = 0; - } +/** @type {import('./functionCall')} */ +module.exports = Function.prototype.call; - push(chunk, encoding) { - if (chunk) { - this.compressedSize += chunk.length; - } - return super.push(chunk, encoding); - } +/***/ }), - _transform(chunk, encoding, callback) { - if (chunk) { - this.checksum = crc32.buf(chunk, this.checksum) >>> 0; - this.rawSize += chunk.length; - } +/***/ 88705: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - super._transform(chunk, encoding, callback) - } +"use strict"; - digest(encoding) { - const checksum = Buffer.allocUnsafe(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; - } - hex() { - return this.digest('hex').toUpperCase(); - } +var bind = __nccwpck_require__(37564); +var $TypeError = __nccwpck_require__(73314); - size(compressed = false) { - if (compressed) { - return this.compressedSize; - } else { - return this.rawSize; - } - } -} +var $call = __nccwpck_require__(88093); +var $actualApply = __nccwpck_require__(22639); -module.exports = DeflateCRC32Stream; +/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ +module.exports = function callBindBasic(args) { + if (args.length < 1 || typeof args[0] !== 'function') { + throw new $TypeError('a function is required'); + } + return $actualApply(bind, $call, args); +}; /***/ }), -/***/ 82770: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 31330: +/***/ ((module) => { "use strict"; -/** - * node-crc32-stream - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT - */ - -module.exports = { - CRC32Stream: __nccwpck_require__(3662), - DeflateCRC32Stream: __nccwpck_require__(76252) -} +/** @type {import('./reflectApply')} */ +module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; /***/ }), -/***/ 6110: -/***/ ((module, exports, __nccwpck_require__) => { - -/* eslint-env browser */ +/***/ 71710: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * This is the web browser implementation of `debug()`. - */ +var Traverse = __nccwpck_require__(62958); +var EventEmitter = (__nccwpck_require__(24434).EventEmitter); -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; +module.exports = Chainsaw; +function Chainsaw (builder) { + var saw = Chainsaw.saw(builder, {}); + var r = builder.call(saw.handlers, saw); + if (r !== undefined) saw.handlers = r; + saw.record(); + return saw.chain(); +}; - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); +Chainsaw.light = function ChainsawLight (builder) { + var saw = Chainsaw.saw(builder, {}); + var r = builder.call(saw.handlers, saw); + if (r !== undefined) saw.handlers = r; + return saw.chain(); +}; -/** - * Colors. - */ +Chainsaw.saw = function (builder, handlers) { + var saw = new EventEmitter; + saw.handlers = handlers; + saw.actions = []; -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; + saw.chain = function () { + var ch = Traverse(saw.handlers).map(function (node) { + if (this.isRoot) return node; + var ps = this.path; -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ + if (typeof node === 'function') { + this.update(function () { + saw.actions.push({ + path : ps, + args : [].slice.call(arguments) + }); + return ch; + }); + } + }); -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } + process.nextTick(function () { + saw.emit('begin'); + saw.next(); + }); - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } + return ch; + }; - let m; + saw.pop = function () { + return saw.actions.shift(); + }; - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - // eslint-disable-next-line no-return-assign - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} + saw.next = function () { + var action = saw.pop(); -/** - * Colorize log arguments if enabled. - * - * @api public - */ + if (!action) { + saw.emit('end'); + } + else if (!action.trap) { + var node = saw.handlers; + action.path.forEach(function (key) { node = node[key] }); + node.apply(saw.handlers, action.args); + } + }; -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); + saw.nest = function (cb) { + var args = [].slice.call(arguments, 1); + var autonext = true; - if (!this.useColors) { - return; - } + if (typeof cb === 'boolean') { + var autonext = cb; + cb = args.shift(); + } - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); + var s = Chainsaw.saw(builder, {}); + var r = builder.call(s.handlers, s); - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); + if (r !== undefined) s.handlers = r; - args.splice(lastC, 0, c); -} + // If we are recording... + if ("undefined" !== typeof saw.step) { + // ... our children should, too + s.record(); + } -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); + cb.apply(s.chain(), args); + if (autonext !== false) s.on('end', saw.next); + }; -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} + saw.record = function () { + upgradeChainsaw(saw); + }; -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } + ['trap', 'down', 'jump'].forEach(function (method) { + saw[method] = function () { + throw new Error("To use the trap, down and jump features, please "+ + "call record() first to start recording actions."); + }; + }); - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } + return saw; +}; - return r; -} +function upgradeChainsaw(saw) { + saw.step = 0; -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ + // override pop + saw.pop = function () { + return saw.actions[saw.step++]; + }; -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} + saw.trap = function (name, cb) { + var ps = Array.isArray(name) ? name : [name]; + saw.actions.push({ + path : ps, + step : saw.step, + cb : cb, + trap : true + }); + }; -module.exports = __nccwpck_require__(40897)(exports); + saw.down = function (name) { + var ps = (Array.isArray(name) ? name : [name]).join('/'); + var i = saw.actions.slice(saw.step).map(function (x) { + if (x.trap && x.step <= saw.step) return false; + return x.path.join('/') == ps; + }).indexOf(true); -const {formatters} = module.exports; + if (i >= 0) saw.step += i; + else saw.step = saw.actions.length; -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ + var act = saw.actions[saw.step - 1]; + if (act && act.trap) { + // It's a trap! + saw.step = act.step; + act.cb(); + } + else saw.next(); + }; -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } + saw.jump = function (step) { + saw.step = step; + saw.next(); + }; }; /***/ }), -/***/ 40897: +/***/ 35630: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var util = __nccwpck_require__(39023); +var Stream = (__nccwpck_require__(2203).Stream); +var DelayedStream = __nccwpck_require__(72710); -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __nccwpck_require__(70744); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; - createDebug.names = []; - createDebug.skips = []; + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; +CombinedStream.create = function(options) { + var combinedStream = new this(); - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } + return combinedStream; +}; - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } - const self = debug; + this._handleErrors(stream); - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; + if (this.pauseStreams) { + stream.pause(); + } + } - args[0] = createDebug.coerce(args[0]); + this._streams.push(stream); + return this; +}; - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); +CombinedStream.prototype._getNext = function() { + this._currentStream = null; - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } + if (typeof stream == 'undefined') { + this.end(); + return; + } - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } - return debug; - } + this._pipeNext(stream); + }.bind(this)); +}; - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } - createDebug.names = []; - createDebug.skips = []; + var value = stream; + this.write(value); + this._getNext(); +}; - const split = (typeof namespaces === 'string' ? namespaces : '') - .trim() - .replace(/\s+/g, ',') - .split(',') - .filter(Boolean); +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; - for (const ns of split) { - if (ns[0] === '-') { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; - /** - * Checks if the given string matches a namespace template, honoring - * asterisks as wildcards. - * - * @param {String} search - * @param {String} template - * @return {Boolean} - */ - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { - // Match character or proceed with wildcard - if (template[templateIndex] === '*') { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; // Skip the '*' - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition - // Backtrack to the last '*' and try to match more characters - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; // No match - } - } + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; - // Handle trailing '*' in template - while (templateIndex < template.length && template[templateIndex] === '*') { - templateIndex++; - } +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } - return templateIndex === template.length; - } + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; - return false; - } +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; - createDebug.enable(createDebug.load()); + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } - return createDebug; -} + self.dataSize += stream.dataSize; + }); -module.exports = setup; + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; /***/ }), -/***/ 2830: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 96070: +/***/ ((module) => { /** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT */ +var ArchiveEntry = module.exports = function() {}; -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __nccwpck_require__(6110); -} else { - module.exports = __nccwpck_require__(95108); -} +ArchiveEntry.prototype.getName = function() {}; + +ArchiveEntry.prototype.getSize = function() {}; + +ArchiveEntry.prototype.getLastModifiedDate = function() {}; +ArchiveEntry.prototype.isDirectory = function() {}; /***/ }), -/***/ 95108: -/***/ ((module, exports, __nccwpck_require__) => { +/***/ 36306: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** - * Module dependencies. + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT */ +var inherits = (__nccwpck_require__(39023).inherits); +var isStream = __nccwpck_require__(96543); +var Transform = (__nccwpck_require__(29963).Transform); -const tty = __nccwpck_require__(52018); -const util = __nccwpck_require__(39023); +var ArchiveEntry = __nccwpck_require__(96070); +var util = __nccwpck_require__(18300); -/** - * This is the Node.js implementation of `debug()`. - */ +var ArchiveOutputStream = module.exports = function(options) { + if (!(this instanceof ArchiveOutputStream)) { + return new ArchiveOutputStream(options); + } -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); + Transform.call(this, options); -/** - * Colors. - */ + this.offset = 0; + this._archive = { + finish: false, + finished: false, + processing: false + }; +}; -exports.colors = [6, 2, 3, 4, 5, 1]; +inherits(ArchiveOutputStream, Transform); -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __nccwpck_require__(60075); +ArchiveOutputStream.prototype._appendBuffer = function(zae, source, callback) { + // scaffold only +}; - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} +ArchiveOutputStream.prototype._appendStream = function(zae, source, callback) { + // scaffold only +}; -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ +ArchiveOutputStream.prototype._emitErrorCallback = function(err) { + if (err) { + this.emit('error', err); + } +}; -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); +ArchiveOutputStream.prototype._finish = function(ae) { + // scaffold only +}; - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } +ArchiveOutputStream.prototype._normalizeEntry = function(ae) { + // scaffold only +}; - obj[prop] = val; - return obj; -}, {}); +ArchiveOutputStream.prototype._transform = function(chunk, encoding, callback) { + callback(null, chunk); +}; -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ +ArchiveOutputStream.prototype.entry = function(ae, source, callback) { + source = source || null; -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} + if (typeof callback !== 'function') { + callback = this._emitErrorCallback.bind(this); + } -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ + if (!(ae instanceof ArchiveEntry)) { + callback(new Error('not a valid instance of ArchiveEntry')); + return; + } -function formatArgs(args) { - const {namespace: name, useColors} = this; + if (this._archive.finish || this._archive.finished) { + callback(new Error('unacceptable entry after finish')); + return; + } - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; + if (this._archive.processing) { + callback(new Error('already processing an entry')); + return; + } - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} + this._archive.processing = true; + this._normalizeEntry(ae); + this._entry = ae; -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} + source = util.normalizeInputSource(source); -/** - * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. - */ + if (Buffer.isBuffer(source)) { + this._appendBuffer(ae, source, callback); + } else if (isStream(source)) { + this._appendStream(ae, source, callback); + } else { + this._archive.processing = false; + callback(new Error('input source must be valid Stream or Buffer instance')); + return; + } -function log(...args) { - return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); -} + return this; +}; -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} +ArchiveOutputStream.prototype.finish = function() { + if (this._archive.processing) { + this._archive.finish = true; + return; + } -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ + this._finish(); +}; -function load() { - return process.env.DEBUG; -} +ArchiveOutputStream.prototype.getBytesWritten = function() { + return this.offset; +}; + +ArchiveOutputStream.prototype.write = function(chunk, cb) { + if (chunk) { + this.offset += chunk.length; + } + + return Transform.prototype.write.call(this, chunk, cb); +}; + +/***/ }), + +/***/ 94908: +/***/ ((module) => { /** - * Init logic for `debug` instances. + * node-compress-commons * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT */ +module.exports = { + WORD: 4, + DWORD: 8, + EMPTY: Buffer.alloc(0), -function init(debug) { - debug.inspectOpts = {}; + SHORT: 2, + SHORT_MASK: 0xffff, + SHORT_SHIFT: 16, + SHORT_ZERO: Buffer.from(Array(2)), + LONG: 4, + LONG_ZERO: Buffer.from(Array(4)), - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} + MIN_VERSION_INITIAL: 10, + MIN_VERSION_DATA_DESCRIPTOR: 20, + MIN_VERSION_ZIP64: 45, + VERSION_MADEBY: 45, -module.exports = __nccwpck_require__(40897)(exports); + METHOD_STORED: 0, + METHOD_DEFLATED: 8, -const {formatters} = module.exports; + PLATFORM_UNIX: 3, + PLATFORM_FAT: 0, -/** - * Map %o to `util.inspect()`, all on a single line. - */ + SIG_LFH: 0x04034b50, + SIG_DD: 0x08074b50, + SIG_CFH: 0x02014b50, + SIG_EOCD: 0x06054b50, + SIG_ZIP64_EOCD: 0x06064B50, + SIG_ZIP64_EOCD_LOC: 0x07064B50, -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; + ZIP64_MAGIC_SHORT: 0xffff, + ZIP64_MAGIC: 0xffffffff, + ZIP64_EXTRA_ID: 0x0001, -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ + ZLIB_NO_COMPRESSION: 0, + ZLIB_BEST_SPEED: 1, + ZLIB_BEST_COMPRESSION: 9, + ZLIB_DEFAULT_COMPRESSION: -1, -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); + MODE_MASK: 0xFFF, + DEFAULT_FILE_MODE: 33188, // 010644 = -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH + DEFAULT_DIR_MODE: 16877, // 040755 = drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH + + EXT_FILE_ATTR_DIR: 1106051088, // 010173200020 = drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D) + EXT_FILE_ATTR_FILE: 2175008800, // 020151000040 = -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0 + + // Unix file types + S_IFMT: 61440, // 0170000 type of file mask + S_IFIFO: 4096, // 010000 named pipe (fifo) + S_IFCHR: 8192, // 020000 character special + S_IFDIR: 16384, // 040000 directory + S_IFBLK: 24576, // 060000 block special + S_IFREG: 32768, // 0100000 regular + S_IFLNK: 40960, // 0120000 symbolic link + S_IFSOCK: 49152, // 0140000 socket + + // DOS file type flags + S_DOS_A: 32, // 040 Archive + S_DOS_D: 16, // 020 Directory + S_DOS_V: 8, // 010 Volume + S_DOS_S: 4, // 04 System + S_DOS_H: 2, // 02 Hidden + S_DOS_R: 1 // 01 Read Only }; /***/ }), -/***/ 72710: +/***/ 97632: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Stream = (__nccwpck_require__(2203).Stream); -var util = __nccwpck_require__(39023); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var zipUtil = __nccwpck_require__(6453); -DelayedStream.create = function(source, options) { - var delayedStream = new this(); +var DATA_DESCRIPTOR_FLAG = 1 << 3; +var ENCRYPTION_FLAG = 1 << 0; +var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; +var SLIDING_DICTIONARY_SIZE_FLAG = 1 << 1; +var STRONG_ENCRYPTION_FLAG = 1 << 6; +var UFT8_NAMES_FLAG = 1 << 11; - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; +var GeneralPurposeBit = module.exports = function() { + if (!(this instanceof GeneralPurposeBit)) { + return new GeneralPurposeBit(); } - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; + this.descriptor = false; + this.encryption = false; + this.utf8 = false; + this.numberOfShannonFanoTrees = 0; + this.strongEncryption = false; + this.slidingDictionarySize = 0; - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } + return this; +}; - return delayedStream; +GeneralPurposeBit.prototype.encode = function() { + return zipUtil.getShortBytes( + (this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) | + (this.utf8 ? UFT8_NAMES_FLAG : 0) | + (this.encryption ? ENCRYPTION_FLAG : 0) | + (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0) + ); }; -Object.defineProperty(DelayedStream.prototype, 'readable', { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } -}); +GeneralPurposeBit.prototype.parse = function(buf, offset) { + var flag = zipUtil.getShortBytesValue(buf, offset); + var gbp = new GeneralPurposeBit(); -DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); -}; + gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG) !== 0); + gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG) !== 0); + gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG) !== 0); + gbp.useEncryption((flag & ENCRYPTION_FLAG) !== 0); + gbp.setSlidingDictionarySize((flag & SLIDING_DICTIONARY_SIZE_FLAG) !== 0 ? 8192 : 4096); + gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2); -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } + return gbp; +}; - this.source.resume(); +GeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n) { + this.numberOfShannonFanoTrees = n; }; -DelayedStream.prototype.pause = function() { - this.source.pause(); +GeneralPurposeBit.prototype.getNumberOfShannonFanoTrees = function() { + return this.numberOfShannonFanoTrees; }; -DelayedStream.prototype.release = function() { - this._released = true; +GeneralPurposeBit.prototype.setSlidingDictionarySize = function(n) { + this.slidingDictionarySize = n; +}; - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; +GeneralPurposeBit.prototype.getSlidingDictionarySize = function() { + return this.slidingDictionarySize; }; -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; +GeneralPurposeBit.prototype.useDataDescriptor = function(b) { + this.descriptor = b; }; -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } +GeneralPurposeBit.prototype.usesDataDescriptor = function() { + return this.descriptor; +}; - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } +GeneralPurposeBit.prototype.useEncryption = function(b) { + this.encryption = b; +}; - this._bufferedEvents.push(args); +GeneralPurposeBit.prototype.usesEncryption = function() { + return this.encryption; }; -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } +GeneralPurposeBit.prototype.useStrongEncryption = function(b) { + this.strongEncryption = b; +}; - if (this.dataSize <= this.maxDataSize) { - return; - } +GeneralPurposeBit.prototype.usesStrongEncryption = function() { + return this.strongEncryption; +}; - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); +GeneralPurposeBit.prototype.useUTF8ForNames = function(b) { + this.utf8 = b; }; +GeneralPurposeBit.prototype.usesUTF8ForNames = function() { + return this.utf8; +}; /***/ }), -/***/ 14150: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 23810: +/***/ ((module) => { +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +module.exports = { + /** + * Bits used for permissions (and sticky bit) + */ + PERM_MASK: 4095, // 07777 -Object.defineProperty(exports, "__esModule", ({ value: true })); + /** + * Bits used to indicate the filesystem object type. + */ + FILE_TYPE_FLAG: 61440, // 0170000 -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) + /** + * Indicates symbolic links. + */ + LINK_FLAG: 40960, // 0120000 - /* istanbul ignore next */ + /** + * Indicates plain files. + */ + FILE_FLAG: 32768, // 0100000 - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } + /** + * Indicates directories. + */ + DIR_FLAG: 16384, // 040000 - this.name = 'Deprecation'; - } + // ---------------------------------------------------------- + // somewhat arbitrary choices that are quite common for shared + // installations + // ----------------------------------------------------------- -} + /** + * Default permissions for symbolic links. + */ + DEFAULT_LINK_PERM: 511, // 0777 -exports.Deprecation = Deprecation; + /** + * Default permissions for directories. + */ + DEFAULT_DIR_PERM: 493, // 0755 + /** + * Default permissions for plain files. + */ + DEFAULT_FILE_PERM: 420 // 0644 +}; /***/ }), -/***/ 95129: +/***/ 6453: /***/ ((module) => { -"use strict"; +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var util = module.exports = {}; +util.dateToDos = function(d, forceLocalTime) { + forceLocalTime = forceLocalTime || false; -function _process (v, mod) { - var i - var r + var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear(); - if (typeof mod === 'function') { - r = mod(v) - if (r !== undefined) { - v = r - } - } else if (Array.isArray(mod)) { - for (i = 0; i < mod.length; i++) { - r = mod[i](v) - if (r !== undefined) { - v = r - } - } + if (year < 1980) { + return 2162688; // 1980-1-1 00:00:00 + } else if (year >= 2044) { + return 2141175677; // 2043-12-31 23:59:58 } - return v -} + var val = { + year: year, + month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), + date: forceLocalTime ? d.getDate() : d.getUTCDate(), + hours: forceLocalTime ? d.getHours() : d.getUTCHours(), + minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), + seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() + }; -function parseKey (key, val) { - // detect negative index notation - if (key[0] === '-' && Array.isArray(val) && /^-\d+$/.test(key)) { - return val.length + parseInt(key, 10) - } - return key -} + return ((val.year - 1980) << 25) | ((val.month + 1) << 21) | (val.date << 16) | + (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2); +}; -function isIndex (k) { - return /^\d+$/.test(k) -} +util.dosToDate = function(dos) { + return new Date(((dos >> 25) & 0x7f) + 1980, ((dos >> 21) & 0x0f) - 1, (dos >> 16) & 0x1f, (dos >> 11) & 0x1f, (dos >> 5) & 0x3f, (dos & 0x1f) << 1); +}; -function isObject (val) { - return Object.prototype.toString.call(val) === '[object Object]' -} +util.fromDosTime = function(buf) { + return util.dosToDate(buf.readUInt32LE(0)); +}; -function isArrayOrObject (val) { - return Object(val) === val -} +util.getEightBytes = function(v) { + var buf = Buffer.alloc(8); + buf.writeUInt32LE(v % 0x0100000000, 0); + buf.writeUInt32LE((v / 0x0100000000) | 0, 4); -function isEmptyObject (val) { - return Object.keys(val).length === 0 -} + return buf; +}; + +util.getShortBytes = function(v) { + var buf = Buffer.alloc(2); + buf.writeUInt16LE((v & 0xFFFF) >>> 0, 0); -var blacklist = ['__proto__', 'prototype', 'constructor'] -var blacklistFilter = function (part) { return blacklist.indexOf(part) === -1 } + return buf; +}; -function parsePath (path, sep) { - if (path.indexOf('[') >= 0) { - path = path.replace(/\[/g, sep).replace(/]/g, '') - } +util.getShortBytesValue = function(buf, offset) { + return buf.readUInt16LE(offset); +}; + +util.getLongBytes = function(v) { + var buf = Buffer.alloc(4); + buf.writeUInt32LE((v & 0xFFFFFFFF) >>> 0, 0); + + return buf; +}; - var parts = path.split(sep) +util.getLongBytesValue = function(buf, offset) { + return buf.readUInt32LE(offset); +}; - var check = parts.filter(blacklistFilter) +util.toDosTime = function(d) { + return util.getLongBytes(util.dateToDos(d)); +}; - if (check.length !== parts.length) { - throw Error('Refusing to update blacklisted property ' + path) - } +/***/ }), - return parts -} +/***/ 73380: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var inherits = (__nccwpck_require__(39023).inherits); +var normalizePath = __nccwpck_require__(56133); + +var ArchiveEntry = __nccwpck_require__(96070); +var GeneralPurposeBit = __nccwpck_require__(97632); +var UnixStat = __nccwpck_require__(23810); -var hasOwnProperty = Object.prototype.hasOwnProperty +var constants = __nccwpck_require__(94908); +var zipUtil = __nccwpck_require__(6453); -function DotObject (separator, override, useArray, useBrackets) { - if (!(this instanceof DotObject)) { - return new DotObject(separator, override, useArray, useBrackets) +var ZipArchiveEntry = module.exports = function(name) { + if (!(this instanceof ZipArchiveEntry)) { + return new ZipArchiveEntry(name); } - if (typeof override === 'undefined') override = false - if (typeof useArray === 'undefined') useArray = true - if (typeof useBrackets === 'undefined') useBrackets = true - this.separator = separator || '.' - this.override = override - this.useArray = useArray - this.useBrackets = useBrackets - this.keepArray = false + ArchiveEntry.call(this); - // contains touched arrays - this.cleanup = [] -} + this.platform = constants.PLATFORM_FAT; + this.method = -1; -var dotDefault = new DotObject('.', false, true, true) -function wrap (method) { - return function () { - return dotDefault[method].apply(dotDefault, arguments) + this.name = null; + this.size = 0; + this.csize = 0; + this.gpb = new GeneralPurposeBit(); + this.crc = 0; + this.time = -1; + + this.minver = constants.MIN_VERSION_INITIAL; + this.mode = -1; + this.extra = null; + this.exattr = 0; + this.inattr = 0; + this.comment = null; + + if (name) { + this.setName(name); } -} +}; -DotObject.prototype._fill = function (a, obj, v, mod) { - var k = a.shift() +inherits(ZipArchiveEntry, ArchiveEntry); - if (a.length > 0) { - obj[k] = obj[k] || (this.useArray && isIndex(a[0]) ? [] : {}) +/** + * Returns the extra fields related to the entry. + * + * @returns {Buffer} + */ +ZipArchiveEntry.prototype.getCentralDirectoryExtra = function() { + return this.getExtra(); +}; - if (!isArrayOrObject(obj[k])) { - if (this.override) { - obj[k] = {} - } else { - if (!(isArrayOrObject(v) && isEmptyObject(v))) { - throw new Error( - 'Trying to redefine `' + k + '` which is a ' + typeof obj[k] - ) - } +/** + * Returns the comment set for the entry. + * + * @returns {string} + */ +ZipArchiveEntry.prototype.getComment = function() { + return this.comment !== null ? this.comment : ''; +}; - return - } - } +/** + * Returns the compressed size of the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getCompressedSize = function() { + return this.csize; +}; - this._fill(a, obj[k], v, mod) - } else { - if (!this.override && isArrayOrObject(obj[k]) && !isEmptyObject(obj[k])) { - if (!(isArrayOrObject(v) && isEmptyObject(v))) { - throw new Error("Trying to redefine non-empty obj['" + k + "']") - } +/** + * Returns the CRC32 digest for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getCrc = function() { + return this.crc; +}; - return - } +/** + * Returns the external file attributes for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getExternalAttributes = function() { + return this.exattr; +}; - obj[k] = _process(v, mod) - } -} +/** + * Returns the extra fields related to the entry. + * + * @returns {Buffer} + */ +ZipArchiveEntry.prototype.getExtra = function() { + return this.extra !== null ? this.extra : constants.EMPTY; +}; /** + * Returns the general purpose bits related to the entry. * - * Converts an object with dotted-key/value pairs to it's expanded version + * @returns {GeneralPurposeBit} + */ +ZipArchiveEntry.prototype.getGeneralPurposeBit = function() { + return this.gpb; +}; + +/** + * Returns the internal file attributes for the entry. * - * Optionally transformed by a set of modifiers. + * @returns {number} + */ +ZipArchiveEntry.prototype.getInternalAttributes = function() { + return this.inattr; +}; + +/** + * Returns the last modified date of the entry. * - * Usage: + * @returns {number} + */ +ZipArchiveEntry.prototype.getLastModifiedDate = function() { + return this.getTime(); +}; + +/** + * Returns the extra fields related to the entry. * - * var row = { - * 'nr': 200, - * 'doc.name': ' My Document ' - * } + * @returns {Buffer} + */ +ZipArchiveEntry.prototype.getLocalFileDataExtra = function() { + return this.getExtra(); +}; + +/** + * Returns the compression method used on the entry. * - * var mods = { - * 'doc.name': [_s.trim, _s.underscored] - * } + * @returns {number} + */ +ZipArchiveEntry.prototype.getMethod = function() { + return this.method; +}; + +/** + * Returns the filename of the entry. + * + * @returns {string} + */ +ZipArchiveEntry.prototype.getName = function() { + return this.name; +}; + +/** + * Returns the platform on which the entry was made. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getPlatform = function() { + return this.platform; +}; + +/** + * Returns the size of the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getSize = function() { + return this.size; +}; + +/** + * Returns a date object representing the last modified date of the entry. + * + * @returns {number|Date} + */ +ZipArchiveEntry.prototype.getTime = function() { + return this.time !== -1 ? zipUtil.dosToDate(this.time) : -1; +}; + +/** + * Returns the DOS timestamp for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getTimeDos = function() { + return this.time !== -1 ? this.time : 0; +}; + +/** + * Returns the UNIX file permissions for the entry. * - * dot.object(row, mods) + * @returns {number} + */ +ZipArchiveEntry.prototype.getUnixMode = function() { + return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK); +}; + +/** + * Returns the version of ZIP needed to extract the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getVersionNeededToExtract = function() { + return this.minver; +}; + +/** + * Sets the comment of the entry. * - * @param {Object} obj - * @param {Object} mods + * @param comment */ -DotObject.prototype.object = function (obj, mods) { - var self = this - - Object.keys(obj).forEach(function (k) { - var mod = mods === undefined ? null : mods[k] - // normalize array notation. - var ok = parsePath(k, self.separator).join(self.separator) - - if (ok.indexOf(self.separator) !== -1) { - self._fill(ok.split(self.separator), obj, obj[k], mod) - delete obj[k] - } else { - obj[k] = _process(obj[k], mod) - } - }) +ZipArchiveEntry.prototype.setComment = function(comment) { + if (Buffer.byteLength(comment) !== comment.length) { + this.getGeneralPurposeBit().useUTF8ForNames(true); + } - return obj -} + this.comment = comment; +}; /** - * @param {String} path dotted path - * @param {String} v value to be set - * @param {Object} obj object to be modified - * @param {Function|Array} mod optional modifier + * Sets the compressed size of the entry. + * + * @param size */ -DotObject.prototype.str = function (path, v, obj, mod) { - var ok = parsePath(path, this.separator).join(this.separator) - - if (path.indexOf(this.separator) !== -1) { - this._fill(ok.split(this.separator), obj, v, mod) - } else { - obj[path] = _process(v, mod) +ZipArchiveEntry.prototype.setCompressedSize = function(size) { + if (size < 0) { + throw new Error('invalid entry compressed size'); } - return obj -} + this.csize = size; +}; /** + * Sets the checksum of the entry. * - * Pick a value from an object using dot notation. - * - * Optionally remove the value - * - * @param {String} path - * @param {Object} obj - * @param {Boolean} remove - */ -DotObject.prototype.pick = function (path, obj, remove, reindexArray) { - var i - var keys - var val - var key - var cp - - keys = parsePath(path, this.separator) - for (i = 0; i < keys.length; i++) { - key = parseKey(keys[i], obj) - if (obj && typeof obj === 'object' && key in obj) { - if (i === keys.length - 1) { - if (remove) { - val = obj[key] - if (reindexArray && Array.isArray(obj)) { - obj.splice(key, 1) - } else { - delete obj[key] - } - if (Array.isArray(obj)) { - cp = keys.slice(0, -1).join('.') - if (this.cleanup.indexOf(cp) === -1) { - this.cleanup.push(cp) - } - } - return val - } else { - return obj[key] - } - } else { - obj = obj[key] - } - } else { - return undefined - } - } - if (remove && Array.isArray(obj)) { - obj = obj.filter(function (n) { - return n !== undefined - }) + * @param crc + */ +ZipArchiveEntry.prototype.setCrc = function(crc) { + if (crc < 0) { + throw new Error('invalid entry crc32'); } - return obj -} + + this.crc = crc; +}; + /** + * Sets the external file attributes of the entry. * - * Delete value from an object using dot notation. - * - * @param {String} path - * @param {Object} obj - * @return {any} The removed value + * @param attr */ -DotObject.prototype.delete = function (path, obj) { - return this.remove(path, obj, true) -} +ZipArchiveEntry.prototype.setExternalAttributes = function(attr) { + this.exattr = attr >>> 0; +}; /** + * Sets the extra fields related to the entry. * - * Remove value from an object using dot notation. - * - * Will remove multiple items if path is an array. - * In this case array indexes will be retained until all - * removals have been processed. - * - * Use dot.delete() to automatically re-index arrays. - * - * @param {String|Array} path - * @param {Object} obj - * @param {Boolean} reindexArray - * @return {any} The removed value + * @param extra */ -DotObject.prototype.remove = function (path, obj, reindexArray) { - var i +ZipArchiveEntry.prototype.setExtra = function(extra) { + this.extra = extra; +}; - this.cleanup = [] - if (Array.isArray(path)) { - for (i = 0; i < path.length; i++) { - this.pick(path[i], obj, true, reindexArray) - } - if (!reindexArray) { - this._cleanup(obj) - } - return obj - } else { - return this.pick(path, obj, true, reindexArray) - } -} - -DotObject.prototype._cleanup = function (obj) { - var ret - var i - var keys - var root - if (this.cleanup.length) { - for (i = 0; i < this.cleanup.length; i++) { - keys = this.cleanup[i].split('.') - root = keys.splice(0, -1).join('.') - ret = root ? this.pick(root, obj) : obj - ret = ret[keys[0]].filter(function (v) { - return v !== undefined - }) - this.set(this.cleanup[i], ret, obj) - } - this.cleanup = [] +/** + * Sets the general purpose bits related to the entry. + * + * @param gpb + */ +ZipArchiveEntry.prototype.setGeneralPurposeBit = function(gpb) { + if (!(gpb instanceof GeneralPurposeBit)) { + throw new Error('invalid entry GeneralPurposeBit'); } -} + + this.gpb = gpb; +}; /** - * Alias method for `dot.remove` - * - * Note: this is not an alias for dot.delete() + * Sets the internal file attributes of the entry. * - * @param {String|Array} path - * @param {Object} obj - * @param {Boolean} reindexArray - * @return {any} The removed value + * @param attr */ -DotObject.prototype.del = DotObject.prototype.remove +ZipArchiveEntry.prototype.setInternalAttributes = function(attr) { + this.inattr = attr; +}; /** + * Sets the compression method of the entry. * - * Move a property from one place to the other. - * - * If the source path does not exist (undefined) - * the target property will not be set. - * - * @param {String} source - * @param {String} target - * @param {Object} obj - * @param {Function|Array} mods - * @param {Boolean} merge + * @param method */ -DotObject.prototype.move = function (source, target, obj, mods, merge) { - if (typeof mods === 'function' || Array.isArray(mods)) { - this.set(target, _process(this.pick(source, obj, true), mods), obj, merge) - } else { - merge = mods - this.set(target, this.pick(source, obj, true), obj, merge) +ZipArchiveEntry.prototype.setMethod = function(method) { + if (method < 0) { + throw new Error('invalid entry compression method'); } - return obj -} + this.method = method; +}; /** + * Sets the name of the entry. * - * Transfer a property from one object to another object. - * - * If the source path does not exist (undefined) - * the property on the other object will not be set. - * - * @param {String} source - * @param {String} target - * @param {Object} obj1 - * @param {Object} obj2 - * @param {Function|Array} mods - * @param {Boolean} merge + * @param name + * @param prependSlash */ -DotObject.prototype.transfer = function ( - source, - target, - obj1, - obj2, - mods, - merge -) { - if (typeof mods === 'function' || Array.isArray(mods)) { - this.set( - target, - _process(this.pick(source, obj1, true), mods), - obj2, - merge - ) - } else { - merge = mods - this.set(target, this.pick(source, obj1, true), obj2, merge) +ZipArchiveEntry.prototype.setName = function(name, prependSlash = false) { + name = normalizePath(name, false) + .replace(/^\w+:/, '') + .replace(/^(\.\.\/|\/)+/, ''); + + if (prependSlash) { + name = `/${name}`; } - return obj2 -} + if (Buffer.byteLength(name) !== name.length) { + this.getGeneralPurposeBit().useUTF8ForNames(true); + } + + this.name = name; +}; /** + * Sets the platform on which the entry was made. * - * Copy a property from one object to another object. - * - * If the source path does not exist (undefined) - * the property on the other object will not be set. + * @param platform + */ +ZipArchiveEntry.prototype.setPlatform = function(platform) { + this.platform = platform; +}; + +/** + * Sets the size of the entry. * - * @param {String} source - * @param {String} target - * @param {Object} obj1 - * @param {Object} obj2 - * @param {Function|Array} mods - * @param {Boolean} merge + * @param size */ -DotObject.prototype.copy = function (source, target, obj1, obj2, mods, merge) { - if (typeof mods === 'function' || Array.isArray(mods)) { - this.set( - target, - _process( - // clone what is picked - JSON.parse(JSON.stringify(this.pick(source, obj1, false))), - mods - ), - obj2, - merge - ) - } else { - merge = mods - this.set(target, this.pick(source, obj1, false), obj2, merge) +ZipArchiveEntry.prototype.setSize = function(size) { + if (size < 0) { + throw new Error('invalid entry size'); } - return obj2 -} + this.size = size; +}; /** + * Sets the time of the entry. * - * Set a property on an object using dot notation. - * - * @param {String} path - * @param {any} val - * @param {Object} obj - * @param {Boolean} merge + * @param time + * @param forceLocalTime */ -DotObject.prototype.set = function (path, val, obj, merge) { - var i - var k - var keys - var key - - // Do not operate if the value is undefined. - if (typeof val === 'undefined') { - return obj +ZipArchiveEntry.prototype.setTime = function(time, forceLocalTime) { + if (!(time instanceof Date)) { + throw new Error('invalid entry time'); } - keys = parsePath(path, this.separator) - for (i = 0; i < keys.length; i++) { - key = keys[i] - if (i === keys.length - 1) { - if (merge && isObject(val) && isObject(obj[key])) { - for (k in val) { - if (hasOwnProperty.call(val, k)) { - obj[key][k] = val[k] - } - } - } else if (merge && Array.isArray(obj[key]) && Array.isArray(val)) { - for (var j = 0; j < val.length; j++) { - obj[keys[i]].push(val[j]) - } - } else { - obj[key] = val - } - } else if ( - // force the value to be an object - !hasOwnProperty.call(obj, key) || - (!isObject(obj[key]) && !Array.isArray(obj[key])) - ) { - // initialize as array if next key is numeric - if (/^\d+$/.test(keys[i + 1])) { - obj[key] = [] - } else { - obj[key] = {} - } - } - obj = obj[key] - } - return obj -} + this.time = zipUtil.dateToDos(time, forceLocalTime); +}; /** + * Sets the UNIX file permissions for the entry. * - * Transform an object - * - * Usage: - * - * var obj = { - * "id": 1, - * "some": { - * "thing": "else" - * } - * } - * - * var transform = { - * "id": "nr", - * "some.thing": "name" - * } - * - * var tgt = dot.transform(transform, obj) - * - * @param {Object} recipe Transform recipe - * @param {Object} obj Object to be transformed - * @param {Array} mods modifiers for the target + * @param mode */ -DotObject.prototype.transform = function (recipe, obj, tgt) { - obj = obj || {} - tgt = tgt || {} - Object.keys(recipe).forEach( - function (key) { - this.set(recipe[key], this.pick(key, obj), tgt) - }.bind(this) - ) - return tgt -} +ZipArchiveEntry.prototype.setUnixMode = function(mode) { + mode |= this.isDirectory() ? constants.S_IFDIR : constants.S_IFREG; + + var extattr = 0; + extattr |= (mode << constants.SHORT_SHIFT) | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A); + + this.setExternalAttributes(extattr); + this.mode = mode & constants.MODE_MASK; + this.platform = constants.PLATFORM_UNIX; +}; /** + * Sets the version of ZIP needed to extract this entry. * - * Convert object to dotted-key/value pair - * - * Usage: + * @param minver + */ +ZipArchiveEntry.prototype.setVersionNeededToExtract = function(minver) { + this.minver = minver; +}; + +/** + * Returns true if this entry represents a directory. * - * var tgt = dot.dot(obj) + * @returns {boolean} + */ +ZipArchiveEntry.prototype.isDirectory = function() { + return this.getName().slice(-1) === '/'; +}; + +/** + * Returns true if this entry represents a unix symlink, + * in which case the entry's content contains the target path + * for the symlink. * - * or + * @returns {boolean} + */ +ZipArchiveEntry.prototype.isUnixSymlink = function() { + return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG; +}; + +/** + * Returns true if this entry is using the ZIP64 extension of ZIP. * - * var tgt = {} - * dot.dot(obj, tgt) + * @returns {boolean} + */ +ZipArchiveEntry.prototype.isZip64 = function() { + return this.csize > constants.ZIP64_MAGIC || this.size > constants.ZIP64_MAGIC; +}; + + +/***/ }), + +/***/ 82132: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * node-compress-commons * - * @param {Object} obj source object - * @param {Object} tgt target object - * @param {Array} path path array (internal) + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT */ -DotObject.prototype.dot = function (obj, tgt, path) { - tgt = tgt || {} - path = path || [] - var isArray = Array.isArray(obj) +var inherits = (__nccwpck_require__(39023).inherits); +var crc32 = __nccwpck_require__(84891); +var {CRC32Stream} = __nccwpck_require__(82770); +var {DeflateCRC32Stream} = __nccwpck_require__(82770); - Object.keys(obj).forEach( - function (key) { - var index = isArray && this.useBrackets ? '[' + key + ']' : key - if ( - isArrayOrObject(obj[key]) && - ((isObject(obj[key]) && !isEmptyObject(obj[key])) || - (Array.isArray(obj[key]) && !this.keepArray && obj[key].length !== 0)) - ) { - if (isArray && this.useBrackets) { - var previousKey = path[path.length - 1] || '' - return this.dot( - obj[key], - tgt, - path.slice(0, -1).concat(previousKey + index) - ) - } else { - return this.dot(obj[key], tgt, path.concat(index)) - } - } else { - if (isArray && this.useBrackets) { - tgt[path.join(this.separator).concat('[' + key + ']')] = obj[key] - } else { - tgt[path.concat(index).join(this.separator)] = obj[key] - } - } - }.bind(this) - ) - return tgt -} - -DotObject.pick = wrap('pick') -DotObject.move = wrap('move') -DotObject.transfer = wrap('transfer') -DotObject.transform = wrap('transform') -DotObject.copy = wrap('copy') -DotObject.object = wrap('object') -DotObject.str = wrap('str') -DotObject.set = wrap('set') -DotObject.delete = wrap('delete') -DotObject.del = DotObject.remove = wrap('remove') -DotObject.dot = wrap('dot'); -['override', 'overwrite'].forEach(function (prop) { - Object.defineProperty(DotObject, prop, { - get: function () { - return dotDefault.override - }, - set: function (val) { - dotDefault.override = !!val - } - }) -}); -['useArray', 'keepArray', 'useBrackets'].forEach(function (prop) { - Object.defineProperty(DotObject, prop, { - get: function () { - return dotDefault[prop] - }, - set: function (val) { - dotDefault[prop] = val - } +var ArchiveOutputStream = __nccwpck_require__(36306); +var ZipArchiveEntry = __nccwpck_require__(73380); +var GeneralPurposeBit = __nccwpck_require__(97632); + +var constants = __nccwpck_require__(94908); +var util = __nccwpck_require__(18300); +var zipUtil = __nccwpck_require__(6453); + +var ZipArchiveOutputStream = module.exports = function(options) { + if (!(this instanceof ZipArchiveOutputStream)) { + return new ZipArchiveOutputStream(options); + } + + options = this.options = this._defaults(options); + + ArchiveOutputStream.call(this, options); + + this._entry = null; + this._entries = []; + this._archive = { + centralLength: 0, + centralOffset: 0, + comment: '', + finish: false, + finished: false, + processing: false, + forceZip64: options.forceZip64, + forceLocalTime: options.forceLocalTime + }; +}; + +inherits(ZipArchiveOutputStream, ArchiveOutputStream); + +ZipArchiveOutputStream.prototype._afterAppend = function(ae) { + this._entries.push(ae); + + if (ae.getGeneralPurposeBit().usesDataDescriptor()) { + this._writeDataDescriptor(ae); + } + + this._archive.processing = false; + this._entry = null; + + if (this._archive.finish && !this._archive.finished) { + this._finish(); + } +}; + +ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) { + if (source.length === 0) { + ae.setMethod(constants.METHOD_STORED); + } + + var method = ae.getMethod(); + + if (method === constants.METHOD_STORED) { + ae.setSize(source.length); + ae.setCompressedSize(source.length); + ae.setCrc(crc32.buf(source) >>> 0); + } + + this._writeLocalFileHeader(ae); + + if (method === constants.METHOD_STORED) { + this.write(source); + this._afterAppend(ae); + callback(null, ae); + return; + } else if (method === constants.METHOD_DEFLATED) { + this._smartStream(ae, callback).end(source); + return; + } else { + callback(new Error('compression method ' + method + ' not implemented')); + return; + } +}; + +ZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) { + ae.getGeneralPurposeBit().useDataDescriptor(true); + ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); + + this._writeLocalFileHeader(ae); + + var smart = this._smartStream(ae, callback); + source.once('error', function(err) { + smart.emit('error', err); + smart.end(); }) -}) + source.pipe(smart); +}; -DotObject._process = _process +ZipArchiveOutputStream.prototype._defaults = function(o) { + if (typeof o !== 'object') { + o = {}; + } -module.exports = DotObject + if (typeof o.zlib !== 'object') { + o.zlib = {}; + } + if (typeof o.zlib.level !== 'number') { + o.zlib.level = constants.ZLIB_BEST_SPEED; + } -/***/ }), + o.forceZip64 = !!o.forceZip64; + o.forceLocalTime = !!o.forceLocalTime; -/***/ 26669: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return o; +}; -"use strict"; +ZipArchiveOutputStream.prototype._finish = function() { + this._archive.centralOffset = this.offset; + this._entries.forEach(function(ae) { + this._writeCentralFileHeader(ae); + }.bind(this)); -var callBind = __nccwpck_require__(88705); -var gOPD = __nccwpck_require__(33170); + this._archive.centralLength = this.offset - this._archive.centralOffset; -var hasProtoAccessor; -try { - // eslint-disable-next-line no-extra-parens, no-proto - hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; -} catch (e) { - if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { - throw e; - } -} + if (this.isZip64()) { + this._writeCentralDirectoryZip64(); + } -// eslint-disable-next-line no-extra-parens -var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); + this._writeCentralDirectoryEnd(); -var $Object = Object; -var $getPrototypeOf = $Object.getPrototypeOf; + this._archive.processing = false; + this._archive.finish = true; + this._archive.finished = true; + this.end(); +}; -/** @type {import('./get')} */ -module.exports = desc && typeof desc.get === 'function' - ? callBind([desc.get]) - : typeof $getPrototypeOf === 'function' - ? /** @type {import('./get')} */ function getDunder(value) { - // eslint-disable-next-line eqeqeq - return $getPrototypeOf(value == null ? value : $Object(value)); - } - : false; +ZipArchiveOutputStream.prototype._normalizeEntry = function(ae) { + if (ae.getMethod() === -1) { + ae.setMethod(constants.METHOD_DEFLATED); + } + if (ae.getMethod() === constants.METHOD_DEFLATED) { + ae.getGeneralPurposeBit().useDataDescriptor(true); + ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); + } -/***/ }), + if (ae.getTime() === -1) { + ae.setTime(new Date(), this._archive.forceLocalTime); + } -/***/ 31424: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + ae._offsets = { + file: 0, + data: 0, + contents: 0, + }; +}; + +ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { + var deflate = ae.getMethod() === constants.METHOD_DEFLATED; + var process = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); + var error = null; + + function handleStuff() { + var digest = process.digest().readUInt32BE(0); + ae.setCrc(digest); + ae.setSize(process.size()); + ae.setCompressedSize(process.size(true)); + this._afterAppend(ae); + callback(error, ae); + } -var once = __nccwpck_require__(55560); + process.once('end', handleStuff.bind(this)); + process.once('error', function(err) { + error = err; + }); -var noop = function() {}; + process.pipe(this, { end: false }); -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; + return process; }; -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +ZipArchiveOutputStream.prototype._writeCentralDirectoryEnd = function() { + var records = this._entries.length; + var size = this._archive.centralLength; + var offset = this._archive.centralOffset; + + if (this.isZip64()) { + records = constants.ZIP64_MAGIC_SHORT; + size = constants.ZIP64_MAGIC; + offset = constants.ZIP64_MAGIC; + } + + // signature + this.write(zipUtil.getLongBytes(constants.SIG_EOCD)); + + // disk numbers + this.write(constants.SHORT_ZERO); + this.write(constants.SHORT_ZERO); + + // number of entries + this.write(zipUtil.getShortBytes(records)); + this.write(zipUtil.getShortBytes(records)); + + // length and location of CD + this.write(zipUtil.getLongBytes(size)); + this.write(zipUtil.getLongBytes(offset)); + + // archive comment + var comment = this.getComment(); + var commentLength = Buffer.byteLength(comment); + this.write(zipUtil.getShortBytes(commentLength)); + this.write(comment); }; -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; +ZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() { + // signature + this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD)); + + // size of the ZIP64 EOCD record + this.write(zipUtil.getEightBytes(44)); - callback = once(callback || noop); + // version made by + this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - var cancelled = false; + // version to extract + this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; + // disk numbers + this.write(constants.LONG_ZERO); + this.write(constants.LONG_ZERO); - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; + // number of entries + this.write(zipUtil.getEightBytes(this._entries.length)); + this.write(zipUtil.getEightBytes(this._entries.length)); - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; + // length and location of CD + this.write(zipUtil.getEightBytes(this._archive.centralLength)); + this.write(zipUtil.getEightBytes(this._archive.centralOffset)); - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; + // extensible data sector + // not implemented at this time - var onerror = function(err) { - callback.call(stream, err); - }; + // end of central directory locator + this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD_LOC)); + + // disk number holding the ZIP64 EOCD record + this.write(constants.LONG_ZERO); + + // relative offset of the ZIP64 EOCD record + this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength)); + + // total number of disks + this.write(zipUtil.getLongBytes(1)); +}; - var onclose = function() { - process.nextTick(onclosenexttick); - }; +ZipArchiveOutputStream.prototype._writeCentralFileHeader = function(ae) { + var gpb = ae.getGeneralPurposeBit(); + var method = ae.getMethod(); + var fileOffset = ae._offsets.file; - var onclosenexttick = function() { - if (cancelled) return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); - }; + var size = ae.getSize(); + var compressedSize = ae.getCompressedSize(); - var onrequest = function() { - stream.req.on('finish', onfinish); - }; + if (ae.isZip64() || fileOffset > constants.ZIP64_MAGIC) { + size = constants.ZIP64_MAGIC; + compressedSize = constants.ZIP64_MAGIC; + fileOffset = constants.ZIP64_MAGIC; - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } + ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - cancelled = true; - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; + var extraBuf = Buffer.concat([ + zipUtil.getShortBytes(constants.ZIP64_EXTRA_ID), + zipUtil.getShortBytes(24), + zipUtil.getEightBytes(ae.getSize()), + zipUtil.getEightBytes(ae.getCompressedSize()), + zipUtil.getEightBytes(ae._offsets.file) + ], 28); -module.exports = eos; + ae.setExtra(extraBuf); + } + // signature + this.write(zipUtil.getLongBytes(constants.SIG_CFH)); -/***/ }), + // version made by + this.write(zipUtil.getShortBytes((ae.getPlatform() << 8) | constants.VERSION_MADEBY)); -/***/ 79094: -/***/ ((module) => { + // version to extract and general bit flag + this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); + this.write(gpb.encode()); -"use strict"; + // compression method + this.write(zipUtil.getShortBytes(method)); + // datetime + this.write(zipUtil.getLongBytes(ae.getTimeDos())); -/** @type {import('.')} */ -var $defineProperty = Object.defineProperty || false; -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = false; - } -} + // crc32 checksum + this.write(zipUtil.getLongBytes(ae.getCrc())); -module.exports = $defineProperty; + // sizes + this.write(zipUtil.getLongBytes(compressedSize)); + this.write(zipUtil.getLongBytes(size)); + var name = ae.getName(); + var comment = ae.getComment(); + var extra = ae.getCentralDirectoryExtra(); -/***/ }), + if (gpb.usesUTF8ForNames()) { + name = Buffer.from(name); + comment = Buffer.from(comment); + } -/***/ 33056: -/***/ ((module) => { + // name length + this.write(zipUtil.getShortBytes(name.length)); -"use strict"; + // extra length + this.write(zipUtil.getShortBytes(extra.length)); + // comments length + this.write(zipUtil.getShortBytes(comment.length)); -/** @type {import('./eval')} */ -module.exports = EvalError; + // disk number start + this.write(constants.SHORT_ZERO); + // internal attributes + this.write(zipUtil.getShortBytes(ae.getInternalAttributes())); -/***/ }), + // external attributes + this.write(zipUtil.getLongBytes(ae.getExternalAttributes())); -/***/ 31620: -/***/ ((module) => { + // relative offset of LFH + this.write(zipUtil.getLongBytes(fileOffset)); -"use strict"; + // name + this.write(name); + // extra + this.write(extra); -/** @type {import('.')} */ -module.exports = Error; + // comment + this.write(comment); +}; +ZipArchiveOutputStream.prototype._writeDataDescriptor = function(ae) { + // signature + this.write(zipUtil.getLongBytes(constants.SIG_DD)); -/***/ }), + // crc32 checksum + this.write(zipUtil.getLongBytes(ae.getCrc())); -/***/ 14585: -/***/ ((module) => { + // sizes + if (ae.isZip64()) { + this.write(zipUtil.getEightBytes(ae.getCompressedSize())); + this.write(zipUtil.getEightBytes(ae.getSize())); + } else { + this.write(zipUtil.getLongBytes(ae.getCompressedSize())); + this.write(zipUtil.getLongBytes(ae.getSize())); + } +}; -"use strict"; +ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) { + var gpb = ae.getGeneralPurposeBit(); + var method = ae.getMethod(); + var name = ae.getName(); + var extra = ae.getLocalFileDataExtra(); + if (ae.isZip64()) { + gpb.useDataDescriptor(true); + ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); + } -/** @type {import('./range')} */ -module.exports = RangeError; + if (gpb.usesUTF8ForNames()) { + name = Buffer.from(name); + } + ae._offsets.file = this.offset; -/***/ }), + // signature + this.write(zipUtil.getLongBytes(constants.SIG_LFH)); -/***/ 46905: -/***/ ((module) => { + // version to extract and general bit flag + this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); + this.write(gpb.encode()); -"use strict"; + // compression method + this.write(zipUtil.getShortBytes(method)); + // datetime + this.write(zipUtil.getLongBytes(ae.getTimeDos())); -/** @type {import('./ref')} */ -module.exports = ReferenceError; + ae._offsets.data = this.offset; + // crc32 checksum and sizes + if (gpb.usesDataDescriptor()) { + this.write(constants.LONG_ZERO); + this.write(constants.LONG_ZERO); + this.write(constants.LONG_ZERO); + } else { + this.write(zipUtil.getLongBytes(ae.getCrc())); + this.write(zipUtil.getLongBytes(ae.getCompressedSize())); + this.write(zipUtil.getLongBytes(ae.getSize())); + } -/***/ }), + // name length + this.write(zipUtil.getShortBytes(name.length)); -/***/ 80105: -/***/ ((module) => { + // extra length + this.write(zipUtil.getShortBytes(extra.length)); -"use strict"; + // name + this.write(name); + // extra + this.write(extra); -/** @type {import('./syntax')} */ -module.exports = SyntaxError; + ae._offsets.contents = this.offset; +}; +ZipArchiveOutputStream.prototype.getComment = function(comment) { + return this._archive.comment !== null ? this._archive.comment : ''; +}; -/***/ }), +ZipArchiveOutputStream.prototype.isZip64 = function() { + return this._archive.forceZip64 || this._entries.length > constants.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants.ZIP64_MAGIC || this._archive.centralOffset > constants.ZIP64_MAGIC; +}; -/***/ 73314: -/***/ ((module) => { +ZipArchiveOutputStream.prototype.setComment = function(comment) { + this._archive.comment = comment; +}; -"use strict"; +/***/ }), -/** @type {import('./type')} */ -module.exports = TypeError; +/***/ 47544: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +module.exports = { + ArchiveEntry: __nccwpck_require__(96070), + ZipArchiveEntry: __nccwpck_require__(73380), + ArchiveOutputStream: __nccwpck_require__(36306), + ZipArchiveOutputStream: __nccwpck_require__(82132) +}; /***/ }), -/***/ 32578: -/***/ ((module) => { +/***/ 18300: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var Stream = (__nccwpck_require__(2203).Stream); +var PassThrough = (__nccwpck_require__(29963).PassThrough); +var isStream = __nccwpck_require__(96543); +var util = module.exports = {}; -/** @type {import('./uri')} */ -module.exports = URIError; +util.normalizeInputSource = function(source) { + if (source === null) { + return Buffer.alloc(0); + } else if (typeof source === 'string') { + return Buffer.from(source); + } else if (isStream(source) && !source._readableState) { + var normalized = new PassThrough(); + source.pipe(normalized); + + return normalized; + } + return source; +}; /***/ }), -/***/ 95399: -/***/ ((module) => { +/***/ 45481: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. -/** @type {import('.')} */ -module.exports = Object; +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; -/***/ }), +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; -/***/ 88700: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; -"use strict"; +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; -var GetIntrinsic = __nccwpck_require__(60470); +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; -var hasToStringTag = __nccwpck_require__(85479)(); -var hasOwn = __nccwpck_require__(54076); -var $TypeError = __nccwpck_require__(73314); +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; -var toStringTag = hasToStringTag ? Symbol.toStringTag : null; +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; -/** @type {import('.')} */ -module.exports = function setToStringTag(object, value) { - var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; - var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; - if ( - (typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean') - || (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean') - ) { - throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans'); - } - if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { - if ($defineProperty) { - $defineProperty(object, toStringTag, { - configurable: !nonConfigurable, - enumerable: false, - value: value, - writable: false - }); - } else { - object[toStringTag] = value; // eslint-disable-line no-param-reassign - } - } -}; +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; -/***/ }), +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; -/***/ 34778: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; -var debug; +exports.isBuffer = __nccwpck_require__(20181).Buffer.isBuffer; -module.exports = function () { - if (!debug) { - try { - /* eslint global-require: off */ - debug = __nccwpck_require__(2830)("follow-redirects"); - } - catch (error) { /* */ } - if (typeof debug !== "function") { - debug = function () { /* */ }; - } - } - debug.apply(null, arguments); -}; +function objectToString(o) { + return Object.prototype.toString.call(o); +} /***/ }), -/***/ 1573: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 84891: +/***/ ((__unused_webpack_module, exports) => { -var url = __nccwpck_require__(87016); -var URL = url.URL; -var http = __nccwpck_require__(58611); -var https = __nccwpck_require__(65692); -var Writable = (__nccwpck_require__(2203).Writable); -var assert = __nccwpck_require__(42613); -var debug = __nccwpck_require__(34778); +/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */ +/* vim: set ts=2: */ +/*exported CRC32 */ +var CRC32; +(function (factory) { + /*jshint ignore:start */ + /*eslint-disable */ + if(typeof DO_NOT_EXPORT_CRC === 'undefined') { + if(true) { + factory(exports); + } else {} + } else { + factory(CRC32 = {}); + } + /*eslint-enable */ + /*jshint ignore:end */ +}(function(CRC32) { +CRC32.version = '1.2.2'; +/*global Int32Array */ +function signed_crc_table() { + var c = 0, table = new Array(256); -// Preventive platform detection -// istanbul ignore next -(function detectUnsupportedEnvironment() { - var looksLikeNode = typeof process !== "undefined"; - var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; - var looksLikeV8 = isFunction(Error.captureStackTrace); - if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { - console.warn("The follow-redirects package should be excluded from browser builds."); - } -}()); + for(var n =0; n != 256; ++n){ + c = n; + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); + table[n] = c; + } -// Whether to use the native URL object or the legacy url module -var useNativeURL = false; -try { - assert(new URL("")); -} -catch (error) { - useNativeURL = error.code === "ERR_INVALID_URL"; + return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table; } -// HTTP headers to drop across HTTP/HTTPS and domain boundaries -var sensitiveHeaders = [ - "Authorization", - "Proxy-Authorization", - "Cookie", -]; - -// URL fields to preserve in copy operations -var preservedUrlFields = [ - "auth", - "host", - "hostname", - "href", - "path", - "pathname", - "port", - "protocol", - "query", - "search", - "hash", -]; +var T0 = signed_crc_table(); +function slice_by_16_tables(T) { + var c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ; -// Create handlers that pass events from native requests -var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; -var eventHandlers = Object.create(null); -events.forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); + for(n = 0; n != 256; ++n) table[n] = T[n]; + for(n = 0; n != 256; ++n) { + v = T[n]; + for(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF]; + } + var out = []; + for(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256); + return out; +} +var TT = slice_by_16_tables(T0); +var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4]; +var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; +var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14]; +function crc32_bstr(bstr, seed) { + var C = seed ^ -1; + for(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF]; + return ~C; +} -// Error types with codes -var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError -); -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded", - RedirectionError -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); +function crc32_buf(B, seed) { + var C = seed ^ -1, L = B.length - 15, i = 0; + for(; i < L;) C = + Tf[B[i++] ^ (C & 255)] ^ + Te[B[i++] ^ ((C >> 8) & 255)] ^ + Td[B[i++] ^ ((C >> 16) & 255)] ^ + Tc[B[i++] ^ (C >>> 24)] ^ + Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ + T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ + T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]]; + L += 15; + while(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF]; + return ~C; +} -// istanbul ignore next -var destroy = Writable.prototype.destroy || noop; +function crc32_str(str, seed) { + var C = seed ^ -1; + for(var i = 0, L = str.length, c = 0, d = 0; i < L;) { + c = str.charCodeAt(i++); + if(c < 0x80) { + C = (C>>>8) ^ T0[(C^c)&0xFF]; + } else if(c < 0x800) { + C = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF]; + C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; + } else if(c >= 0xD800 && c < 0xE000) { + c = (c&1023)+64; d = str.charCodeAt(i++)&1023; + C = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF]; + C = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF]; + C = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF]; + C = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF]; + } else { + C = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF]; + C = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF]; + C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; + } + } + return ~C; +} +CRC32.table = T0; +// $FlowIgnore +CRC32.bstr = crc32_bstr; +// $FlowIgnore +CRC32.buf = crc32_buf; +// $FlowIgnore +CRC32.str = crc32_str; +})); -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); - } +/***/ }), - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - try { - self._processResponse(response); - } - catch (cause) { - self.emit("error", cause instanceof RedirectionError ? - cause : new RedirectionError({ cause: cause })); - } - }; +/***/ 3662: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Create filter for sensitive HTTP headers - this._headerFilter = new RegExp("^(?:" + - sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + - ")$", "i"); +"use strict"; +/** + * node-crc32-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT + */ - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); + -RedirectableRequest.prototype.abort = function () { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); -}; +const {Transform} = __nccwpck_require__(29963); -RedirectableRequest.prototype.destroy = function (error) { - destroyRequest(this._currentRequest, error); - destroy.call(this, error); - return this; -}; +const crc32 = __nccwpck_require__(84891); -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } +class CRC32Stream extends Transform { + constructor(options) { + super(options); + this.checksum = Buffer.allocUnsafe(4); + this.checksum.writeInt32BE(0, 0); - // Validate input and shift parameters if necessary - if (!isString(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; + this.rawSize = 0; } - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); + _transform(chunk, encoding, callback) { + if (chunk) { + this.checksum = crc32.buf(chunk, this.checksum) >>> 0; + this.rawSize += chunk.length; } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } -}; -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (isFunction(data)) { - callback = data; - data = encoding = null; + callback(null, chunk); } - else if (isFunction(encoding)) { - callback = encoding; - encoding = null; + + digest(encoding) { + const checksum = Buffer.allocUnsafe(4); + checksum.writeUInt32BE(this.checksum >>> 0, 0); + return encoding ? checksum.toString(encoding) : checksum; } - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); + hex() { + return this.digest('hex').toUpperCase(); } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; + + size() { + return this.rawSize; } -}; +} -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; +module.exports = CRC32Stream; -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - var self = this; +/***/ }), - // Destroys the socket on timeout - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); +/***/ 76252: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/** + * node-crc32-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT + */ + + + +const {DeflateRaw} = __nccwpck_require__(43106); + +const crc32 = __nccwpck_require__(84891); + +class DeflateCRC32Stream extends DeflateRaw { + constructor(options) { + super(options); + + this.checksum = Buffer.allocUnsafe(4); + this.checksum.writeInt32BE(0, 0); + + this.rawSize = 0; + this.compressedSize = 0; } - // Sets up a timer to trigger a timeout event - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); + push(chunk, encoding) { + if (chunk) { + this.compressedSize += chunk.length; } - self._timeout = setTimeout(function () { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); + + return super.push(chunk, encoding); } - // Stops a timeout from triggering - function clearTimer() { - // Clear the timeout - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; + _transform(chunk, encoding, callback) { + if (chunk) { + this.checksum = crc32.buf(chunk, this.checksum) >>> 0; + this.rawSize += chunk.length; } - // Clean up all attached listeners - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - self.removeListener("close", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); - } + super._transform(chunk, encoding, callback) } - // Attach callback if passed - if (callback) { - this.on("timeout", callback); + digest(encoding) { + const checksum = Buffer.allocUnsafe(4); + checksum.writeUInt32BE(this.checksum >>> 0, 0); + return encoding ? checksum.toString(encoding) : checksum; } - // Start the timer if or when the socket is opened - if (this.socket) { - startTimer(this.socket); + hex() { + return this.digest('hex').toUpperCase(); } - else { - this._currentRequest.once("socket", startTimer); + + size(compressed = false) { + if (compressed) { + return this.compressedSize; + } else { + return this.rawSize; + } } +} - // Clean up on events - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - this.on("close", clearTimer); +module.exports = DeflateCRC32Stream; - return this; -}; -// Proxy all other public ClientRequest methods -[ - "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); +/***/ }), -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); +/***/ 82770: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; - } - if (!isArray(options.sensitiveHeaders)) { - options.sensitiveHeaders = []; - } +"use strict"; +/** + * node-crc32-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT + */ - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } -}; +module.exports = { + CRC32Stream: __nccwpck_require__(3662), + DeflateCRC32Stream: __nccwpck_require__(76252) +} -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - throw new TypeError("Unsupported protocol " + protocol); - } - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } +/***/ }), - // Create the native request and set up its event handlers - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } +/***/ 6110: +/***/ ((module, exports, __nccwpck_require__) => { - // RFC7230§5.3.1: When making a request directly to an origin server, […] - // a client MUST send only the absolute path […] as the request-target. - this._currentUrl = /^\//.test(this._options.path) ? - url.format(this._options) : - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._options.path; +/* eslint-env browser */ - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - // istanbul ignore else - if (request === self._currentRequest) { - // Report any write errors - // istanbul ignore if - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - // istanbul ignore else - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } - } - }()); - } -}; +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); - } +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ - // RFC7231§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } - // If the response is not a redirect; return it as-is - var location = response.headers.location; - if (!location || this._options.followRedirects === false || - statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } - // Clean up - this._requestBodyBuffers = []; - return; - } + let m; - // The response is a redirect, so abort the current request - destroyRequest(this._currentRequest); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - throw new TooManyRedirectsError(); - } +/** + * Colorize log arguments if enabled. + * + * @api public + */ - // Store the request headers if applicable - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host"), - }, this._options.headers); - } +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } + if (!this.useColors) { + return; + } - // Drop the Host header, as the redirect might lead to a different host - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); - // If the redirect is relative, carry over the host of the last request - var currentUrlParts = parseUrl(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : - url.format(Object.assign(currentUrlParts, { host: currentHost })); + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); - // Create the redirected request - var redirectUrl = resolveUrl(location, currentUrl); - debug("redirecting to", redirectUrl.href); - this._isRedirect = true; - spreadUrlObject(redirectUrl, this._options); + args.splice(lastC, 0, c); +} - // Drop confidential headers when redirecting to a less secure protocol - // or to a different domain that is not a superdomain - if (redirectUrl.protocol !== currentUrlParts.protocol && - redirectUrl.protocol !== "https:" || - redirectUrl.host !== currentHost && - !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(this._headerFilter, this._options.headers); - } +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); - // Evaluate the beforeRedirect callback - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode: statusCode, - }; - var requestDetails = { - url: currentUrl, - method: method, - headers: requestHeaders, - }; - beforeRedirect(this._options, responseDetails, requestDetails); - this._sanitizeOptions(this._options); - } +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} - // Perform the redirected request - this._performRequest(); -}; +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); + return r; +} - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters, ensuring that input is an object - if (isURL(input)) { - input = spreadUrlObject(input); - } - else if (isString(input)) { - input = spreadUrlObject(parseUrl(input)); - } - else { - callback = options; - options = validateUrl(input); - input = { protocol: protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; - } +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } +module.exports = __nccwpck_require__(40897)(exports); - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } +const {formatters} = module.exports; - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ -function noop() { /* empty */ } +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; -function parseUrl(input) { - var parsed; - // istanbul ignore else - if (useNativeURL) { - parsed = new URL(input); - } - else { - // Ensure the URL is valid and absolute - parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; -} -function resolveUrl(relative, base) { - // istanbul ignore next - return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); -} +/***/ }), -function validateUrl(input) { - if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { - throw new InvalidUrlError({ input: input.href || input }); - } - if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { - throw new InvalidUrlError({ input: input.href || input }); - } - return input; -} +/***/ 40897: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function spreadUrlObject(urlObject, target) { - var spread = target || {}; - for (var key of preservedUrlFields) { - spread[key] = urlObject[key]; - } - // Fix IPv6 hostname - if (spread.hostname.startsWith("[")) { - spread.hostname = spread.hostname.slice(1, -1); - } - // Ensure port is a number - if (spread.port !== "") { - spread.port = Number(spread.port); - } - // Concatenate path - spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ - return spread; -} +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(70744); + createDebug.destroy = destroy; -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return (lastValue === null || typeof lastValue === "undefined") ? - undefined : String(lastValue).trim(); -} + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); -function createErrorType(code, message, baseClass) { - // Create constructor - function CustomError(properties) { - // istanbul ignore else - if (isFunction(Error.captureStackTrace)) { - Error.captureStackTrace(this, this.constructor); - } - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } + /** + * The currently active debug mode names, and names to skip. + */ - // Attach constructor and set default properties - CustomError.prototype = new (baseClass || Error)(); - Object.defineProperties(CustomError.prototype, { - constructor: { - value: CustomError, - enumerable: false, - }, - name: { - value: "Error [" + code + "]", - enumerable: false, - }, - }); - return CustomError; -} + createDebug.names = []; + createDebug.skips = []; -function destroyRequest(request, error) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.destroy(error); -} + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; -function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); -} + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; -function isArray(value) { - return value instanceof Array; -} + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } -function isString(value) { - return typeof value === "string" || value instanceof String; -} + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; -function isFunction(value) { - return typeof value === "function"; -} + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; -function isBuffer(value) { - return typeof value === "object" && ("length" in value); -} + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } -function isURL(value) { - return URL && value instanceof URL; -} + const self = debug; -function escapeRegex(regex) { - return regex.replace(/[\]\\/()*+?.$]/g, "\\$&"); -} + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); -/***/ }), + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); -/***/ 96454: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); -"use strict"; + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. -var CombinedStream = __nccwpck_require__(35630); -var util = __nccwpck_require__(39023); -var path = __nccwpck_require__(16928); -var http = __nccwpck_require__(58611); -var https = __nccwpck_require__(65692); -var parseUrl = (__nccwpck_require__(87016).parse); -var fs = __nccwpck_require__(79896); -var Stream = (__nccwpck_require__(2203).Stream); -var crypto = __nccwpck_require__(76982); -var mime = __nccwpck_require__(14096); -var asynckit = __nccwpck_require__(31324); -var setToStringTag = __nccwpck_require__(88700); -var hasOwn = __nccwpck_require__(54076); -var populate = __nccwpck_require__(11835); + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } -/** - * Escape CR, LF, and `"` in a multipart `name`/`filename` parameter, so a field - * name or filename can not break out of its header line to inject headers or - * smuggle additional parts. Matches the WHATWG HTML multipart/form-data encoding. - * - * @param {string} str - the parameter value to escape - * @returns {string} the escaped value - */ -function escapeHeaderParam(str) { - return String(str).replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/"/g, '%22'); -} + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); -/** - * Create readable "multipart/form-data" streams. - * Can be used to submit forms - * and file uploads to other web applications. - * - * @constructor - * @param {object} options - Properties to be added/overriden for FormData and CombinedStream - */ -function FormData(options) { - if (!(this instanceof FormData)) { - return new FormData(options); - } + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; + return debug; + } - CombinedStream.call(this); + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } - options = options || {}; // eslint-disable-line no-param-reassign - for (var option in options) { // eslint-disable-line no-restricted-syntax - this[option] = options[option]; - } -} + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; -// make it a Stream -util.inherits(FormData, CombinedStream); + createDebug.names = []; + createDebug.skips = []; -FormData.LINE_BREAK = '\r\n'; -FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(/\s+/g, ',') + .split(',') + .filter(Boolean); -FormData.prototype.append = function (field, value, options) { - options = options || {}; // eslint-disable-line no-param-reassign + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } - // allow filename as single option - if (typeof options === 'string') { - options = { filename: options }; // eslint-disable-line no-param-reassign - } + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; - var append = CombinedStream.prototype.append.bind(this); + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; // No match + } + } - // all that streamy business can't handle numbers - if (typeof value === 'number' || value == null) { - value = String(value); // eslint-disable-line no-param-reassign - } + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } - // https://github.com/felixge/node-form-data/issues/38 - if (Array.isArray(value)) { - /* - * Please convert your array into string - * the way web server expects it - */ - this._error(new Error('Arrays are not supported.')); - return; - } + return templateIndex === template.length; + } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } - append(header); - append(value); - append(footer); + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } - // pass along options.knownLength - this._trackLength(header, value, options); -}; + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } -FormData.prototype._trackLength = function (header, value, options) { - var valueLength = 0; + return false; + } - /* - * used w/ getLengthSync(), when length is known. - * e.g. for streaming directly from a remote server, - * w/ a known file a size, and not wanting to wait for - * incoming file to finish to get its size. - */ - if (options.knownLength != null) { - valueLength += Number(options.knownLength); - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } - this._valueLength += valueLength; + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length; + createDebug.enable(createDebug.load()); - // empty or either doesn't have path or not an http response or not a stream - if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) { - return; - } + return createDebug; +} - // no need to bother with the length - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } -}; +module.exports = setup; -FormData.prototype._lengthRetriever = function (value, callback) { - if (hasOwn(value, 'fd')) { - // take read range into a account - // `end` = Infinity –> read file till the end - // - // TODO: Looks like there is bug in Node fs.createReadStream - // it doesn't respect `end` options without `start` options - // Fix it when node fixes it. - // https://github.com/joyent/node/issues/7819 - if (value.end != undefined && value.end != Infinity && value.start != undefined) { - // when end specified - // no need to calculate range - // inclusive, starts with 0 - callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return - // not that fast snoopy - } else { - // still need to fetch file size from fs - fs.stat(value.path, function (err, stat) { - if (err) { - callback(err); - return; - } +/***/ }), - // update final size based on the range options - var fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } +/***/ 2830: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // or http response - } else if (hasOwn(value, 'httpVersion')) { - callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ - // or request stream http://github.com/mikeal/request - } else if (hasOwn(value, 'httpModule')) { - // wait till response come back - value.on('response', function (response) { - value.pause(); - callback(null, Number(response.headers['content-length'])); - }); - value.resume(); +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(6110); +} else { + module.exports = __nccwpck_require__(95108); +} - // something else - } else { - callback('Unknown stream'); // eslint-disable-line callback-return - } -}; -FormData.prototype._multiPartHeader = function (field, value, options) { - /* - * custom header specified (as string)? - * it becomes responsible for boundary - * (e.g. to handle extra CRLFs on .NET servers) - */ - if (typeof options.header === 'string') { - return options.header; - } +/***/ }), - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); +/***/ 95108: +/***/ ((module, exports, __nccwpck_require__) => { - var contents = ''; - var headers = { - // add custom disposition as third element or keep it two elements if not - 'Content-Disposition': ['form-data', 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - 'Content-Type': [].concat(contentType || []) - }; +/** + * Module dependencies. + */ - // allow custom headers. - if (typeof options.header === 'object') { - populate(headers, options.header); - } +const tty = __nccwpck_require__(52018); +const util = __nccwpck_require__(39023); - var header; - for (var prop in headers) { // eslint-disable-line no-restricted-syntax - if (hasOwn(headers, prop)) { - header = headers[prop]; +/** + * This is the Node.js implementation of `debug()`. + */ - // skip nullish headers. - if (header == null) { - continue; // eslint-disable-line no-restricted-syntax, no-continue - } +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); - // convert all headers to arrays. - if (!Array.isArray(header)) { - header = [header]; - } +/** + * Colors. + */ - // add non-empty headers. - if (header.length) { - contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; - } - } - } +exports.colors = [6, 2, 3, 4, 5, 1]; - return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; -}; +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(60075); -FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return - var filename; + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} - if (typeof options.filepath === 'string') { - // custom filepath for relative paths - filename = path.normalize(options.filepath).replace(/\\/g, '/'); - } else if (options.filename || (value && (value.name || value.path))) { - /* - * custom filename take precedence - * formidable and the browser add a name property - * fs- and request- streams have path property - */ - filename = path.basename(options.filename || (value && (value.name || value.path))); - } else if (value && value.readable && hasOwn(value, 'httpVersion')) { - // or try http response - filename = path.basename(value.client._httpMessage.path || ''); - } +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ - if (filename) { - return 'filename="' + escapeHeaderParam(filename) + '"'; - } -}; +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); -FormData.prototype._getContentType = function (value, options) { - // use custom content-type above all - var contentType = options.contentType; + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } - // or try `name` from formidable, browser - if (!contentType && value && value.name) { - contentType = mime.lookup(value.name); - } + obj[prop] = val; + return obj; +}, {}); - // or try `path` from fs-, request- streams - if (!contentType && value && value.path) { - contentType = mime.lookup(value.path); - } +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ - // or if it's http-reponse - if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) { - contentType = value.headers['content-type']; - } +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} - // or guess it from the filepath or filename - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ - // fallback to the default content type if `value` is not simple value - if (!contentType && value && typeof value === 'object') { - contentType = FormData.DEFAULT_CONTENT_TYPE; - } +function formatArgs(args) { + const {namespace: name, useColors} = this; - return contentType; -}; + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; -FormData.prototype._multiPartFooter = function () { - return function (next) { - var footer = FormData.LINE_BREAK; + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} - var lastPart = this._streams.length === 0; - if (lastPart) { - footer += this._lastBoundary(); - } +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} - next(footer); - }.bind(this); -}; +/** + * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. + */ -FormData.prototype._lastBoundary = function () { - return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; -}; +function log(...args) { + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); +} -FormData.prototype.getHeaders = function (userHeaders) { - var header; - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} - for (header in userHeaders) { // eslint-disable-line no-restricted-syntax - if (hasOwn(userHeaders, header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ - return formHeaders; -}; +function load() { + return process.env.DEBUG; +} -FormData.prototype.setBoundary = function (boundary) { - if (typeof boundary !== 'string') { - throw new TypeError('FormData boundary must be a string'); - } - this._boundary = boundary; -}; +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ -FormData.prototype.getBoundary = function () { - if (!this._boundary) { - this._generateBoundary(); - } +function init(debug) { + debug.inspectOpts = {}; - return this._boundary; -}; + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} -FormData.prototype.getBuffer = function () { - var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap - var boundary = this.getBoundary(); +module.exports = __nccwpck_require__(40897)(exports); - // Create the form content. Add Line breaks to the end of data. - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== 'function') { - // Add content to the buffer. - if (Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); - } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); - } +const {formatters} = module.exports; - // Add break after content. - if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]); - } - } - } +/** + * Map %o to `util.inspect()`, all on a single line. + */ - // Add the footer and return the Buffer object. - return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); }; -FormData.prototype._generateBoundary = function () { - // This generates a 50 character boundary similar to those used by Firefox. +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ - // They are optimized for boyer-moore parsing. - this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex'); +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually and add it as knownLength option -FormData.prototype.getLengthSync = function () { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - // https://github.com/form-data/form-data/issues/40 - if (!this.hasKnownLength()) { - /* - * Some async length retrievers are present - * therefore synchronous length calculation is false. - * Please use getLength(callback) to get proper length - */ - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } +/***/ }), - return knownLength; -}; +/***/ 72710: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Public API to check if length of added values is known -// https://github.com/form-data/form-data/issues/196 -// https://github.com/form-data/form-data/issues/262 -FormData.prototype.hasKnownLength = function () { - var hasKnownLength = true; +var Stream = (__nccwpck_require__(2203).Stream); +var util = __nccwpck_require__(39023); - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; - return hasKnownLength; -}; + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util.inherits(DelayedStream, Stream); -FormData.prototype.getLength = function (cb) { - var knownLength = this._overheadLength + this._valueLength; +DelayedStream.create = function(source, options) { + var delayedStream = new this(); - if (this._streams.length) { - knownLength += this._lastBoundary().length; + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } + delayedStream.source = source; - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) { - if (err) { - cb(err); - return; - } + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; - values.forEach(function (length) { - knownLength += length; - }); + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } - cb(null, knownLength); - }); + return delayedStream; }; -FormData.prototype.submit = function (params, cb) { - var request; - var options; - var defaults = { method: 'post' }; - - // parse provided url if it's string or treat it as options object - if (typeof params === 'string') { - params = parseUrl(params); // eslint-disable-line no-param-reassign - /* eslint sort-keys: 0 */ - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); - } else { // use custom params - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol === 'https:' ? 443 : 80; - } +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; } +}); - // put that good code in getHeaders to some use - options.headers = this.getHeaders(params.headers); +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; - // https if specified, fallback to http in any other case - if (options.protocol === 'https:') { - request = https.request(options); - } else { - request = http.request(options); +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); } - // get content length and fire away - this.getLength(function (err, length) { - if (err && err !== 'Unknown stream') { - this._error(err); - return; - } - - // add content length - if (length) { - request.setHeader('Content-Length', length); - } - - this.pipe(request); - if (cb) { - var onResponse; - - var callback = function (error, responce) { - request.removeListener('error', callback); - request.removeListener('response', onResponse); + this.source.resume(); +}; - return cb.call(this, error, responce); - }; +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; - onResponse = callback.bind(this, null); +DelayedStream.prototype.release = function() { + this._released = true; - request.on('error', callback); - request.on('response', onResponse); - } + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); }.bind(this)); - - return request; -}; - -FormData.prototype._error = function (err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit('error', err); - } + this._bufferedEvents = []; }; -FormData.prototype.toString = function () { - return '[object FormData]'; +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; }; -setToStringTag(FormData.prototype, 'FormData'); - -// Public API -module.exports = FormData; +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } -/***/ }), - -/***/ 11835: -/***/ ((module) => { + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } -"use strict"; + this._bufferedEvents.push(args); +}; +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } -// populates missing values -module.exports = function (dst, src) { - Object.keys(src).forEach(function (prop) { - dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign - }); + if (this.dataSize <= this.maxDataSize) { + return; + } - return dst; + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); }; /***/ }), -/***/ 12147: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = (__nccwpck_require__(79896).constants) || __nccwpck_require__(49140) - +/***/ 14150: +/***/ ((__unused_webpack_module, exports) => { -/***/ }), +"use strict"; -/***/ 29728: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch +Object.defineProperty(exports, "__esModule", ({ value: true })); -var fs = __nccwpck_require__(79896) -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __nccwpck_require__(61201) - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } + /* istanbul ignore next */ - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } + this.name = 'Deprecation'; } -} -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync } -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} +exports.Deprecation = Deprecation; /***/ }), -/***/ 61201: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 26669: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +"use strict"; -var pathModule = __nccwpck_require__(16928); -var isWindows = process.platform === 'win32'; -var fs = __nccwpck_require__(79896); -// JavaScript implementation of realpath, ported from node pre-v6 +var callBind = __nccwpck_require__(88705); +var gOPD = __nccwpck_require__(33170); + +var hasProtoAccessor; +try { + // eslint-disable-next-line no-extra-parens, no-proto + hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; +} catch (e) { + if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { + throw e; + } +} -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); +// eslint-disable-next-line no-extra-parens +var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; +var $Object = Object; +var $getPrototypeOf = $Object.getPrototypeOf; - return callback; +/** @type {import('./get')} */ +module.exports = desc && typeof desc.get === 'function' + ? callBind([desc.get]) + : typeof $getPrototypeOf === 'function' + ? /** @type {import('./get')} */ function getDunder(value) { + // eslint-disable-next-line eqeqeq + return $getPrototypeOf(value == null ? value : $Object(value)); + } + : false; - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} +/***/ }), -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} +/***/ 79094: +/***/ ((module) => { -var normalize = pathModule.normalize; +"use strict"; -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; +/** @type {import('.')} */ +var $defineProperty = Object.defineProperty || false; +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } } -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; +module.exports = $defineProperty; - start(); - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; +/***/ }), - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } +/***/ 33056: +/***/ ((module) => { - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; +"use strict"; - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } +/** @type {import('./eval')} */ +module.exports = EvalError; - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } +/***/ }), - if (cache) cache[original] = p; +/***/ 31620: +/***/ ((module) => { - return p; -}; +"use strict"; -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } +/** @type {import('.')} */ +module.exports = Error; - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; +/***/ }), - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } +/***/ 14585: +/***/ ((module) => { - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } +"use strict"; - return fs.lstat(base, gotStat); - } - function gotStat(err, stat) { - if (err) return cb(err); +/** @type {import('./range')} */ +module.exports = RangeError; - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); +/***/ }), - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } +/***/ 46905: +/***/ ((module) => { - function gotTarget(err, target, base) { - if (err) return cb(err); +"use strict"; - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; +/** @type {import('./ref')} */ +module.exports = ReferenceError; /***/ }), -/***/ 99808: +/***/ 80105: /***/ ((module) => { "use strict"; -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var toStr = Object.prototype.toString; -var max = Math.max; -var funcType = '[object Function]'; +/** @type {import('./syntax')} */ +module.exports = SyntaxError; -var concatty = function concatty(a, b) { - var arr = []; - for (var i = 0; i < a.length; i += 1) { - arr[i] = a[i]; - } - for (var j = 0; j < b.length; j += 1) { - arr[j + a.length] = b[j]; - } +/***/ }), - return arr; -}; +/***/ 73314: +/***/ ((module) => { -var slicy = function slicy(arrLike, offset) { - var arr = []; - for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { - arr[j] = arrLike[i]; - } - return arr; -}; +"use strict"; -var joiny = function (arr, joiner) { - var str = ''; - for (var i = 0; i < arr.length; i += 1) { - str += arr[i]; - if (i + 1 < arr.length) { - str += joiner; - } - } - return str; -}; -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); +/** @type {import('./type')} */ +module.exports = TypeError; - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) - ); - }; +/***/ }), - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = '$' + i; - } +/***/ 32578: +/***/ ((module) => { - bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); +"use strict"; - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; -}; +/** @type {import('./uri')} */ +module.exports = URIError; /***/ }), -/***/ 37564: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 95399: +/***/ ((module) => { "use strict"; -var implementation = __nccwpck_require__(99808); - -module.exports = Function.prototype.bind || implementation; +/** @type {import('.')} */ +module.exports = Object; /***/ }), -/***/ 60470: +/***/ 88700: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var undefined; +var GetIntrinsic = __nccwpck_require__(60470); -var $Object = __nccwpck_require__(95399); +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $Error = __nccwpck_require__(31620); -var $EvalError = __nccwpck_require__(33056); -var $RangeError = __nccwpck_require__(14585); -var $ReferenceError = __nccwpck_require__(46905); -var $SyntaxError = __nccwpck_require__(80105); +var hasToStringTag = __nccwpck_require__(85479)(); +var hasOwn = __nccwpck_require__(54076); var $TypeError = __nccwpck_require__(73314); -var $URIError = __nccwpck_require__(32578); - -var abs = __nccwpck_require__(55641); -var floor = __nccwpck_require__(96171); -var max = __nccwpck_require__(57147); -var min = __nccwpck_require__(41017); -var pow = __nccwpck_require__(56947); -var round = __nccwpck_require__(42621); -var sign = __nccwpck_require__(30156); -var $Function = Function; +var toStringTag = hasToStringTag ? Symbol.toStringTag : null; -// eslint-disable-next-line consistent-return -var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); - } catch (e) {} +/** @type {import('.')} */ +module.exports = function setToStringTag(object, value) { + var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; + var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; + if ( + (typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean') + || (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean') + ) { + throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans'); + } + if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { + if ($defineProperty) { + $defineProperty(object, toStringTag, { + configurable: !nonConfigurable, + enumerable: false, + value: value, + writable: false + }); + } else { + object[toStringTag] = value; // eslint-disable-line no-param-reassign + } + } }; -var $gOPD = __nccwpck_require__(33170); -var $defineProperty = __nccwpck_require__(79094); -var throwTypeError = function () { - throw new $TypeError(); -}; -var ThrowTypeError = $gOPD - ? (function () { - try { - // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties - arguments.callee; // IE 8 does not throw here - return throwTypeError; - } catch (calleeThrows) { - try { - // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') - return $gOPD(arguments, 'callee').get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }()) - : throwTypeError; +/***/ }), -var hasSymbols = __nccwpck_require__(23336)(); +/***/ 16577: +/***/ ((module, exports) => { -var getProto = __nccwpck_require__(81967); -var $ObjectGPO = __nccwpck_require__(91311); -var $ReflectGPO = __nccwpck_require__(48681); +"use strict"; +/** + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ -var $apply = __nccwpck_require__(33945); -var $call = __nccwpck_require__(88093); -var needsEval = {}; +Object.defineProperty(exports, "__esModule", ({ value: true })); -var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); +/** + * @typedef {object} PrivateData + * @property {EventTarget} eventTarget The event target. + * @property {{type:string}} event The original event object. + * @property {number} eventPhase The current event phase. + * @property {EventTarget|null} currentTarget The current event target. + * @property {boolean} canceled The flag to prevent default. + * @property {boolean} stopped The flag to stop propagation. + * @property {boolean} immediateStopped The flag to stop propagation immediately. + * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null. + * @property {number} timeStamp The unix time. + * @private + */ -var INTRINSICS = { - __proto__: null, - '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, - '%Array%': Array, - '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, - '%AsyncFromSyncIteratorPrototype%': undefined, - '%AsyncFunction%': needsEval, - '%AsyncGenerator%': needsEval, - '%AsyncGeneratorFunction%': needsEval, - '%AsyncIteratorPrototype%': needsEval, - '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, - '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, - '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, - '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, - '%Boolean%': Boolean, - '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, - '%Date%': Date, - '%decodeURI%': decodeURI, - '%decodeURIComponent%': decodeURIComponent, - '%encodeURI%': encodeURI, - '%encodeURIComponent%': encodeURIComponent, - '%Error%': $Error, - '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': $EvalError, - '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, - '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, - '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, - '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, - '%Function%': $Function, - '%GeneratorFunction%': needsEval, - '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, - '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, - '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, - '%isFinite%': isFinite, - '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, - '%JSON%': typeof JSON === 'object' ? JSON : undefined, - '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), - '%Math%': Math, - '%Number%': Number, - '%Object%': $Object, - '%Object.getOwnPropertyDescriptor%': $gOPD, - '%parseFloat%': parseFloat, - '%parseInt%': parseInt, - '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, - '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': $RangeError, - '%ReferenceError%': $ReferenceError, - '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, - '%RegExp%': RegExp, - '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), - '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, - '%String%': String, - '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, - '%Symbol%': hasSymbols ? Symbol : undefined, - '%SyntaxError%': $SyntaxError, - '%ThrowTypeError%': ThrowTypeError, - '%TypedArray%': TypedArray, - '%TypeError%': $TypeError, - '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, - '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, - '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, - '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': $URIError, - '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, - '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, +/** + * Private data for event wrappers. + * @type {WeakMap} + * @private + */ +const privateData = new WeakMap(); - '%Function.prototype.call%': $call, - '%Function.prototype.apply%': $apply, - '%Object.defineProperty%': $defineProperty, - '%Object.getPrototypeOf%': $ObjectGPO, - '%Math.abs%': abs, - '%Math.floor%': floor, - '%Math.max%': max, - '%Math.min%': min, - '%Math.pow%': pow, - '%Math.round%': round, - '%Math.sign%': sign, - '%Reflect.getPrototypeOf%': $ReflectGPO -}; +/** + * Cache for wrapper classes. + * @type {WeakMap} + * @private + */ +const wrappers = new WeakMap(); -if (getProto) { - try { - null.error; // eslint-disable-line no-unused-expressions - } catch (e) { - // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 - var errorProto = getProto(getProto(e)); - INTRINSICS['%Error.prototype%'] = errorProto; - } +/** + * Get private data. + * @param {Event} event The event object to get private data. + * @returns {PrivateData} The private data of the event. + * @private + */ +function pd(event) { + const retv = privateData.get(event); + console.assert( + retv != null, + "'this' is expected an Event object, but got", + event + ); + return retv } -var doEval = function doEval(name) { - var value; - if (name === '%AsyncFunction%') { - value = getEvalledConstructor('async function () {}'); - } else if (name === '%GeneratorFunction%') { - value = getEvalledConstructor('function* () {}'); - } else if (name === '%AsyncGeneratorFunction%') { - value = getEvalledConstructor('async function* () {}'); - } else if (name === '%AsyncGenerator%') { - var fn = doEval('%AsyncGeneratorFunction%'); - if (fn) { - value = fn.prototype; - } - } else if (name === '%AsyncIteratorPrototype%') { - var gen = doEval('%AsyncGenerator%'); - if (gen && getProto) { - value = getProto(gen.prototype); - } - } +/** + * https://dom.spec.whatwg.org/#set-the-canceled-flag + * @param data {PrivateData} private data. + */ +function setCancelFlag(data) { + if (data.passiveListener != null) { + if ( + typeof console !== "undefined" && + typeof console.error === "function" + ) { + console.error( + "Unable to preventDefault inside passive event listener invocation.", + data.passiveListener + ); + } + return + } + if (!data.event.cancelable) { + return + } - INTRINSICS[name] = value; + data.canceled = true; + if (typeof data.event.preventDefault === "function") { + data.event.preventDefault(); + } +} - return value; -}; +/** + * @see https://dom.spec.whatwg.org/#interface-event + * @private + */ +/** + * The event wrapper. + * @constructor + * @param {EventTarget} eventTarget The event target of this dispatching. + * @param {Event|{type:string}} event The original event to wrap. + */ +function Event(eventTarget, event) { + privateData.set(this, { + eventTarget, + event, + eventPhase: 2, + currentTarget: eventTarget, + canceled: false, + stopped: false, + immediateStopped: false, + passiveListener: null, + timeStamp: event.timeStamp || Date.now(), + }); -var LEGACY_ALIASES = { - __proto__: null, - '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], - '%ArrayPrototype%': ['Array', 'prototype'], - '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], - '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], - '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], - '%ArrayProto_values%': ['Array', 'prototype', 'values'], - '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], - '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], - '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], - '%BooleanPrototype%': ['Boolean', 'prototype'], - '%DataViewPrototype%': ['DataView', 'prototype'], - '%DatePrototype%': ['Date', 'prototype'], - '%ErrorPrototype%': ['Error', 'prototype'], - '%EvalErrorPrototype%': ['EvalError', 'prototype'], - '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], - '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], - '%FunctionPrototype%': ['Function', 'prototype'], - '%Generator%': ['GeneratorFunction', 'prototype'], - '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], - '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], - '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], - '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], - '%JSONParse%': ['JSON', 'parse'], - '%JSONStringify%': ['JSON', 'stringify'], - '%MapPrototype%': ['Map', 'prototype'], - '%NumberPrototype%': ['Number', 'prototype'], - '%ObjectPrototype%': ['Object', 'prototype'], - '%ObjProto_toString%': ['Object', 'prototype', 'toString'], - '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], - '%PromisePrototype%': ['Promise', 'prototype'], - '%PromiseProto_then%': ['Promise', 'prototype', 'then'], - '%Promise_all%': ['Promise', 'all'], - '%Promise_reject%': ['Promise', 'reject'], - '%Promise_resolve%': ['Promise', 'resolve'], - '%RangeErrorPrototype%': ['RangeError', 'prototype'], - '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], - '%RegExpPrototype%': ['RegExp', 'prototype'], - '%SetPrototype%': ['Set', 'prototype'], - '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], - '%StringPrototype%': ['String', 'prototype'], - '%SymbolPrototype%': ['Symbol', 'prototype'], - '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], - '%TypedArrayPrototype%': ['TypedArray', 'prototype'], - '%TypeErrorPrototype%': ['TypeError', 'prototype'], - '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], - '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], - '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], - '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], - '%URIErrorPrototype%': ['URIError', 'prototype'], - '%WeakMapPrototype%': ['WeakMap', 'prototype'], - '%WeakSetPrototype%': ['WeakSet', 'prototype'] -}; + // https://heycam.github.io/webidl/#Unforgeable + Object.defineProperty(this, "isTrusted", { value: false, enumerable: true }); -var bind = __nccwpck_require__(37564); -var hasOwn = __nccwpck_require__(54076); -var $concat = bind.call($call, Array.prototype.concat); -var $spliceApply = bind.call($apply, Array.prototype.splice); -var $replace = bind.call($call, String.prototype.replace); -var $strSlice = bind.call($call, String.prototype.slice); -var $exec = bind.call($call, RegExp.prototype.exec); + // Define accessors + const keys = Object.keys(event); + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (!(key in this)) { + Object.defineProperty(this, key, defineRedirectDescriptor(key)); + } + } +} -/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ -var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; -var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ -var stringToPath = function stringToPath(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === '%' && last !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); - } else if (last === '%' && first !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; - }); - return result; -}; -/* end adaptation */ +// Should be enumerable, but class methods are not enumerable. +Event.prototype = { + /** + * The type of this event. + * @type {string} + */ + get type() { + return pd(this).event.type + }, -var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = '%' + alias[0] + '%'; - } + /** + * The target of this event. + * @type {EventTarget} + */ + get target() { + return pd(this).eventTarget + }, - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === 'undefined' && !allowMissing) { - throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); - } + /** + * The target of this event. + * @type {EventTarget} + */ + get currentTarget() { + return pd(this).currentTarget + }, + + /** + * @returns {EventTarget[]} The composed path of this event. + */ + composedPath() { + const currentTarget = pd(this).currentTarget; + if (currentTarget == null) { + return [] + } + return [currentTarget] + }, + + /** + * Constant of NONE. + * @type {number} + */ + get NONE() { + return 0 + }, + + /** + * Constant of CAPTURING_PHASE. + * @type {number} + */ + get CAPTURING_PHASE() { + return 1 + }, + + /** + * Constant of AT_TARGET. + * @type {number} + */ + get AT_TARGET() { + return 2 + }, + + /** + * Constant of BUBBLING_PHASE. + * @type {number} + */ + get BUBBLING_PHASE() { + return 3 + }, - return { - alias: alias, - name: intrinsicName, - value: value - }; - } + /** + * The target of this event. + * @type {number} + */ + get eventPhase() { + return pd(this).eventPhase + }, - throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); -}; + /** + * Stop event bubbling. + * @returns {void} + */ + stopPropagation() { + const data = pd(this); -module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== 'string' || name.length === 0) { - throw new $TypeError('intrinsic name must be a non-empty string'); - } - if (arguments.length > 1 && typeof allowMissing !== 'boolean') { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } + data.stopped = true; + if (typeof data.event.stopPropagation === "function") { + data.event.stopPropagation(); + } + }, - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + /** + * Stop event bubbling. + * @returns {void} + */ + stopImmediatePropagation() { + const data = pd(this); - var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; + data.stopped = true; + data.immediateStopped = true; + if (typeof data.event.stopImmediatePropagation === "function") { + data.event.stopImmediatePropagation(); + } + }, - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } + /** + * The flag to be bubbling. + * @type {boolean} + */ + get bubbles() { + return Boolean(pd(this).event.bubbles) + }, - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - ( - (first === '"' || first === "'" || first === '`') - || (last === '"' || last === "'" || last === '`') - ) - && first !== last - ) { - throw new $SyntaxError('property names with quotes must have matching quotes'); - } - if (part === 'constructor' || !isOwn) { - skipFurtherCaching = true; - } + /** + * The flag to be cancelable. + * @type {boolean} + */ + get cancelable() { + return Boolean(pd(this).event.cancelable) + }, - intrinsicBaseName += '.' + part; - intrinsicRealName = '%' + intrinsicBaseName + '%'; + /** + * Cancel this event. + * @returns {void} + */ + preventDefault() { + setCancelFlag(pd(this)); + }, - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); - } - return void undefined; - } - if ($gOPD && (i + 1) >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; + /** + * The flag to indicate cancellation state. + * @type {boolean} + */ + get defaultPrevented() { + return pd(this).canceled + }, - // By convention, when a data property is converted to an accessor - // property to emulate a data property that does not suffer from - // the override mistake, that accessor's getter is marked with - // an `originalValue` property. Here, when we detect this, we - // uphold the illusion by pretending to see that original data - // property, i.e., returning the value rather than the getter - // itself. - if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } + /** + * The flag to be composed. + * @type {boolean} + */ + get composed() { + return Boolean(pd(this).event.composed) + }, - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; -}; + /** + * The unix time of this event. + * @type {number} + */ + get timeStamp() { + return pd(this).timeStamp + }, + /** + * The target of this event. + * @type {EventTarget} + * @deprecated + */ + get srcElement() { + return pd(this).eventTarget + }, -/***/ }), + /** + * The flag to stop event bubbling. + * @type {boolean} + * @deprecated + */ + get cancelBubble() { + return pd(this).stopped + }, + set cancelBubble(value) { + if (!value) { + return + } + const data = pd(this); -/***/ 91311: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + data.stopped = true; + if (typeof data.event.cancelBubble === "boolean") { + data.event.cancelBubble = true; + } + }, -"use strict"; + /** + * The flag to indicate cancellation state. + * @type {boolean} + * @deprecated + */ + get returnValue() { + return !pd(this).canceled + }, + set returnValue(value) { + if (!value) { + setCancelFlag(pd(this)); + } + }, + /** + * Initialize this event object. But do nothing under event dispatching. + * @param {string} type The event type. + * @param {boolean} [bubbles=false] The flag to be possible to bubble up. + * @param {boolean} [cancelable=false] The flag to be possible to cancel. + * @deprecated + */ + initEvent() { + // Do nothing. + }, +}; -var $Object = __nccwpck_require__(95399); +// `constructor` is not enumerable. +Object.defineProperty(Event.prototype, "constructor", { + value: Event, + configurable: true, + writable: true, +}); -/** @type {import('./Object.getPrototypeOf')} */ -module.exports = $Object.getPrototypeOf || null; +// Ensure `event instanceof window.Event` is `true`. +if (typeof window !== "undefined" && typeof window.Event !== "undefined") { + Object.setPrototypeOf(Event.prototype, window.Event.prototype); + // Make association for wrappers. + wrappers.set(window.Event.prototype, Event); +} -/***/ }), +/** + * Get the property descriptor to redirect a given property. + * @param {string} key Property name to define property descriptor. + * @returns {PropertyDescriptor} The property descriptor to redirect the property. + * @private + */ +function defineRedirectDescriptor(key) { + return { + get() { + return pd(this).event[key] + }, + set(value) { + pd(this).event[key] = value; + }, + configurable: true, + enumerable: true, + } +} -/***/ 48681: -/***/ ((module) => { +/** + * Get the property descriptor to call a given method property. + * @param {string} key Property name to define property descriptor. + * @returns {PropertyDescriptor} The property descriptor to call the method property. + * @private + */ +function defineCallDescriptor(key) { + return { + value() { + const event = pd(this).event; + return event[key].apply(event, arguments) + }, + configurable: true, + enumerable: true, + } +} -"use strict"; +/** + * Define new wrapper class. + * @param {Function} BaseEvent The base wrapper class. + * @param {Object} proto The prototype of the original event. + * @returns {Function} The defined wrapper class. + * @private + */ +function defineWrapper(BaseEvent, proto) { + const keys = Object.keys(proto); + if (keys.length === 0) { + return BaseEvent + } + /** CustomEvent */ + function CustomEvent(eventTarget, event) { + BaseEvent.call(this, eventTarget, event); + } -/** @type {import('./Reflect.getPrototypeOf')} */ -module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; + CustomEvent.prototype = Object.create(BaseEvent.prototype, { + constructor: { value: CustomEvent, configurable: true, writable: true }, + }); + // Define accessors. + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (!(key in BaseEvent.prototype)) { + const descriptor = Object.getOwnPropertyDescriptor(proto, key); + const isFunc = typeof descriptor.value === "function"; + Object.defineProperty( + CustomEvent.prototype, + key, + isFunc + ? defineCallDescriptor(key) + : defineRedirectDescriptor(key) + ); + } + } -/***/ }), + return CustomEvent +} -/***/ 81967: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Get the wrapper class of a given prototype. + * @param {Object} proto The prototype of the original event to get its wrapper. + * @returns {Function} The wrapper class. + * @private + */ +function getWrapper(proto) { + if (proto == null || proto === Object.prototype) { + return Event + } -"use strict"; + let wrapper = wrappers.get(proto); + if (wrapper == null) { + wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); + wrappers.set(proto, wrapper); + } + return wrapper +} +/** + * Wrap a given event to management a dispatching. + * @param {EventTarget} eventTarget The event target of this dispatching. + * @param {Object} event The event to wrap. + * @returns {Event} The wrapper instance. + * @private + */ +function wrapEvent(eventTarget, event) { + const Wrapper = getWrapper(Object.getPrototypeOf(event)); + return new Wrapper(eventTarget, event) +} -var reflectGetProto = __nccwpck_require__(48681); -var originalGetProto = __nccwpck_require__(91311); +/** + * Get the immediateStopped flag of a given event. + * @param {Event} event The event to get. + * @returns {boolean} The flag to stop propagation immediately. + * @private + */ +function isStopped(event) { + return pd(event).immediateStopped +} -var getDunderProto = __nccwpck_require__(26669); +/** + * Set the current event phase of a given event. + * @param {Event} event The event to set current target. + * @param {number} eventPhase New event phase. + * @returns {void} + * @private + */ +function setEventPhase(event, eventPhase) { + pd(event).eventPhase = eventPhase; +} -/** @type {import('.')} */ -module.exports = reflectGetProto - ? function getProto(O) { - // @ts-expect-error TS can't narrow inside a closure, for some reason - return reflectGetProto(O); - } - : originalGetProto - ? function getProto(O) { - if (!O || (typeof O !== 'object' && typeof O !== 'function')) { - throw new TypeError('getProto: not an object'); - } - // @ts-expect-error TS can't narrow inside a closure, for some reason - return originalGetProto(O); - } - : getDunderProto - ? function getProto(O) { - // @ts-expect-error TS can't narrow inside a closure, for some reason - return getDunderProto(O); - } - : null; +/** + * Set the current target of a given event. + * @param {Event} event The event to set current target. + * @param {EventTarget|null} currentTarget New current target. + * @returns {void} + * @private + */ +function setCurrentTarget(event, currentTarget) { + pd(event).currentTarget = currentTarget; +} +/** + * Set a passive listener of a given event. + * @param {Event} event The event to set current target. + * @param {Function|null} passiveListener New passive listener. + * @returns {void} + * @private + */ +function setPassiveListener(event, passiveListener) { + pd(event).passiveListener = passiveListener; +} -/***/ }), +/** + * @typedef {object} ListenerNode + * @property {Function} listener + * @property {1|2|3} listenerType + * @property {boolean} passive + * @property {boolean} once + * @property {ListenerNode|null} next + * @private + */ -/***/ 32541: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * @type {WeakMap>} + * @private + */ +const listenersMap = new WeakMap(); -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored +// Listener types +const CAPTURE = 1; +const BUBBLE = 2; +const ATTRIBUTE = 3; -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) +/** + * Check whether a given value is an object or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an object. + */ +function isObject(x) { + return x !== null && typeof x === "object" //eslint-disable-line no-restricted-syntax } -var fs = __nccwpck_require__(79896) -var path = __nccwpck_require__(16928) -var minimatch = __nccwpck_require__(43772) -var isAbsolute = __nccwpck_require__(19024) -var Minimatch = minimatch.Minimatch - -function alphasort (a, b) { - return a.localeCompare(b, 'en') +/** + * Get listeners. + * @param {EventTarget} eventTarget The event target to get. + * @returns {Map} The listeners. + * @private + */ +function getListeners(eventTarget) { + const listeners = listenersMap.get(eventTarget); + if (listeners == null) { + throw new TypeError( + "'this' is expected an EventTarget object, but got another value." + ) + } + return listeners } -function setupIgnores (self, options) { - self.ignore = options.ignore || [] +/** + * Get the property descriptor for the event attribute of a given event. + * @param {string} eventName The event name to get property descriptor. + * @returns {PropertyDescriptor} The property descriptor. + * @private + */ +function defineEventAttributeDescriptor(eventName) { + return { + get() { + const listeners = getListeners(this); + let node = listeners.get(eventName); + while (node != null) { + if (node.listenerType === ATTRIBUTE) { + return node.listener + } + node = node.next; + } + return null + }, + + set(listener) { + if (typeof listener !== "function" && !isObject(listener)) { + listener = null; // eslint-disable-line no-param-reassign + } + const listeners = getListeners(this); + + // Traverse to the tail while removing old value. + let prev = null; + let node = listeners.get(eventName); + while (node != null) { + if (node.listenerType === ATTRIBUTE) { + // Remove old value. + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + } else { + prev = node; + } - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] + node = node.next; + } - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } + // Add new value. + if (listener !== null) { + const newNode = { + listener, + listenerType: ATTRIBUTE, + passive: false, + once: false, + next: null, + }; + if (prev === null) { + listeners.set(eventName, newNode); + } else { + prev.next = newNode; + } + } + }, + configurable: true, + enumerable: true, + } } -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } +/** + * Define an event attribute (e.g. `eventTarget.onclick`). + * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite. + * @param {string} eventName The event name to define. + * @returns {void} + */ +function defineEventAttribute(eventTargetPrototype, eventName) { + Object.defineProperty( + eventTargetPrototype, + `on${eventName}`, + defineEventAttributeDescriptor(eventName) + ); +} - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - self.fs = options.fs || fs - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - // always treat \ in patterns as escapes, not path separators - options.allowWindowsEscape = false - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) +/** + * Define a custom EventTarget with event attributes. + * @param {string[]} eventNames Event names for event attributes. + * @returns {EventTarget} The custom EventTarget. + * @private + */ +function defineCustomEventTarget(eventNames) { + /** CustomEventTarget */ + function CustomEventTarget() { + EventTarget.call(this); } - } - if (!nou) - all = Object.keys(all) + CustomEventTarget.prototype = Object.create(EventTarget.prototype, { + constructor: { + value: CustomEventTarget, + configurable: true, + writable: true, + }, + }); + + for (let i = 0; i < eventNames.length; ++i) { + defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); + } - if (!self.nosort) - all = all.sort(alphasort) + return CustomEventTarget +} - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) +/** + * EventTarget. + * + * - This is constructor if no arguments. + * - This is a function which returns a CustomEventTarget constructor if there are arguments. + * + * For example: + * + * class A extends EventTarget {} + * class B extends EventTarget("message") {} + * class C extends EventTarget("message", "error") {} + * class D extends EventTarget(["message", "error"]) {} + */ +function EventTarget() { + /*eslint-disable consistent-return */ + if (this instanceof EventTarget) { + listenersMap.set(this, new Map()); + return } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) + if (arguments.length === 1 && Array.isArray(arguments[0])) { + return defineCustomEventTarget(arguments[0]) } - } + if (arguments.length > 0) { + const types = new Array(arguments.length); + for (let i = 0; i < arguments.length; ++i) { + types[i] = arguments[i]; + } + return defineCustomEventTarget(types) + } + throw new TypeError("Cannot call a class as a function") + /*eslint-enable consistent-return */ +} - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) +// Should be enumerable, but class methods are not enumerable. +EventTarget.prototype = { + /** + * Add a given listener to this event target. + * @param {string} eventName The event name to add. + * @param {Function} listener The listener to add. + * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. + * @returns {void} + */ + addEventListener(eventName, listener, options) { + if (listener == null) { + return + } + if (typeof listener !== "function" && !isObject(listener)) { + throw new TypeError("'listener' should be a function or an object.") + } + + const listeners = getListeners(this); + const optionsIsObj = isObject(options); + const capture = optionsIsObj + ? Boolean(options.capture) + : Boolean(options); + const listenerType = capture ? CAPTURE : BUBBLE; + const newNode = { + listener, + listenerType, + passive: optionsIsObj && Boolean(options.passive), + once: optionsIsObj && Boolean(options.once), + next: null, + }; - self.found = all -} + // Set it as the first node if the first node is null. + let node = listeners.get(eventName); + if (node === undefined) { + listeners.set(eventName, newNode); + return + } + + // Traverse to the tail while checking duplication.. + let prev = null; + while (node != null) { + if ( + node.listener === listener && + node.listenerType === listenerType + ) { + // Should ignore duplication. + return + } + prev = node; + node = node.next; + } -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' + // Add it. + prev.next = newNode; + }, - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) + /** + * Remove a given listener from this event target. + * @param {string} eventName The event name to remove. + * @param {Function} listener The listener to remove. + * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. + * @returns {void} + */ + removeEventListener(eventName, listener, options) { + if (listener == null) { + return + } - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } + const listeners = getListeners(this); + const capture = isObject(options) + ? Boolean(options.capture) + : Boolean(options); + const listenerType = capture ? CAPTURE : BUBBLE; + + let prev = null; + let node = listeners.get(eventName); + while (node != null) { + if ( + node.listener === listener && + node.listenerType === listenerType + ) { + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + return + } - return m -} + prev = node; + node = node.next; + } + }, -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } + /** + * Dispatch a given event. + * @param {Event|{type:string}} event The event to dispatch. + * @returns {boolean} `false` if canceled. + */ + dispatchEvent(event) { + if (event == null || typeof event.type !== "string") { + throw new TypeError('"event.type" should be a string.') + } - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') + // If listeners aren't registered, terminate. + const listeners = getListeners(this); + const eventName = event.type; + let node = listeners.get(eventName); + if (node == null) { + return true + } - return abs -} + // Since we cannot rewrite several properties, so wrap object. + const wrappedEvent = wrapEvent(this, event); + // This doesn't process capturing phase and bubbling phase. + // This isn't participating in a tree. + let prev = null; + while (node != null) { + // Remove this listener if it's once + if (node.once) { + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + } else { + prev = node; + } -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false + // Call this listener + setPassiveListener( + wrappedEvent, + node.passive ? node.listener : null + ); + if (typeof node.listener === "function") { + try { + node.listener.call(this, wrappedEvent); + } catch (err) { + if ( + typeof console !== "undefined" && + typeof console.error === "function" + ) { + console.error(err); + } + } + } else if ( + node.listenerType !== ATTRIBUTE && + typeof node.listener.handleEvent === "function" + ) { + node.listener.handleEvent(wrappedEvent); + } - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} + // Break if `event.stopImmediatePropagation` was called. + if (isStopped(wrappedEvent)) { + break + } -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false + node = node.next; + } + setPassiveListener(wrappedEvent, null); + setEventPhase(wrappedEvent, 0); + setCurrentTarget(wrappedEvent, null); - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) + return !wrappedEvent.defaultPrevented + }, +}; + +// `constructor` is not enumerable. +Object.defineProperty(EventTarget.prototype, "constructor", { + value: EventTarget, + configurable: true, + writable: true, +}); + +// Ensure `eventTarget instanceof window.EventTarget` is `true`. +if ( + typeof window !== "undefined" && + typeof window.EventTarget !== "undefined" +) { + Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype); } +exports.defineEventAttribute = defineEventAttribute; +exports.EventTarget = EventTarget; +exports["default"] = EventTarget; + +module.exports = EventTarget +module.exports.EventTarget = module.exports["default"] = EventTarget +module.exports.defineEventAttribute = defineEventAttribute +//# sourceMappingURL=event-target-shim.js.map + /***/ }), -/***/ 33574: +/***/ 29580: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var rp = __nccwpck_require__(29728) -var minimatch = __nccwpck_require__(43772) -var Minimatch = minimatch.Minimatch -var inherits = __nccwpck_require__(39598) -var EE = (__nccwpck_require__(24434).EventEmitter) -var path = __nccwpck_require__(16928) -var assert = __nccwpck_require__(42613) -var isAbsolute = __nccwpck_require__(19024) -var globSync = __nccwpck_require__(39795) -var common = __nccwpck_require__(32541) -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __nccwpck_require__(33176) -var util = __nccwpck_require__(39023) -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored +module.exports = __nccwpck_require__(24434) + -var once = __nccwpck_require__(55560) +/***/ }), -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} +/***/ 13587: +/***/ ((module) => { - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) +module.exports = class FixedFIFO { + constructor (hwm) { + if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) throw new Error('Max size for a FixedFIFO should be a power of two') + this.buffer = new Array(hwm) + this.mask = hwm - 1 + this.top = 0 + this.btm = 0 + this.next = null } - return new Glob(pattern, options, cb) -} + clear () { + this.top = this.btm = 0 + this.next = null + this.buffer.fill(undefined) + } -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync + push (data) { + if (this.buffer[this.top] !== undefined) return false + this.buffer[this.top] = data + this.top = (this.top + 1) & this.mask + return true + } -// old api surface -glob.glob = glob + shift () { + const last = this.buffer[this.btm] + if (last === undefined) return undefined + this.buffer[this.btm] = undefined + this.btm = (this.btm + 1) & this.mask + return last + } -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin + peek () { + return this.buffer[this.btm] } - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] + isEmpty () { + return this.buffer[this.btm] === undefined } - return origin } -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - var g = new Glob(pattern, options) - var set = g.minimatch.set +/***/ }), - if (!pattern) - return false +/***/ 83867: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (set.length > 1) - return true +const FixedFIFO = __nccwpck_require__(13587) - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true +module.exports = class FastFIFO { + constructor (hwm) { + this.hwm = hwm || 16 + this.head = new FixedFIFO(this.hwm) + this.tail = this.head + this.length = 0 } - return false -} + clear () { + this.head = this.tail + this.head.clear() + this.length = 0 + } + + push (val) { + this.length++ + if (!this.head.push(val)) { + const prev = this.head + this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length) + this.head.push(val) + } + } + + shift () { + if (this.length !== 0) this.length-- + const val = this.tail.shift() + if (val === undefined && this.tail.next) { + const next = this.tail.next + this.tail.next = null + this.tail = next + return this.tail.shift() + } -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null + return val } - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) + peek () { + const val = this.tail.peek() + if (val === undefined && this.tail.next) return this.tail.next.peek() + return val } - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) + isEmpty () { + return this.length === 0 + } +} - setopts(this, pattern, options) - this._didRealPath = false - // process each pattern in the minimatch set - var n = this.minimatch.set.length +/***/ }), - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) +/***/ 34778: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) +var debug; + +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = __nccwpck_require__(2830)("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; + } } + debug.apply(null, arguments); +}; - var self = this - this._processing = 0 - this._emitQueue = [] - this._processQueue = [] - this.paused = false +/***/ }), - if (this.noprocess) - return this +/***/ 1573: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (n === 0) - return done() +var url = __nccwpck_require__(87016); +var URL = url.URL; +var http = __nccwpck_require__(58611); +var https = __nccwpck_require__(65692); +var Writable = (__nccwpck_require__(2203).Writable); +var assert = __nccwpck_require__(42613); +var debug = __nccwpck_require__(34778); - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) +// Preventive platform detection +// istanbul ignore next +(function detectUnsupportedEnvironment() { + var looksLikeNode = typeof process !== "undefined"; + var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var looksLikeV8 = isFunction(Error.captureStackTrace); + if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { + console.warn("The follow-redirects package should be excluded from browser builds."); } - sync = false +}()); - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } +// Whether to use the native URL object or the legacy url module +var useNativeURL = false; +try { + assert(new URL("")); +} +catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; } -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() +// HTTP headers to drop across HTTP/HTTPS and domain boundaries +var sensitiveHeaders = [ + "Authorization", + "Proxy-Authorization", + "Cookie", +]; - common.finish(this) - this.emit('end', this.found) -} +// URL fields to preserve in copy operations +var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash", +]; -Glob.prototype._realpath = function () { - if (this._didRealpath) - return +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); - this._didRealpath = true +// Error types with codes +var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError +); +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded", + RedirectionError +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); - var n = this.matches.length - if (n === 0) - return this._finish() +// istanbul ignore next +var destroy = Writable.prototype.destroy || noop; - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; - function next () { - if (--n === 0) - self._finish() + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + try { + self._processResponse(response); + } + catch (cause) { + self.emit("error", cause instanceof RedirectionError ? + cause : new RedirectionError({ cause: cause })); + } + }; - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here + // Create filter for sensitive HTTP headers + this._headerFilter = new RegExp("^(?:" + + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + + ")$", "i"); - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) + // Perform the first request + this._performRequest(); } +RedirectableRequest.prototype = Object.create(Writable.prototype); -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} +RedirectableRequest.prototype.abort = function () { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); +}; -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} +RedirectableRequest.prototype.destroy = function (error) { + destroyRequest(this._currentRequest, error); + destroy.call(this, error); + return this; +}; -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); + } -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') + // Validate input and shift parameters if necessary + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; } -} -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); } + return; } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break +}; - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (isFunction(data)) { + callback = data; + data = encoding = null; + } + else if (isFunction(encoding)) { + callback = encoding; + encoding = null; } - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } +}; -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); } - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; } - // This was the last one, and no stats were needed - return cb() - } - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + self.removeListener("close", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); } - this._process([e].concat(remain), index, inGlobStar, cb) } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - if (isIgnored(this, e)) - return + // Attach callback if passed + if (callback) { + this.on("timeout", callback); + } - if (this.paused) { - this._emitQueue.push([index, e]) - return + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); } - var abs = isAbsolute(e) ? e : this._makeAbs(e) + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + this.on("close", clearTimer); - if (this.mark) - e = this._mark(e) + return this; +}; - if (this.absolute) - e = abs +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); - if (this.matches[index][e]) - return +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } + if (!isArray(options.sensitiveHeaders)) { + options.sensitiveHeaders = []; } - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; + } -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } +}; - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); + } - if (lstatcb) - self.fs.lstat(abs, lstatcb) + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() + // Create the native request and set up its event handlers + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym + // RFC7230§5.3.1: When making a request directly to an origin server, […] + // a client MUST send only the absolute path […] as the request-target. + this._currentUrl = /^\//.test(this._options.path) ? + url.format(this._options) : + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._options.path; - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + // istanbul ignore else + if (request === self._currentRequest) { + // Report any write errors + // istanbul ignore if + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + // istanbul ignore else + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } + } + }()); } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return +}; - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); - if (Array.isArray(c)) - return cb(null, c) + // Clean up + this._requestBodyBuffers = []; + return; } - var self = this - self.fs.readdir(abs, readdirCb(this, abs, cb)) -} + // The response is a redirect, so abort the current request + destroyRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); } - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); } - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) + // Create the redirected request + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); + this._isRedirect = true; + spreadUrlObject(redirectUrl, this._options); - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrl.protocol !== currentUrlParts.protocol && + redirectUrl.protocol !== "https:" || + redirectUrl.host !== currentHost && + !isSubdomain(redirectUrl.host, currentHost)) { + removeMatchingHeaders(this._headerFilter, this._options.headers); + } - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) + // Evaluate the beforeRedirect callback + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + beforeRedirect(this._options, responseDetails, requestDetails); + this._sanitizeOptions(this._options); + } - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) + // Perform the redirected request + this._performRequest(); +}; - var isSym = this.symlinks[abs] - var len = entries.length +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() + // Wrap each protocol + var nativeProtocols = {}; + Object.keys(protocols).forEach(function (scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue + // Executes a request, following redirects + function request(input, options, callback) { + // Parse parameters, ensuring that input is an object + if (isURL(input)) { + input = spreadUrlObject(input); + } + else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } + else { + callback = options; + options = validateUrl(input); + input = { protocol: protocol }; + } + if (isFunction(options)) { + callback = options; + options = null; + } - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) + // Set defaults + options = Object.assign({ + maxRedirects: exports.maxRedirects, + maxBodyLength: exports.maxBodyLength, + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; + } - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } - cb() -} + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; } -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() +function noop() { /* empty */ } - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' +function parseUrl(input) { + var parsed; + // istanbul ignore else + if (useNativeURL) { + parsed = new URL(input); + } + else { + // Ensure the URL is valid and absolute + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); } } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() + return parsed; } -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) +function resolveUrl(relative, base) { + // istanbul ignore next + return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); +} - if (needDir && c === 'FILE') - return cb() +function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); + } + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; +} - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. +function spreadUrlObject(urlObject, target) { + var spread = target || {}; + for (var key of preservedUrlFields) { + spread[key] = urlObject[key]; } - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } + // Fix IPv6 hostname + if (spread.hostname.startsWith("[")) { + spread.hostname = spread.hostname.slice(1, -1); + } + // Ensure port is a number + if (spread.port !== "") { + spread.port = Number(spread.port); } + // Concatenate path + spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - self.fs.lstat(abs, statcb) + return spread; +} - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return self.fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; } } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); } -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() +function createErrorType(code, message, baseClass) { + // Create constructor + function CustomError(properties) { + // istanbul ignore else + if (isFunction(Error.captureStackTrace)) { + Error.captureStackTrace(this, this.constructor); + } + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; } - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) + // Attach constructor and set default properties + CustomError.prototype = new (baseClass || Error)(); + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false, + }, + name: { + value: "Error [" + code + "]", + enumerable: false, + }, + }); + return CustomError; } - -/***/ }), - -/***/ 39795: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = globSync -globSync.GlobSync = GlobSync - -var rp = __nccwpck_require__(29728) -var minimatch = __nccwpck_require__(43772) -var Minimatch = minimatch.Minimatch -var Glob = (__nccwpck_require__(33574).Glob) -var util = __nccwpck_require__(39023) -var path = __nccwpck_require__(16928) -var assert = __nccwpck_require__(42613) -var isAbsolute = __nccwpck_require__(19024) -var common = __nccwpck_require__(32541) -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found +function destroyRequest(request, error) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error); } -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) +function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} - if (this.noprocess) - return this +function isArray(value) { + return value instanceof Array; +} - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() +function isString(value) { + return typeof value === "string" || value instanceof String; } -GlobSync.prototype._finish = function () { - assert.ok(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) +function isFunction(value) { + return typeof value === "function"; } +function isBuffer(value) { + return typeof value === "object" && ("length" in value); +} -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert.ok(this instanceof GlobSync) +function isURL(value) { + return URL && value instanceof URL; +} - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. +function escapeRegex(regex) { + return regex.replace(/[\]\\/()*+?.$]/g, "\\$&"); +} - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return +// Exports +module.exports = wrap({ http: http, https: https }); +module.exports.wrap = wrap; - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } +/***/ }), - var remain = pattern.slice(n) +/***/ 96454: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix +"use strict"; - var abs = this._makeAbs(read) - //if ignored, skip processing - if (childrenIgnored(this, read)) - return +var CombinedStream = __nccwpck_require__(35630); +var util = __nccwpck_require__(39023); +var path = __nccwpck_require__(16928); +var http = __nccwpck_require__(58611); +var https = __nccwpck_require__(65692); +var parseUrl = (__nccwpck_require__(87016).parse); +var fs = __nccwpck_require__(79896); +var Stream = (__nccwpck_require__(2203).Stream); +var crypto = __nccwpck_require__(76982); +var mime = __nccwpck_require__(14096); +var asynckit = __nccwpck_require__(31324); +var setToStringTag = __nccwpck_require__(88700); +var hasOwn = __nccwpck_require__(54076); +var populate = __nccwpck_require__(11835); - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +/** + * Escape CR, LF, and `"` in a multipart `name`/`filename` parameter, so a field + * name or filename can not break out of its header line to inject headers or + * smuggle additional parts. Matches the WHATWG HTML multipart/form-data encoding. + * + * @param {string} str - the parameter value to escape + * @returns {string} the escaped value + */ +function escapeHeaderParam(str) { + return String(str).replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/"/g, '%22'); } - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); } - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } + CombinedStream.call(this); - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) + options = options || {}; // eslint-disable-line no-param-reassign + for (var option in options) { // eslint-disable-line no-restricted-syntax + this[option] = options[option]; } } +// make it a Stream +util.inherits(FormData, CombinedStream); -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; - if (this.mark) - e = this._mark(e) +FormData.prototype.append = function (field, value, options) { + options = options || {}; // eslint-disable-line no-param-reassign - if (this.absolute) { - e = abs + // allow filename as single option + if (typeof options === 'string') { + options = { filename: options }; // eslint-disable-line no-param-reassign } - if (this.matches[index][e]) - return + var append = CombinedStream.prototype.append.bind(this); - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return + // all that streamy business can't handle numbers + if (typeof value === 'number' || value == null) { + value = String(value); // eslint-disable-line no-param-reassign } - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } + // https://github.com/felixge/node-form-data/issues/38 + if (Array.isArray(value)) { + /* + * Please convert your array into string + * the way web server expects it + */ + this._error(new Error('Arrays are not supported.')); + return; } - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null + append(header); + append(value); + append(footer); - if (Array.isArray(c)) - return c - } + // pass along options.knownLength + this._trackLength(header, value, options); +}; - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} +FormData.prototype._trackLength = function (header, value, options) { + var valueLength = 0; -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } + /* + * used w/ getLengthSync(), when length is known. + * e.g. for streaming directly from a remote server, + * w/ a known file a size, and not wanting to wait for + * incoming file to finish to get its size. + */ + if (options.knownLength != null) { + valueLength += Number(options.knownLength); + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); } - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break + this._valueLength += valueLength; - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length; - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break + // empty or either doesn't have path or not an http response or not a stream + if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) { + return; } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) +}; - // If it doesn't exist, then just mark the lack of results - if (!exists) - return +FormData.prototype._lengthRetriever = function (value, callback) { + if (hasOwn(value, 'fd')) { + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) + // not that fast snoopy } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' + // still need to fetch file size from fs + fs.stat(value.path, function (err, stat) { + if (err) { + callback(err); + return; + } + + // update final size based on the range options + var fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); } - } - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') + // or http response + } else if (hasOwn(value, 'httpVersion')) { + callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return - // Mark this as a match - this._emitMatch(index, prefix) -} + // or request stream http://github.com/mikeal/request + } else if (hasOwn(value, 'httpModule')) { + // wait till response come back + value.on('response', function (response) { + value.pause(); + callback(null, Number(response.headers['content-length'])); + }); + value.resume(); -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' + // something else + } else { + callback('Unknown stream'); // eslint-disable-line callback-return + } +}; - if (f.length > this.maxLength) - return false +FormData.prototype._multiPartHeader = function (field, value, options) { + /* + * custom header specified (as string)? + * it becomes responsible for boundary + * (e.g. to handle extra CRLFs on .NET servers) + */ + if (typeof options.header === 'string') { + return options.header; + } - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); - if (Array.isArray(c)) - c = 'DIR' + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c + // allow custom headers. + if (typeof options.header === 'object') { + populate(headers, options.header); + } - if (needDir && c === 'FILE') - return false + var header; + for (var prop in headers) { // eslint-disable-line no-restricted-syntax + if (hasOwn(headers, prop)) { + header = headers[prop]; - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } + // skip nullish headers. + if (header == null) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; } - } - if (lstat && lstat.isSymbolicLink()) { - try { - stat = this.fs.statSync(abs) - } catch (er) { - stat = lstat + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; } - } else { - stat = lstat } } - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - - -/***/ }), - -/***/ 1174: -/***/ ((module) => { - -"use strict"; - - -/** @type {import('./gOPD')} */ -module.exports = Object.getOwnPropertyDescriptor; - - -/***/ }), + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; -/***/ 33170: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return + var filename; -"use strict"; + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || (value && (value.name || value.path))) { + /* + * custom filename take precedence + * formidable and the browser add a name property + * fs- and request- streams have path property + */ + filename = path.basename(options.filename || (value && (value.name || value.path))); + } else if (value && value.readable && hasOwn(value, 'httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); + } + if (filename) { + return 'filename="' + escapeHeaderParam(filename) + '"'; + } +}; -/** @type {import('.')} */ -var $gOPD = __nccwpck_require__(1174); +FormData.prototype._getContentType = function (value, options) { + // use custom content-type above all + var contentType = options.contentType; -if ($gOPD) { - try { - $gOPD([], 'length'); - } catch (e) { - // IE 8 has a broken gOPD - $gOPD = null; - } -} + // or try `name` from formidable, browser + if (!contentType && value && value.name) { + contentType = mime.lookup(value.name); + } -module.exports = $gOPD; + // or try `path` from fs-, request- streams + if (!contentType && value && value.path) { + contentType = mime.lookup(value.path); + } + // or if it's http-reponse + if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) { + contentType = value.headers['content-type']; + } -/***/ }), + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } -/***/ 73964: -/***/ ((module) => { + // fallback to the default content type if `value` is not simple value + if (!contentType && value && typeof value === 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } -"use strict"; + return contentType; +}; +FormData.prototype._multiPartFooter = function () { + return function (next) { + var footer = FormData.LINE_BREAK; -module.exports = clone + var lastPart = this._streams.length === 0; + if (lastPart) { + footer += this._lastBoundary(); + } -var getPrototypeOf = Object.getPrototypeOf || function (obj) { - return obj.__proto__ -} + next(footer); + }.bind(this); +}; -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj +FormData.prototype._lastBoundary = function () { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) } - else - var copy = Object.create(null) +FormData.prototype.getHeaders = function (userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) + for (header in userHeaders) { // eslint-disable-line no-restricted-syntax + if (hasOwn(userHeaders, header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } - return copy -} + return formHeaders; +}; +FormData.prototype.setBoundary = function (boundary) { + if (typeof boundary !== 'string') { + throw new TypeError('FormData boundary must be a string'); + } + this._boundary = boundary; +}; -/***/ }), +FormData.prototype.getBoundary = function () { + if (!this._boundary) { + this._generateBoundary(); + } -/***/ 35744: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return this._boundary; +}; -var fs = __nccwpck_require__(79896) -var polyfills = __nccwpck_require__(83501) -var legacy = __nccwpck_require__(12270) -var clone = __nccwpck_require__(73964) +FormData.prototype.getBuffer = function () { + var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap + var boundary = this.getBoundary(); -var util = __nccwpck_require__(39023) + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { + // Add content to the buffer. + if (Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); + } else { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); + } -/* istanbul ignore next - node 0.x polyfill */ -var gracefulQueue -var previousSymbol + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]); + } + } + } -/* istanbul ignore else - node 0.x polyfill */ -if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { - gracefulQueue = Symbol.for('graceful-fs.queue') - // This is used in testing by future versions - previousSymbol = Symbol.for('graceful-fs.previous') -} else { - gracefulQueue = '___graceful-fs.queue' - previousSymbol = '___graceful-fs.previous' -} + // Add the footer and return the Buffer object. + return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); +}; -function noop () {} +FormData.prototype._generateBoundary = function () { + // This generates a 50 character boundary similar to those used by Firefox. -function publishQueue(context, queue) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue - } - }) -} + // They are optimized for boyer-moore parsing. + this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex'); +}; -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually and add it as knownLength option +FormData.prototype.getLengthSync = function () { + var knownLength = this._overheadLength + this._valueLength; + + // Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; } -// Once time initialization -if (!fs[gracefulQueue]) { - // This queue can be shared by multiple loaded instances - var queue = global[gracefulQueue] || [] - publishQueue(fs, queue) + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + /* + * Some async length retrievers are present + * therefore synchronous length calculation is false. + * Please use getLength(callback) to get proper length + */ + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } - // Patch fs.close/closeSync to shared queue version, because we need - // to retry() whenever a close happens *anywhere* in the program. - // This is essential when multiple graceful-fs instances are - // in play at the same time. - fs.close = (function (fs$close) { - function close (fd, cb) { - return fs$close.call(fs, fd, function (err) { - // This function uses the graceful-fs shared queue - if (!err) { - resetQueue() - } + return knownLength; +}; - if (typeof cb === 'function') - cb.apply(this, arguments) - }) - } +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function () { + var hasKnownLength = true; - Object.defineProperty(close, previousSymbol, { - value: fs$close - }) - return close - })(fs.close) + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } - fs.closeSync = (function (fs$closeSync) { - function closeSync (fd) { - // This function uses the graceful-fs shared queue - fs$closeSync.apply(fs, arguments) - resetQueue() - } + return hasKnownLength; +}; - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }) - return closeSync - })(fs.closeSync) +FormData.prototype.getLength = function (cb) { + var knownLength = this._overheadLength + this._valueLength; - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(fs[gracefulQueue]) - __nccwpck_require__(42613).equal(fs[gracefulQueue].length, 0) - }) + if (this._streams.length) { + knownLength += this._lastBoundary().length; } -} -if (!global[gracefulQueue]) { - publishQueue(global, fs[gracefulQueue]); -} + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } -module.exports = patch(clone(fs)) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { - module.exports = patch(fs) - fs.__patched = true; -} + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) { + if (err) { + cb(err); + return; + } -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch + values.forEach(function (length) { + knownLength += length; + }); - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null + cb(null, knownLength); + }); +}; - return go$readFile(path, options, cb) +FormData.prototype.submit = function (params, cb) { + var request; + var options; + var defaults = { method: 'post' }; - function go$readFile (path, options, cb, startTime) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) + // parse provided url if it's string or treat it as options object + if (typeof params === 'string') { + params = parseUrl(params); // eslint-disable-line no-param-reassign + /* eslint sort-keys: 0 */ + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + } else { // use custom params + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol === 'https:' ? 443 : 80; } } - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); - return go$writeFile(path, data, options, cb) + // https if specified, fallback to http in any other case + if (options.protocol === 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } - function go$writeFile (path, data, options, cb, startTime) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) + // get content length and fire away + this.getLength(function (err, length) { + if (err && err !== 'Unknown stream') { + this._error(err); + return; } - } - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null + // add content length + if (length) { + request.setHeader('Content-Length', length); + } - return go$appendFile(path, data, options, cb) + this.pipe(request); + if (cb) { + var onResponse; - function go$appendFile (path, data, options, cb, startTime) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } - } + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); - var fs$copyFile = fs.copyFile - if (fs$copyFile) - fs.copyFile = copyFile - function copyFile (src, dest, flags, cb) { - if (typeof flags === 'function') { - cb = flags - flags = 0 - } - return go$copyFile(src, dest, flags, cb) + return cb.call(this, error, responce); + }; - function go$copyFile (src, dest, flags, cb, startTime) { - return fs$copyFile(src, dest, flags, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) + onResponse = callback.bind(this, null); + + request.on('error', callback); + request.on('response', onResponse); } + }.bind(this)); + + return request; +}; + +FormData.prototype._error = function (err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); } +}; - var fs$readdir = fs.readdir - fs.readdir = readdir - var noReaddirOptionVersions = /^v[0-5]\./ - function readdir (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null +FormData.prototype.toString = function () { + return '[object FormData]'; +}; +setToStringTag(FormData.prototype, 'FormData'); - var go$readdir = noReaddirOptionVersions.test(process.version) - ? function go$readdir (path, options, cb, startTime) { - return fs$readdir(path, fs$readdirCallback( - path, options, cb, startTime - )) - } - : function go$readdir (path, options, cb, startTime) { - return fs$readdir(path, options, fs$readdirCallback( - path, options, cb, startTime - )) - } +// Public API +module.exports = FormData; - return go$readdir(path, options, cb) - function fs$readdirCallback (path, options, cb, startTime) { - return function (err, files) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([ - go$readdir, - [path, options, cb], - err, - startTime || Date.now(), - Date.now() - ]) - else { - if (files && files.sort) - files.sort() +/***/ }), - if (typeof cb === 'function') - cb.call(this, err, files) - } - } - } - } +/***/ 11835: +/***/ ((module) => { - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } +"use strict"; - var fs$ReadStream = fs.ReadStream - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - } - var fs$WriteStream = fs.WriteStream - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - } +// populates missing values +module.exports = function (dst, src) { + Object.keys(src).forEach(function (prop) { + dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign + }); - Object.defineProperty(fs, 'ReadStream', { - get: function () { - return ReadStream - }, - set: function (val) { - ReadStream = val - }, - enumerable: true, - configurable: true - }) - Object.defineProperty(fs, 'WriteStream', { - get: function () { - return WriteStream - }, - set: function (val) { - WriteStream = val - }, - enumerable: true, - configurable: true - }) + return dst; +}; - // legacy names - var FileReadStream = ReadStream - Object.defineProperty(fs, 'FileReadStream', { - get: function () { - return FileReadStream - }, - set: function (val) { - FileReadStream = val - }, - enumerable: true, - configurable: true - }) - var FileWriteStream = WriteStream - Object.defineProperty(fs, 'FileWriteStream', { - get: function () { - return FileWriteStream - }, - set: function (val) { - FileWriteStream = val - }, - enumerable: true, - configurable: true - }) - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } +/***/ }), - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() +/***/ 99808: +/***/ ((module) => { - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } +"use strict"; - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } +/* eslint no-invalid-this: 1 */ - function createReadStream (path, options) { - return new fs.ReadStream(path, options) - } +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var toStr = Object.prototype.toString; +var max = Math.max; +var funcType = '[object Function]'; - function createWriteStream (path, options) { - return new fs.WriteStream(path, options) - } +var concatty = function concatty(a, b) { + var arr = []; - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; - return go$open(path, flags, mode, cb) +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; - function go$open (path, flags, mode, cb, startTime) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; } - }) } - } + return str; +}; - return fs -} +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - fs[gracefulQueue].push(elem) - retry() -} + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); -// keep track of the timeout between retry() calls -var retryTimer + }; -// reset the startTime and lastTime to now -// this resets the start of the 60 second overall timeout as well as the -// delay between attempts so that we'll retry these jobs sooner -function resetQueue () { - var now = Date.now() - for (var i = 0; i < fs[gracefulQueue].length; ++i) { - // entries that are only a length of 2 are from an older version, don't - // bother modifying those since they'll be retried anyway. - if (fs[gracefulQueue][i].length > 2) { - fs[gracefulQueue][i][3] = now // startTime - fs[gracefulQueue][i][4] = now // lastTime + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs[i] = '$' + i; } - } - // call retry to make sure we're actively processing the queue - retry() -} - -function retry () { - // clear the timer and remove it to help prevent unintended concurrency - clearTimeout(retryTimer) - retryTimer = undefined - - if (fs[gracefulQueue].length === 0) - return - var elem = fs[gracefulQueue].shift() - var fn = elem[0] - var args = elem[1] - // these items may be unset if they were added by an older graceful-fs - var err = elem[2] - var startTime = elem[3] - var lastTime = elem[4] + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); - // if we don't have a startTime we have no way of knowing if we've waited - // long enough, so go ahead and retry this item now - if (startTime === undefined) { - debug('RETRY', fn.name, args) - fn.apply(null, args) - } else if (Date.now() - startTime >= 60000) { - // it's been more than 60 seconds total, bail now - debug('TIMEOUT', fn.name, args) - var cb = args.pop() - if (typeof cb === 'function') - cb.call(null, err) - } else { - // the amount of time between the last attempt and right now - var sinceAttempt = Date.now() - lastTime - // the amount of time between when we first tried, and when we last tried - // rounded up to at least 1 - var sinceStart = Math.max(lastTime - startTime, 1) - // backoff. wait longer than the total time we've been retrying, but only - // up to a maximum of 100ms - var desiredDelay = Math.min(sinceStart * 1.2, 100) - // it's been long enough since the last retry, do it again - if (sinceAttempt >= desiredDelay) { - debug('RETRY', fn.name, args) - fn.apply(null, args.concat([startTime])) - } else { - // if we can't do this job yet, push it to the end of the queue - // and let the next iteration check again - fs[gracefulQueue].push(elem) + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; } - } - // schedule our next run if one isn't already scheduled - if (retryTimer === undefined) { - retryTimer = setTimeout(retry, 0) - } -} + return bound; +}; /***/ }), -/***/ 12270: +/***/ 37564: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Stream = (__nccwpck_require__(2203).Stream) +"use strict"; -module.exports = legacy -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } +var implementation = __nccwpck_require__(99808); - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); +module.exports = Function.prototype.bind || implementation; - Stream.call(this); - var self = this; +/***/ }), - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; +/***/ 60470: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; +"use strict"; - options = options || {}; - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } +var undefined; - if (this.encoding) this.setEncoding(this.encoding); +var $Object = __nccwpck_require__(95399); - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } +var $Error = __nccwpck_require__(31620); +var $EvalError = __nccwpck_require__(33056); +var $RangeError = __nccwpck_require__(14585); +var $ReferenceError = __nccwpck_require__(46905); +var $SyntaxError = __nccwpck_require__(80105); +var $TypeError = __nccwpck_require__(73314); +var $URIError = __nccwpck_require__(32578); - if (this.start > this.end) { - throw new Error('start must be <= end'); - } +var abs = __nccwpck_require__(55641); +var floor = __nccwpck_require__(96171); +var max = __nccwpck_require__(57147); +var min = __nccwpck_require__(41017); +var pow = __nccwpck_require__(56947); +var round = __nccwpck_require__(42621); +var sign = __nccwpck_require__(30156); - this.pos = this.start; - } +var $Function = Function; - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } +var $gOPD = __nccwpck_require__(33170); +var $defineProperty = __nccwpck_require__(79094); - self.fd = fd; - self.emit('open', fd); - self._read(); - }) - } +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); +var hasSymbols = __nccwpck_require__(23336)(); - Stream.call(this); +var getProto = __nccwpck_require__(81967); +var $ObjectGPO = __nccwpck_require__(91311); +var $ReflectGPO = __nccwpck_require__(48681); - this.path = path; - this.fd = null; - this.writable = true; +var $apply = __nccwpck_require__(33945); +var $call = __nccwpck_require__(88093); - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; +var needsEval = {}; - options = options || {}; +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } +var INTRINSICS = { + __proto__: null, + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, + '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': $Error, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': $EvalError, + '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': $Object, + '%Object.getOwnPropertyDescriptor%': $gOPD, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': $RangeError, + '%ReferenceError%': $ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': $URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } + '%Function.prototype.call%': $call, + '%Function.prototype.apply%': $apply, + '%Object.defineProperty%': $defineProperty, + '%Object.getPrototypeOf%': $ObjectGPO, + '%Math.abs%': abs, + '%Math.floor%': floor, + '%Math.max%': max, + '%Math.min%': min, + '%Math.pow%': pow, + '%Math.round%': round, + '%Math.sign%': sign, + '%Reflect.getPrototypeOf%': $ReflectGPO +}; - this.pos = this.start; - } +if (getProto) { + try { + null.error; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } +} - this.busy = false; - this._queue = []; +var doEval = function doEval(name) { + var value; + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } - } -} + INTRINSICS[name] = value; + return value; +}; -/***/ }), +var LEGACY_ALIASES = { + __proto__: null, + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; -/***/ 83501: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var bind = __nccwpck_require__(37564); +var hasOwn = __nccwpck_require__(54076); +var $concat = bind.call($call, Array.prototype.concat); +var $spliceApply = bind.call($apply, Array.prototype.splice); +var $replace = bind.call($call, String.prototype.replace); +var $strSlice = bind.call($call, String.prototype.slice); +var $exec = bind.call($call, RegExp.prototype.exec); -var constants = __nccwpck_require__(49140) +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +/* end adaptation */ -var origCwd = process.cwd -var cwd = null +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -try { - process.cwd() -} catch (er) {} +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } -// This check is needed until node.js 12 is required -if (typeof process.chdir === 'function') { - var chdir = process.chdir - process.chdir = function (d) { - cwd = null - chdir.call(process, d) - } - if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) -} + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; -module.exports = patch + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; -function patch (fs) { - // (re-)implement some things that are known busted or missing. + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } - // lchmod, broken prior to 0.6.2 - // back-port the fix here. - if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs) - } + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ( + ( + (first === '"' || first === "'" || first === '`') + || (last === '"' || last === "'" || last === '`') + ) + && first !== last + ) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + return void undefined; + } + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) +/***/ }), - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) +/***/ 91311: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) +"use strict"; - // if lchmod/lchown do not exist, then make them no-ops - if (fs.chmod && !fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (fs.chown && !fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (cb) process.nextTick(cb) - } - fs.lchownSync = function () {} - } - // on Windows, A/V software can lock the directory, causing this - // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 60 seconds. +var $Object = __nccwpck_require__(95399); - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = typeof fs.rename !== 'function' ? fs.rename - : (function (fs$rename) { - function rename (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - } - if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) - return rename - })(fs.rename) - } +/** @type {import('./Object.getPrototypeOf')} */ +module.exports = $Object.getPrototypeOf || null; - // if read() returns EAGAIN, then just try it again. - fs.read = typeof fs.read !== 'function' ? fs.read - : (function (fs$read) { - function read (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - // This ensures `util.promisify` works as it does for native `fs.read`. - if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) - return read - })(fs.read) +/***/ }), - fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync - : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } - }})(fs.readSync) +/***/ 48681: +/***/ ((module) => { - function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - if (callback) callback(err || err2) - }) - }) - }) - } +"use strict"; - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var threw = true - var ret - try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - } +/** @type {import('./Reflect.getPrototypeOf')} */ +module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; - function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } +/***/ }), - } else if (fs.futimes) { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } - } +/***/ 81967: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } +"use strict"; - function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } +var reflectGetProto = __nccwpck_require__(48681); +var originalGetProto = __nccwpck_require__(91311); - function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } +var getDunderProto = __nccwpck_require__(26669); - function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } +/** @type {import('.')} */ +module.exports = reflectGetProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return reflectGetProto(O); + } + : originalGetProto + ? function getProto(O) { + if (!O || (typeof O !== 'object' && typeof O !== 'function')) { + throw new TypeError('getProto: not an object'); + } + // @ts-expect-error TS can't narrow inside a closure, for some reason + return originalGetProto(O); + } + : getDunderProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return getDunderProto(O); + } + : null; - function statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - function callback (er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - if (cb) cb.apply(this, arguments) - } - return options ? orig.call(fs, target, options, callback) - : orig.call(fs, target, callback) - } - } - function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options) { - var stats = options ? orig.call(fs, target, options) - : orig.call(fs, target) - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - return stats; - } - } +/***/ }), - // ENOSYS means that the fs doesn't support the op. Just ignore - // that, because it doesn't matter. - // - // if there's no getuid, or if getuid() is something other - // than 0, and the error is EINVAL or EPERM, then just ignore - // it. - // - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // - // When running as root, or if other types of errors are - // encountered, then it's strict. - function chownErOk (er) { - if (!er) - return true +/***/ 1174: +/***/ ((module) => { - if (er.code === "ENOSYS") - return true +"use strict"; - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - return false - } -} +/** @type {import('./gOPD')} */ +module.exports = Object.getOwnPropertyDescriptor; /***/ }), -/***/ 23336: +/***/ 33170: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var origSymbol = typeof Symbol !== 'undefined' && Symbol; -var hasSymbolSham = __nccwpck_require__(61114); - /** @type {import('.')} */ -module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== 'function') { return false; } - if (typeof Symbol !== 'function') { return false; } - if (typeof origSymbol('foo') !== 'symbol') { return false; } - if (typeof Symbol('bar') !== 'symbol') { return false; } +var $gOPD = __nccwpck_require__(1174); - return hasSymbolSham(); -}; +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; /***/ }), -/***/ 61114: +/***/ 73964: /***/ ((module) => { "use strict"; -/** @type {import('./shams')} */ -/* eslint complexity: [2, 18], max-statements: [2, 33] */ -module.exports = function hasSymbols() { - if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } - if (typeof Symbol.iterator === 'symbol') { return true; } +module.exports = clone - /** @type {{ [k in symbol]?: unknown }} */ - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - if (typeof sym === 'string') { return false; } +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} - if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } - if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj - // temp disabled per https://github.com/ljharb/object.assign/issues/17 - // if (sym instanceof Symbol) { return false; } - // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 - // if (!(symObj instanceof Symbol)) { return false; } + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) - // if (typeof Symbol.prototype.toString !== 'function') { return false; } - // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) - var symVal = 42; - obj[sym] = symVal; - for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop - if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + return copy +} - if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { return false; } +/***/ }), + +/***/ 35744: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(79896) +var polyfills = __nccwpck_require__(83501) +var legacy = __nccwpck_require__(12270) +var clone = __nccwpck_require__(73964) + +var util = __nccwpck_require__(39023) + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } +function noop () {} - if (typeof Object.getOwnPropertyDescriptor === 'function') { - // eslint-disable-next-line no-extra-parens - var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } - } +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} - return true; -}; +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) -/***/ }), + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } -/***/ 85479: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } -"use strict"; + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } -var hasSymbols = __nccwpck_require__(61114); + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) -/** @type {import('.')} */ -module.exports = function hasToStringTagShams() { - return hasSymbols() && !!Symbol.toStringTag; -}; + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + __nccwpck_require__(42613).equal(fs[gracefulQueue].length, 0) + }) + } +} +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} -/***/ }), +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} -/***/ 54076: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch -"use strict"; + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + return go$readFile(path, options, cb) -var call = Function.prototype.call; -var $hasOwn = Object.prototype.hasOwnProperty; -var bind = __nccwpck_require__(37564); + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } -/** @type {import('.')} */ -module.exports = bind.call(call, $hasOwn); + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + return go$writeFile(path, data, options, cb) -/***/ }), + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } -/***/ 96904: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null -"use strict"; + return go$appendFile(path, data, options, cb) -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const net_1 = __importDefault(__nccwpck_require__(69278)); -const tls_1 = __importDefault(__nccwpck_require__(64756)); -const url_1 = __importDefault(__nccwpck_require__(87016)); -const assert_1 = __importDefault(__nccwpck_require__(42613)); -const debug_1 = __importDefault(__nccwpck_require__(2830)); -const agent_base_1 = __nccwpck_require__(8207); -const parse_proxy_response_1 = __importDefault(__nccwpck_require__(37943)); -const debug = debug_1.default('https-proxy-agent:agent'); -/** - * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to - * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. - * - * Outgoing HTTP requests are first tunneled through the proxy server using the - * `CONNECT` HTTP request method to establish a connection to the proxy server, - * and then the proxy server connects to the destination target and issues the - * HTTP request from the proxy server. - * - * `https:` requests have their socket connection upgraded to TLS once - * the connection to the proxy server has been established. - * - * @api public - */ -class HttpsProxyAgent extends agent_base_1.Agent { - constructor(_opts) { - let opts; - if (typeof _opts === 'string') { - opts = url_1.default.parse(_opts); - } + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { - opts = _opts; - } - if (!opts) { - throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); - } - debug('creating new HttpsProxyAgent instance: %o', opts); - super(opts); - const proxy = Object.assign({}, opts); - // If `true`, then connect to the proxy server over TLS. - // Defaults to `false`. - this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); - // Prefer `hostname` over `host`, and set the `port` if needed. - proxy.host = proxy.hostname || proxy.host; - if (typeof proxy.port === 'string') { - proxy.port = parseInt(proxy.port, 10); - } - if (!proxy.port && proxy.host) { - proxy.port = this.secureProxy ? 443 : 80; - } - // ALPN is supported by Node.js >= v5. - // attempt to negotiate http/1.1 for proxy servers that support http/2 - if (this.secureProxy && !('ALPNProtocols' in proxy)) { - proxy.ALPNProtocols = ['http 1.1']; - } - if (proxy.host && proxy.path) { - // If both a `host` and `path` are specified then it's most likely - // the result of a `url.parse()` call... we need to remove the - // `path` portion so that `net.connect()` doesn't attempt to open - // that as a Unix socket file. - delete proxy.path; - delete proxy.pathname; + if (typeof cb === 'function') + cb.apply(this, arguments) } - this.proxy = proxy; + }) } - /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. - * - * @api protected - */ - callback(req, opts) { - return __awaiter(this, void 0, void 0, function* () { - const { proxy, secureProxy } = this; - // Create a socket connection to the proxy server. - let socket; - if (secureProxy) { - debug('Creating `tls.Socket`: %o', proxy); - socket = tls_1.default.connect(proxy); - } - else { - debug('Creating `net.Socket`: %o', proxy); - socket = net_1.default.connect(proxy); - } - const headers = Object.assign({}, proxy.headers); - const hostname = `${opts.host}:${opts.port}`; - let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; - // Inject the `Proxy-Authorization` header if necessary. - if (proxy.auth) { - headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; - } - // The `Host` header should only include the port - // number when it is not the default port. - let { host, port, secureEndpoint } = opts; - if (!isDefaultPort(port, secureEndpoint)) { - host += `:${port}`; - } - headers.Host = host; - headers.Connection = 'close'; - for (const name of Object.keys(headers)) { - payload += `${name}: ${headers[name]}\r\n`; - } - const proxyResponsePromise = parse_proxy_response_1.default(socket); - socket.write(`${payload}\r\n`); - const { statusCode, buffered } = yield proxyResponsePromise; - if (statusCode === 200) { - req.once('socket', resume); - if (opts.secureEndpoint) { - // The proxy is connecting to a TLS server, so upgrade - // this socket connection to a TLS connection. - debug('Upgrading socket connection to TLS'); - const servername = opts.servername || opts.host; - return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, - servername })); - } - return socket; - } - // Some other status code that's not 200... need to re-play the HTTP - // header "data" events onto the socket once the HTTP machinery is - // attached so that the node core `http` can parse and handle the - // error status code. - // Close the original socket, and a new "fake" socket is returned - // instead, so that the proxy doesn't get the HTTP request - // written to it (which may contain `Authorization` headers or other - // sensitive data). - // - // See: https://hackerone.com/reports/541502 - socket.destroy(); - const fakeSocket = new net_1.default.Socket({ writable: false }); - fakeSocket.readable = true; - // Need to wait for the "socket" event to re-play the "data" events. - req.once('socket', (s) => { - debug('replaying proxy buffer for failed request'); - assert_1.default(s.listenerCount('data') > 0); - // Replay the "buffered" Buffer onto the fake `socket`, since at - // this point the HTTP module machinery has been hooked up for - // the user. - s.push(buffered); - s.push(null); - }); - return fakeSocket; - }); + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 } -} -exports["default"] = HttpsProxyAgent; -function resume(socket) { - socket.resume(); -} -function isDefaultPort(port, secure) { - return Boolean((!secure && port === 80) || (secure && port === 443)); -} -function isHTTPS(protocol) { - return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; -} -function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) } + }) } - return ret; -} -//# sourceMappingURL=agent.js.map - -/***/ }), - -/***/ 3669: -/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { - -"use strict"; + } -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -const agent_1 = __importDefault(__nccwpck_require__(96904)); -function createHttpsProxyAgent(opts) { - return new agent_1.default(opts); -} -(function (createHttpsProxyAgent) { - createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; - createHttpsProxyAgent.prototype = agent_1.default.prototype; -})(createHttpsProxyAgent || (createHttpsProxyAgent = {})); -module.exports = createHttpsProxyAgent; -//# sourceMappingURL=index.js.map + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null -/***/ }), + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } -/***/ 37943: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + return go$readdir(path, options, cb) -"use strict"; + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const debug_1 = __importDefault(__nccwpck_require__(2830)); -const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); -function parseProxyResponse(socket) { - return new Promise((resolve, reject) => { - // we need to buffer any HTTP traffic that happens with the proxy before we get - // the CONNECT response, so that if the response is anything other than an "200" - // response code, then we can re-play the "data" events on the socket once the - // HTTP parser is hooked up... - let buffersLength = 0; - const buffers = []; - function read() { - const b = socket.read(); - if (b) - ondata(b); - else - socket.once('readable', read); - } - function cleanup() { - socket.removeListener('end', onend); - socket.removeListener('error', onerror); - socket.removeListener('close', onclose); - socket.removeListener('readable', read); - } - function onclose(err) { - debug('onclose had error %o', err); - } - function onend() { - debug('onend'); - } - function onerror(err) { - cleanup(); - debug('onerror %o', err); - reject(err); - } - function ondata(b) { - buffers.push(b); - buffersLength += b.length; - const buffered = Buffer.concat(buffers, buffersLength); - const endOfHeaders = buffered.indexOf('\r\n\r\n'); - if (endOfHeaders === -1) { - // keep buffering - debug('have not received end of HTTP headers yet...'); - read(); - return; - } - const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); - const statusCode = +firstLine.split(' ')[1]; - debug('got proxy server response: %o', firstLine); - resolve({ - statusCode, - buffered - }); + if (typeof cb === 'function') + cb.call(this, err, files) } - socket.on('error', onerror); - socket.on('close', onclose); - socket.on('end', onend); - read(); - }); -} -exports["default"] = parseProxyResponse; -//# sourceMappingURL=parse-proxy-response.js.map + } + } + } -/***/ }), + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } -/***/ 33176: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } -var wrappy = __nccwpck_require__(58264) -var reqs = Object.create(null) -var once = __nccwpck_require__(55560) + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) -module.exports = wrappy(inflight) + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } -} -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) + that.emit('error', err) } else { - delete reqs[key] + that.fd = fd + that.emit('open', fd) + that.read() } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} - + }) + } -/***/ }), + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } -/***/ 39598: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } -try { - var util = __nccwpck_require__(39023); - /* istanbul ignore next */ - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - /* istanbul ignore next */ - module.exports = __nccwpck_require__(26589); -} + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } -/***/ }), + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null -/***/ 26589: -/***/ ((module) => { + return go$open(path, flags, mode, cb) -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) } }) } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } } -} - - -/***/ }), - -/***/ 93407: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; + return fs } -function isPlainObject(o) { - var ctor,prot; - - if (isObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} - // If has modified prototype - prot = ctor.prototype; - if (isObject(prot) === false) return false; +// keep track of the timeout between retry() calls +var retryTimer - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } } - - // Most likely a plain Object - return true; + // call retry to make sure we're actively processing the queue + retry() } -exports.isPlainObject = isPlainObject; - - -/***/ }), - -/***/ 82513: -/***/ ((module) => { - -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + if (fs[gracefulQueue].length === 0) + return -/***/ }), + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] -/***/ 79699: -/***/ ((module) => { + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } -"use strict"; -function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[o]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const a=o;a.default=o,a.InvalidTokenError=n,module.exports=a; -//# sourceMappingURL=jwt-decode.cjs.js.map + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} /***/ }), -/***/ 32126: +/***/ 12270: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __nccwpck_require__(39023); -var PassThrough = __nccwpck_require__(1835); - -module.exports = { - Readable: Readable, - Writable: Writable -}; +var Stream = (__nccwpck_require__(2203).Stream) -util.inherits(Readable, PassThrough); -util.inherits(Writable, PassThrough); +module.exports = legacy -// Patch the given method of instance so that the callback -// is executed once, before the actual method is called the -// first time. -function beforeFirstCall(instance, method, callback) { - instance[method] = function() { - delete instance[method]; - callback.apply(this, arguments); - return this[method].apply(this, arguments); - }; -} +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } -function Readable(fn, options) { - if (!(this instanceof Readable)) - return new Readable(fn, options); + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); - PassThrough.call(this, options); + Stream.call(this); - beforeFirstCall(this, '_read', function() { - var source = fn.call(this, options); - var emit = this.emit.bind(this, 'error'); - source.on('error', emit); - source.pipe(this); - }); + var self = this; - this.emit('readable'); -} + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; -function Writable(fn, options) { - if (!(this instanceof Writable)) - return new Writable(fn, options); + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; - PassThrough.call(this, options); + options = options || {}; - beforeFirstCall(this, '_write', function() { - var destination = fn.call(this, options); - var emit = this.emit.bind(this, 'error'); - destination.on('error', emit); - this.pipe(destination); - }); + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } - this.emit('writable'); -} + if (this.encoding) this.setEncoding(this.encoding); + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + if (this.start > this.end) { + throw new Error('start must be <= end'); + } -/***/ }), + this.pos = this.start; + } -/***/ 34793: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + Stream.call(this); -/**/ + this.path = path; + this.fd = null; + this.writable = true; -var pna = __nccwpck_require__(41564); -/**/ + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ + options = options || {}; -module.exports = Duplex; + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } -var Readable = __nccwpck_require__(74559); -var Writable = __nccwpck_require__(54579); + this.pos = this.start; + } -util.inherits(Duplex, Readable); + this.busy = false; + this._queue = []; -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } } } -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; +/***/ }), - this.once('end', onend); -} +/***/ 83501: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); +var constants = __nccwpck_require__(49140) -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; +var origCwd = process.cwd +var cwd = null - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform -function onEndNT(self) { - self.end(); +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd } - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) } -}); + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); +module.exports = patch - pna.nextTick(cb, err); -}; +function patch (fs) { + // (re-)implement some things that are known busted or missing. -/***/ }), + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } -/***/ 72029: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) -module.exports = PassThrough; + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) -var Transform = __nccwpck_require__(69343); + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) -util.inherits(PassThrough, Transform); + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. - Transform.call(this, options); -} + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) + } -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } -/***/ }), + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) -/***/ 74559: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } -/**/ + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } -var pna = __nccwpck_require__(41564); -/**/ + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } -module.exports = Readable; + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } -/**/ -var isArray = __nccwpck_require__(82513); -/**/ + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } -/**/ -var Duplex; -/**/ + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } -Readable.ReadableState = ReadableState; -/**/ -var EE = (__nccwpck_require__(24434).EventEmitter); + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } -/**/ -var Stream = __nccwpck_require__(87137); -/**/ + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } -/**/ + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } -var Buffer = (__nccwpck_require__(13644).Buffer); -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true -/**/ + if (er.code === "ENOSYS") + return true -/**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } -/**/ -var debugUtil = __nccwpck_require__(39023); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; + return false + } } -/**/ -var BufferList = __nccwpck_require__(46127); -var destroyImpl = __nccwpck_require__(91031); -var StringDecoder; -util.inherits(Readable, Stream); +/***/ }), -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; +/***/ 23336: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); +"use strict"; - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} -function ReadableState(options, stream) { - Duplex = Duplex || __nccwpck_require__(34793); +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = __nccwpck_require__(61114); - options = options || {}; +/** @type {import('.')} */ +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; + return hasSymbolSham(); +}; - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; +/***/ }), - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; +/***/ 61114: +/***/ ((module) => { - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; +"use strict"; - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; +/** @type {import('./shams')} */ +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; + /** @type {{ [k in symbol]?: unknown }} */ + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } - // has it been destroyed - this.destroyed = false; + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; + var symVal = 42; + obj[sym] = symVal; + for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } - // if true, a maybeReadMore has been scheduled - this.readingMore = false; + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(50176)/* .StringDecoder */ .I); - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } -function Readable(options) { - Duplex = Duplex || __nccwpck_require__(34793); + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } - if (!(this instanceof Readable)) return new Readable(options); + if (typeof Object.getOwnPropertyDescriptor === 'function') { + // eslint-disable-next-line no-extra-parens + var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } - this._readableState = new ReadableState(options, this); + return true; +}; - // legacy - this.readable = true; - if (options) { - if (typeof options.read === 'function') this._read = options.read; +/***/ }), - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } +/***/ 85479: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - Stream.call(this); -} +"use strict"; -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); +var hasSymbols = __nccwpck_require__(61114); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); +/** @type {import('.')} */ +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; }; -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } +/***/ }), - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; +/***/ 54076: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; +"use strict"; -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = __nccwpck_require__(37564); - return needMoreData(state); -} +/** @type {import('.')} */ +module.exports = bind.call(call, $hasOwn); -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} +/***/ }), -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} +/***/ 81970: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} +"use strict"; -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(50176)/* .StringDecoder */ .I); - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; }; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpProxyAgent = void 0; +const net = __importStar(__nccwpck_require__(69278)); +const tls = __importStar(__nccwpck_require__(64756)); +const debug_1 = __importDefault(__nccwpck_require__(2830)); +const events_1 = __nccwpck_require__(24434); +const agent_base_1 = __nccwpck_require__(70737); +const url_1 = __nccwpck_require__(87016); +const debug = (0, debug_1.default)('http-proxy-agent'); +/** + * The `HttpProxyAgent` implements an HTTP Agent subclass that connects + * to the specified "HTTP proxy server" in order to proxy HTTP requests. + */ +class HttpProxyAgent extends agent_base_1.Agent { + constructor(proxy, opts) { + super(opts); + this.proxy = typeof proxy === 'string' ? new url_1.URL(proxy) : proxy; + this.proxyHeaders = opts?.headers ?? {}; + debug('Creating new HttpProxyAgent instance: %o', this.proxy.href); + // Trim off the brackets from IPv6 addresses + const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ''); + const port = this.proxy.port + ? parseInt(this.proxy.port, 10) + : this.proxy.protocol === 'https:' + ? 443 + : 80; + this.connectOpts = { + ...(opts ? omit(opts, 'headers') : null), + host, + port, + }; + } + addRequest(req, opts) { + req._header = null; + this.setRequestProps(req, opts); + // @ts-expect-error `addRequest()` isn't defined in `@types/node` + super.addRequest(req, opts); + } + setRequestProps(req, opts) { + const { proxy } = this; + const protocol = opts.secureEndpoint ? 'https:' : 'http:'; + const hostname = req.getHeader('host') || 'localhost'; + const base = `${protocol}//${hostname}`; + const url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); + } + // Change the `http.ClientRequest` instance's "path" field + // to the absolute path of the URL that will be requested. + req.path = String(url); + // Inject the `Proxy-Authorization` header if necessary. + const headers = typeof this.proxyHeaders === 'function' + ? this.proxyHeaders() + : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; + } + if (!headers['Proxy-Connection']) { + headers['Proxy-Connection'] = this.keepAlive + ? 'Keep-Alive' + : 'close'; + } + for (const name of Object.keys(headers)) { + const value = headers[name]; + if (value) { + req.setHeader(name, value); + } + } + } + async connect(req, opts) { + req._header = null; + if (!req.path.includes('://')) { + this.setRequestProps(req, opts); + } + // At this point, the http ClientRequest's internal `_header` field + // might have already been set. If this is the case then we'll need + // to re-generate the string since we just changed the `req.path`. + let first; + let endOfHeaders; + debug('Regenerating stored HTTP header string for request'); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug('Patching connection write() output buffer with updated header'); + first = req.outputData[0].data; + endOfHeaders = first.indexOf('\r\n\r\n') + 4; + req.outputData[0].data = + req._header + first.substring(endOfHeaders); + debug('Output buffer: %o', req.outputData[0].data); + } + // Create a socket connection to the proxy server. + let socket; + if (this.proxy.protocol === 'https:') { + debug('Creating `tls.Socket`: %o', this.connectOpts); + socket = tls.connect(this.connectOpts); + } + else { + debug('Creating `net.Socket`: %o', this.connectOpts); + socket = net.connect(this.connectOpts); + } + // Wait for the socket's `connect` event, so that this `callback()` + // function throws instead of the `http` request machinery. This is + // important for i.e. `PacProxyAgent` which determines a failed proxy + // connection via the `callback()` function throwing. + await (0, events_1.once)(socket, 'connect'); + return socket; + } } - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; +HttpProxyAgent.protocols = ['http', 'https']; +exports.HttpProxyAgent = HttpProxyAgent; +function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } +//# sourceMappingURL=index.js.map -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); +/***/ }), - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } +/***/ 64268: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. +"use strict"; - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.req = exports.json = exports.toBuffer = void 0; +const http = __importStar(__nccwpck_require__(58611)); +const https = __importStar(__nccwpck_require__(65692)); +async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); + } + return Buffer.concat(chunks, length); +} +exports.toBuffer = toBuffer; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +async function json(stream) { + const buf = await toBuffer(stream); + const str = buf.toString('utf8'); + try { + return JSON.parse(str); + } + catch (_err) { + const err = _err; + err.message += ` (input: ${str})`; + throw err; + } +} +exports.json = json; +function req(url, opts = {}) { + const href = typeof url === 'string' ? url : url.href; + const req = (href.startsWith('https:') ? https : http).request(url, opts); + const promise = new Promise((resolve, reject) => { + req + .once('response', resolve) + .once('error', reject) + .end(); + }); + req.then = promise.then.bind(promise); + return req; +} +exports.req = req; +//# sourceMappingURL=helpers.js.map - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } +/***/ }), - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } +/***/ 70737: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; +"use strict"; - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Agent = void 0; +const net = __importStar(__nccwpck_require__(69278)); +const http = __importStar(__nccwpck_require__(58611)); +const https_1 = __nccwpck_require__(65692); +__exportStar(__nccwpck_require__(64268), exports); +const INTERNAL = Symbol('AgentBaseInternalState'); +class Agent extends http.Agent { + constructor(opts) { + super(opts); + this[INTERNAL] = {}; + } + /** + * Determine whether this is an `http` or `https` request. + */ + isSecureEndpoint(options) { + if (options) { + // First check the `secureEndpoint` property explicitly, since this + // means that a parent `Agent` is "passing through" to this instance. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (typeof options.secureEndpoint === 'boolean') { + return options.secureEndpoint; + } + // If no explicit `secure` endpoint, check if `protocol` property is + // set. This will usually be the case since using a full string URL + // or `URL` instance should be the most common usage. + if (typeof options.protocol === 'string') { + return options.protocol === 'https:'; + } + } + // Finally, if no `protocol` property was set, then fall back to + // checking the stack trace of the current call stack, and try to + // detect the "https" module. + const { stack } = new Error(); + if (typeof stack !== 'string') + return false; + return stack + .split('\n') + .some((l) => l.indexOf('(https.js:') !== -1 || + l.indexOf('node:https:') !== -1); + } + // In order to support async signatures in `connect()` and Node's native + // connection pooling in `http.Agent`, the array of sockets for each origin + // has to be updated synchronously. This is so the length of the array is + // accurate when `addRequest()` is next called. We achieve this by creating a + // fake socket and adding it to `sockets[origin]` and incrementing + // `totalSocketCount`. + incrementSockets(name) { + // If `maxSockets` and `maxTotalSockets` are both Infinity then there is no + // need to create a fake socket because Node.js native connection pooling + // will never be invoked. + if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { + return null; + } + // All instances of `sockets` are expected TypeScript errors. The + // alternative is to add it as a private property of this class but that + // will break TypeScript subclassing. + if (!this.sockets[name]) { + // @ts-expect-error `sockets` is readonly in `@types/node` + this.sockets[name] = []; + } + const fakeSocket = new net.Socket({ writable: false }); + this.sockets[name].push(fakeSocket); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount++; + return fakeSocket; + } + decrementSockets(name, socket) { + if (!this.sockets[name] || socket === null) { + return; + } + const sockets = this.sockets[name]; + const index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount--; + if (sockets.length === 0) { + // @ts-expect-error `sockets` is readonly in `@types/node` + delete this.sockets[name]; + } + } + } + // In order to properly update the socket pool, we need to call `getName()` on + // the core `https.Agent` if it is a secureEndpoint. + getName(options) { + const secureEndpoint = this.isSecureEndpoint(options); + if (secureEndpoint) { + // @ts-expect-error `getName()` isn't defined in `@types/node` + return https_1.Agent.prototype.getName.call(this, options); + } + // @ts-expect-error `getName()` isn't defined in `@types/node` + return super.getName(options); + } + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options), + }; + const name = this.getName(connectOpts); + const fakeSocket = this.incrementSockets(name); + Promise.resolve() + .then(() => this.connect(req, connectOpts)) + .then((socket) => { + this.decrementSockets(name, fakeSocket); + if (socket instanceof http.Agent) { + try { + // @ts-expect-error `addRequest()` isn't defined in `@types/node` + return socket.addRequest(req, connectOpts); + } + catch (err) { + return cb(err); + } + } + this[INTERNAL].currentSocket = socket; + // @ts-expect-error `createSocket()` isn't defined in `@types/node` + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); + } + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = undefined; + if (!socket) { + throw new Error('No socket was returned in the `connect()` function'); + } + return socket; + } + get defaultPort() { + return (this[INTERNAL].defaultPort ?? + (this.protocol === 'https:' ? 443 : 80)); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; + } + } + get protocol() { + return (this[INTERNAL].protocol ?? + (this.isSecureEndpoint() ? 'https:' : 'http:')); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; + } + } +} +exports.Agent = Agent; +//# sourceMappingURL=index.js.map - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; +/***/ }), - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } +/***/ 96904: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - if (ret !== null) this.emit('data', ret); +"use strict"; - return ret; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const net_1 = __importDefault(__nccwpck_require__(69278)); +const tls_1 = __importDefault(__nccwpck_require__(64756)); +const url_1 = __importDefault(__nccwpck_require__(87016)); +const assert_1 = __importDefault(__nccwpck_require__(42613)); +const debug_1 = __importDefault(__nccwpck_require__(2830)); +const agent_base_1 = __nccwpck_require__(8207); +const parse_proxy_response_1 = __importDefault(__nccwpck_require__(37943)); +const debug = debug_1.default('https-proxy-agent:agent'); +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + * + * @api public + */ +class HttpsProxyAgent extends agent_base_1.Agent { + constructor(_opts) { + let opts; + if (typeof _opts === 'string') { + opts = url_1.default.parse(_opts); + } + else { + opts = _opts; + } + if (!opts) { + throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); + } + debug('creating new HttpsProxyAgent instance: %o', opts); + super(opts); + const proxy = Object.assign({}, opts); + // If `true`, then connect to the proxy server over TLS. + // Defaults to `false`. + this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); + // Prefer `hostname` over `host`, and set the `port` if needed. + proxy.host = proxy.hostname || proxy.host; + if (typeof proxy.port === 'string') { + proxy.port = parseInt(proxy.port, 10); + } + if (!proxy.port && proxy.host) { + proxy.port = this.secureProxy ? 443 : 80; + } + // ALPN is supported by Node.js >= v5. + // attempt to negotiate http/1.1 for proxy servers that support http/2 + if (this.secureProxy && !('ALPNProtocols' in proxy)) { + proxy.ALPNProtocols = ['http 1.1']; + } + if (proxy.host && proxy.path) { + // If both a `host` and `path` are specified then it's most likely + // the result of a `url.parse()` call... we need to remove the + // `path` portion so that `net.connect()` doesn't attempt to open + // that as a Unix socket file. + delete proxy.path; + delete proxy.pathname; + } + this.proxy = proxy; + } + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req, opts) { + return __awaiter(this, void 0, void 0, function* () { + const { proxy, secureProxy } = this; + // Create a socket connection to the proxy server. + let socket; + if (secureProxy) { + debug('Creating `tls.Socket`: %o', proxy); + socket = tls_1.default.connect(proxy); + } + else { + debug('Creating `net.Socket`: %o', proxy); + socket = net_1.default.connect(proxy); + } + const headers = Object.assign({}, proxy.headers); + const hostname = `${opts.host}:${opts.port}`; + let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.auth) { + headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; + } + // The `Host` header should only include the port + // number when it is not the default port. + let { host, port, secureEndpoint } = opts; + if (!isDefaultPort(port, secureEndpoint)) { + host += `:${port}`; + } + headers.Host = host; + headers.Connection = 'close'; + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r\n`; + } + const proxyResponsePromise = parse_proxy_response_1.default(socket); + socket.write(`${payload}\r\n`); + const { statusCode, buffered } = yield proxyResponsePromise; + if (statusCode === 200) { + req.once('socket', resume); + if (opts.secureEndpoint) { + // The proxy is connecting to a TLS server, so upgrade + // this socket connection to a TLS connection. + debug('Upgrading socket connection to TLS'); + const servername = opts.servername || opts.host; + return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, + servername })); + } + return socket; + } + // Some other status code that's not 200... need to re-play the HTTP + // header "data" events onto the socket once the HTTP machinery is + // attached so that the node core `http` can parse and handle the + // error status code. + // Close the original socket, and a new "fake" socket is returned + // instead, so that the proxy doesn't get the HTTP request + // written to it (which may contain `Authorization` headers or other + // sensitive data). + // + // See: https://hackerone.com/reports/541502 + socket.destroy(); + const fakeSocket = new net_1.default.Socket({ writable: false }); + fakeSocket.readable = true; + // Need to wait for the "socket" event to re-play the "data" events. + req.once('socket', (s) => { + debug('replaying proxy buffer for failed request'); + assert_1.default(s.listenerCount('data') > 0); + // Replay the "buffered" Buffer onto the fake `socket`, since at + // this point the HTTP module machinery has been hooked up for + // the user. + s.push(buffered); + s.push(null); + }); + return fakeSocket; + }); } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); } - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } +exports["default"] = HttpsProxyAgent; +function resume(socket) { + socket.resume(); } - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); +function isDefaultPort(port, secure) { + return Boolean((!secure && port === 80) || (secure && port === 443)); } - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } +function isHTTPS(protocol) { + return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; +function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } +//# sourceMappingURL=agent.js.map -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } +/***/ }), - function onend() { - debug('onend'); - dest.end(); - } +/***/ 3669: +/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); +"use strict"; - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const agent_1 = __importDefault(__nccwpck_require__(96904)); +function createHttpsProxyAgent(opts) { + return new agent_1.default(opts); +} +(function (createHttpsProxyAgent) { + createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; + createHttpsProxyAgent.prototype = agent_1.default.prototype; +})(createHttpsProxyAgent || (createHttpsProxyAgent = {})); +module.exports = createHttpsProxyAgent; +//# sourceMappingURL=index.js.map - cleanedUp = true; +/***/ }), - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +/***/ 37943: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } +"use strict"; - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const debug_1 = __importDefault(__nccwpck_require__(2830)); +const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); +function parseProxyResponse(socket) { + return new Promise((resolve, reject) => { + // we need to buffer any HTTP traffic that happens with the proxy before we get + // the CONNECT response, so that if the response is anything other than an "200" + // response code, then we can re-play the "data" events on the socket once the + // HTTP parser is hooked up... + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once('readable', read); + } + function cleanup() { + socket.removeListener('end', onend); + socket.removeListener('error', onerror); + socket.removeListener('close', onclose); + socket.removeListener('readable', read); + } + function onclose(err) { + debug('onclose had error %o', err); + } + function onend() { + debug('onend'); + } + function onerror(err) { + cleanup(); + debug('onerror %o', err); + reject(err); + } + function ondata(b) { + buffers.push(b); + buffersLength += b.length; + const buffered = Buffer.concat(buffers, buffersLength); + const endOfHeaders = buffered.indexOf('\r\n\r\n'); + if (endOfHeaders === -1) { + // keep buffering + debug('have not received end of HTTP headers yet...'); + read(); + return; + } + const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); + const statusCode = +firstLine.split(' ')[1]; + debug('got proxy server response: %o', firstLine); + resolve({ + statusCode, + buffered + }); + } + socket.on('error', onerror); + socket.on('close', onclose); + socket.on('end', onend); + read(); + }); +} +exports["default"] = parseProxyResponse; +//# sourceMappingURL=parse-proxy-response.js.map - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); +/***/ }), - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); +/***/ 39598: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } +try { + var util = __nccwpck_require__(39023); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(26589); +} - // tell the dest that it's being piped to - dest.emit('pipe', src); - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } +/***/ }), - return dest; -}; +/***/ 26589: +/***/ ((module) => { -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) } }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } } -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - // slow case. multiple pipe destinations. +/***/ }), - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +/***/ 93407: +/***/ ((__unused_webpack_module, exports) => { - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { hasUnpiped: false }); - }return this; - } +"use strict"; - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; +Object.defineProperty(exports, "__esModule", ({ value: true })); - dest.emit('unpipe', this, unpipeInfo); +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ - return this; -}; +function isObject(o) { + return Object.prototype.toString.call(o) === '[object Object]'; +} -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); +function isPlainObject(o) { + var ctor,prot; - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } + if (isObject(o) === false) return false; - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + // If has modified constructor + ctor = o.constructor; + if (ctor === undefined) return true; -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} + // If has modified prototype + prot = ctor.prototype; + if (isObject(prot) === false) return false; -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; } - return this; -}; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } + // Most likely a plain Object + return true; } -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } +exports.isPlainObject = isPlainObject; - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; +/***/ }), -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} +/***/ 96543: +/***/ ((module) => { -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; +"use strict"; - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } +const isStream = stream => + stream !== null && + typeof stream === 'object' && + typeof stream.pipe === 'function'; - _this.push(null); - }); +isStream.writable = stream => + isStream(stream) && + stream.writable !== false && + typeof stream._write === 'function' && + typeof stream._writableState === 'object'; - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); +isStream.readable = stream => + isStream(stream) && + stream.readable !== false && + typeof stream._read === 'function' && + typeof stream._readableState === 'object'; - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; +isStream.duplex = stream => + isStream.writable(stream) && + isStream.readable(stream); - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); +isStream.transform = stream => + isStream.duplex(stream) && + typeof stream._transform === 'function'; - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } +module.exports = isStream; - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; +/***/ }), - return this; +/***/ 82513: +/***/ ((module) => { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; }; -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); -// exposed for testing purposes only. -Readable._fromList = fromList; +/***/ }), -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; +/***/ 79699: +/***/ ((module) => { - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } +"use strict"; +function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[o]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const a=o;a.default=o,a.InvalidTokenError=n,module.exports=a; +//# sourceMappingURL=jwt-decode.cjs.js.map - return ret; -} -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} +/***/ }), -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} +/***/ 32126: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} +var util = __nccwpck_require__(39023); +var PassThrough = __nccwpck_require__(1835); -function endReadable(stream) { - var state = stream._readableState; +module.exports = { + Readable: Readable, + Writable: Writable +}; - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); +util.inherits(Readable, PassThrough); +util.inherits(Writable, PassThrough); - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } +// Patch the given method of instance so that the callback +// is executed once, before the actual method is called the +// first time. +function beforeFirstCall(instance, method, callback) { + instance[method] = function() { + delete instance[method]; + callback.apply(this, arguments); + return this[method].apply(this, arguments); + }; } -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } +function Readable(fn, options) { + if (!(this instanceof Readable)) + return new Readable(fn, options); + + PassThrough.call(this, options); + + beforeFirstCall(this, '_read', function() { + var source = fn.call(this, options); + var emit = this.emit.bind(this, 'error'); + source.on('error', emit); + source.pipe(this); + }); + + this.emit('readable'); } -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; +function Writable(fn, options) { + if (!(this instanceof Writable)) + return new Writable(fn, options); + + PassThrough.call(this, options); + + beforeFirstCall(this, '_write', function() { + var destination = fn.call(this, options); + var emit = this.emit.bind(this, 'error'); + destination.on('error', emit); + this.pipe(destination); + }); + + this.emit('writable'); } + + /***/ }), -/***/ 69343: +/***/ 34793: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -74574,203 +36539,174 @@ function indexOf(xs, x) { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. -module.exports = Transform; +/**/ -var Duplex = __nccwpck_require__(34793); +var pna = __nccwpck_require__(19183); +/**/ /**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; /**/ -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } +module.exports = Duplex; - ts.writechunk = null; - ts.writecb = null; +/**/ +var util = Object.create(__nccwpck_require__(45481)); +util.inherits = __nccwpck_require__(39598); +/**/ - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); +var Readable = __nccwpck_require__(74559); +var Writable = __nccwpck_require__(54579); - cb(er); +util.inherits(Duplex, Readable); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); - Duplex.call(this, options); + Readable.call(this, options); + Writable.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; + if (options && options.readable === false) this.readable = false; - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; + if (options && options.writable === false) this.writable = false; - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; + this.once('end', onend); +} - if (typeof options.flush === 'function') this._flush = options.flush; +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; } +}); - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); } -function prefinish() { - var _this = this; +function onEndNT(self) { + self.end(); +} - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; } -} +}); -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); + pna.nextTick(cb, err); }; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; +/***/ }), + +/***/ 72029: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; +module.exports = PassThrough; -function done(stream, er, data) { - if (er) return stream.emit('error', er); +var Transform = __nccwpck_require__(69343); - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); +/**/ +var util = Object.create(__nccwpck_require__(45481)); +util.inherits = __nccwpck_require__(39598); +/**/ - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); +util.inherits(PassThrough, Transform); - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); - return stream.push(null); + Transform.call(this, options); } +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; + /***/ }), -/***/ 54579: +/***/ 74559: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -74795,58 +36731,30 @@ function done(stream, er, data) { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - /**/ -var pna = __nccwpck_require__(41564); +var pna = __nccwpck_require__(19183); /**/ -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ +module.exports = Readable; /**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +var isArray = __nccwpck_require__(82513); /**/ /**/ var Duplex; /**/ -Writable.WritableState = WritableState; +Readable.ReadableState = ReadableState; /**/ -var util = Object.create(__nccwpck_require__(45481)); -util.inherits = __nccwpck_require__(39598); -/**/ +var EE = (__nccwpck_require__(24434).EventEmitter); -/**/ -var internalUtil = { - deprecate: __nccwpck_require__(24488) +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; }; /**/ @@ -74867,13 +36775,42 @@ function _isUint8Array(obj) { /**/ +/**/ +var util = Object.create(__nccwpck_require__(45481)); +util.inherits = __nccwpck_require__(39598); +/**/ + +/**/ +var debugUtil = __nccwpck_require__(39023); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = __nccwpck_require__(46127); var destroyImpl = __nccwpck_require__(91031); +var StringDecoder; -util.inherits(Writable, Stream); +util.inherits(Readable, Stream); -function nop() {} +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; -function WritableState(options, stream) { +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { Duplex = Duplex || __nccwpck_require__(34793); options = options || {}; @@ -74885,872 +36822,1139 @@ function WritableState(options, stream) { // These options can be provided separately as readableXXX and writableXXX. var isDuplex = stream instanceof Duplex; - // object stream flag to indicate whether or not this stream - // contains buffers or objects. + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; + var readableHwm = options.readableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; this.ended = false; - // when 'finish' is emitted - this.finished = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; // has it been destroyed this.destroyed = false; - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; - // a flag to see when we're in the middle of a write. - this.writing = false; + // if true, a maybeReadMore has been scheduled + this.readingMore = false; - // when true all writes will be buffered until .uncork() call - this.corked = 0; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(50176)/* .StringDecoder */ .I); + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; +function Readable(options) { + Duplex = Duplex || __nccwpck_require__(34793); - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + if (!(this instanceof Readable)) return new Readable(options); - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; + this._readableState = new ReadableState(options, this); - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; + // legacy + this.readable = true; - // the amount that is being written when _write is called. - this.writelen = 0; + if (options) { + if (typeof options.read === 'function') this._read = options.read; - this.bufferedRequest = null; - this.lastBufferedRequest = null; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + Stream.call(this); +} - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); - // count buffered requests - this.bufferedRequestCount = 0; +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; } - return out; + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } - return object && object._writableState instanceof WritableState; + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || __nccwpck_require__(34793); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); } - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; + return needMoreData(state); +} - if (typeof options.writev === 'function') this._writev = options.writev; +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} - if (typeof options.final === 'function') this._final = options.final; +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); } + return er; +} - Stream.call(this); +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; }; -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(50176)/* .StringDecoder */ .I); + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - return valid; + return n; } -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; } + return state.length; +} - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; - if (typeof cb !== 'function') cb = nop; + if (n !== 0) state.emittedReadable = false; - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } - return ret; -}; + n = howMuchToRead(n, state); -Writable.prototype.cork = function () { - var state = this._writableState; + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } - state.corked++; -}; + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. -Writable.prototype.uncork = function () { - var state = this._writableState; + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); - if (state.corked) { - state.corked--; + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); } -}; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; } - return chunk; -} -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; + if (ret !== null) this.emit('data', ret); - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; + return ret; +}; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); } + state.ended = true; - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); } -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } } -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); } -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); } } -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; } + state.readingMore = false; } -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - doWrite(stream, state, true, state.length, buffer, '', holder.finish); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); } } - - if (entry === null) state.lastBufferedRequest = null; } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; + function onend() { + debug('onend'); + dest.end(); } - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); - // ignore unnecessary end() calls. - if (!state.ending) endWritable(this, state, cb); -}; + cleanedUp = true; -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } -} -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); } } - return need; -} -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } - state.ended = true; - stream.writable = false; -} -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); } + dest.once('finish', onfinish); - // reuse the free corkReq. - state.corkedRequestsFree.next = corkReq; -} + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } + // tell the dest that it's being piped to + dest.emit('pipe', src); - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); } -}); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); + return dest; }; -/***/ }), +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} -/***/ 46127: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; -"use strict"; + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (!dest) dest = state.pipes; -var Buffer = (__nccwpck_require__(13644).Buffer); -var util = __nccwpck_require__(39023); + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} + // slow case. multiple pipe destinations. -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; - this.head = null; - this.tail = null; - this.length = 0; + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, { hasUnpiped: false }); + }return this; } - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; + dest.emit('unpipe', this, unpipeInfo); - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; + return this; +}; - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } } - return ret; - }; + } - return BufferList; -}(); + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); } -/***/ }), +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; -/***/ 91031: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} -"use strict"; +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} -/**/ +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; -var pna = __nccwpck_require__(41564); -/**/ +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; + var state = this._readableState; + var paused = false; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - pna.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, this, err); - } + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); } - return this; - } + _this.push(null); + }); - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); - if (this._readableState) { - this._readableState.destroyed = true; + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } } - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - pna.nextTick(emitErrorNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, _this, err); - } - } else if (cb) { - cb(err); + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); } - }); + }; return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; } -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } + return ret; +} - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; } + list.length -= c; + return ret; } -function emitErrorNT(self, err) { - self.emit('error', err); +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; } -module.exports = { - destroy: destroy, - undestroy: undestroy -}; +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} /***/ }), -/***/ 87137: +/***/ 69343: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(2203); +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + + + +module.exports = Transform; + +var Duplex = __nccwpck_require__(34793); + +/**/ +var util = Object.create(__nccwpck_require__(45481)); +util.inherits = __nccwpck_require__(39598); +/**/ +util.inherits(Transform, Duplex); -/***/ }), +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; -/***/ 1835: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var cb = ts.writecb; -module.exports = __nccwpck_require__(73109).PassThrough + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + ts.writechunk = null; + ts.writecb = null; -/***/ }), + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); -/***/ 73109: -/***/ ((module, exports, __nccwpck_require__) => { + cb(er); -var Stream = __nccwpck_require__(2203); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = __nccwpck_require__(74559); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = __nccwpck_require__(54579); - exports.Duplex = __nccwpck_require__(34793); - exports.Transform = __nccwpck_require__(69343); - exports.PassThrough = __nccwpck_require__(72029); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } } +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); -/***/ }), + Duplex.call(this, options); -/***/ 13644: -/***/ ((module, exports, __nccwpck_require__) => { + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; -/* eslint-disable node/no-deprecated-api */ -var buffer = __nccwpck_require__(20181) -var Buffer = buffer.Buffer + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); } -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) +function prefinish() { + var _this = this; -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); } - return Buffer(arg, encodingOrOffset, length) } -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { - buf.fill(0) + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - return buf -} +}; -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + return stream.push(null); +} /***/ }), -/***/ 50176: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 54579: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. @@ -75774,2164 +37978,1622 @@ SafeBuffer.allocUnsafeSlow = function (size) { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + /**/ -var Buffer = (__nccwpck_require__(13644).Buffer); +var pna = __nccwpck_require__(19183); /**/ -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; +module.exports = Writable; -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; } -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.I = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; } +/* */ -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ -StringDecoder.prototype.end = utf8End; +/**/ +var Duplex; +/**/ -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; +Writable.WritableState = WritableState; -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; +/**/ +var util = Object.create(__nccwpck_require__(45481)); +util.inherits = __nccwpck_require__(39598); +/**/ + +/**/ +var internalUtil = { + deprecate: __nccwpck_require__(24488) }; +/**/ -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - 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; - return byte >> 6 === 0x02 ? -1 : -2; +/**/ +var Stream = __nccwpck_require__(87137); +/**/ + +/**/ + +var Buffer = (__nccwpck_require__(13644).Buffer); +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; +/**/ + +var destroyImpl = __nccwpck_require__(91031); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || __nccwpck_require__(34793); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; } - return nb; - } - return 0; + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; } -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } +function Writable(options) { + Duplex = Duplex || __nccwpck_require__(34793); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); } -} -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); + Stream.call(this); } -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); } -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; } -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); } - return r; -} -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - return buf.toString('base64', i, buf.length - n); -} -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} + if (typeof cb !== 'function') cb = nop; -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } -/***/ }), + return ret; +}; -/***/ 97623: -/***/ ((module) => { +Writable.prototype.cork = function () { + var state = this._writableState; -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ + state.corked++; +}; -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +Writable.prototype.uncork = function () { + var state = this._writableState; -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + if (state.corked) { + state.corked--; -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); } - return func.apply(thisArg, args); + return chunk; } -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); - while (++index < n) { - result[index] = iteratee(index); +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } } - return result; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; } -/** Used for built-in method references. */ -var objectProto = Object.prototype; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; + onwriteStateUpdate(state); - var length = result.length, - skipIndexes = !!length; + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); } } - return result; } -/** - * Used by `_.defaults` to customize its `_.assignIn` use. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ -function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); } -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); } } -/** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; } - } - return result; -} + buffer.allBuffers = allBuffers; -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - while (++index < length) { - array[index] = args[start + index]; + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - object || (object = {}); + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - var index = -1, - length = props.length; +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; - while (++index < length) { - var key = props[index]; +Writable.prototype._writev = null; - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - assignValue(object, key, newValue === undefined ? source[key] : newValue); + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - return object; -} -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } + // ignore unnecessary end() calls. + if (!state.ending) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); } - return object; + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); }); } - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } } - return false; -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; } -/** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); } } - return result; + return need; } -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; } -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + + // reuse the free corkReq. + state.corkedRequestsFree.next = corkReq; } -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} +/***/ }), -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} +/***/ 46127: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} +"use strict"; -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} -/** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ -var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); -}); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ -var defaults = baseRest(function(args) { - args.push(undefined, assignInDefaults); - return apply(assignInWith, undefined, args); -}); +var Buffer = (__nccwpck_require__(13644).Buffer); +var util = __nccwpck_require__(39023); -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +function copyBuffer(src, target, offset) { + src.copy(target, offset); } -module.exports = defaults; +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } -/***/ }), + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; -/***/ 91306: -/***/ ((module) => { + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; + return BufferList; +}(); -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +/***/ }), -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; +/***/ 91031: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +"use strict"; -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); +/**/ -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} +var pna = __nccwpck_require__(19183); +/**/ -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - var length = array ? array.length : 0; - return !!length && baseIndexOf(array, value, 0) > -1; -} +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array ? array.length : 0; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; - while (++index < length) { - if (comparator(value, array[index])) { - return true; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + pna.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, this, err); + } } - } - return false; -} - -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array ? array.length : 0, - result = Array(length); - while (++index < length) { - result[index] = iteratee(array[index], index, array); + return this; } - return result; -} -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks - while (++index < length) { - array[offset + index] = values[index]; + if (this._readableState) { + this._readableState.destroyed = true; } - return array; -} -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + pna.nextTick(emitErrorNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, _this, err); + } + } else if (cb) { + cb(err); } - } - return -1; + }); + + return this; } -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; } - var index = fromIndex - 1, - length = array.length; - while (++index < length) { - if (array[index] === value) { - return index; - } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; } - return -1; } -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; +function emitErrorNT(self, err) { + self.emit('error', err); } -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} +module.exports = { + destroy: destroy, + undestroy: undestroy +}; -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} +/***/ }), -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} +/***/ 87137: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} +module.exports = __nccwpck_require__(2203); -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; +/***/ }), -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); +/***/ 1835: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +module.exports = __nccwpck_require__(73109).PassThrough -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; +/***/ }), -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +/***/ 73109: +/***/ ((module, exports, __nccwpck_require__) => { -/** Built-in value references. */ -var Symbol = root.Symbol, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; +var Stream = __nccwpck_require__(2203); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = __nccwpck_require__(74559); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __nccwpck_require__(54579); + exports.Duplex = __nccwpck_require__(34793); + exports.Transform = __nccwpck_require__(69343); + exports.PassThrough = __nccwpck_require__(72029); +} -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); +/***/ }), -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; +/***/ 13644: +/***/ ((module, exports, __nccwpck_require__) => { - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(20181) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] } } +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) } -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) } -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') } - return hasOwnProperty.call(data, key) ? data[key] : undefined; + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf } -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) } -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) } -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; +/***/ }), + +/***/ 50176: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +/**/ - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); +var Buffer = (__nccwpck_require__(13644).Buffer); +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; } - return true; -} +}; -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; - return index < 0 ? undefined : data[index][1]; +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; } -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.I = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); } -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; } else { - data[index][1] = value; + i = 0; } - return this; -} + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; +StringDecoder.prototype.end = utf8End; -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); } -} + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + 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; + return byte >> 6 === 0x02 ? -1 : -2; } -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; } -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } } -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; } -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); } -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; } -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); } -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; } -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; } - return -1; + return buf.toString('base64', i, buf.length - n); } -/** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; } +/***/ }), + +/***/ 66320: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var hashClear = __nccwpck_require__(48051), + hashDelete = __nccwpck_require__(15431), + hashGet = __nccwpck_require__(26934), + hashHas = __nccwpck_require__(64306), + hashSet = __nccwpck_require__(17226); + /** - * The base implementation of `_.flatten` with support for restricting flattening. + * Creates a hash object. * * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function baseFlatten(array, depth, predicate, isStrict, result) { +function Hash(entries) { var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); + length = entries == null ? 0 : entries.length; + this.clear(); while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return result; } +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; + + +/***/ }), + +/***/ 68884: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var listCacheClear = __nccwpck_require__(99791), + listCacheDelete = __nccwpck_require__(24555), + listCacheGet = __nccwpck_require__(86634), + listCacheHas = __nccwpck_require__(8430), + listCacheSet = __nccwpck_require__(36918); + /** - * The base implementation of `_.isNative` without bad shim checks. + * Creates an list cache object. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); } -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} +module.exports = ListCache; -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} +/***/ }), -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); -} +/***/ 98272: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getNative = __nccwpck_require__(68573), + root = __nccwpck_require__(6748); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), + +/***/ 79660: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var mapCacheClear = __nccwpck_require__(88487), + mapCacheDelete = __nccwpck_require__(36275), + mapCacheGet = __nccwpck_require__(30130), + mapCacheHas = __nccwpck_require__(69254), + mapCacheSet = __nccwpck_require__(59806); /** - * Checks if `value` is suitable for use as unique object key. + * Creates a map cache object to store key-value pairs. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; + + +/***/ }), + +/***/ 84986: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getNative = __nccwpck_require__(68573), + root = __nccwpck_require__(6748); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; + + +/***/ }), + +/***/ 23706: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var MapCache = __nccwpck_require__(79660), + setCacheAdd = __nccwpck_require__(44671), + setCacheHas = __nccwpck_require__(71884); + /** - * Checks if `func` has its source masked. + * + * Creates an array cache object to store unique values. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @constructor + * @param {Array} [values] The values to cache. */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } } +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; + + +/***/ }), + +/***/ 38584: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var root = __nccwpck_require__(6748); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), + +/***/ 59678: +/***/ ((module) => { + /** - * Converts `func` to its source code. + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. * * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); } - return ''; + return func.apply(thisArg, args); } -/** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order of result values is determined by the - * order they occur in the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ -var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; -}); +module.exports = apply; -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} +/***/ }), -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; +/***/ 70534: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} +var baseIndexOf = __nccwpck_require__(84760); /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. * - * _.isArrayLikeObject(_.noop); - * // => false + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; } -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} +module.exports = arrayIncludes; -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} + +/***/ }), + +/***/ 37314: +/***/ ((module) => { /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * This function is like `arrayIncludes` except that it accepts a comparator. * - * _.isObject(null); - * // => false + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; } +module.exports = arrayIncludesWith; + + +/***/ }), + +/***/ 62000: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseTimes = __nccwpck_require__(21299), + isArguments = __nccwpck_require__(60541), + isArray = __nccwpck_require__(77192), + isBuffer = __nccwpck_require__(43739), + isIndex = __nccwpck_require__(37446), + isTypedArray = __nccwpck_require__(35000); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false + * Creates an array of the enumerable property names of the array-like `value`. * - * _.isObjectLike(null); - * // => false + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; } -module.exports = difference; +module.exports = arrayLikeKeys; /***/ }), -/***/ 43549: +/***/ 56649: /***/ ((module) => { /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; +module.exports = arrayMap; -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +/***/ }), -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); +/***/ 50827: +/***/ ((module) => { /** * Appends the elements of `values` to `array`. @@ -77952,23 +39614,149 @@ function arrayPush(array, values) { return array; } -/** Used for built-in method references. */ -var objectProto = Object.prototype; +module.exports = arrayPush; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + +/***/ }), + +/***/ 74024: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var eq = __nccwpck_require__(75199); /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; + + +/***/ }), + +/***/ 3126: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var SetCache = __nccwpck_require__(23706), + arrayIncludes = __nccwpck_require__(70534), + arrayIncludesWith = __nccwpck_require__(37314), + arrayMap = __nccwpck_require__(56649), + baseUnary = __nccwpck_require__(55506), + cacheHas = __nccwpck_require__(64486); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. */ -var objectToString = objectProto.toString; +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; -/** Built-in value references. */ -var Symbol = root.Symbol, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; + + +/***/ }), + +/***/ 35588: +/***/ ((module) => { + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + + +/***/ }), + +/***/ 63183: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var arrayPush = __nccwpck_require__(50827), + isFlattenable = __nccwpck_require__(45088); /** * The base implementation of `_.flatten` with support for restricting flattening. @@ -78004,434 +39792,124 @@ function baseFlatten(array, depth, predicate, isStrict, result) { return result; } -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); -} - -/** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ -function flatten(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, 1) : []; -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} +module.exports = baseFlatten; -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} +/***/ }), -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} +/***/ 29117: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} +var Symbol = __nccwpck_require__(38584), + getRawTag = __nccwpck_require__(95292), + objectToString = __nccwpck_require__(71723); -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false + * The base implementation of `getTag` without fallbacks for buggy environments. * - * _.isObjectLike(null); - * // => false + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } -module.exports = flatten; +module.exports = baseGetTag; /***/ }), -/***/ 29888: -/***/ ((module) => { - -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; +/***/ 84760: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} +var baseFindIndex = __nccwpck_require__(35588), + baseIsNaN = __nccwpck_require__(34352), + strictIndexOf = __nccwpck_require__(95232); /** - * Creates a unary function that invokes `func` with its argument transformed. + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); } -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +module.exports = baseIndexOf; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); +/***/ }), -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; +/***/ 93605: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); +var baseGetTag = __nccwpck_require__(29117), + isObjectLike = __nccwpck_require__(51645); -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. + * The base implementation of `_.isArguments`. * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang + * @private * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ -function isPlainObject(value) { - if (!isObjectLike(value) || - objectToString.call(value) != objectTag || isHostObject(value)) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } -module.exports = isPlainObject; +module.exports = baseIsArguments; /***/ }), -/***/ 51104: +/***/ 34352: /***/ ((module) => { /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ +function baseIsNaN(value) { + return value !== value; +} -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +module.exports = baseIsNaN; -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; +/***/ }), -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; +/***/ 92334: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isFunction = __nccwpck_require__(34329), + isMasked = __nccwpck_require__(46613), + isObject = __nccwpck_require__(96482), + toSource = __nccwpck_require__(57192); /** * Used to match `RegExp` @@ -78442,149 +39920,335 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. + * The base implementation of `_.isNative` without bad shim checks. * * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; } - return func.apply(thisArg, args); + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. +module.exports = baseIsNative; + + +/***/ }), + +/***/ 16880: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseGetTag = __nccwpck_require__(29117), + isLength = __nccwpck_require__(56657), + isObjectLike = __nccwpck_require__(51645); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ -function arrayIncludes(array, value) { - var length = array ? array.length : 0; - return !!length && baseIndexOf(array, value, 0) > -1; +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } +module.exports = baseIsTypedArray; + + +/***/ }), + +/***/ 82094: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isObject = __nccwpck_require__(96482), + isPrototype = __nccwpck_require__(55944), + nativeKeysIn = __nccwpck_require__(94008); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** - * This function is like `arrayIncludes` except that it accepts a comparator. + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array ? array.length : 0; +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; - while (++index < length) { - if (comparator(value, array[index])) { - return true; + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); } } - return false; + return result; } +module.exports = baseKeysIn; + + +/***/ }), + +/***/ 22035: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var identity = __nccwpck_require__(46851), + overRest = __nccwpck_require__(20168), + setToString = __nccwpck_require__(59402); + /** - * Appends the elements of `values` to `array`. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ -function arrayPush(array, values) { +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; + + +/***/ }), + +/***/ 64953: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var constant = __nccwpck_require__(85089), + defineProperty = __nccwpck_require__(83106), + identity = __nccwpck_require__(46851); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; + + +/***/ }), + +/***/ 21299: +/***/ ((module) => { + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { var index = -1, - length = values.length, - offset = array.length; + result = Array(n); - while (++index < length) { - array[offset + index] = values[index]; + while (++index < n) { + result[index] = iteratee(index); } - return array; + return result; } +module.exports = baseTimes; + + +/***/ }), + +/***/ 55506: +/***/ ((module) => { + /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. + * The base implementation of `_.unary` without support for storing metadata. * * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; +function baseUnary(func) { + return function(value) { + return func(value); + }; } +module.exports = baseUnary; + + +/***/ }), + +/***/ 32772: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var SetCache = __nccwpck_require__(23706), + arrayIncludes = __nccwpck_require__(70534), + arrayIncludesWith = __nccwpck_require__(37314), + cacheHas = __nccwpck_require__(64486), + createSet = __nccwpck_require__(48242), + setToArray = __nccwpck_require__(11894); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: while (++index < length) { - if (array[index] === value) { - return index; + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); } } - return -1; + return result; } -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} +module.exports = baseUniq; + + +/***/ }), + +/***/ 64486: +/***/ ((module) => { /** - * Checks if a cache value for `key` exists. + * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. @@ -78595,70 +40259,148 @@ function cacheHas(cache, key) { return cache.has(key); } +module.exports = cacheHas; + + +/***/ }), + +/***/ 60252: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var root = __nccwpck_require__(6748); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), + +/***/ 48242: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Set = __nccwpck_require__(84986), + noop = __nccwpck_require__(89029), + setToArray = __nccwpck_require__(11894); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + /** - * Gets the value at `key` of `object`. + * Creates a set object of `values`. * * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +module.exports = createSet; + + +/***/ }), + +/***/ 83106: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getNative = __nccwpck_require__(68573); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), + +/***/ 78997: +/***/ ((module) => { + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; + + +/***/ }), + +/***/ 1194: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isKeyable = __nccwpck_require__(93245); /** - * Checks if `value` is a host object in IE < 9. + * Gets the data for `map`. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; } +module.exports = getMapData; + + +/***/ }), + +/***/ 68573: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseIsNative = __nccwpck_require__(92334), + getValue = __nccwpck_require__(8293); + /** - * Converts `set` to an array of its values. + * Gets the native function at `key` of `object`. * * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; } -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; +module.exports = getNative; -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); +/***/ }), -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +/***/ 86194: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var overArg = __nccwpck_require__(61128); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), + +/***/ 95292: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Symbol = __nccwpck_require__(38584); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; @@ -78668,46 +40410,68 @@ var hasOwnProperty = objectProto.hasOwnProperty; * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +var nativeObjectToString = objectProto.toString; /** Built-in value references. */ -var Symbol = root.Symbol, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - nativeCreate = getNative(Object, 'create'); +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * Creates a hash object. + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } } + return result; +} + +module.exports = getRawTag; + + +/***/ }), + +/***/ 8293: +/***/ ((module) => { + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; } +module.exports = getValue; + + +/***/ }), + +/***/ 48051: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var nativeCreate = __nccwpck_require__(71563); + /** * Removes all key-value entries from the hash. * @@ -78717,8 +40481,17 @@ function Hash(entries) { */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } +module.exports = hashClear; + + +/***/ }), + +/***/ 15431: +/***/ ((module) => { + /** * Removes `key` and its value from the hash. * @@ -78730,9 +40503,30 @@ function hashClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; } +module.exports = hashDelete; + + +/***/ }), + +/***/ 26934: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var nativeCreate = __nccwpck_require__(71563); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** * Gets the hash value for `key`. * @@ -78751,6 +40545,22 @@ function hashGet(key) { return hasOwnProperty.call(data, key) ? data[key] : undefined; } +module.exports = hashGet; + + +/***/ }), + +/***/ 64306: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var nativeCreate = __nccwpck_require__(71563); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** * Checks if a hash value for `key` exists. * @@ -78762,9 +40572,22 @@ function hashGet(key) { */ function hashHas(key) { var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } +module.exports = hashHas; + + +/***/ }), + +/***/ 17226: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var nativeCreate = __nccwpck_require__(71563); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + /** * Sets the hash `key` to `value`. * @@ -78777,35 +40600,189 @@ function hashHas(key) { */ function hashSet(key, value) { var data = this.__data__; + this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; +module.exports = hashSet; + + +/***/ }), + +/***/ 45088: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Symbol = __nccwpck_require__(38584), + isArguments = __nccwpck_require__(60541), + isArray = __nccwpck_require__(77192); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** - * Creates an list cache object. + * Checks if `value` is a flattenable `arguments` object or array. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); +module.exports = isFlattenable; + + +/***/ }), + +/***/ 37446: +/***/ ((module) => { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), + +/***/ 3349: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var eq = __nccwpck_require__(75199), + isArrayLike = __nccwpck_require__(75119), + isIndex = __nccwpck_require__(37446), + isObject = __nccwpck_require__(96482); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); } + return false; +} + +module.exports = isIterateeCall; + + +/***/ }), + +/***/ 93245: +/***/ ((module) => { + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; + + +/***/ }), + +/***/ 46613: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var coreJsData = __nccwpck_require__(60252); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; + + +/***/ }), + +/***/ 55944: +/***/ ((module) => { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; } +module.exports = isPrototype; + + +/***/ }), + +/***/ 99791: +/***/ ((module) => { + /** * Removes all key-value entries from the list cache. * @@ -78815,8 +40792,25 @@ function ListCache(entries) { */ function listCacheClear() { this.__data__ = []; + this.size = 0; } +module.exports = listCacheClear; + + +/***/ }), + +/***/ 24555: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var assocIndexOf = __nccwpck_require__(74024); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + /** * Removes `key` and its value from the list cache. * @@ -78839,9 +40833,20 @@ function listCacheDelete(key) { } else { splice.call(data, index, 1); } + --this.size; return true; } +module.exports = listCacheDelete; + + +/***/ }), + +/***/ 86634: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var assocIndexOf = __nccwpck_require__(74024); + /** * Gets the list cache value for `key`. * @@ -78858,6 +40863,16 @@ function listCacheGet(key) { return index < 0 ? undefined : data[index][1]; } +module.exports = listCacheGet; + + +/***/ }), + +/***/ 8430: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var assocIndexOf = __nccwpck_require__(74024); + /** * Checks if a list cache value for `key` exists. * @@ -78871,6 +40886,16 @@ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } +module.exports = listCacheHas; + + +/***/ }), + +/***/ 36918: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var assocIndexOf = __nccwpck_require__(74024); + /** * Sets the list cache `key` to `value`. * @@ -78886,6 +40911,7 @@ function listCacheSet(key, value) { index = assocIndexOf(data, key); if (index < 0) { + ++this.size; data.push([key, value]); } else { data[index][1] = value; @@ -78893,30 +40919,17 @@ function listCacheSet(key, value) { return this; } -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; +module.exports = listCacheSet; -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +/***/ }), + +/***/ 88487: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Hash = __nccwpck_require__(66320), + ListCache = __nccwpck_require__(68884), + Map = __nccwpck_require__(98272); /** * Removes all key-value entries from the map. @@ -78926,6 +40939,7 @@ function MapCache(entries) { * @memberOf MapCache */ function mapCacheClear() { + this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), @@ -78933,6 +40947,16 @@ function mapCacheClear() { }; } +module.exports = mapCacheClear; + + +/***/ }), + +/***/ 36275: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getMapData = __nccwpck_require__(1194); + /** * Removes `key` and its value from the map. * @@ -78943,9 +40967,21 @@ function mapCacheClear() { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; } +module.exports = mapCacheDelete; + + +/***/ }), + +/***/ 30130: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getMapData = __nccwpck_require__(1194); + /** * Gets the map value for `key`. * @@ -78959,6 +40995,16 @@ function mapCacheGet(key) { return getMapData(this, key).get(key); } +module.exports = mapCacheGet; + + +/***/ }), + +/***/ 69254: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getMapData = __nccwpck_require__(1194); + /** * Checks if a map value for `key` exists. * @@ -78972,6 +41018,16 @@ function mapCacheHas(key) { return getMapData(this, key).has(key); } +module.exports = mapCacheHas; + + +/***/ }), + +/***/ 59806: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getMapData = __nccwpck_require__(1194); + /** * Sets the map `key` to `value`. * @@ -78983,144 +41039,166 @@ function mapCacheHas(key) { * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; return this; } -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; +module.exports = mapCacheSet; + + +/***/ }), + +/***/ 71563: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getNative = __nccwpck_require__(68573); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; + + +/***/ }), + +/***/ 94008: +/***/ ((module) => { /** - * - * Creates an array cache object to store unique values. + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. * * @private - * @constructor - * @param {Array} [values] The values to cache. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } } + return result; } +module.exports = nativeKeysIn; + + +/***/ }), + +/***/ 88724: +/***/ ((module, exports, __nccwpck_require__) => { + +/* module decorator */ module = __nccwpck_require__.nmd(module); +var freeGlobal = __nccwpck_require__(78997); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; + + +/***/ }), + +/***/ 71723: +/***/ ((module) => { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} +var nativeObjectToString = objectProto.toString; /** - * Checks if `value` is in the array cache. + * Converts `value` to a string using `Object.prototype.toString`. * * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. */ -function setCacheHas(value) { - return this.__data__.has(value); +function objectToString(value) { + return nativeObjectToString.call(value); } -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; +module.exports = objectToString; + + +/***/ }), + +/***/ 61128: +/***/ ((module) => { /** - * Gets the index at which the `key` is found in `array` of key-value pairs. + * Creates a unary function that invokes `func` with its argument transformed. * * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; } -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; +module.exports = overArg; - predicate || (predicate = isFlattenable); - result || (result = []); - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} +/***/ }), -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} +/***/ 20168: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var apply = __nccwpck_require__(59678); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ -function baseRest(func, start) { +function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, @@ -79136,153 +41214,213 @@ function baseRest(func, start) { while (++index < start) { otherArgs[index] = args[index]; } - otherArgs[start] = array; + otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } +module.exports = overRest; + + +/***/ }), + +/***/ 6748: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var freeGlobal = __nccwpck_require__(78997); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), + +/***/ 44671: +/***/ ((module) => { + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -/** - * Creates a set object of `values`. + * Adds `value` to the array cache. * * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. */ -var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); -}; +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; + + +/***/ }), + +/***/ 71884: +/***/ ((module) => { /** - * Gets the data for `map`. + * Checks if `value` is in the array cache. * * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {boolean} Returns `true` if `value` is found, else `false`. */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; +function setCacheHas(value) { + return this.__data__.has(value); } +module.exports = setCacheHas; + + +/***/ }), + +/***/ 11894: +/***/ ((module) => { + /** - * Gets the native function at `key` of `object`. + * Converts `set` to an array of its values. * * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; } +module.exports = setToArray; + + +/***/ }), + +/***/ 59402: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseSetToString = __nccwpck_require__(64953), + shortOut = __nccwpck_require__(83286); + /** - * Checks if `value` is a flattenable `arguments` object or array. + * Sets the `toString` method of `func` to return `string`. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); -} +var setToString = shortOut(baseSetToString); + +module.exports = setToString; + + +/***/ }), + +/***/ 83286: +/***/ ((module) => { + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; /** - * Checks if `value` is suitable for use as unique object key. + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; } +module.exports = shortOut; + + +/***/ }), + +/***/ 95232: +/***/ ((module) => { + /** - * Checks if `func` has its source masked. + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; } +module.exports = strictIndexOf; + + +/***/ }), + +/***/ 57192: +/***/ ((module) => { + +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + /** * Converts `func` to its source code. * * @private - * @param {Function} func The function to process. + * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { @@ -79297,26 +41435,158 @@ function toSource(func) { return ''; } +module.exports = toSource; + + +/***/ }), + +/***/ 85089: +/***/ ((module) => { + /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; + + +/***/ }), + +/***/ 7511: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseRest = __nccwpck_require__(22035), + eq = __nccwpck_require__(75199), + isIterateeCall = __nccwpck_require__(3349), + keysIn = __nccwpck_require__(19430); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; +}); + +module.exports = defaults; + + +/***/ }), + +/***/ 57294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseDifference = __nccwpck_require__(3126), + baseFlatten = __nccwpck_require__(63183), + baseRest = __nccwpck_require__(22035), + isArrayLikeObject = __nccwpck_require__(97100); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor * @example * - * _.union([2], [1, 2]); - * // => [2, 1] + * _.difference([2, 1], [2, 3]); + * // => [1] */ -var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; }); +module.exports = difference; + + +/***/ }), + +/***/ 75199: +/***/ ((module) => { + /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) @@ -79353,6 +41623,83 @@ function eq(value, other) { return value === other || (value !== value && other !== other); } +module.exports = eq; + + +/***/ }), + +/***/ 97047: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseFlatten = __nccwpck_require__(63183); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; + + +/***/ }), + +/***/ 46851: +/***/ ((module) => { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), + +/***/ 60541: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseIsArguments = __nccwpck_require__(93605), + isObjectLike = __nccwpck_require__(51645); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + /** * Checks if `value` is likely an `arguments` object. * @@ -79371,11 +41718,18 @@ function eq(value, other) { * _.isArguments([1, 2, 3]); * // => false */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; + + +/***/ }), + +/***/ 77192: +/***/ ((module) => { /** * Checks if `value` is classified as an `Array` object. @@ -79402,6 +41756,17 @@ function isArguments(value) { */ var isArray = Array.isArray; +module.exports = isArray; + + +/***/ }), + +/***/ 75119: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isFunction = __nccwpck_require__(34329), + isLength = __nccwpck_require__(56657); + /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or @@ -79431,6 +41796,17 @@ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } +module.exports = isArrayLike; + + +/***/ }), + +/***/ 97100: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isArrayLike = __nccwpck_require__(75119), + isObjectLike = __nccwpck_require__(51645); + /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. @@ -79460,6 +41836,69 @@ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } +module.exports = isArrayLikeObject; + + +/***/ }), + +/***/ 43739: +/***/ ((module, exports, __nccwpck_require__) => { + +/* module decorator */ module = __nccwpck_require__.nmd(module); +var root = __nccwpck_require__(6748), + stubFalse = __nccwpck_require__(92074); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; + + +/***/ }), + +/***/ 34329: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseGetTag = __nccwpck_require__(29117), + isObject = __nccwpck_require__(96482); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + /** * Checks if `value` is classified as a `Function` object. * @@ -79478,101 +41917,281 @@ function isArrayLikeObject(value) { * // => false */ function isFunction(value) { + if (!isObject(value)) { + return false; + } // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; + + +/***/ }), + +/***/ 56657: +/***/ ((module) => { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + + +/***/ }), + +/***/ 96482: +/***/ ((module) => { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), + +/***/ 51645: +/***/ ((module) => { + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; } +module.exports = isObjectLike; + + +/***/ }), + +/***/ 36542: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseGetTag = __nccwpck_require__(29117), + getPrototype = __nccwpck_require__(86194), + isObjectLike = __nccwpck_require__(51645); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ - * @since 4.0.0 + * @since 0.8.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * - * _.isLength(3); - * // => true + * function Foo() { + * this.a = 1; + * } * - * _.isLength(Number.MIN_VALUE); + * _.isPlainObject(new Foo); * // => false * - * _.isLength(Infinity); + * _.isPlainObject([1, 2, 3]); * // => false * - * _.isLength('3'); - * // => false + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; } +module.exports = isPlainObject; + + +/***/ }), + +/***/ 35000: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseIsTypedArray = __nccwpck_require__(16880), + baseUnary = __nccwpck_require__(55506), + nodeUtil = __nccwpck_require__(88724); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * Checks if `value` is classified as a typed array. * * @static * @memberOf _ - * @since 0.1.0 + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); + * _.isTypedArray(new Uint8Array); * // => true * - * _.isObject(null); + * _.isTypedArray([]); * // => false */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; + + +/***/ }), + +/***/ 19430: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var arrayLikeKeys = __nccwpck_require__(62000), + baseKeysIn = __nccwpck_require__(82094), + isArrayLike = __nccwpck_require__(75119); /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. * @example * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * _.isObjectLike(_.noop); - * // => false + * Foo.prototype.c = 3; * - * _.isObjectLike(null); - * // => false + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } +module.exports = keysIn; + + +/***/ }), + +/***/ 89029: +/***/ ((module) => { + /** * This method returns `undefined`. * @@ -79589,6 +42208,64 @@ function noop() { // No operation performed. } +module.exports = noop; + + +/***/ }), + +/***/ 92074: +/***/ ((module) => { + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = stubFalse; + + +/***/ }), + +/***/ 73270: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseFlatten = __nccwpck_require__(63183), + baseRest = __nccwpck_require__(22035), + baseUniq = __nccwpck_require__(32772), + isArrayLikeObject = __nccwpck_require__(97100); + +/** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ +var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); +}); + module.exports = union; @@ -79912,960 +42589,6 @@ function populateMaps (extensions, types) { } -/***/ }), - -/***/ 43772: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = (function () { try { return __nccwpck_require__(16928) } catch (e) {}}()) || { - sep: '/' -} -minimatch.sep = path.sep - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __nccwpck_require__(94691) - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - b = b || {} - var t = {} - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - m.Minimatch.defaults = function defaults (options) { - return orig.defaults(ext(def, options)).Minimatch - } - - m.filter = function filter (pattern, options) { - return orig.filter(pattern, ext(def, options)) - } - - m.defaults = function defaults (options) { - return orig.defaults(ext(def, options)) - } - - m.makeRe = function makeRe (pattern, options) { - return orig.makeRe(pattern, ext(def, options)) - } - - m.braceExpand = function braceExpand (pattern, options) { - return orig.braceExpand(pattern, ext(def, options)) - } - - m.match = function (list, pattern, options) { - return orig.match(list, pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - assertValidPattern(pattern) - - if (!options) options = {} - - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (!options.allowWindowsEscape && path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - assertValidPattern(pattern) - - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -var MAX_PATTERN_LENGTH = 1024 * 64 -var assertValidPattern = function (pattern) { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } - - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - assertValidPattern(pattern) - - var options = this.options - - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - /* istanbul ignore next */ - case '/': { - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - } - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '[': case '.': case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = function match (f, partial) { - if (typeof partial === 'undefined') partial = this.partial - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - - /***/ }), /***/ 4469: @@ -82973,404 +44696,2351 @@ module.exports = function(path, stripTrailing) { } } - var segs = path.split(/[/\\]+/); - if (stripTrailing !== false && segs[segs.length - 1] === '') { - segs.pop(); + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); +}; + + +/***/ }), + +/***/ 55560: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var wrappy = __nccwpck_require__(58264) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} + + +/***/ }), + +/***/ 19183: +/***/ ((module) => { + +"use strict"; + + +if (typeof process === 'undefined' || + !process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + + + +/***/ }), + +/***/ 7945: +/***/ ((module) => { + +// for now just expose the builtin process global from node.js +module.exports = global.process; + + +/***/ }), + +/***/ 80652: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { SymbolDispose } = __nccwpck_require__(50999) +const { AbortError, codes } = __nccwpck_require__(69220) +const { isNodeStream, isWebStream, kControllerErrorFunction } = __nccwpck_require__(83426) +const eos = __nccwpck_require__(36815) +const { ERR_INVALID_ARG_TYPE } = codes +let addAbortListener + +// This method is inlined here for readable-stream +// It also does not allow for signal to not exist on the stream +// https://github.com/nodejs/node/pull/36061#discussion_r533718029 +const validateAbortSignal = (signal, name) => { + if (typeof signal !== 'object' || !('aborted' in signal)) { + throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal) + } +} +module.exports.addAbortSignal = function addAbortSignal(signal, stream) { + validateAbortSignal(signal, 'signal') + if (!isNodeStream(stream) && !isWebStream(stream)) { + throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream) + } + return module.exports.addAbortSignalNoValidate(signal, stream) +} +module.exports.addAbortSignalNoValidate = function (signal, stream) { + if (typeof signal !== 'object' || !('aborted' in signal)) { + return stream + } + const onAbort = isNodeStream(stream) + ? () => { + stream.destroy( + new AbortError(undefined, { + cause: signal.reason + }) + ) + } + : () => { + stream[kControllerErrorFunction]( + new AbortError(undefined, { + cause: signal.reason + }) + ) + } + if (signal.aborted) { + onAbort() + } else { + addAbortListener = addAbortListener || (__nccwpck_require__(23539).addAbortListener) + const disposable = addAbortListener(signal, onAbort) + eos(stream, disposable[SymbolDispose]) + } + return stream +} + + +/***/ }), + +/***/ 77336: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array } = __nccwpck_require__(50999) +const { Buffer } = __nccwpck_require__(20181) +const { inspect } = __nccwpck_require__(23539) +module.exports = class BufferList { + constructor() { + this.head = null + this.tail = null + this.length = 0 + } + push(v) { + const entry = { + data: v, + next: null + } + if (this.length > 0) this.tail.next = entry + else this.head = entry + this.tail = entry + ++this.length + } + unshift(v) { + const entry = { + data: v, + next: this.head + } + if (this.length === 0) this.tail = entry + this.head = entry + ++this.length + } + shift() { + if (this.length === 0) return + const ret = this.head.data + if (this.length === 1) this.head = this.tail = null + else this.head = this.head.next + --this.length + return ret + } + clear() { + this.head = this.tail = null + this.length = 0 + } + join(s) { + if (this.length === 0) return '' + let p = this.head + let ret = '' + p.data + while ((p = p.next) !== null) ret += s + p.data + return ret + } + concat(n) { + if (this.length === 0) return Buffer.alloc(0) + const ret = Buffer.allocUnsafe(n >>> 0) + let p = this.head + let i = 0 + while (p) { + TypedArrayPrototypeSet(ret, p.data, i) + i += p.data.length + p = p.next + } + return ret + } + + // Consumes a specified amount of bytes or characters from the buffered data. + consume(n, hasStrings) { + const data = this.head.data + if (n < data.length) { + // `slice` is the same for buffers and strings. + const slice = data.slice(0, n) + this.head.data = data.slice(n) + return slice + } + if (n === data.length) { + // First chunk is a perfect match. + return this.shift() + } + // Result spans more than one buffer. + return hasStrings ? this._getString(n) : this._getBuffer(n) + } + first() { + return this.head.data + } + *[SymbolIterator]() { + for (let p = this.head; p; p = p.next) { + yield p.data + } + } + + // Consumes a specified amount of characters from the buffered data. + _getString(n) { + let ret = '' + let p = this.head + let c = 0 + do { + const str = p.data + if (n > str.length) { + ret += str + n -= str.length + } else { + if (n === str.length) { + ret += str + ++c + if (p.next) this.head = p.next + else this.head = this.tail = null + } else { + ret += StringPrototypeSlice(str, 0, n) + this.head = p + p.data = StringPrototypeSlice(str, n) + } + break + } + ++c + } while ((p = p.next) !== null) + this.length -= c + return ret + } + + // Consumes a specified amount of bytes from the buffered data. + _getBuffer(n) { + const ret = Buffer.allocUnsafe(n) + const retLen = n + let p = this.head + let c = 0 + do { + const buf = p.data + if (n > buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n) + n -= buf.length + } else { + if (n === buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n) + ++c + if (p.next) this.head = p.next + else this.head = this.tail = null + } else { + TypedArrayPrototypeSet(ret, new Uint8Array(buf.buffer, buf.byteOffset, n), retLen - n) + this.head = p + p.data = buf.slice(n) + } + break + } + ++c + } while ((p = p.next) !== null) + this.length -= c + return ret + } + + // Make sure the linked list only shows the minimal necessary information. + [Symbol.for('nodejs.util.inspect.custom')](_, options) { + return inspect(this, { + ...options, + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + }) + } +} + + +/***/ }), + +/***/ 64999: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { pipeline } = __nccwpck_require__(16701) +const Duplex = __nccwpck_require__(94449) +const { destroyer } = __nccwpck_require__(65089) +const { + isNodeStream, + isReadable, + isWritable, + isWebStream, + isTransformStream, + isWritableStream, + isReadableStream +} = __nccwpck_require__(83426) +const { + AbortError, + codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS } +} = __nccwpck_require__(69220) +const eos = __nccwpck_require__(36815) +module.exports = function compose(...streams) { + if (streams.length === 0) { + throw new ERR_MISSING_ARGS('streams') + } + if (streams.length === 1) { + return Duplex.from(streams[0]) + } + const orgStreams = [...streams] + if (typeof streams[0] === 'function') { + streams[0] = Duplex.from(streams[0]) + } + if (typeof streams[streams.length - 1] === 'function') { + const idx = streams.length - 1 + streams[idx] = Duplex.from(streams[idx]) + } + for (let n = 0; n < streams.length; ++n) { + if (!isNodeStream(streams[n]) && !isWebStream(streams[n])) { + // TODO(ronag): Add checks for non streams. + continue + } + if ( + n < streams.length - 1 && + !(isReadable(streams[n]) || isReadableStream(streams[n]) || isTransformStream(streams[n])) + ) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be readable') + } + if (n > 0 && !(isWritable(streams[n]) || isWritableStream(streams[n]) || isTransformStream(streams[n]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be writable') + } + } + let ondrain + let onfinish + let onreadable + let onclose + let d + function onfinished(err) { + const cb = onclose + onclose = null + if (cb) { + cb(err) + } else if (err) { + d.destroy(err) + } else if (!readable && !writable) { + d.destroy() + } + } + const head = streams[0] + const tail = pipeline(streams, onfinished) + const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head)) + const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail)) + + // TODO(ronag): Avoid double buffering. + // Implement Writable/Readable/Duplex traits. + // See, https://github.com/nodejs/node/pull/33515. + d = new Duplex({ + // TODO (ronag): highWaterMark? + writableObjectMode: !!(head !== null && head !== undefined && head.writableObjectMode), + readableObjectMode: !!(tail !== null && tail !== undefined && tail.readableObjectMode), + writable, + readable + }) + if (writable) { + if (isNodeStream(head)) { + d._write = function (chunk, encoding, callback) { + if (head.write(chunk, encoding)) { + callback() + } else { + ondrain = callback + } + } + d._final = function (callback) { + head.end() + onfinish = callback + } + head.on('drain', function () { + if (ondrain) { + const cb = ondrain + ondrain = null + cb() + } + }) + } else if (isWebStream(head)) { + const writable = isTransformStream(head) ? head.writable : head + const writer = writable.getWriter() + d._write = async function (chunk, encoding, callback) { + try { + await writer.ready + writer.write(chunk).catch(() => {}) + callback() + } catch (err) { + callback(err) + } + } + d._final = async function (callback) { + try { + await writer.ready + writer.close().catch(() => {}) + onfinish = callback + } catch (err) { + callback(err) + } + } + } + const toRead = isTransformStream(tail) ? tail.readable : tail + eos(toRead, () => { + if (onfinish) { + const cb = onfinish + onfinish = null + cb() + } + }) + } + if (readable) { + if (isNodeStream(tail)) { + tail.on('readable', function () { + if (onreadable) { + const cb = onreadable + onreadable = null + cb() + } + }) + tail.on('end', function () { + d.push(null) + }) + d._read = function () { + while (true) { + const buf = tail.read() + if (buf === null) { + onreadable = d._read + return + } + if (!d.push(buf)) { + return + } + } + } + } else if (isWebStream(tail)) { + const readable = isTransformStream(tail) ? tail.readable : tail + const reader = readable.getReader() + d._read = async function () { + while (true) { + try { + const { value, done } = await reader.read() + if (!d.push(value)) { + return + } + if (done) { + d.push(null) + return + } + } catch { + return + } + } + } + } + } + d._destroy = function (err, callback) { + if (!err && onclose !== null) { + err = new AbortError() + } + onreadable = null + ondrain = null + onfinish = null + if (onclose === null) { + callback(err) + } else { + onclose = callback + if (isNodeStream(tail)) { + destroyer(tail, err) + } + } + } + return d +} + + +/***/ }), + +/***/ 65089: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/* replacement start */ + +const process = __nccwpck_require__(7945) + +/* replacement end */ + +const { + aggregateTwoErrors, + codes: { ERR_MULTIPLE_CALLBACK }, + AbortError +} = __nccwpck_require__(69220) +const { Symbol } = __nccwpck_require__(50999) +const { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = __nccwpck_require__(83426) +const kDestroy = Symbol('kDestroy') +const kConstruct = Symbol('kConstruct') +function checkError(err, w, r) { + if (err) { + // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364 + err.stack // eslint-disable-line no-unused-expressions + + if (w && !w.errored) { + w.errored = err + } + if (r && !r.errored) { + r.errored = err + } + } +} + +// Backwards compat. cb() is undocumented and unused in core but +// unfortunately might be used by modules. +function destroy(err, cb) { + const r = this._readableState + const w = this._writableState + // With duplex streams we use the writable side for state. + const s = w || r + if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) { + if (typeof cb === 'function') { + cb() + } + return this + } + + // We set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + checkError(err, w, r) + if (w) { + w.destroyed = true + } + if (r) { + r.destroyed = true + } + + // If still constructing then defer calling _destroy. + if (!s.constructed) { + this.once(kDestroy, function (er) { + _destroy(this, aggregateTwoErrors(er, err), cb) + }) + } else { + _destroy(this, err, cb) + } + return this +} +function _destroy(self, err, cb) { + let called = false + function onDestroy(err) { + if (called) { + return + } + called = true + const r = self._readableState + const w = self._writableState + checkError(err, w, r) + if (w) { + w.closed = true + } + if (r) { + r.closed = true + } + if (typeof cb === 'function') { + cb(err) + } + if (err) { + process.nextTick(emitErrorCloseNT, self, err) + } else { + process.nextTick(emitCloseNT, self) + } + } + try { + self._destroy(err || null, onDestroy) + } catch (err) { + onDestroy(err) + } +} +function emitErrorCloseNT(self, err) { + emitErrorNT(self, err) + emitCloseNT(self) +} +function emitCloseNT(self) { + const r = self._readableState + const w = self._writableState + if (w) { + w.closeEmitted = true + } + if (r) { + r.closeEmitted = true + } + if ((w !== null && w !== undefined && w.emitClose) || (r !== null && r !== undefined && r.emitClose)) { + self.emit('close') + } +} +function emitErrorNT(self, err) { + const r = self._readableState + const w = self._writableState + if ((w !== null && w !== undefined && w.errorEmitted) || (r !== null && r !== undefined && r.errorEmitted)) { + return + } + if (w) { + w.errorEmitted = true + } + if (r) { + r.errorEmitted = true + } + self.emit('error', err) +} +function undestroy() { + const r = this._readableState + const w = this._writableState + if (r) { + r.constructed = true + r.closed = false + r.closeEmitted = false + r.destroyed = false + r.errored = null + r.errorEmitted = false + r.reading = false + r.ended = r.readable === false + r.endEmitted = r.readable === false + } + if (w) { + w.constructed = true + w.destroyed = false + w.closed = false + w.closeEmitted = false + w.errored = null + w.errorEmitted = false + w.finalCalled = false + w.prefinished = false + w.ended = w.writable === false + w.ending = w.writable === false + w.finished = w.writable === false + } +} +function errorOrDestroy(stream, err, sync) { + // We have tests that rely on errors being emitted + // in the same tick, so changing this is semver major. + // For now when you opt-in to autoDestroy we allow + // the error to be emitted nextTick. In a future + // semver major update we should change the default to this. + + const r = stream._readableState + const w = stream._writableState + if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) { + return this + } + if ((r !== null && r !== undefined && r.autoDestroy) || (w !== null && w !== undefined && w.autoDestroy)) + stream.destroy(err) + else if (err) { + // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364 + err.stack // eslint-disable-line no-unused-expressions + + if (w && !w.errored) { + w.errored = err + } + if (r && !r.errored) { + r.errored = err + } + if (sync) { + process.nextTick(emitErrorNT, stream, err) + } else { + emitErrorNT(stream, err) + } + } +} +function construct(stream, cb) { + if (typeof stream._construct !== 'function') { + return + } + const r = stream._readableState + const w = stream._writableState + if (r) { + r.constructed = false + } + if (w) { + w.constructed = false + } + stream.once(kConstruct, cb) + if (stream.listenerCount(kConstruct) > 1) { + // Duplex + return + } + process.nextTick(constructNT, stream) +} +function constructNT(stream) { + let called = false + function onConstruct(err) { + if (called) { + errorOrDestroy(stream, err !== null && err !== undefined ? err : new ERR_MULTIPLE_CALLBACK()) + return + } + called = true + const r = stream._readableState + const w = stream._writableState + const s = w || r + if (r) { + r.constructed = true + } + if (w) { + w.constructed = true + } + if (s.destroyed) { + stream.emit(kDestroy, err) + } else if (err) { + errorOrDestroy(stream, err, true) + } else { + process.nextTick(emitConstructNT, stream) + } + } + try { + stream._construct((err) => { + process.nextTick(onConstruct, err) + }) + } catch (err) { + process.nextTick(onConstruct, err) + } +} +function emitConstructNT(stream) { + stream.emit(kConstruct) +} +function isRequest(stream) { + return (stream === null || stream === undefined ? undefined : stream.setHeader) && typeof stream.abort === 'function' +} +function emitCloseLegacy(stream) { + stream.emit('close') +} +function emitErrorCloseLegacy(stream, err) { + stream.emit('error', err) + process.nextTick(emitCloseLegacy, stream) +} + +// Normalize destroy for legacy. +function destroyer(stream, err) { + if (!stream || isDestroyed(stream)) { + return } - return prefix + segs.join('/'); -}; + if (!err && !isFinished(stream)) { + err = new AbortError() + } + + // TODO: Remove isRequest branches. + if (isServerRequest(stream)) { + stream.socket = null + stream.destroy(err) + } else if (isRequest(stream)) { + stream.abort() + } else if (isRequest(stream.req)) { + stream.req.abort() + } else if (typeof stream.destroy === 'function') { + stream.destroy(err) + } else if (typeof stream.close === 'function') { + // TODO: Don't lose err? + stream.close() + } else if (err) { + process.nextTick(emitErrorCloseLegacy, stream, err) + } else { + process.nextTick(emitCloseLegacy, stream) + } + if (!stream.destroyed) { + stream[kIsDestroyed] = true + } +} +module.exports = { + construct, + destroyer, + destroy, + undestroy, + errorOrDestroy +} /***/ }), -/***/ 55560: +/***/ 94449: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var wrappy = __nccwpck_require__(58264) -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototype inheritance, this class +// prototypically inherits from Readable, and then parasitically from +// Writable. - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) + +const { + ObjectDefineProperties, + ObjectGetOwnPropertyDescriptor, + ObjectKeys, + ObjectSetPrototypeOf +} = __nccwpck_require__(50999) +module.exports = Duplex +const Readable = __nccwpck_require__(17783) +const Writable = __nccwpck_require__(58939) +ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype) +ObjectSetPrototypeOf(Duplex, Readable) +{ + const keys = ObjectKeys(Writable.prototype) + // Allow the keys array to be GC'ed. + for (let i = 0; i < keys.length; i++) { + const method = keys[i] + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method] + } +} +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options) + Readable.call(this, options) + Writable.call(this, options) + if (options) { + this.allowHalfOpen = options.allowHalfOpen !== false + if (options.readable === false) { + this._readableState.readable = false + this._readableState.ended = true + this._readableState.endEmitted = true + } + if (options.writable === false) { + this._writableState.writable = false + this._writableState.ending = true + this._writableState.ended = true + this._writableState.finished = true + } + } else { + this.allowHalfOpen = true } - f.called = false - return f } +ObjectDefineProperties(Duplex.prototype, { + writable: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable') + }, + writableHighWaterMark: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableHighWaterMark') + }, + writableObjectMode: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableObjectMode') + }, + writableBuffer: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableBuffer') + }, + writableLength: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableLength') + }, + writableFinished: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableFinished') + }, + writableCorked: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableCorked') + }, + writableEnded: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableEnded') + }, + writableNeedDrain: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableNeedDrain') + }, + destroyed: { + __proto__: null, + get() { + if (this._readableState === undefined || this._writableState === undefined) { + return false + } + return this._readableState.destroyed && this._writableState.destroyed + }, + set(value) { + // Backward compatibility, the user is explicitly + // managing destroyed. + if (this._readableState && this._writableState) { + this._readableState.destroyed = value + this._writableState.destroyed = value + } + } + } +}) +let webStreamsAdapters -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) +// Lazy to avoid circular references +function lazyWebStreams() { + if (webStreamsAdapters === undefined) webStreamsAdapters = {} + return webStreamsAdapters +} +Duplex.fromWeb = function (pair, options) { + return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options) +} +Duplex.toWeb = function (duplex) { + return lazyWebStreams().newReadableWritablePairFromDuplex(duplex) +} +let duplexify +Duplex.from = function (body) { + if (!duplexify) { + duplexify = __nccwpck_require__(4599) } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f + return duplexify(body, 'body') } /***/ }), -/***/ 19024: -/***/ ((module) => { +/***/ 4599: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/* replacement start */ +const process = __nccwpck_require__(7945) -function posix(path) { - return path.charAt(0) === '/'; -} +/* replacement end */ + +;('use strict') +const bufferModule = __nccwpck_require__(20181) +const { + isReadable, + isWritable, + isIterable, + isNodeStream, + isReadableNodeStream, + isWritableNodeStream, + isDuplexNodeStream, + isReadableStream, + isWritableStream +} = __nccwpck_require__(83426) +const eos = __nccwpck_require__(36815) +const { + AbortError, + codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE } +} = __nccwpck_require__(69220) +const { destroyer } = __nccwpck_require__(65089) +const Duplex = __nccwpck_require__(94449) +const Readable = __nccwpck_require__(17783) +const Writable = __nccwpck_require__(58939) +const { createDeferredPromise } = __nccwpck_require__(23539) +const from = __nccwpck_require__(4659) +const Blob = globalThis.Blob || bufferModule.Blob +const isBlob = + typeof Blob !== 'undefined' + ? function isBlob(b) { + return b instanceof Blob + } + : function isBlob(b) { + return false + } +const AbortController = globalThis.AbortController || (__nccwpck_require__(17413).AbortController) +const { FunctionPrototypeCall } = __nccwpck_require__(50999) + +// This is needed for pre node 17. +class Duplexify extends Duplex { + constructor(options) { + super(options) -function win32(path) { - // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = Boolean(device && device.charAt(1) !== ':'); + // https://github.com/nodejs/node/pull/34385 - // UNC paths are always absolute - return Boolean(result[2] || isUnc); + if ((options === null || options === undefined ? undefined : options.readable) === false) { + this._readableState.readable = false + this._readableState.ended = true + this._readableState.endEmitted = true + } + if ((options === null || options === undefined ? undefined : options.writable) === false) { + this._writableState.writable = false + this._writableState.ending = true + this._writableState.ended = true + this._writableState.finished = true + } + } +} +module.exports = function duplexify(body, name) { + if (isDuplexNodeStream(body)) { + return body + } + if (isReadableNodeStream(body)) { + return _duplexify({ + readable: body + }) + } + if (isWritableNodeStream(body)) { + return _duplexify({ + writable: body + }) + } + if (isNodeStream(body)) { + return _duplexify({ + writable: false, + readable: false + }) + } + if (isReadableStream(body)) { + return _duplexify({ + readable: Readable.fromWeb(body) + }) + } + if (isWritableStream(body)) { + return _duplexify({ + writable: Writable.fromWeb(body) + }) + } + if (typeof body === 'function') { + const { value, write, final, destroy } = fromAsyncGen(body) + if (isIterable(value)) { + return from(Duplexify, value, { + // TODO (ronag): highWaterMark? + objectMode: true, + write, + final, + destroy + }) + } + const then = value === null || value === undefined ? undefined : value.then + if (typeof then === 'function') { + let d + const promise = FunctionPrototypeCall( + then, + value, + (val) => { + if (val != null) { + throw new ERR_INVALID_RETURN_VALUE('nully', 'body', val) + } + }, + (err) => { + destroyer(d, err) + } + ) + return (d = new Duplexify({ + // TODO (ronag): highWaterMark? + objectMode: true, + readable: false, + write, + final(cb) { + final(async () => { + try { + await promise + process.nextTick(cb, null) + } catch (err) { + process.nextTick(cb, err) + } + }) + }, + destroy + })) + } + throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or AsyncFunction', name, value) + } + if (isBlob(body)) { + return duplexify(body.arrayBuffer()) + } + if (isIterable(body)) { + return from(Duplexify, body, { + // TODO (ronag): highWaterMark? + objectMode: true, + writable: false + }) + } + if ( + isReadableStream(body === null || body === undefined ? undefined : body.readable) && + isWritableStream(body === null || body === undefined ? undefined : body.writable) + ) { + return Duplexify.fromWeb(body) + } + if ( + typeof (body === null || body === undefined ? undefined : body.writable) === 'object' || + typeof (body === null || body === undefined ? undefined : body.readable) === 'object' + ) { + const readable = + body !== null && body !== undefined && body.readable + ? isReadableNodeStream(body === null || body === undefined ? undefined : body.readable) + ? body === null || body === undefined + ? undefined + : body.readable + : duplexify(body.readable) + : undefined + const writable = + body !== null && body !== undefined && body.writable + ? isWritableNodeStream(body === null || body === undefined ? undefined : body.writable) + ? body === null || body === undefined + ? undefined + : body.writable + : duplexify(body.writable) + : undefined + return _duplexify({ + readable, + writable + }) + } + const then = body === null || body === undefined ? undefined : body.then + if (typeof then === 'function') { + let d + FunctionPrototypeCall( + then, + body, + (val) => { + if (val != null) { + d.push(val) + } + d.push(null) + }, + (err) => { + destroyer(d, err) + } + ) + return (d = new Duplexify({ + objectMode: true, + writable: false, + read() {} + })) + } + throw new ERR_INVALID_ARG_TYPE( + name, + [ + 'Blob', + 'ReadableStream', + 'WritableStream', + 'Stream', + 'Iterable', + 'AsyncIterable', + 'Function', + '{ readable, writable } pair', + 'Promise' + ], + body + ) } +function fromAsyncGen(fn) { + let { promise, resolve } = createDeferredPromise() + const ac = new AbortController() + const signal = ac.signal + const value = fn( + (async function* () { + while (true) { + const _promise = promise + promise = null + const { chunk, done, cb } = await _promise + process.nextTick(cb) + if (done) return + if (signal.aborted) + throw new AbortError(undefined, { + cause: signal.reason + }) + ;({ promise, resolve } = createDeferredPromise()) + yield chunk + } + })(), + { + signal + } + ) + return { + value, + write(chunk, encoding, cb) { + const _resolve = resolve + resolve = null + _resolve({ + chunk, + done: false, + cb + }) + }, + final(cb) { + const _resolve = resolve + resolve = null + _resolve({ + done: true, + cb + }) + }, + destroy(err, cb) { + ac.abort() + cb(err) + } + } +} +function _duplexify(pair) { + const r = pair.readable && typeof pair.readable.read !== 'function' ? Readable.wrap(pair.readable) : pair.readable + const w = pair.writable + let readable = !!isReadable(r) + let writable = !!isWritable(w) + let ondrain + let onfinish + let onreadable + let onclose + let d + function onfinished(err) { + const cb = onclose + onclose = null + if (cb) { + cb(err) + } else if (err) { + d.destroy(err) + } + } -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; + // TODO(ronag): Avoid double buffering. + // Implement Writable/Readable/Duplex traits. + // See, https://github.com/nodejs/node/pull/33515. + d = new Duplexify({ + // TODO (ronag): highWaterMark? + readableObjectMode: !!(r !== null && r !== undefined && r.readableObjectMode), + writableObjectMode: !!(w !== null && w !== undefined && w.writableObjectMode), + readable, + writable + }) + if (writable) { + eos(w, (err) => { + writable = false + if (err) { + destroyer(r, err) + } + onfinished(err) + }) + d._write = function (chunk, encoding, callback) { + if (w.write(chunk, encoding)) { + callback() + } else { + ondrain = callback + } + } + d._final = function (callback) { + w.end() + onfinish = callback + } + w.on('drain', function () { + if (ondrain) { + const cb = ondrain + ondrain = null + cb() + } + }) + w.on('finish', function () { + if (onfinish) { + const cb = onfinish + onfinish = null + cb() + } + }) + } + if (readable) { + eos(r, (err) => { + readable = false + if (err) { + destroyer(r, err) + } + onfinished(err) + }) + r.on('readable', function () { + if (onreadable) { + const cb = onreadable + onreadable = null + cb() + } + }) + r.on('end', function () { + d.push(null) + }) + d._read = function () { + while (true) { + const buf = r.read() + if (buf === null) { + onreadable = d._read + return + } + if (!d.push(buf)) { + return + } + } + } + } + d._destroy = function (err, callback) { + if (!err && onclose !== null) { + err = new AbortError() + } + onreadable = null + ondrain = null + onfinish = null + if (onclose === null) { + callback(err) + } else { + onclose = callback + destroyer(w, err) + destroyer(r, err) + } + } + return d +} /***/ }), -/***/ 41564: -/***/ ((module) => { +/***/ 36815: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +// Ported from https://github.com/mafintosh/end-of-stream with +// permission from the author, Mathias Buus (@mafintosh). -if (typeof process === 'undefined' || - !process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = { nextTick: nextTick }; -} else { - module.exports = process -} -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); +/* replacement start */ + +const process = __nccwpck_require__(7945) + +/* replacement end */ + +const { AbortError, codes } = __nccwpck_require__(69220) +const { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes +const { kEmptyObject, once } = __nccwpck_require__(23539) +const { validateAbortSignal, validateFunction, validateObject, validateBoolean } = __nccwpck_require__(49554) +const { Promise, PromisePrototypeThen, SymbolDispose } = __nccwpck_require__(50999) +const { + isClosed, + isReadable, + isReadableNodeStream, + isReadableStream, + isReadableFinished, + isReadableErrored, + isWritable, + isWritableNodeStream, + isWritableStream, + isWritableFinished, + isWritableErrored, + isNodeStream, + willEmitClose: _willEmitClose, + kIsClosedPromise +} = __nccwpck_require__(83426) +let addAbortListener +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function' +} +const nop = () => {} +function eos(stream, options, callback) { + var _options$readable, _options$writable + if (arguments.length === 2) { + callback = options + options = kEmptyObject + } else if (options == null) { + options = kEmptyObject + } else { + validateObject(options, 'options') + } + validateFunction(callback, 'callback') + validateAbortSignal(options.signal, 'options.signal') + callback = once(callback) + if (isReadableStream(stream) || isWritableStream(stream)) { + return eosWeb(stream, options, callback) + } + if (!isNodeStream(stream)) { + throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream) + } + const readable = + (_options$readable = options.readable) !== null && _options$readable !== undefined + ? _options$readable + : isReadableNodeStream(stream) + const writable = + (_options$writable = options.writable) !== null && _options$writable !== undefined + ? _options$writable + : isWritableNodeStream(stream) + const wState = stream._writableState + const rState = stream._readableState + const onlegacyfinish = () => { + if (!stream.writable) { + onfinish() + } + } + + // TODO (ronag): Improve soft detection to include core modules and + // common ecosystem modules that do properly emit 'close' but fail + // this generic check. + let willEmitClose = + _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable + let writableFinished = isWritableFinished(stream, false) + const onfinish = () => { + writableFinished = true + // Stream should not be destroyed here. If it is that + // means that user space is doing something differently and + // we cannot trust willEmitClose. + if (stream.destroyed) { + willEmitClose = false + } + if (willEmitClose && (!stream.readable || readable)) { + return + } + if (!readable || readableFinished) { + callback.call(stream) + } } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; + let readableFinished = isReadableFinished(stream, false) + const onend = () => { + readableFinished = true + // Stream should not be destroyed here. If it is that + // means that user space is doing something differently and + // we cannot trust willEmitClose. + if (stream.destroyed) { + willEmitClose = false + } + if (willEmitClose && (!stream.writable || writable)) { + return + } + if (!writable || writableFinished) { + callback.call(stream) + } + } + const onerror = (err) => { + callback.call(stream, err) + } + let closed = isClosed(stream) + const onclose = () => { + closed = true + const errored = isWritableErrored(stream) || isReadableErrored(stream) + if (errored && typeof errored !== 'boolean') { + return callback.call(stream, errored) + } + if (readable && !readableFinished && isReadableNodeStream(stream, true)) { + if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE()) + } + if (writable && !writableFinished) { + if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE()) + } + callback.call(stream) + } + const onclosed = () => { + closed = true + const errored = isWritableErrored(stream) || isReadableErrored(stream) + if (errored && typeof errored !== 'boolean') { + return callback.call(stream, errored) + } + callback.call(stream) + } + const onrequest = () => { + stream.req.on('finish', onfinish) + } + if (isRequest(stream)) { + stream.on('complete', onfinish) + if (!willEmitClose) { + stream.on('abort', onclose) + } + if (stream.req) { + onrequest() + } else { + stream.on('request', onrequest) + } + } else if (writable && !wState) { + // legacy streams + stream.on('end', onlegacyfinish) + stream.on('close', onlegacyfinish) + } + + // Not all streams will emit 'close' after 'aborted'. + if (!willEmitClose && typeof stream.aborted === 'boolean') { + stream.on('aborted', onclose) + } + stream.on('end', onend) + stream.on('finish', onfinish) + if (options.error !== false) { + stream.on('error', onerror) + } + stream.on('close', onclose) + if (closed) { + process.nextTick(onclose) + } else if ( + (wState !== null && wState !== undefined && wState.errorEmitted) || + (rState !== null && rState !== undefined && rState.errorEmitted) + ) { + if (!willEmitClose) { + process.nextTick(onclosed) + } + } else if ( + !readable && + (!willEmitClose || isReadable(stream)) && + (writableFinished || isWritable(stream) === false) + ) { + process.nextTick(onclosed) + } else if ( + !writable && + (!willEmitClose || isWritable(stream)) && + (readableFinished || isReadable(stream) === false) + ) { + process.nextTick(onclosed) + } else if (rState && stream.req && stream.aborted) { + process.nextTick(onclosed) + } + const cleanup = () => { + callback = nop + stream.removeListener('aborted', onclose) + stream.removeListener('complete', onfinish) + stream.removeListener('abort', onclose) + stream.removeListener('request', onrequest) + if (stream.req) stream.req.removeListener('finish', onfinish) + stream.removeListener('end', onlegacyfinish) + stream.removeListener('close', onlegacyfinish) + stream.removeListener('finish', onfinish) + stream.removeListener('end', onend) + stream.removeListener('error', onerror) + stream.removeListener('close', onclose) + } + if (options.signal && !closed) { + const abort = () => { + // Keep it because cleanup removes it. + const endCallback = callback + cleanup() + endCallback.call( + stream, + new AbortError(undefined, { + cause: options.signal.reason + }) + ) + } + if (options.signal.aborted) { + process.nextTick(abort) + } else { + addAbortListener = addAbortListener || (__nccwpck_require__(23539).addAbortListener) + const disposable = addAbortListener(options.signal, abort) + const originalCallback = callback + callback = once((...args) => { + disposable[SymbolDispose]() + originalCallback.apply(stream, args) + }) } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); } + return cleanup } - +function eosWeb(stream, options, callback) { + let isAborted = false + let abort = nop + if (options.signal) { + abort = () => { + isAborted = true + callback.call( + stream, + new AbortError(undefined, { + cause: options.signal.reason + }) + ) + } + if (options.signal.aborted) { + process.nextTick(abort) + } else { + addAbortListener = addAbortListener || (__nccwpck_require__(23539).addAbortListener) + const disposable = addAbortListener(options.signal, abort) + const originalCallback = callback + callback = once((...args) => { + disposable[SymbolDispose]() + originalCallback.apply(stream, args) + }) + } + } + const resolverFn = (...args) => { + if (!isAborted) { + process.nextTick(() => callback.apply(stream, args)) + } + } + PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn) + return nop +} +function finished(stream, opts) { + var _opts + let autoCleanup = false + if (opts === null) { + opts = kEmptyObject + } + if ((_opts = opts) !== null && _opts !== undefined && _opts.cleanup) { + validateBoolean(opts.cleanup, 'cleanup') + autoCleanup = opts.cleanup + } + return new Promise((resolve, reject) => { + const cleanup = eos(stream, opts, (err) => { + if (autoCleanup) { + cleanup() + } + if (err) { + reject(err) + } else { + resolve() + } + }) + }) +} +module.exports = eos +module.exports.finished = finished /***/ }), -/***/ 25500: -/***/ ((module) => { +/***/ 4659: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const codes = {}; +/* replacement start */ -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error +const process = __nccwpck_require__(7945) + +/* replacement end */ + +const { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = __nccwpck_require__(50999) +const { Buffer } = __nccwpck_require__(20181) +const { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = (__nccwpck_require__(69220).codes) +function from(Readable, iterable, opts) { + let iterator + if (typeof iterable === 'string' || iterable instanceof Buffer) { + return new Readable({ + objectMode: true, + ...opts, + read() { + this.push(iterable) + this.push(null) + } + }) + } + let isAsync + if (iterable && iterable[SymbolAsyncIterator]) { + isAsync = true + iterator = iterable[SymbolAsyncIterator]() + } else if (iterable && iterable[SymbolIterator]) { + isAsync = false + iterator = iterable[SymbolIterator]() + } else { + throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable) } + const readable = new Readable({ + objectMode: true, + highWaterMark: 1, + // TODO(ronag): What options should be allowed? + ...opts + }) - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) + // Flag to protect against _read + // being called before last iteration completion. + let reading = false + readable._read = function () { + if (!reading) { + reading = true + next() } } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); + readable._destroy = function (error, cb) { + PromisePrototypeThen( + close(error), + () => process.nextTick(cb, error), + // nextTick is here in case cb throws + (e) => process.nextTick(cb, e || error) + ) + } + async function close(error) { + const hadError = error !== undefined && error !== null + const hasThrow = typeof iterator.throw === 'function' + if (hadError && hasThrow) { + const { value, done } = await iterator.throw(error) + await value + if (done) { + return + } + } + if (typeof iterator.return === 'function') { + const { value } = await iterator.return() + await value } } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes[code] = NodeError; -} - -// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; + async function next() { + for (;;) { + try { + const { value, done } = isAsync ? await iterator.next() : iterator.next() + if (done) { + readable.push(null) + } else { + const res = value && typeof value.then === 'function' ? await value : value + if (res === null) { + reading = false + throw new ERR_STREAM_NULL_VALUES() + } else if (readable.push(res)) { + continue + } else { + reading = false + } + } + } catch (err) { + readable.destroy(err) + } + break } - } else { - return `of ${thing} ${String(expected)}`; } + return readable } +module.exports = from -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; -} +/***/ }), -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } +/***/ 84128: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } +"use strict"; + + +const { ArrayIsArray, ObjectSetPrototypeOf } = __nccwpck_require__(50999) +const { EventEmitter: EE } = __nccwpck_require__(24434) +function Stream(opts) { + EE.call(this, opts) } +ObjectSetPrototypeOf(Stream.prototype, EE.prototype) +ObjectSetPrototypeOf(Stream, EE) +Stream.prototype.pipe = function (dest, options) { + const source = this + function ondata(chunk) { + if (dest.writable && dest.write(chunk) === false && source.pause) { + source.pause() + } + } + source.on('data', ondata) + function ondrain() { + if (source.readable && source.resume) { + source.resume() + } + } + dest.on('drain', ondrain) -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; + // If the 'end' option is not supplied, dest.end() will be called when + // source gets the 'end' or 'close' events. Only dest.end() once. + if (!dest._isStdio && (!options || options.end !== false)) { + source.on('end', onend) + source.on('close', onclose) + } + let didOnEnd = false + function onend() { + if (didOnEnd) return + didOnEnd = true + dest.end() + } + function onclose() { + if (didOnEnd) return + didOnEnd = true + if (typeof dest.destroy === 'function') dest.destroy() } - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; + // Don't leave dangling pipes when there are errors. + function onerror(er) { + cleanup() + if (EE.listenerCount(this, 'error') === 0) { + this.emit('error', er) + } } + prependListener(source, 'error', onerror) + prependListener(dest, 'error', onerror) - msg += `. Received type ${typeof actual}`; - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); + // Remove all the event listeners that were added. + function cleanup() { + source.removeListener('data', ondata) + dest.removeListener('drain', ondrain) + source.removeListener('end', onend) + source.removeListener('close', onclose) + source.removeListener('error', onerror) + dest.removeListener('error', onerror) + source.removeListener('end', cleanup) + source.removeListener('close', cleanup) + dest.removeListener('close', cleanup) + } + source.on('end', cleanup) + source.on('close', cleanup) + dest.on('close', cleanup) + dest.emit('pipe', source) + + // Allow for unix-like usage: A.pipe(B).pipe(C) + return dest +} +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn) -module.exports.F = codes; + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn) + else if (ArrayIsArray(emitter._events[event])) emitter._events[event].unshift(fn) + else emitter._events[event] = [fn, emitter._events[event]] +} +module.exports = { + Stream, + prependListener +} /***/ }), -/***/ 82063: +/***/ 11222: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -}; -/**/ +const AbortController = globalThis.AbortController || (__nccwpck_require__(17413).AbortController) +const { + codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE }, + AbortError +} = __nccwpck_require__(69220) +const { validateAbortSignal, validateInteger, validateObject } = __nccwpck_require__(49554) +const kWeakHandler = (__nccwpck_require__(50999).Symbol)('kWeak') +const kResistStopPropagation = (__nccwpck_require__(50999).Symbol)('kResistStopPropagation') +const { finished } = __nccwpck_require__(36815) +const staticCompose = __nccwpck_require__(64999) +const { addAbortSignalNoValidate } = __nccwpck_require__(80652) +const { isWritable, isNodeStream } = __nccwpck_require__(83426) +const { deprecate } = __nccwpck_require__(23539) +const { + ArrayPrototypePush, + Boolean, + MathFloor, + Number, + NumberIsNaN, + Promise, + PromiseReject, + PromiseResolve, + PromisePrototypeThen, + Symbol +} = __nccwpck_require__(50999) +const kEmpty = Symbol('kEmpty') +const kEof = Symbol('kEof') +function compose(stream, options) { + if (options != null) { + validateObject(options, 'options') + } + if ((options === null || options === undefined ? undefined : options.signal) != null) { + validateAbortSignal(options.signal, 'options.signal') + } + if (isNodeStream(stream) && !isWritable(stream)) { + throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be writable') + } + const composedStream = staticCompose(this, stream) + if (options !== null && options !== undefined && options.signal) { + // Not validating as we already validated before + addAbortSignalNoValidate(options.signal, composedStream) + } + return composedStream +} +function map(fn, options) { + if (typeof fn !== 'function') { + throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn) + } + if (options != null) { + validateObject(options, 'options') + } + if ((options === null || options === undefined ? undefined : options.signal) != null) { + validateAbortSignal(options.signal, 'options.signal') + } + let concurrency = 1 + if ((options === null || options === undefined ? undefined : options.concurrency) != null) { + concurrency = MathFloor(options.concurrency) + } + let highWaterMark = concurrency - 1 + if ((options === null || options === undefined ? undefined : options.highWaterMark) != null) { + highWaterMark = MathFloor(options.highWaterMark) + } + validateInteger(concurrency, 'options.concurrency', 1) + validateInteger(highWaterMark, 'options.highWaterMark', 0) + highWaterMark += concurrency + return async function* map() { + const signal = (__nccwpck_require__(23539).AbortSignalAny)( + [options === null || options === undefined ? undefined : options.signal].filter(Boolean) + ) + const stream = this + const queue = [] + const signalOpt = { + signal + } + let next + let resume + let done = false + let cnt = 0 + function onCatch() { + done = true + afterItemProcessed() + } + function afterItemProcessed() { + cnt -= 1 + maybeResume() + } + function maybeResume() { + if (resume && !done && cnt < concurrency && queue.length < highWaterMark) { + resume() + resume = null + } + } + async function pump() { + try { + for await (let val of stream) { + if (done) { + return + } + if (signal.aborted) { + throw new AbortError() + } + try { + val = fn(val, signalOpt) + if (val === kEmpty) { + continue + } + val = PromiseResolve(val) + } catch (err) { + val = PromiseReject(err) + } + cnt += 1 + PromisePrototypeThen(val, afterItemProcessed, onCatch) + queue.push(val) + if (next) { + next() + next = null + } + if (!done && (queue.length >= highWaterMark || cnt >= concurrency)) { + await new Promise((resolve) => { + resume = resolve + }) + } + } + queue.push(kEof) + } catch (err) { + const val = PromiseReject(err) + PromisePrototypeThen(val, afterItemProcessed, onCatch) + queue.push(val) + } finally { + done = true + if (next) { + next() + next = null + } + } + } + pump() + try { + while (true) { + while (queue.length > 0) { + const val = await queue[0] + if (val === kEof) { + return + } + if (signal.aborted) { + throw new AbortError() + } + if (val !== kEmpty) { + yield val + } + queue.shift() + maybeResume() + } + await new Promise((resolve) => { + next = resolve + }) + } + } finally { + done = true + if (resume) { + resume() + resume = null + } + } + }.call(this) +} +function asIndexedPairs(options = undefined) { + if (options != null) { + validateObject(options, 'options') + } + if ((options === null || options === undefined ? undefined : options.signal) != null) { + validateAbortSignal(options.signal, 'options.signal') + } + return async function* asIndexedPairs() { + let index = 0 + for await (const val of this) { + var _options$signal + if ( + options !== null && + options !== undefined && + (_options$signal = options.signal) !== null && + _options$signal !== undefined && + _options$signal.aborted + ) { + throw new AbortError({ + cause: options.signal.reason + }) + } + yield [index++, val] + } + }.call(this) +} +async function some(fn, options = undefined) { + for await (const unused of filter.call(this, fn, options)) { + return true + } + return false +} +async function every(fn, options = undefined) { + if (typeof fn !== 'function') { + throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn) + } + // https://en.wikipedia.org/wiki/De_Morgan%27s_laws + return !(await some.call( + this, + async (...args) => { + return !(await fn(...args)) + }, + options + )) +} +async function find(fn, options) { + for await (const result of filter.call(this, fn, options)) { + return result + } + return undefined +} +async function forEach(fn, options) { + if (typeof fn !== 'function') { + throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn) + } + async function forEachFn(value, options) { + await fn(value, options) + return kEmpty + } + // eslint-disable-next-line no-unused-vars + for await (const unused of map.call(this, forEachFn, options)); +} +function filter(fn, options) { + if (typeof fn !== 'function') { + throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn) + } + async function filterFn(value, options) { + if (await fn(value, options)) { + return value + } + return kEmpty + } + return map.call(this, filterFn, options) +} -module.exports = Duplex; -var Readable = __nccwpck_require__(86893); -var Writable = __nccwpck_require__(38797); -__nccwpck_require__(39598)(Duplex, Readable); -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +// Specific to provide better error to reduce since the argument is only +// missing if the stream has no items in it - but the code is still appropriate +class ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS { + constructor() { + super('reduce') + this.message = 'Reduce of an empty stream requires an initial value' + } +} +async function reduce(reducer, initialValue, options) { + var _options$signal2 + if (typeof reducer !== 'function') { + throw new ERR_INVALID_ARG_TYPE('reducer', ['Function', 'AsyncFunction'], reducer) + } + if (options != null) { + validateObject(options, 'options') + } + if ((options === null || options === undefined ? undefined : options.signal) != null) { + validateAbortSignal(options.signal, 'options.signal') + } + let hasInitialValue = arguments.length > 1 + if ( + options !== null && + options !== undefined && + (_options$signal2 = options.signal) !== null && + _options$signal2 !== undefined && + _options$signal2.aborted + ) { + const err = new AbortError(undefined, { + cause: options.signal.reason + }) + this.once('error', () => {}) // The error is already propagated + await finished(this.destroy(err)) + throw err + } + const ac = new AbortController() + const signal = ac.signal + if (options !== null && options !== undefined && options.signal) { + const opts = { + once: true, + [kWeakHandler]: this, + [kResistStopPropagation]: true + } + options.signal.addEventListener('abort', () => ac.abort(), opts) + } + let gotAnyItemFromStream = false + try { + for await (const value of this) { + var _options$signal3 + gotAnyItemFromStream = true + if ( + options !== null && + options !== undefined && + (_options$signal3 = options.signal) !== null && + _options$signal3 !== undefined && + _options$signal3.aborted + ) { + throw new AbortError() + } + if (!hasInitialValue) { + initialValue = value + hasInitialValue = true + } else { + initialValue = await reducer(initialValue, value, { + signal + }) + } + } + if (!gotAnyItemFromStream && !hasInitialValue) { + throw new ReduceAwareErrMissingArgs() + } + } finally { + ac.abort() + } + return initialValue +} +async function toArray(options) { + if (options != null) { + validateObject(options, 'options') + } + if ((options === null || options === undefined ? undefined : options.signal) != null) { + validateAbortSignal(options.signal, 'options.signal') + } + const result = [] + for await (const val of this) { + var _options$signal4 + if ( + options !== null && + options !== undefined && + (_options$signal4 = options.signal) !== null && + _options$signal4 !== undefined && + _options$signal4.aborted + ) { + throw new AbortError(undefined, { + cause: options.signal.reason + }) + } + ArrayPrototypePush(result, val) } + return result } -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); +function flatMap(fn, options) { + const values = map.call(this, fn, options) + return async function* flatMap() { + for await (const val of values) { + yield* val + } + }.call(this) +} +function toIntegerOrInfinity(number) { + // We coerce here to align with the spec + // https://github.com/tc39/proposal-iterator-helpers/issues/169 + number = Number(number) + if (NumberIsNaN(number)) { + return 0 + } + if (number < 0) { + throw new ERR_OUT_OF_RANGE('number', '>= 0', number) + } + return number +} +function drop(number, options = undefined) { + if (options != null) { + validateObject(options, 'options') + } + if ((options === null || options === undefined ? undefined : options.signal) != null) { + validateAbortSignal(options.signal, 'options.signal') + } + number = toIntegerOrInfinity(number) + return async function* drop() { + var _options$signal5 + if ( + options !== null && + options !== undefined && + (_options$signal5 = options.signal) !== null && + _options$signal5 !== undefined && + _options$signal5.aborted + ) { + throw new AbortError() } - } + for await (const val of this) { + var _options$signal6 + if ( + options !== null && + options !== undefined && + (_options$signal6 = options.signal) !== null && + _options$signal6 !== undefined && + _options$signal6.aborted + ) { + throw new AbortError() + } + if (number-- <= 0) { + yield val + } + } + }.call(this) } -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; +function take(number, options = undefined) { + if (options != null) { + validateObject(options, 'options') } -}); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; + if ((options === null || options === undefined ? undefined : options.signal) != null) { + validateAbortSignal(options.signal, 'options.signal') } -}); - -// the no-half-open enforcer -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; + number = toIntegerOrInfinity(number) + return async function* take() { + var _options$signal7 + if ( + options !== null && + options !== undefined && + (_options$signal7 = options.signal) !== null && + _options$signal7 !== undefined && + _options$signal7.aborted + ) { + throw new AbortError() + } + for await (const val of this) { + var _options$signal8 + if ( + options !== null && + options !== undefined && + (_options$signal8 = options.signal) !== null && + _options$signal8 !== undefined && + _options$signal8.aborted + ) { + throw new AbortError() + } + if (number-- > 0) { + yield val + } - // no more data can be written. - // But allow more writes to happen in this tick. - process.nextTick(onEndNT, this); + // Don't get another item from iterator in case we reached the end + if (number <= 0) { + return + } + } + }.call(this) } -function onEndNT(self) { - self.end(); +module.exports.streamReturningOperators = { + asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs will be removed in a future version.'), + drop, + filter, + flatMap, + map, + take, + compose +} +module.exports.promiseReturningOperators = { + every, + forEach, + reduce, + toArray, + some, + find } -Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); /***/ }), -/***/ 35283: +/***/ 19173: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -83401,20 +47071,501 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { -module.exports = PassThrough; -var Transform = __nccwpck_require__(12337); -__nccwpck_require__(39598)(PassThrough, Transform); +const { ObjectSetPrototypeOf } = __nccwpck_require__(50999) +module.exports = PassThrough +const Transform = __nccwpck_require__(12135) +ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype) +ObjectSetPrototypeOf(PassThrough, Transform) function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); + if (!(this instanceof PassThrough)) return new PassThrough(options) + Transform.call(this, options) } PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; + cb(null, chunk) +} + + +/***/ }), + +/***/ 16701: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/* replacement start */ + +const process = __nccwpck_require__(7945) + +/* replacement end */ +// Ported from https://github.com/mafintosh/pump with +// permission from the author, Mathias Buus (@mafintosh). + +;('use strict') +const { ArrayIsArray, Promise, SymbolAsyncIterator, SymbolDispose } = __nccwpck_require__(50999) +const eos = __nccwpck_require__(36815) +const { once } = __nccwpck_require__(23539) +const destroyImpl = __nccwpck_require__(65089) +const Duplex = __nccwpck_require__(94449) +const { + aggregateTwoErrors, + codes: { + ERR_INVALID_ARG_TYPE, + ERR_INVALID_RETURN_VALUE, + ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED, + ERR_STREAM_PREMATURE_CLOSE + }, + AbortError +} = __nccwpck_require__(69220) +const { validateFunction, validateAbortSignal } = __nccwpck_require__(49554) +const { + isIterable, + isReadable, + isReadableNodeStream, + isNodeStream, + isTransformStream, + isWebStream, + isReadableStream, + isReadableFinished +} = __nccwpck_require__(83426) +const AbortController = globalThis.AbortController || (__nccwpck_require__(17413).AbortController) +let PassThrough +let Readable +let addAbortListener +function destroyer(stream, reading, writing) { + let finished = false + stream.on('close', () => { + finished = true + }) + const cleanup = eos( + stream, + { + readable: reading, + writable: writing + }, + (err) => { + finished = !err + } + ) + return { + destroy: (err) => { + if (finished) return + finished = true + destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe')) + }, + cleanup + } +} +function popCallback(streams) { + // Streams should never be an empty array. It should always contain at least + // a single stream. Therefore optimize for the average case instead of + // checking for length === 0 as well. + validateFunction(streams[streams.length - 1], 'streams[stream.length - 1]') + return streams.pop() +} +function makeAsyncIterable(val) { + if (isIterable(val)) { + return val + } else if (isReadableNodeStream(val)) { + // Legacy streams are not Iterable. + return fromReadable(val) + } + throw new ERR_INVALID_ARG_TYPE('val', ['Readable', 'Iterable', 'AsyncIterable'], val) +} +async function* fromReadable(val) { + if (!Readable) { + Readable = __nccwpck_require__(17783) + } + yield* Readable.prototype[SymbolAsyncIterator].call(val) +} +async function pumpToNode(iterable, writable, finish, { end }) { + let error + let onresolve = null + const resume = (err) => { + if (err) { + error = err + } + if (onresolve) { + const callback = onresolve + onresolve = null + callback() + } + } + const wait = () => + new Promise((resolve, reject) => { + if (error) { + reject(error) + } else { + onresolve = () => { + if (error) { + reject(error) + } else { + resolve() + } + } + } + }) + writable.on('drain', resume) + const cleanup = eos( + writable, + { + readable: false + }, + resume + ) + try { + if (writable.writableNeedDrain) { + await wait() + } + for await (const chunk of iterable) { + if (!writable.write(chunk)) { + await wait() + } + } + if (end) { + writable.end() + await wait() + } + finish() + } catch (err) { + finish(error !== err ? aggregateTwoErrors(error, err) : err) + } finally { + cleanup() + writable.off('drain', resume) + } +} +async function pumpToWeb(readable, writable, finish, { end }) { + if (isTransformStream(writable)) { + writable = writable.writable + } + // https://streams.spec.whatwg.org/#example-manual-write-with-backpressure + const writer = writable.getWriter() + try { + for await (const chunk of readable) { + await writer.ready + writer.write(chunk).catch(() => {}) + } + await writer.ready + if (end) { + await writer.close() + } + finish() + } catch (err) { + try { + await writer.abort(err) + finish(err) + } catch (err) { + finish(err) + } + } +} +function pipeline(...streams) { + return pipelineImpl(streams, once(popCallback(streams))) +} +function pipelineImpl(streams, callback, opts) { + if (streams.length === 1 && ArrayIsArray(streams[0])) { + streams = streams[0] + } + if (streams.length < 2) { + throw new ERR_MISSING_ARGS('streams') + } + const ac = new AbortController() + const signal = ac.signal + const outerSignal = opts === null || opts === undefined ? undefined : opts.signal + + // Need to cleanup event listeners if last stream is readable + // https://github.com/nodejs/node/issues/35452 + const lastStreamCleanup = [] + validateAbortSignal(outerSignal, 'options.signal') + function abort() { + finishImpl(new AbortError()) + } + addAbortListener = addAbortListener || (__nccwpck_require__(23539).addAbortListener) + let disposable + if (outerSignal) { + disposable = addAbortListener(outerSignal, abort) + } + let error + let value + const destroys = [] + let finishCount = 0 + function finish(err) { + finishImpl(err, --finishCount === 0) + } + function finishImpl(err, final) { + var _disposable + if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) { + error = err + } + if (!error && !final) { + return + } + while (destroys.length) { + destroys.shift()(error) + } + ;(_disposable = disposable) === null || _disposable === undefined ? undefined : _disposable[SymbolDispose]() + ac.abort() + if (final) { + if (!error) { + lastStreamCleanup.forEach((fn) => fn()) + } + process.nextTick(callback, error, value) + } + } + let ret + for (let i = 0; i < streams.length; i++) { + const stream = streams[i] + const reading = i < streams.length - 1 + const writing = i > 0 + const end = reading || (opts === null || opts === undefined ? undefined : opts.end) !== false + const isLastStream = i === streams.length - 1 + if (isNodeStream(stream)) { + if (end) { + const { destroy, cleanup } = destroyer(stream, reading, writing) + destroys.push(destroy) + if (isReadable(stream) && isLastStream) { + lastStreamCleanup.push(cleanup) + } + } + + // Catch stream errors that occur after pipe/pump has completed. + function onError(err) { + if (err && err.name !== 'AbortError' && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { + finish(err) + } + } + stream.on('error', onError) + if (isReadable(stream) && isLastStream) { + lastStreamCleanup.push(() => { + stream.removeListener('error', onError) + }) + } + } + if (i === 0) { + if (typeof stream === 'function') { + ret = stream({ + signal + }) + if (!isIterable(ret)) { + throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or Stream', 'source', ret) + } + } else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) { + ret = stream + } else { + ret = Duplex.from(stream) + } + } else if (typeof stream === 'function') { + if (isTransformStream(ret)) { + var _ret + ret = makeAsyncIterable((_ret = ret) === null || _ret === undefined ? undefined : _ret.readable) + } else { + ret = makeAsyncIterable(ret) + } + ret = stream(ret, { + signal + }) + if (reading) { + if (!isIterable(ret, true)) { + throw new ERR_INVALID_RETURN_VALUE('AsyncIterable', `transform[${i - 1}]`, ret) + } + } else { + var _ret2 + if (!PassThrough) { + PassThrough = __nccwpck_require__(19173) + } + + // If the last argument to pipeline is not a stream + // we must create a proxy stream so that pipeline(...) + // always returns a stream which can be further + // composed through `.pipe(stream)`. + + const pt = new PassThrough({ + objectMode: true + }) + + // Handle Promises/A+ spec, `then` could be a getter that throws on + // second use. + const then = (_ret2 = ret) === null || _ret2 === undefined ? undefined : _ret2.then + if (typeof then === 'function') { + finishCount++ + then.call( + ret, + (val) => { + value = val + if (val != null) { + pt.write(val) + } + if (end) { + pt.end() + } + process.nextTick(finish) + }, + (err) => { + pt.destroy(err) + process.nextTick(finish, err) + } + ) + } else if (isIterable(ret, true)) { + finishCount++ + pumpToNode(ret, pt, finish, { + end + }) + } else if (isReadableStream(ret) || isTransformStream(ret)) { + const toRead = ret.readable || ret + finishCount++ + pumpToNode(toRead, pt, finish, { + end + }) + } else { + throw new ERR_INVALID_RETURN_VALUE('AsyncIterable or Promise', 'destination', ret) + } + ret = pt + const { destroy, cleanup } = destroyer(ret, false, true) + destroys.push(destroy) + if (isLastStream) { + lastStreamCleanup.push(cleanup) + } + } + } else if (isNodeStream(stream)) { + if (isReadableNodeStream(ret)) { + finishCount += 2 + const cleanup = pipe(ret, stream, finish, { + end + }) + if (isReadable(stream) && isLastStream) { + lastStreamCleanup.push(cleanup) + } + } else if (isTransformStream(ret) || isReadableStream(ret)) { + const toRead = ret.readable || ret + finishCount++ + pumpToNode(toRead, stream, finish, { + end + }) + } else if (isIterable(ret)) { + finishCount++ + pumpToNode(ret, stream, finish, { + end + }) + } else { + throw new ERR_INVALID_ARG_TYPE( + 'val', + ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'], + ret + ) + } + ret = stream + } else if (isWebStream(stream)) { + if (isReadableNodeStream(ret)) { + finishCount++ + pumpToWeb(makeAsyncIterable(ret), stream, finish, { + end + }) + } else if (isReadableStream(ret) || isIterable(ret)) { + finishCount++ + pumpToWeb(ret, stream, finish, { + end + }) + } else if (isTransformStream(ret)) { + finishCount++ + pumpToWeb(ret.readable, stream, finish, { + end + }) + } else { + throw new ERR_INVALID_ARG_TYPE( + 'val', + ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'], + ret + ) + } + ret = stream + } else { + ret = Duplex.from(stream) + } + } + if ( + (signal !== null && signal !== undefined && signal.aborted) || + (outerSignal !== null && outerSignal !== undefined && outerSignal.aborted) + ) { + process.nextTick(abort) + } + return ret +} +function pipe(src, dst, finish, { end }) { + let ended = false + dst.on('close', () => { + if (!ended) { + // Finish if the destination closes before the source has completed. + finish(new ERR_STREAM_PREMATURE_CLOSE()) + } + }) + src.pipe(dst, { + end: false + }) // If end is true we already will have a listener to end dst. + + if (end) { + // Compat. Before node v10.12.0 stdio used to throw an error so + // pipe() did/does not end() stdio destinations. + // Now they allow it but "secretly" don't close the underlying fd. + + function endFn() { + ended = true + dst.end() + } + if (isReadableFinished(src)) { + // End the destination if the source has already ended. + process.nextTick(endFn) + } else { + src.once('end', endFn) + } + } else { + finish() + } + eos( + src, + { + readable: true, + writable: false + }, + (err) => { + const rState = src._readableState + if ( + err && + err.code === 'ERR_STREAM_PREMATURE_CLOSE' && + rState && + rState.ended && + !rState.errored && + !rState.errorEmitted + ) { + // Some readable streams will emit 'close' before 'end'. However, since + // this is on the readable side 'end' should still be emitted if the + // stream has been ended and no error emitted. This should be allowed in + // favor of backwards compatibility. Since the stream is piped to a + // destination this should not result in any observable difference. + // We don't need to check if this is a writable premature close since + // eos will only fail with premature close on the reading side for + // duplex streams. + src.once('end', finish).once('error', finish) + } else { + finish(err) + } + } + ) + return eos( + dst, + { + readable: false, + writable: true + }, + finish + ) +} +module.exports = { + pipelineImpl, + pipeline +} + /***/ }), -/***/ 86893: +/***/ 17783: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -83441,364 +47592,407 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) { -module.exports = Readable; - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = (__nccwpck_require__(24434).EventEmitter); -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = __nccwpck_require__(63283); -/**/ - -var Buffer = (__nccwpck_require__(20181).Buffer); -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} +/* replacement start */ -/**/ -var debugUtil = __nccwpck_require__(39023); -var debug; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; -} -/**/ +const process = __nccwpck_require__(7945) -var BufferList = __nccwpck_require__(77336); -var destroyImpl = __nccwpck_require__(65089); -var _require = __nccwpck_require__(54874), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = (__nccwpck_require__(25500)/* .codes */ .F), - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; - -// Lazy loaded to improve the startup performance. -var StringDecoder; -var createReadableStreamAsyncIterator; -var from; -__nccwpck_require__(39598)(Readable, Stream); -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); +/* replacement end */ - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - 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]]; -} +const { + ArrayPrototypeIndexOf, + NumberIsInteger, + NumberIsNaN, + NumberParseInt, + ObjectDefineProperties, + ObjectKeys, + ObjectSetPrototypeOf, + Promise, + SafeSet, + SymbolAsyncDispose, + SymbolAsyncIterator, + Symbol +} = __nccwpck_require__(50999) +module.exports = Readable +Readable.ReadableState = ReadableState +const { EventEmitter: EE } = __nccwpck_require__(24434) +const { Stream, prependListener } = __nccwpck_require__(84128) +const { Buffer } = __nccwpck_require__(20181) +const { addAbortSignal } = __nccwpck_require__(80652) +const eos = __nccwpck_require__(36815) +let debug = (__nccwpck_require__(23539).debuglog)('stream', (fn) => { + debug = fn +}) +const BufferList = __nccwpck_require__(77336) +const destroyImpl = __nccwpck_require__(65089) +const { getHighWaterMark, getDefaultHighWaterMark } = __nccwpck_require__(54874) +const { + aggregateTwoErrors, + codes: { + ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED, + ERR_OUT_OF_RANGE, + ERR_STREAM_PUSH_AFTER_EOF, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT + }, + AbortError +} = __nccwpck_require__(69220) +const { validateObject } = __nccwpck_require__(49554) +const kPaused = Symbol('kPaused') +const { StringDecoder } = __nccwpck_require__(80634) +const from = __nccwpck_require__(4659) +ObjectSetPrototypeOf(Readable.prototype, Stream.prototype) +ObjectSetPrototypeOf(Readable, Stream) +const nop = () => {} +const { errorOrDestroy } = destroyImpl +const kObjectMode = 1 << 0 +const kEnded = 1 << 1 +const kEndEmitted = 1 << 2 +const kReading = 1 << 3 +const kConstructed = 1 << 4 +const kSync = 1 << 5 +const kNeedReadable = 1 << 6 +const kEmittedReadable = 1 << 7 +const kReadableListening = 1 << 8 +const kResumeScheduled = 1 << 9 +const kErrorEmitted = 1 << 10 +const kEmitClose = 1 << 11 +const kAutoDestroy = 1 << 12 +const kDestroyed = 1 << 13 +const kClosed = 1 << 14 +const kCloseEmitted = 1 << 15 +const kMultiAwaitDrain = 1 << 16 +const kReadingMore = 1 << 17 +const kDataEmitted = 1 << 18 + +// TODO(benjamingr) it is likely slower to do it this way than with free functions +function makeBitMapDescriptor(bit) { + return { + enumerable: false, + get() { + return (this.state & bit) !== 0 + }, + set(value) { + if (value) this.state |= bit + else this.state &= ~bit + } + } +} +ObjectDefineProperties(ReadableState.prototype, { + objectMode: makeBitMapDescriptor(kObjectMode), + ended: makeBitMapDescriptor(kEnded), + endEmitted: makeBitMapDescriptor(kEndEmitted), + reading: makeBitMapDescriptor(kReading), + // Stream is still being constructed and cannot be + // destroyed until construction finished or failed. + // Async construction is opt in, therefore we start as + // constructed. + constructed: makeBitMapDescriptor(kConstructed), + // A flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + sync: makeBitMapDescriptor(kSync), + // Whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + needReadable: makeBitMapDescriptor(kNeedReadable), + emittedReadable: makeBitMapDescriptor(kEmittedReadable), + readableListening: makeBitMapDescriptor(kReadableListening), + resumeScheduled: makeBitMapDescriptor(kResumeScheduled), + // True if the error was already emitted and should not be thrown again. + errorEmitted: makeBitMapDescriptor(kErrorEmitted), + emitClose: makeBitMapDescriptor(kEmitClose), + autoDestroy: makeBitMapDescriptor(kAutoDestroy), + // Has it been destroyed. + destroyed: makeBitMapDescriptor(kDestroyed), + // Indicates whether the stream has finished destroying. + closed: makeBitMapDescriptor(kClosed), + // True if close has been emitted or would have been emitted + // depending on emitClose. + closeEmitted: makeBitMapDescriptor(kCloseEmitted), + multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain), + // If true, a maybeReadMore has been scheduled. + readingMore: makeBitMapDescriptor(kReadingMore), + dataEmitted: makeBitMapDescriptor(kDataEmitted) +}) function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || __nccwpck_require__(82063); - options = options || {}; - // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof __nccwpck_require__(94449) - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + // Bit map field to store ReadableState more effciently with 1 bit per field + // instead of a V8 slot per field. + this.state = kEmitClose | kAutoDestroy | kConstructed | kSync + // Object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away. + if (options && options.objectMode) this.state |= kObjectMode + if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode - // the point at which it stops calling _read() to fill the buffer + // The point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); + this.highWaterMark = options + ? getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex) + : getDefaultHighWaterMark(false) // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; + // array.shift(). + this.buffer = new BufferList() + this.length = 0 + this.pipes = [] + this.flowing = null + this[kPaused] = null // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; + if (options && options.emitClose === false) this.state &= ~kEmitClose - // Should .destroy() be called after 'end' (and potentially 'finish') - this.autoDestroy = !!options.autoDestroy; + // Should .destroy() be called after 'end' (and potentially 'finish'). + if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy - // has it been destroyed - this.destroyed = false; + // Indicates whether the stream has errored. When true no further + // _read calls, 'data' or 'readable' events should occur. This is needed + // since when autoDestroy is disabled we need a way to tell whether the + // stream has failed. + this.errored = null // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; + this.defaultEncoding = (options && options.defaultEncoding) || 'utf8' - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(80634)/* .StringDecoder */ .I); - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; + // Ref the piped dest which we need a drain event on it + // type: null | Writable | Set. + this.awaitDrainWriters = null + this.decoder = null + this.encoding = null + if (options && options.encoding) { + this.decoder = new StringDecoder(options.encoding) + this.encoding = options.encoding } } function Readable(options) { - Duplex = Duplex || __nccwpck_require__(82063); - if (!(this instanceof Readable)) return new Readable(options); + if (!(this instanceof Readable)) return new Readable(options) // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); - - // legacy - this.readable = true; + // the ReadableState constructor, at least with V8 6.5. + const isDuplex = this instanceof __nccwpck_require__(94449) + this._readableState = new ReadableState(options, this, isDuplex) if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.read === 'function') this._read = options.read + if (typeof options.destroy === 'function') this._destroy = options.destroy + if (typeof options.construct === 'function') this._construct = options.construct + if (options.signal && !isDuplex) addAbortSignal(options.signal, this) } - Stream.call(this); -} -Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; + Stream.call(this, options) + destroyImpl.construct(this, () => { + if (this._readableState.needReadable) { + maybeReadMore(this, this._readableState) } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; + }) +} +Readable.prototype.destroy = destroyImpl.destroy +Readable.prototype._undestroy = destroyImpl.undestroy Readable.prototype._destroy = function (err, cb) { - cb(err); -}; + cb(err) +} +Readable.prototype[EE.captureRejectionSymbol] = function (err) { + this.destroy(err) +} +Readable.prototype[SymbolAsyncDispose] = function () { + let error + if (!this.destroyed) { + error = this.readableEnded ? null : new AbortError() + this.destroy(error) + } + return new Promise((resolve, reject) => eos(this, (err) => (err && err !== error ? reject(err) : resolve(null)))) +} // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { + return readableAddChunk(this, chunk, encoding, false) +} + +// Unshift should *always* be something directly out of read(). +Readable.prototype.unshift = function (chunk, encoding) { + return readableAddChunk(this, chunk, encoding, true) +} +function readableAddChunk(stream, chunk, encoding, addToFront) { + debug('readableAddChunk', chunk) + const state = stream._readableState + let err + if ((state.state & kObjectMode) === 0) { if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; + encoding = encoding || state.defaultEncoding + if (state.encoding !== encoding) { + if (addToFront && state.encoding) { + // When unshifting, if state.encoding is set, we have to save + // the string in the BufferList with the state encoding. + chunk = Buffer.from(chunk, encoding).toString(state.encoding) + } else { + chunk = Buffer.from(chunk, encoding) + encoding = '' + } } - skipChunkCheck = true; + } else if (chunk instanceof Buffer) { + encoding = '' + } else if (Stream._isUint8Array(chunk)) { + chunk = Stream._uint8ArrayToBuffer(chunk) + encoding = '' + } else if (chunk != null) { + err = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk) } - } else { - skipChunkCheck = true; } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; + if (err) { + errorOrDestroy(stream, err) + } else if (chunk === null) { + state.state &= ~kReading + onEofChunk(stream, state) + } else if ((state.state & kObjectMode) !== 0 || (chunk && chunk.length > 0)) { + if (addToFront) { + if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()) + else if (state.destroyed || state.errored) return false + else addChunk(stream, state, chunk, true) + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()) + } else if (state.destroyed || state.errored) { + return false + } else { + state.state &= ~kReading + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk) + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false) + else maybeReadMore(stream, state) } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } + addChunk(stream, state, chunk, false) } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); } + } else if (!addToFront) { + state.state &= ~kReading + maybeReadMore(stream, state) } // We can push more data if we are below the highWaterMark. // Also, if we have no data yet, we can stand some more bytes. // This is to work around cases where hwm=0, such as the repl. - return !state.ended && (state.length < state.highWaterMark || state.length === 0); + return !state.ended && (state.length < state.highWaterMark || state.length === 0) } function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); + if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount('data') > 0) { + // Use the guard to avoid creating `Set()` repeatedly + // when we have multiple pipes. + if ((state.state & kMultiAwaitDrain) !== 0) { + state.awaitDrainWriters.clear() + } else { + state.awaitDrainWriters = null + } + state.dataEmitted = true + stream.emit('data', chunk) } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); + // Update the buffer info. + state.length += state.objectMode ? 1 : chunk.length + if (addToFront) state.buffer.unshift(chunk) + else state.buffer.push(chunk) + if ((state.state & kNeedReadable) !== 0) emitReadable(stream) } - maybeReadMore(stream, state); -} -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - return er; + maybeReadMore(stream, state) } Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; + const state = this._readableState + return state[kPaused] === true || state.flowing === false +} -// backwards compatibility. +// Backwards compatibility. Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(80634)/* .StringDecoder */ .I); - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; - // If setEncoding(null), decoder.encoding equals utf8 - this._readableState.encoding = this._readableState.decoder.encoding; - + const decoder = new StringDecoder(enc) + this._readableState.decoder = decoder + // If setEncoding(null), decoder.encoding equals utf8. + this._readableState.encoding = this._readableState.decoder.encoding + const buffer = this._readableState.buffer // Iterate over current buffer to convert already stored Buffers: - var p = this._readableState.buffer.head; - var content = ''; - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - this._readableState.buffer.clear(); - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; + let content = '' + for (const data of buffer) { + content += decoder.write(data) + } + buffer.clear() + if (content !== '') buffer.push(content) + this._readableState.length = content.length + return this +} -// Don't raise the hwm > 1GB -var MAX_HWM = 0x40000000; +// Don't raise the hwm > 1GB. +const MAX_HWM = 0x40000000 function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; + if (n > MAX_HWM) { + throw new ERR_OUT_OF_RANGE('size', '<= 1GiB', n) } else { // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; + // tiny amounts. + n-- + n |= n >>> 1 + n |= n >>> 2 + n |= n >>> 4 + n |= n >>> 8 + n |= n >>> 16 + n++ } - return n; + return n } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; + if (n <= 0 || (state.length === 0 && state.ended)) return 0 + if ((state.state & kObjectMode) !== 0) return 1 + if (NumberIsNaN(n)) { + // Only flow one buffer at a time. + if (state.flowing && state.length) return state.buffer.first().length + return state.length } - return state.length; + if (n <= state.length) return n + return state.ended ? state.length : 0 } -// you can override either this method, or the async _read(n) below. +// You can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; + debug('read', n) + // Same as parseInt(undefined, 10), however V8 7.3 performance regressed + // in this scenario, so we are doing it manually. + if (n === undefined) { + n = NaN + } else if (!NumberIsInteger(n)) { + n = NumberParseInt(n, 10) + } + const state = this._readableState + const nOrig = n - // if we're doing read(0) to trigger a readable event, but we + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n) + if (n !== 0) state.state &= ~kEmittedReadable + + // If we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; + if ( + n === 0 && + state.needReadable && + ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended) + ) { + debug('read: emitReadable', state.length, state.ended) + if (state.length === 0 && state.ended) endReadable(this) + else emitReadable(this) + return null } - n = howMuchToRead(n, state); + n = howMuchToRead(n, state) - // if we've ended, and we're now clear, then finish it up. + // If we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; + if (state.length === 0) endReadable(this) + return null } // All the actual chunk generation logic needs to be @@ -83824,76 +48018,90 @@ Readable.prototype.read = function (n) { // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); + let doRead = (state.state & kNeedReadable) !== 0 + debug('need readable', doRead) - // if we currently have less than the highWaterMark, then also read some + // If we currently have less than the highWaterMark, then also read some. if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); + doRead = true + debug('length less than watermark', doRead) } - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); + // However, if we've ended, then there's no point, if we're already + // reading, then it's unnecessary, if we're constructing we have to wait, + // and if we're destroyed or errored, then it's not allowed, + if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) { + doRead = false + debug('reading, ended or constructing', doRead) } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; + debug('do read') + state.state |= kReading | kSync + // If the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.state |= kNeedReadable + + // Call internal read method + try { + this._read(state.highWaterMark) + } catch (err) { + errorOrDestroy(this, err) + } + state.state &= ~kSync + // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); + if (!state.reading) n = howMuchToRead(nOrig, state) } - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; + let ret + if (n > 0) ret = fromList(n, state) + else ret = null if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; + state.needReadable = state.length <= state.highWaterMark + n = 0 } else { - state.length -= n; - state.awaitDrain = 0; + state.length -= n + if (state.multiAwaitDrain) { + state.awaitDrainWriters.clear() + } else { + state.awaitDrainWriters = null + } } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; + if (!state.ended) state.needReadable = true // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); + if (nOrig !== n && state.ended) endReadable(this) } - if (ret !== null) this.emit('data', ret); - return ret; -}; + if (ret !== null && !state.errorEmitted && !state.closeEmitted) { + state.dataEmitted = true + this.emit('data', ret) + } + return ret +} function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; + debug('onEofChunk') + if (state.ended) return if (state.decoder) { - var chunk = state.decoder.end(); + const chunk = state.decoder.end() if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; + state.buffer.push(chunk) + state.length += state.objectMode ? 1 : chunk.length } } - state.ended = true; + state.ended = true if (state.sync) { - // if we are sync, wait until next tick to emit the data. + // If we are sync, wait until next tick to emit the data. // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); + // the readable code triggers during a read() call. + emitReadable(stream) } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } + // Emit 'readable' now to make sure it gets picked up. + state.needReadable = false + state.emittedReadable = true + // We have to emit readable now that we are EOF. Modules + // in the ecosystem (e.g. dicer) rely on this event being sync. + emitReadable_(stream) } } @@ -83901,43 +48109,43 @@ function onEofChunk(stream, state) { // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; + const state = stream._readableState + debug('emitReadable', state.needReadable, state.emittedReadable) + state.needReadable = false if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); + debug('emitReadable', state.flowing) + state.emittedReadable = true + process.nextTick(emitReadable_, stream) } } function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; + const state = stream._readableState + debug('emitReadable_', state.destroyed, state.length, state.ended) + if (!state.destroyed && !state.errored && (state.length || state.ended)) { + stream.emit('readable') + state.emittedReadable = false } - // The stream needs another readable event if + // The stream needs another readable event if: // 1. It is not flowing, as the flow mechanism will take // care of it. // 2. It is not ended. // 3. It is below the highWaterMark, so we can schedule // another readable later. - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark + flow(stream) } -// at this point, the user has presumably seen the 'readable' event, +// At this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); + if (!state.readingMore && state.constructed) { + state.readingMore = true + process.nextTick(maybeReadMore_, stream, state) } } function maybeReadMore_(stream, state) { @@ -83959,236 +48167,249 @@ function maybeReadMore_(stream, state) { // conditions prevent the data from being read: // - The stream has ended (state.ended). // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() + // case where the stream has called the implementation defined _read() // method, but they are processing the call asynchronously and have _not_ // called push() with new data. In this case we skip performing more // read()s. The execution ends in this method again after the _read() ends // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); + while ( + !state.reading && + !state.ended && + (state.length < state.highWaterMark || (state.flowing && state.length === 0)) + ) { + const len = state.length + debug('maybeReadMore read 0') + stream.read(0) if (len === state.length) - // didn't get any data, stop spinning. - break; + // Didn't get any data, stop spinning. + break } - state.readingMore = false; + state.readingMore = false } -// abstract method. to be overridden in specific implementation classes. +// Abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); -}; + throw new ERR_METHOD_NOT_IMPLEMENTED('_read()') +} Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); + const src = this + const state = this._readableState + if (state.pipes.length === 1) { + if (!state.multiAwaitDrain) { + state.multiAwaitDrain = true + state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : []) + } + } + state.pipes.push(dest) + debug('pipe count=%d opts=%j', state.pipes.length, pipeOpts) + const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr + const endFn = doEnd ? onend : unpipe + if (state.endEmitted) process.nextTick(endFn) + else src.once('end', endFn) + dest.on('unpipe', onunpipe) function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); + debug('onunpipe') if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); + unpipeInfo.hasUnpiped = true + cleanup() } } } function onend() { - debug('onend'); - dest.end(); + debug('onend') + dest.end() } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; + let ondrain + let cleanedUp = false function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; - - // if the reader is waiting for a drain event from this + debug('cleanup') + // Cleanup event handlers once the pipe is broken. + dest.removeListener('close', onclose) + dest.removeListener('finish', onfinish) + if (ondrain) { + dest.removeListener('drain', ondrain) + } + dest.removeListener('error', onerror) + dest.removeListener('unpipe', onunpipe) + src.removeListener('end', onend) + src.removeListener('end', unpipe) + src.removeListener('data', ondata) + cleanedUp = true + + // If the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - src.on('data', ondata); + if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) ondrain() + } + function pause() { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if (!cleanedUp) { + if (state.pipes.length === 1 && state.pipes[0] === dest) { + debug('false write response, pause', 0) + state.awaitDrainWriters = dest + state.multiAwaitDrain = false + } else if (state.pipes.length > 1 && state.pipes.includes(dest)) { + debug('false write response, pause', state.awaitDrainWriters.size) + state.awaitDrainWriters.add(dest) + } + src.pause() + } + if (!ondrain) { + // When the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + ondrain = pipeOnDrain(src, dest) + dest.on('drain', ondrain) + } + } + src.on('data', ondata) function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); + debug('ondata') + const ret = dest.write(chunk) + debug('dest.write', ret) if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - src.pause(); + pause() } } - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. + // If the dest has an error, then stop piping into it. + // However, don't suppress the throwing behavior for this. function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); + debug('onerror', er) + unpipe() + dest.removeListener('error', onerror) + if (dest.listenerCount('error') === 0) { + const s = dest._writableState || dest._readableState + if (s && !s.errorEmitted) { + // User incorrectly emitted 'error' directly on the stream. + errorOrDestroy(dest, er) + } else { + dest.emit('error', er) + } + } } // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); + prependListener(dest, 'error', onerror) // Both close and finish should trigger unpipe, but only once. function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); + dest.removeListener('finish', onfinish) + unpipe() } - dest.once('close', onclose); + dest.once('close', onclose) function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); + debug('onfinish') + dest.removeListener('close', onclose) + unpipe() } - dest.once('finish', onfinish); + dest.once('finish', onfinish) function unpipe() { - debug('unpipe'); - src.unpipe(dest); + debug('unpipe') + src.unpipe(dest) } - // tell the dest that it's being piped to - dest.emit('pipe', src); + // Tell the dest that it's being piped to. + dest.emit('pipe', src) - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); + // Start the flow if it hasn't been started already. + + if (dest.writableNeedDrain === true) { + pause() + } else if (!state.flowing) { + debug('pipe resume') + src.resume() } - return dest; -}; -function pipeOnDrain(src) { + return dest +} +function pipeOnDrain(src, dest) { return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); + const state = src._readableState + + // `ondrain` will call directly, + // `this` maybe not a reference to dest, + // so we use the real dest here. + if (state.awaitDrainWriters === dest) { + debug('pipeOnDrain', 1) + state.awaitDrainWriters = null + } else if (state.multiAwaitDrain) { + debug('pipeOnDrain', state.awaitDrainWriters.size) + state.awaitDrainWriters.delete(dest) } - }; + if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount('data')) { + src.resume() + } + } } Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { + const state = this._readableState + const unpipeInfo = { hasUnpiped: false - }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; } - // slow case. multiple pipe destinations. - + // If we're not piping anywhere, then do nothing. + if (state.pipes.length === 0) return this if (!dest) { // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - return this; + const dests = state.pipes + state.pipes = [] + this.pause() + for (let i = 0; i < dests.length; i++) + dests[i].emit('unpipe', this, { + hasUnpiped: false + }) + return this } - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; -}; + // Try to find the right one. + const index = ArrayPrototypeIndexOf(state.pipes, dest) + if (index === -1) return this + state.pipes.splice(index, 1) + if (state.pipes.length === 0) this.pause() + dest.emit('unpipe', this, unpipeInfo) + return this +} -// set up data events if they are asked for -// Ensure readable listeners eventually get something +// Set up data events if they are asked for +// Ensure readable listeners eventually get something. Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; + const res = Stream.prototype.on.call(this, ev, fn) + const state = this._readableState if (ev === 'data') { - // update readableListening so that resume() may be a no-op + // Update readableListening so that resume() may be a no-op // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; + state.readableListening = this.listenerCount('readable') > 0 - // Try start flowing on next tick if stream isn't explicitly paused - if (state.flowing !== false) this.resume(); + // Try start flowing on next tick if stream isn't explicitly paused. + if (state.flowing !== false) this.resume() } else if (ev === 'readable') { if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); + state.readableListening = state.needReadable = true + state.flowing = false + state.emittedReadable = false + debug('on readable', state.length, state.reading) if (state.length) { - emitReadable(this); + emitReadable(this) } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); + process.nextTick(nReadingNextTick, this) } } } - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + return res +} +Readable.prototype.addListener = Readable.prototype.on Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); + const res = Stream.prototype.removeListener.call(this, ev, fn) if (ev === 'readable') { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen @@ -84196,12 +48417,13 @@ Readable.prototype.removeListener = function (ev, fn) { // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. - process.nextTick(updateReadableListening, this); + process.nextTick(updateReadableListening, this) } - return res; -}; + return res +} +Readable.prototype.off = Readable.prototype.removeListener Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); + const res = Stream.prototype.removeAllListeners.apply(this, arguments) if (ev === 'readable' || ev === undefined) { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen @@ -84209,246 +48431,486 @@ Readable.prototype.removeAllListeners = function (ev) { // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. - process.nextTick(updateReadableListening, this); + process.nextTick(updateReadableListening, this) } - return res; -}; + return res +} function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise + const state = self._readableState + state.readableListening = self.listenerCount('readable') > 0 + if (state.resumeScheduled && state[kPaused] === false) { + // Flowing needs to be set to true now, otherwise // the upcoming resume will not flow. - state.flowing = true; + state.flowing = true - // crude way to check if we should resume + // Crude way to check if we should resume. } else if (self.listenerCount('data') > 0) { - self.resume(); + self.resume() + } else if (!state.readableListening) { + state.flowing = null } } function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); + debug('readable nexttick read 0') + self.read(0) } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { - var state = this._readableState; + const state = this._readableState if (!state.flowing) { - debug('resume'); - // we flow only if there is no one listening + debug('resume') + // We flow only if there is no one listening // for readable, but we still have to call - // resume() - state.flowing = !state.readableListening; - resume(this, state); + // resume(). + state.flowing = !state.readableListening + resume(this, state) } - state.paused = false; - return this; -}; + state[kPaused] = false + return this +} function resume(stream, state) { if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); + state.resumeScheduled = true + process.nextTick(resume_, stream, state) } } function resume_(stream, state) { - debug('resume', state.reading); + debug('resume', state.reading) if (!state.reading) { - stream.read(0); + stream.read(0) } - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); + state.resumeScheduled = false + stream.emit('resume') + flow(stream) + if (state.flowing && !state.reading) stream.read(0) } Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); + debug('call pause flowing=%j', this._readableState.flowing) if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); + debug('pause') + this._readableState.flowing = false + this.emit('pause') } - this._readableState.paused = true; - return this; -}; + this._readableState[kPaused] = true + return this +} function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); + const state = stream._readableState + debug('flow', state.flowing) while (state.flowing && stream.read() !== null); } -// wrap an old-style stream as the async data source. +// Wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { - var _this = this; - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); + let paused = false - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); + // TODO (ronag): Should this.destroy(err) emit + // 'error' on the wrapped stream? Would require + // a static factory method, e.g. Readable.wrap(stream). + + stream.on('data', (chunk) => { + if (!this.push(chunk) && stream.pause) { + paused = true + stream.pause() } - }); + }) + stream.on('end', () => { + this.push(null) + }) + stream.on('error', (err) => { + errorOrDestroy(this, err) + }) + stream.on('close', () => { + this.destroy() + }) + stream.on('destroy', () => { + this.destroy() + }) + this._read = () => { + if (paused && stream.resume) { + paused = false + stream.resume() + } + } - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { + // Proxy all the other methods. Important when wrapping filters and duplexes. + const streamKeys = ObjectKeys(stream) + for (let j = 1; j < streamKeys.length; j++) { + const i = streamKeys[j] if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); + this[i] = stream[i].bind(stream) } } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + return this +} +Readable.prototype[SymbolAsyncIterator] = function () { + return streamToAsyncIterator(this) +} +Readable.prototype.iterator = function (options) { + if (options !== undefined) { + validateObject(options, 'options') } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); + return streamToAsyncIterator(this, options) +} +function streamToAsyncIterator(stream, options) { + if (typeof stream.read !== 'function') { + stream = Readable.wrap(stream, { + objectMode: true + }) + } + const iter = createAsyncIterator(stream, options) + iter.stream = stream + return iter +} +async function* createAsyncIterator(stream, options) { + let callback = nop + function next(resolve) { + if (this === stream) { + callback() + callback = nop + } else { + callback = resolve } - }; - return this; -}; -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = __nccwpck_require__(14868); + } + stream.on('readable', next) + let error + const cleanup = eos( + stream, + { + writable: false + }, + (err) => { + error = err ? aggregateTwoErrors(error, err) : null + callback() + callback = nop + } + ) + try { + while (true) { + const chunk = stream.destroyed ? null : stream.read() + if (chunk !== null) { + yield chunk + } else if (error) { + throw error + } else if (error === null) { + return + } else { + await new Promise(next) + } + } + } catch (err) { + error = aggregateTwoErrors(error, err) + throw error + } finally { + if ( + (error || (options === null || options === undefined ? undefined : options.destroyOnReturn) !== false) && + (error === undefined || stream._readableState.autoDestroy) + ) { + destroyImpl.destroyer(stream, null) + } else { + stream.off('readable', next) + cleanup() } - return createReadableStreamAsyncIterator(this); - }; -} -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; } -}); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; +} + +// Making it explicit these properties are not enumerable +// because otherwise some prototype manipulation in +// userland will fail. +ObjectDefineProperties(Readable.prototype, { + readable: { + __proto__: null, + get() { + const r = this._readableState + // r.readable === false means that this is part of a Duplex stream + // where the readable side was disabled upon construction. + // Compat. The user might manually disable readable side through + // deprecated setter. + return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted + }, + set(val) { + // Backwards compat. + if (this._readableState) { + this._readableState.readable = !!val + } + } + }, + readableDidRead: { + __proto__: null, + enumerable: false, + get: function () { + return this._readableState.dataEmitted + } + }, + readableAborted: { + __proto__: null, + enumerable: false, + get: function () { + return !!( + this._readableState.readable !== false && + (this._readableState.destroyed || this._readableState.errored) && + !this._readableState.endEmitted + ) + } + }, + readableHighWaterMark: { + __proto__: null, + enumerable: false, + get: function () { + return this._readableState.highWaterMark + } + }, + readableBuffer: { + __proto__: null, + enumerable: false, + get: function () { + return this._readableState && this._readableState.buffer + } + }, + readableFlowing: { + __proto__: null, + enumerable: false, + get: function () { + return this._readableState.flowing + }, + set: function (state) { + if (this._readableState) { + this._readableState.flowing = state + } + } + }, + readableLength: { + __proto__: null, + enumerable: false, + get() { + return this._readableState.length + } + }, + readableObjectMode: { + __proto__: null, + enumerable: false, + get() { + return this._readableState ? this._readableState.objectMode : false + } + }, + readableEncoding: { + __proto__: null, + enumerable: false, + get() { + return this._readableState ? this._readableState.encoding : null + } + }, + errored: { + __proto__: null, + enumerable: false, + get() { + return this._readableState ? this._readableState.errored : null + } + }, + closed: { + __proto__: null, + get() { + return this._readableState ? this._readableState.closed : false + } + }, + destroyed: { + __proto__: null, + enumerable: false, + get() { + return this._readableState ? this._readableState.destroyed : false + }, + set(value) { + // We ignore the value if the stream + // has not been initialized yet. + if (!this._readableState) { + return + } + + // Backward compatibility, the user is explicitly + // managing destroyed. + this._readableState.destroyed = value + } + }, + readableEnded: { + __proto__: null, + enumerable: false, + get() { + return this._readableState ? this._readableState.endEmitted : false + } } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; +}) +ObjectDefineProperties(ReadableState.prototype, { + // Legacy getter for `pipesCount`. + pipesCount: { + __proto__: null, + get() { + return this.pipes.length + } }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; + // Legacy property for `paused`. + paused: { + __proto__: null, + get() { + return this[kPaused] !== false + }, + set(value) { + this[kPaused] = !!value } } -}); +}) -// exposed for testing purposes only. -Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); +// Exposed for testing purposes only. +Readable._fromList = fromList // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); + // nothing buffered. + if (state.length === 0) return null + let ret + if (state.objectMode) ret = state.buffer.shift() + else if (!n || n >= state.length) { + // Read it all, truncate the list. + if (state.decoder) ret = state.buffer.join('') + else if (state.buffer.length === 1) ret = state.buffer.first() + else ret = state.buffer.concat(state.length) + state.buffer.clear() } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); + // read part of list. + ret = state.buffer.consume(n, state.decoder) } - return ret; + return ret } function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); + const state = stream._readableState + debug('endReadable', state.endEmitted) if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); + state.ended = true + process.nextTick(endReadableNT, state, stream) } } function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); + debug('endReadableNT', state.endEmitted, state.length) // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - if (state.autoDestroy) { + if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) { + state.endEmitted = true + stream.emit('end') + if (stream.writable && stream.allowHalfOpen === false) { + process.nextTick(endWritableNT, stream) + } else if (state.autoDestroy) { // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); + // if the writable side is ready for autoDestroy as well. + const wState = stream._writableState + const autoDestroy = + !wState || + (wState.autoDestroy && + // We don't expect the writable to ever 'finish' + // if writable is explicitly set to false. + (wState.finished || wState.writable === false)) + if (autoDestroy) { + stream.destroy() } } } } -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = __nccwpck_require__(4659); +function endWritableNT(stream) { + const writable = stream.writable && !stream.writableEnded && !stream.destroyed + if (writable) { + stream.end() + } +} +Readable.from = function (iterable, opts) { + return from(Readable, iterable, opts) +} +let webStreamsAdapters + +// Lazy to avoid circular references +function lazyWebStreams() { + if (webStreamsAdapters === undefined) webStreamsAdapters = {} + return webStreamsAdapters +} +Readable.fromWeb = function (readableStream, options) { + return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options) +} +Readable.toWeb = function (streamReadable, options) { + return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options) +} +Readable.wrap = function (src, options) { + var _ref, _src$readableObjectMo + return new Readable({ + objectMode: + (_ref = + (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== undefined + ? _src$readableObjectMo + : src.objectMode) !== null && _ref !== undefined + ? _ref + : true, + ...options, + destroy(err, callback) { + destroyImpl.destroyer(src, err) + callback(err) } - return from(Readable, iterable, opts); - }; + }).wrap(src) } -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; + + +/***/ }), + +/***/ 54874: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { MathFloor, NumberIsInteger } = __nccwpck_require__(50999) +const { validateInteger } = __nccwpck_require__(49554) +const { ERR_INVALID_ARG_VALUE } = (__nccwpck_require__(69220).codes) +let defaultHighWaterMarkBytes = 16 * 1024 +let defaultHighWaterMarkObjectMode = 16 +function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null +} +function getDefaultHighWaterMark(objectMode) { + return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes +} +function setDefaultHighWaterMark(objectMode, value) { + validateInteger(value, 'value', 0) + if (objectMode) { + defaultHighWaterMarkObjectMode = value + } else { + defaultHighWaterMarkBytes = value } - return -1; } +function getHighWaterMark(state, options, duplexKey, isDuplex) { + const hwm = highWaterMarkFrom(options, isDuplex, duplexKey) + if (hwm != null) { + if (!NumberIsInteger(hwm) || hwm < 0) { + const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark' + throw new ERR_INVALID_ARG_VALUE(name, hwm) + } + return MathFloor(hwm) + } + + // Default value + return getDefaultHighWaterMark(state.objectMode) +} +module.exports = { + getHighWaterMark, + getDefaultHighWaterMark, + setDefaultHighWaterMark +} + /***/ }), -/***/ 12337: +/***/ 12135: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -84517,135 +48979,461 @@ function indexOf(xs, x) { -module.exports = Transform; -var _require$codes = (__nccwpck_require__(25500)/* .codes */ .F), - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; -var Duplex = __nccwpck_require__(82063); -__nccwpck_require__(39598)(Transform, Duplex); -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); +const { ObjectSetPrototypeOf, Symbol } = __nccwpck_require__(50999) +module.exports = Transform +const { ERR_METHOD_NOT_IMPLEMENTED } = (__nccwpck_require__(69220).codes) +const Duplex = __nccwpck_require__(94449) +const { getHighWaterMark } = __nccwpck_require__(54874) +ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype) +ObjectSetPrototypeOf(Transform, Duplex) +const kCallback = Symbol('kCallback') +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options) + + // TODO (ronag): This should preferably always be + // applied but would be semver-major. Or even better; + // make Transform a Readable with the Writable interface. + const readableHighWaterMark = options ? getHighWaterMark(this, options, 'readableHighWaterMark', true) : null + if (readableHighWaterMark === 0) { + // A Duplex will buffer both on the writable and readable side while + // a Transform just wants to buffer hwm number of elements. To avoid + // buffering twice we disable buffering on the writable side. + options = { + ...options, + highWaterMark: null, + readableHighWaterMark, + // TODO (ronag): 0 is not optimal since we have + // a "bug" where we check needDrain before calling _write and not after. + // Refs: https://github.com/nodejs/node/pull/32887 + // Refs: https://github.com/nodejs/node/pull/35941 + writableHighWaterMark: options.writableHighWaterMark || 0 + } + } + Duplex.call(this, options) + + // We have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false + this[kCallback] = null + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform + if (typeof options.flush === 'function') this._flush = options.flush } - ts.writechunk = null; - ts.writecb = null; - if (data != null) - // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); + + // When the writable side finishes, then flush out anything remaining. + // Backwards compat. Some Transform streams incorrectly implement _final + // instead of or in addition to _flush. By using 'prefinish' instead of + // implementing _final we continue supporting this unfortunate use case. + this.on('prefinish', prefinish) +} +function final(cb) { + if (typeof this._flush === 'function' && !this.destroyed) { + this._flush((er, data) => { + if (er) { + if (cb) { + cb(er) + } else { + this.destroy(er) + } + return + } + if (data != null) { + this.push(data) + } + this.push(null) + if (cb) { + cb() + } + }) + } else { + this.push(null) + if (cb) { + cb() + } + } +} +function prefinish() { + if (this._final !== final) { + final.call(this) + } +} +Transform.prototype._final = final +Transform.prototype._transform = function (chunk, encoding, callback) { + throw new ERR_METHOD_NOT_IMPLEMENTED('_transform()') +} +Transform.prototype._write = function (chunk, encoding, callback) { + const rState = this._readableState + const wState = this._writableState + const length = rState.length + this._transform(chunk, encoding, (err, val) => { + if (err) { + callback(err) + return + } + if (val != null) { + this.push(val) + } + if ( + wState.ended || + // Backwards compat. + length === rState.length || + // Backwards compat. + rState.length < rState.highWaterMark + ) { + callback() + } else { + this[kCallback] = callback + } + }) +} +Transform.prototype._read = function () { + if (this[kCallback]) { + const callback = this[kCallback] + this[kCallback] = null + callback() + } +} + + +/***/ }), + +/***/ 83426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { SymbolAsyncIterator, SymbolIterator, SymbolFor } = __nccwpck_require__(50999) + +// We need to use SymbolFor to make these globally available +// for interopt with readable-stream, i.e. readable-stream +// and node core needs to be able to read/write private state +// from each other for proper interoperability. +const kIsDestroyed = SymbolFor('nodejs.stream.destroyed') +const kIsErrored = SymbolFor('nodejs.stream.errored') +const kIsReadable = SymbolFor('nodejs.stream.readable') +const kIsWritable = SymbolFor('nodejs.stream.writable') +const kIsDisturbed = SymbolFor('nodejs.stream.disturbed') +const kIsClosedPromise = SymbolFor('nodejs.webstream.isClosedPromise') +const kControllerErrorFunction = SymbolFor('nodejs.webstream.controllerErrorFunction') +function isReadableNodeStream(obj, strict = false) { + var _obj$_readableState + return !!( + ( + obj && + typeof obj.pipe === 'function' && + typeof obj.on === 'function' && + (!strict || (typeof obj.pause === 'function' && typeof obj.resume === 'function')) && + (!obj._writableState || + ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === undefined + ? undefined + : _obj$_readableState.readable) !== false) && + // Duplex + (!obj._writableState || obj._readableState) + ) // Writable has .pipe. + ) +} +function isWritableNodeStream(obj) { + var _obj$_writableState + return !!( + ( + obj && + typeof obj.write === 'function' && + typeof obj.on === 'function' && + (!obj._readableState || + ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === undefined + ? undefined + : _obj$_writableState.writable) !== false) + ) // Duplex + ) +} +function isDuplexNodeStream(obj) { + return !!( + obj && + typeof obj.pipe === 'function' && + obj._readableState && + typeof obj.on === 'function' && + typeof obj.write === 'function' + ) +} +function isNodeStream(obj) { + return ( + obj && + (obj._readableState || + obj._writableState || + (typeof obj.write === 'function' && typeof obj.on === 'function') || + (typeof obj.pipe === 'function' && typeof obj.on === 'function')) + ) +} +function isReadableStream(obj) { + return !!( + obj && + !isNodeStream(obj) && + typeof obj.pipeThrough === 'function' && + typeof obj.getReader === 'function' && + typeof obj.cancel === 'function' + ) +} +function isWritableStream(obj) { + return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === 'function' && typeof obj.abort === 'function') +} +function isTransformStream(obj) { + return !!(obj && !isNodeStream(obj) && typeof obj.readable === 'object' && typeof obj.writable === 'object') +} +function isWebStream(obj) { + return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj) +} +function isIterable(obj, isAsync) { + if (obj == null) return false + if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function' + if (isAsync === false) return typeof obj[SymbolIterator] === 'function' + return typeof obj[SymbolAsyncIterator] === 'function' || typeof obj[SymbolIterator] === 'function' +} +function isDestroyed(stream) { + if (!isNodeStream(stream)) return null + const wState = stream._writableState + const rState = stream._readableState + const state = wState || rState + return !!(stream.destroyed || stream[kIsDestroyed] || (state !== null && state !== undefined && state.destroyed)) +} + +// Have been end():d. +function isWritableEnded(stream) { + if (!isWritableNodeStream(stream)) return null + if (stream.writableEnded === true) return true + const wState = stream._writableState + if (wState !== null && wState !== undefined && wState.errored) return false + if (typeof (wState === null || wState === undefined ? undefined : wState.ended) !== 'boolean') return null + return wState.ended +} + +// Have emitted 'finish'. +function isWritableFinished(stream, strict) { + if (!isWritableNodeStream(stream)) return null + if (stream.writableFinished === true) return true + const wState = stream._writableState + if (wState !== null && wState !== undefined && wState.errored) return false + if (typeof (wState === null || wState === undefined ? undefined : wState.finished) !== 'boolean') return null + return !!(wState.finished || (strict === false && wState.ended === true && wState.length === 0)) +} + +// Have been push(null):d. +function isReadableEnded(stream) { + if (!isReadableNodeStream(stream)) return null + if (stream.readableEnded === true) return true + const rState = stream._readableState + if (!rState || rState.errored) return false + if (typeof (rState === null || rState === undefined ? undefined : rState.ended) !== 'boolean') return null + return rState.ended +} + +// Have emitted 'end'. +function isReadableFinished(stream, strict) { + if (!isReadableNodeStream(stream)) return null + const rState = stream._readableState + if (rState !== null && rState !== undefined && rState.errored) return false + if (typeof (rState === null || rState === undefined ? undefined : rState.endEmitted) !== 'boolean') return null + return !!(rState.endEmitted || (strict === false && rState.ended === true && rState.length === 0)) +} +function isReadable(stream) { + if (stream && stream[kIsReadable] != null) return stream[kIsReadable] + if (typeof (stream === null || stream === undefined ? undefined : stream.readable) !== 'boolean') return null + if (isDestroyed(stream)) return false + return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream) +} +function isWritable(stream) { + if (stream && stream[kIsWritable] != null) return stream[kIsWritable] + if (typeof (stream === null || stream === undefined ? undefined : stream.writable) !== 'boolean') return null + if (isDestroyed(stream)) return false + return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream) +} +function isFinished(stream, opts) { + if (!isNodeStream(stream)) { + return null + } + if (isDestroyed(stream)) { + return true + } + if ((opts === null || opts === undefined ? undefined : opts.readable) !== false && isReadable(stream)) { + return false + } + if ((opts === null || opts === undefined ? undefined : opts.writable) !== false && isWritable(stream)) { + return false + } + return true +} +function isWritableErrored(stream) { + var _stream$_writableStat, _stream$_writableStat2 + if (!isNodeStream(stream)) { + return null + } + if (stream.writableErrored) { + return stream.writableErrored } + return (_stream$_writableStat = + (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === undefined + ? undefined + : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== undefined + ? _stream$_writableStat + : null } -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; +function isReadableErrored(stream) { + var _stream$_readableStat, _stream$_readableStat2 + if (!isNodeStream(stream)) { + return null } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} -function prefinish() { - var _this = this; - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); + if (stream.readableErrored) { + return stream.readableErrored } + return (_stream$_readableStat = + (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === undefined + ? undefined + : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== undefined + ? _stream$_readableStat + : null } -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); -}; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); +function isClosed(stream) { + if (!isNodeStream(stream)) { + return null } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; + if (typeof stream.closed === 'boolean') { + return stream.closed + } + const wState = stream._writableState + const rState = stream._readableState + if ( + typeof (wState === null || wState === undefined ? undefined : wState.closed) === 'boolean' || + typeof (rState === null || rState === undefined ? undefined : rState.closed) === 'boolean' + ) { + return ( + (wState === null || wState === undefined ? undefined : wState.closed) || + (rState === null || rState === undefined ? undefined : rState.closed) + ) } -}; -Transform.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; -function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) - // single equals check for both `null` and `undefined` - stream.push(data); - - // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); + if (typeof stream._closed === 'boolean' && isOutgoingMessage(stream)) { + return stream._closed + } + return null +} +function isOutgoingMessage(stream) { + return ( + typeof stream._closed === 'boolean' && + typeof stream._defaultKeepAlive === 'boolean' && + typeof stream._removedConnection === 'boolean' && + typeof stream._removedContLen === 'boolean' + ) +} +function isServerResponse(stream) { + return typeof stream._sent100 === 'boolean' && isOutgoingMessage(stream) +} +function isServerRequest(stream) { + var _stream$req + return ( + typeof stream._consuming === 'boolean' && + typeof stream._dumped === 'boolean' && + ((_stream$req = stream.req) === null || _stream$req === undefined ? undefined : _stream$req.upgradeOrConnect) === + undefined + ) +} +function willEmitClose(stream) { + if (!isNodeStream(stream)) return null + const wState = stream._writableState + const rState = stream._readableState + const state = wState || rState + return ( + (!state && isServerResponse(stream)) || !!(state && state.autoDestroy && state.emitClose && state.closed === false) + ) +} +function isDisturbed(stream) { + var _stream$kIsDisturbed + return !!( + stream && + ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== undefined + ? _stream$kIsDisturbed + : stream.readableDidRead || stream.readableAborted) + ) +} +function isErrored(stream) { + var _ref, + _ref2, + _ref3, + _ref4, + _ref5, + _stream$kIsErrored, + _stream$_readableStat3, + _stream$_writableStat3, + _stream$_readableStat4, + _stream$_writableStat4 + return !!( + stream && + ((_ref = + (_ref2 = + (_ref3 = + (_ref4 = + (_ref5 = + (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== undefined + ? _stream$kIsErrored + : stream.readableErrored) !== null && _ref5 !== undefined + ? _ref5 + : stream.writableErrored) !== null && _ref4 !== undefined + ? _ref4 + : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === undefined + ? undefined + : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== undefined + ? _ref3 + : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === undefined + ? undefined + : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== undefined + ? _ref2 + : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === undefined + ? undefined + : _stream$_readableStat4.errored) !== null && _ref !== undefined + ? _ref + : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === undefined + ? undefined + : _stream$_writableStat4.errored) + ) +} +module.exports = { + isDestroyed, + kIsDestroyed, + isDisturbed, + kIsDisturbed, + isErrored, + kIsErrored, + isReadable, + kIsReadable, + kIsClosedPromise, + kControllerErrorFunction, + kIsWritable, + isClosed, + isDuplexNodeStream, + isFinished, + isIterable, + isReadableNodeStream, + isReadableStream, + isReadableEnded, + isReadableFinished, + isReadableErrored, + isNodeStream, + isWebStream, + isWritable, + isWritableNodeStream, + isWritableStream, + isWritableEnded, + isWritableFinished, + isWritableErrored, + isServerRequest, + isServerResponse, + willEmitClose, + isTransformStream } + /***/ }), -/***/ 38797: +/***/ 58939: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -84676,212 +49464,181 @@ function done(stream, er, data) { -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; +/* replacement start */ -/**/ -var internalUtil = { - deprecate: __nccwpck_require__(24488) -}; -/**/ +const process = __nccwpck_require__(7945) -/**/ -var Stream = __nccwpck_require__(63283); -/**/ +/* replacement end */ -var Buffer = (__nccwpck_require__(20181).Buffer); -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} -var destroyImpl = __nccwpck_require__(65089); -var _require = __nccwpck_require__(54874), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = (__nccwpck_require__(25500)/* .codes */ .F), - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; -var errorOrDestroy = destroyImpl.errorOrDestroy; -__nccwpck_require__(39598)(Writable, Stream); +const { + ArrayPrototypeSlice, + Error, + FunctionPrototypeSymbolHasInstance, + ObjectDefineProperty, + ObjectDefineProperties, + ObjectSetPrototypeOf, + StringPrototypeToLowerCase, + Symbol, + SymbolHasInstance +} = __nccwpck_require__(50999) +module.exports = Writable +Writable.WritableState = WritableState +const { EventEmitter: EE } = __nccwpck_require__(24434) +const Stream = (__nccwpck_require__(84128).Stream) +const { Buffer } = __nccwpck_require__(20181) +const destroyImpl = __nccwpck_require__(65089) +const { addAbortSignal } = __nccwpck_require__(80652) +const { getHighWaterMark, getDefaultHighWaterMark } = __nccwpck_require__(54874) +const { + ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED, + ERR_STREAM_ALREADY_FINISHED, + ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING +} = (__nccwpck_require__(69220).codes) +const { errorOrDestroy } = destroyImpl +ObjectSetPrototypeOf(Writable.prototype, Stream.prototype) +ObjectSetPrototypeOf(Writable, Stream) function nop() {} +const kOnFinished = Symbol('kOnFinished') function WritableState(options, stream, isDuplex) { - Duplex = Duplex || __nccwpck_require__(82063); - options = options || {}; - // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream, // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof __nccwpck_require__(94449) - // object stream flag to indicate whether or not this stream + // Object stream flag to indicate whether or not this stream // contains buffers or objects. - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + this.objectMode = !!(options && options.objectMode) + if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode) - // the point at which write() starts returning false + // The point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); + // the entire buffer is not flushed immediately on write(). + this.highWaterMark = options + ? getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex) + : getDefaultHighWaterMark(false) - // if _final has been called - this.finalCalled = false; + // if _final has been called. + this.finalCalled = false // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? + this.needDrain = false + // At the start of calling end() + this.ending = false + // When end() has been called, and returned. + this.ended = false + // When 'finish' is emitted. + this.finished = false + + // Has it been destroyed + this.destroyed = false + + // Should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; + const noDecode = !!(options && options.decodeStrings === false) + this.decodeStrings = !noDecode // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + this.defaultEncoding = (options && options.defaultEncoding) || 'utf8' - // not an actual buffer we keep track of, but a measurement + // Not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. - this.length = 0; + this.length = 0 - // a flag to see when we're in the middle of a write. - this.writing = false; + // A flag to see when we're in the middle of a write. + this.writing = false - // when true all writes will be buffered until .uncork() call - this.corked = 0; + // When true all writes will be buffered until .uncork() call. + this.corked = 0 - // a flag to be able to tell if the onwrite cb is called immediately, + // A flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. - this.sync = true; + this.sync = true - // a flag to know if we're processing previously buffered items, which + // A flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + this.bufferProcessing = false - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; + // The callback that's passed to _write(chunk, cb). + this.onwrite = onwrite.bind(undefined, stream) - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; + // The callback that the user supplies to write(chunk, encoding, cb). + this.writecb = null - // the amount that is being written when _write is called. - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; + // The amount that is being written when _write is called. + this.writelen = 0 - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + // Storage for data passed to the afterWrite() callback in case of + // synchronous _write() completion. + this.afterWriteTickInfo = null + resetBuffer(this) - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; + // Number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted. + this.pendingcb = 0 - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; + // Stream is still being constructed and cannot be + // destroyed until construction finished or failed. + // Async construction is opt in, therefore we start as + // constructed. + this.constructed = true + + // Emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams. + this.prefinished = false + + // True if the error was already emitted and should not be thrown again. + this.errorEmitted = false // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; + this.emitClose = !options || options.emitClose !== false - // Should .destroy() be called after 'finish' (and potentially 'end') - this.autoDestroy = !!options.autoDestroy; + // Should .destroy() be called after 'finish' (and potentially 'end'). + this.autoDestroy = !options || options.autoDestroy !== false - // count buffered requests - this.bufferedRequestCount = 0; + // Indicates whether the stream has errored. When true all write() calls + // should return false. This is needed since when autoDestroy + // is disabled we need a way to tell whether the stream has failed. + this.errored = null - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); + // Indicates whether the stream has finished destroying. + this.closed = false + + // True if close has been emitted or would have been emitted + // depending on emitClose. + this.closeEmitted = false + this[kOnFinished] = [] +} +function resetBuffer(state) { + state.buffered = [] + state.bufferedIndex = 0 + state.allBuffers = true + state.allNoop = true } WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; + return ArrayPrototypeSlice(this.buffered, this.bufferedIndex) } +ObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', { + __proto__: null, + get() { + return this.buffered.length - this.bufferedIndex + } +}) function Writable(options) { - Duplex = Duplex || __nccwpck_require__(82063); - // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. @@ -84891,1189 +49648,2128 @@ function Writable(options) { // `_writableState` that would lead to infinite recursion. // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); - - // legacy. - this.writable = true; + // the WritableState constructor, at least with V8 6.5. + const isDuplex = this instanceof __nccwpck_require__(94449) + if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options) + this._writableState = new WritableState(options, this, isDuplex) if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - Stream.call(this); + if (typeof options.write === 'function') this._write = options.write + if (typeof options.writev === 'function') this._writev = options.writev + if (typeof options.destroy === 'function') this._destroy = options.destroy + if (typeof options.final === 'function') this._final = options.final + if (typeof options.construct === 'function') this._construct = options.construct + if (options.signal) addAbortSignal(options.signal, this) + } + Stream.call(this, options) + destroyImpl.construct(this, () => { + const state = this._writableState + if (!state.writing) { + clearBuffer(this, state) + } + finishMaybe(this, state) + }) } +ObjectDefineProperty(Writable, SymbolHasInstance, { + __proto__: null, + value: function (object) { + if (FunctionPrototypeSymbolHasInstance(this, object)) return true + if (this !== Writable) return false + return object && object._writableState instanceof WritableState + } +}) // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); -}; -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); - // TODO: defer error events consistently everywhere, not just the cb - errorOrDestroy(stream, er); - process.nextTick(cb, er); + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()) } - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var er; +function _write(stream, chunk, encoding, cb) { + const state = stream._writableState + if (typeof encoding === 'function') { + cb = encoding + encoding = state.defaultEncoding + } else { + if (!encoding) encoding = state.defaultEncoding + else if (encoding !== 'buffer' && !Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding) + if (typeof cb !== 'function') cb = nop + } if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + throw new ERR_STREAM_NULL_VALUES() + } else if (!state.objectMode) { + if (typeof chunk === 'string') { + if (state.decodeStrings !== false) { + chunk = Buffer.from(chunk, encoding) + encoding = 'buffer' + } + } else if (chunk instanceof Buffer) { + encoding = 'buffer' + } else if (Stream._isUint8Array(chunk)) { + chunk = Stream._uint8ArrayToBuffer(chunk) + encoding = 'buffer' + } else { + throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk) + } } - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; + let err + if (state.ending) { + err = new ERR_STREAM_WRITE_AFTER_END() + } else if (state.destroyed) { + err = new ERR_STREAM_DESTROYED('write') } - return true; + if (err) { + process.nextTick(cb, err) + errorOrDestroy(stream, err, true) + return err + } + state.pendingcb++ + return writeOrBuffer(stream, state, chunk, encoding, cb) } Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; -}; + return _write(this, chunk, encoding, cb) === true +} Writable.prototype.cork = function () { - this._writableState.corked++; -}; + this._writableState.corked++ +} Writable.prototype.uncork = function () { - var state = this._writableState; + const state = this._writableState if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + state.corked-- + if (!state.writing) clearBuffer(this, state) } -}; +} Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; + if (typeof encoding === 'string') encoding = StringPrototypeToLowerCase(encoding) + if (!Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding) + this._writableState.defaultEncoding = encoding + return this } -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); -// if we're already writing something, then just put this +// If we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; +function writeOrBuffer(stream, state, chunk, encoding, callback) { + const len = state.objectMode ? 1 : chunk.length + state.length += len + + // stream._write resets state.length + const ret = state.length < state.highWaterMark + // We must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true + if (state.writing || state.corked || state.errored || !state.constructed) { + state.buffered.push({ + chunk, + encoding, + callback + }) + if (state.allBuffers && encoding !== 'buffer') { + state.allBuffers = false } - } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; + if (state.allNoop && callback !== nop) { + state.allNoop = false } - state.bufferedRequestCount += 1; } else { - doWrite(stream, state, false, len, chunk, encoding, cb); + state.writelen = len + state.writecb = callback + state.writing = true + state.sync = true + stream._write(chunk, encoding, state.onwrite) + state.sync = false } - return ret; + + // Return false if errored or destroyed in order to break + // any synchronous while(stream.write(data)) loops. + return ret && !state.errored && !state.destroyed } function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; + state.writelen = len + state.writecb = cb + state.writing = true + state.sync = true + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write')) + else if (writev) stream._writev(chunk, state.onwrite) + else stream._write(chunk, encoding, state.onwrite) + state.sync = false +} +function onwriteError(stream, state, er, cb) { + --state.pendingcb + cb(er) + // Ensure callbacks are invoked even when autoDestroy is + // not enabled. Passing `er` here doesn't make sense since + // it's related to one specific write, not to the buffered + // writes. + errorBuffer(state) + // This can emit error, but error must always follow cb. + errorOrDestroy(stream, er) } function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); + const state = stream._writableState + const sync = state.sync + const cb = state.writecb + if (typeof cb !== 'function') { + errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK()) + return + } + state.writing = false + state.writecb = null + state.length -= state.writelen + state.writelen = 0 + if (er) { + // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364 + er.stack // eslint-disable-line no-unused-expressions + + if (!state.errored) { + state.errored = er + } + + // In case of duplex streams we need to notify the readable side of the + // error. + if (stream._readableState && !stream._readableState.errored) { + stream._readableState.errored = er } if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); + process.nextTick(onwriteError, stream, state, er, cb) } else { - afterWrite(stream, state, finished, cb); + onwriteError(stream, state, er, cb) + } + } else { + if (state.buffered.length > state.bufferedIndex) { + clearBuffer(stream, state) + } + if (sync) { + // It is a common case that the callback passed to .write() is always + // the same. In that case, we do not schedule a new nextTick(), but + // rather just increase a counter, to improve performance and avoid + // memory allocations. + if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) { + state.afterWriteTickInfo.count++ + } else { + state.afterWriteTickInfo = { + count: 1, + cb, + stream, + state + } + process.nextTick(afterWriteTick, state.afterWriteTickInfo) + } + } else { + afterWrite(stream, state, 1, cb) } } } -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); +function afterWriteTick({ stream, state, count, cb }) { + state.afterWriteTickInfo = null + return afterWrite(stream, state, count, cb) +} +function afterWrite(stream, state, count, cb) { + const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain + if (needDrain) { + state.needDrain = false + stream.emit('drain') + } + while (count-- > 0) { + state.pendingcb-- + cb() + } + if (state.destroyed) { + errorBuffer(state) + } + finishMaybe(stream, state) } -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); +// If there's something in the buffer waiting, then invoke callbacks. +function errorBuffer(state) { + if (state.writing) { + return + } + for (let n = state.bufferedIndex; n < state.buffered.length; ++n) { + var _state$errored + const { chunk, callback } = state.buffered[n] + const len = state.objectMode ? 1 : chunk.length + state.length -= len + callback( + (_state$errored = state.errored) !== null && _state$errored !== undefined + ? _state$errored + : new ERR_STREAM_DESTROYED('write') + ) + } + const onfinishCallbacks = state[kOnFinished].splice(0) + for (let i = 0; i < onfinishCallbacks.length; i++) { + var _state$errored2 + onfinishCallbacks[i]( + (_state$errored2 = state.errored) !== null && _state$errored2 !== undefined + ? _state$errored2 + : new ERR_STREAM_DESTROYED('end') + ) } + resetBuffer(state) } -// if there's something in the buffer waiting, then process it +// If there's something in the buffer waiting, then process it. function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; + if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) { + return + } + const { buffered, bufferedIndex, objectMode } = state + const bufferedLength = buffered.length - bufferedIndex + if (!bufferedLength) { + return + } + let i = bufferedIndex + state.bufferProcessing = true + if (bufferedLength > 1 && stream._writev) { + state.pendingcb -= bufferedLength - 1 + const callback = state.allNoop + ? nop + : (err) => { + for (let n = i; n < buffered.length; ++n) { + buffered[n].callback(err) + } + } + // Make a copy of `buffered` if it's going to be used by `callback` above, + // since `doWrite` will mutate the array. + const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i) + chunks.allBuffers = state.allBuffers + doWrite(stream, state, true, state.length, chunks, '', callback) + resetBuffer(state) } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } + do { + const { chunk, encoding, callback } = buffered[i] + buffered[i++] = null + const len = objectMode ? 1 : chunk.length + doWrite(stream, state, false, len, chunk, encoding, callback) + } while (i < buffered.length && !state.writing) + if (i === buffered.length) { + resetBuffer(state) + } else if (i > 256) { + buffered.splice(0, i) + state.bufferedIndex = 0 + } else { + state.bufferedIndex = i } - if (entry === null) state.lastBufferedRequest = null; } - state.bufferedRequest = entry; - state.bufferProcessing = false; + state.bufferProcessing = false } Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); -}; -Writable.prototype._writev = null; + if (this._writev) { + this._writev( + [ + { + chunk, + encoding + } + ], + cb + ) + } else { + throw new ERR_METHOD_NOT_IMPLEMENTED('_write()') + } +} +Writable.prototype._writev = null Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + const state = this._writableState if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; + cb = chunk + chunk = null + encoding = null } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; + cb = encoding + encoding = null + } + let err + if (chunk !== null && chunk !== undefined) { + const ret = _write(this, chunk, encoding) + if (ret instanceof Error) { + err = ret + } } - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - // .end() fully uncorks + // .end() fully uncorks. if (state.corked) { - state.corked = 1; - this.uncork(); + state.corked = 1 + this.uncork() + } + if (err) { + // Do nothing... + } else if (!state.errored && !state.ending) { + // This is forgiving in terms of unnecessary calls to end() and can hide + // logic errors. However, usually such errors are harmless and causing a + // hard error can be disproportionately destructive. It is not always + // trivial for the user to determine whether end() needs to be called + // or not. + + state.ending = true + finishMaybe(this, state, true) + state.ended = true + } else if (state.finished) { + err = new ERR_STREAM_ALREADY_FINISHED('end') + } else if (state.destroyed) { + err = new ERR_STREAM_DESTROYED('end') } - - // ignore unnecessary end() calls. - if (!state.ending) endWritable(this, state, cb); - return this; -}; -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; + if (typeof cb === 'function') { + if (err || state.finished) { + process.nextTick(cb, err) + } else { + state[kOnFinished].push(cb) + } } -}); + return this +} function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; + return ( + state.ending && + !state.destroyed && + state.constructed && + state.length === 0 && + !state.errored && + state.buffered.length === 0 && + !state.finished && + !state.writing && + !state.errorEmitted && + !state.closeEmitted + ) } function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - errorOrDestroy(stream, err); + let called = false + function onFinish(err) { + if (called) { + errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK()) + return } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); + called = true + state.pendingcb-- + if (err) { + const onfinishCallbacks = state[kOnFinished].splice(0) + for (let i = 0; i < onfinishCallbacks.length; i++) { + onfinishCallbacks[i](err) + } + errorOrDestroy(stream, err, state.sync) + } else if (needFinish(state)) { + state.prefinished = true + stream.emit('prefinish') + // Backwards compat. Don't check state.sync here. + // Some streams assume 'finish' will be emitted + // asynchronously relative to _final callback. + state.pendingcb++ + process.nextTick(finish, stream, state) + } + } + state.sync = true + state.pendingcb++ + try { + stream._final(onFinish) + } catch (err) { + onFinish(err) + } + state.sync = false } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); + state.finalCalled = true + callFinal(stream, state) } else { - state.prefinished = true; - stream.emit('prefinish'); + state.prefinished = true + stream.emit('prefinish') } } } -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); +function finishMaybe(stream, state, sync) { + if (needFinish(state)) { + prefinish(stream, state) if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } + if (sync) { + state.pendingcb++ + process.nextTick( + (stream, state) => { + if (needFinish(state)) { + finish(stream, state) + } else { + state.pendingcb-- + } + }, + stream, + state + ) + } else if (needFinish(state)) { + state.pendingcb++ + finish(stream, state) } } } - return need; } -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); +function finish(stream, state) { + state.pendingcb-- + state.finished = true + const onfinishCallbacks = state[kOnFinished].splice(0) + for (let i = 0; i < onfinishCallbacks.length; i++) { + onfinishCallbacks[i]() } - state.ended = true; - stream.writable = false; -} -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; + stream.emit('finish') + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the readable side is ready for autoDestroy as well. + const rState = stream._readableState + const autoDestroy = + !rState || + (rState.autoDestroy && + // We don't expect the readable to ever 'end' + // if readable is explicitly set to false. + (rState.endEmitted || rState.readable === false)) + if (autoDestroy) { + stream.destroy() + } } - - // reuse the free corkReq. - state.corkedRequestsFree.next = corkReq; } -Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; +ObjectDefineProperties(Writable.prototype, { + closed: { + __proto__: null, + get() { + return this._writableState ? this._writableState.closed : false } - return this._writableState.destroyed; }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; + destroyed: { + __proto__: null, + get() { + return this._writableState ? this._writableState.destroyed : false + }, + set(value) { + // Backward compatibility, the user is explicitly managing destroyed. + if (this._writableState) { + this._writableState.destroyed = value + } + } + }, + writable: { + __proto__: null, + get() { + const w = this._writableState + // w.writable === false means that this is part of a Duplex stream + // where the writable side was disabled upon construction. + // Compat. The user might manually disable writable side through + // deprecated setter. + return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended + }, + set(val) { + // Backwards compatible. + if (this._writableState) { + this._writableState.writable = !!val + } + } + }, + writableFinished: { + __proto__: null, + get() { + return this._writableState ? this._writableState.finished : false + } + }, + writableObjectMode: { + __proto__: null, + get() { + return this._writableState ? this._writableState.objectMode : false + } + }, + writableBuffer: { + __proto__: null, + get() { + return this._writableState && this._writableState.getBuffer() + } + }, + writableEnded: { + __proto__: null, + get() { + return this._writableState ? this._writableState.ending : false } + }, + writableNeedDrain: { + __proto__: null, + get() { + const wState = this._writableState + if (!wState) return false + return !wState.destroyed && !wState.ending && wState.needDrain + } + }, + writableHighWaterMark: { + __proto__: null, + get() { + return this._writableState && this._writableState.highWaterMark + } + }, + writableCorked: { + __proto__: null, + get() { + return this._writableState ? this._writableState.corked : 0 + } + }, + writableLength: { + __proto__: null, + get() { + return this._writableState && this._writableState.length + } + }, + errored: { + __proto__: null, + enumerable: false, + get() { + return this._writableState ? this._writableState.errored : null + } + }, + writableAborted: { + __proto__: null, + enumerable: false, + get: function () { + return !!( + this._writableState.writable !== false && + (this._writableState.destroyed || this._writableState.errored) && + !this._writableState.finished + ) + } + } +}) +const destroy = destroyImpl.destroy +Writable.prototype.destroy = function (err, cb) { + const state = this._writableState - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; + // Invoke pending callbacks. + if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) { + process.nextTick(errorBuffer, state) } -}); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; + destroy.call(this, err, cb) + return this +} +Writable.prototype._undestroy = destroyImpl.undestroy Writable.prototype._destroy = function (err, cb) { - cb(err); -}; + cb(err) +} +Writable.prototype[EE.captureRejectionSymbol] = function (err) { + this.destroy(err) +} +let webStreamsAdapters + +// Lazy to avoid circular references +function lazyWebStreams() { + if (webStreamsAdapters === undefined) webStreamsAdapters = {} + return webStreamsAdapters +} +Writable.fromWeb = function (writableStream, options) { + return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options) +} +Writable.toWeb = function (streamWritable) { + return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable) +} + /***/ }), -/***/ 14868: +/***/ 49554: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +/* eslint jsdoc/require-jsdoc: "error" */ -var _Object$setPrototypeO; -function _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; } -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 || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var finished = __nccwpck_require__(36815); -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); -function createIterResult(value, done) { - return { - value: value, - done: done - }; + +const { + ArrayIsArray, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, + ArrayPrototypeMap, + NumberIsInteger, + NumberIsNaN, + NumberMAX_SAFE_INTEGER, + NumberMIN_SAFE_INTEGER, + NumberParseInt, + ObjectPrototypeHasOwnProperty, + RegExpPrototypeExec, + String, + StringPrototypeToUpperCase, + StringPrototypeTrim +} = __nccwpck_require__(50999) +const { + hideStackFrames, + codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL } +} = __nccwpck_require__(69220) +const { normalizeEncoding } = __nccwpck_require__(23539) +const { isAsyncFunction, isArrayBufferView } = (__nccwpck_require__(23539).types) +const signals = {} + +/** + * @param {*} value + * @returns {boolean} + */ +function isInt32(value) { + return value === (value | 0) } -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - if (resolve !== null) { - var data = iter[kStream].read(); - // we defer if data is null - // we can be expecting either 'end' or - // 'error' - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - iter[kHandlePromise](resolve, reject); - }, reject); - }; + +/** + * @param {*} value + * @returns {boolean} + */ +function isUint32(value) { + return value === value >>> 0 } -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - next: function next() { - var _this = this; - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - if (error !== null) { - return Promise.reject(error); - } - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } +const octalReg = /^[0-7]+$/ +const modeDesc = 'must be a 32-bit unsigned integer or an octal string' - // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - var lastPromise = this[kLastPromise]; - var promise; - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - promise = new Promise(this[kHandlePromise]); +/** + * Parse and validate values that will be converted into mode_t (the S_* + * constants). Only valid numbers and octal strings are allowed. They could be + * converted to 32-bit unsigned integers or non-negative signed integers in the + * C++ land, but any value higher than 0o777 will result in platform-specific + * behaviors. + * @param {*} value Values to be validated + * @param {string} name Name of the argument + * @param {number} [def] If specified, will be returned for invalid values + * @returns {number} + */ +function parseFileMode(value, name, def) { + if (typeof value === 'undefined') { + value = def + } + if (typeof value === 'string') { + if (RegExpPrototypeExec(octalReg, value) === null) { + throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc) } - this[kLastPromise] = promise; - return promise; + value = NumberParseInt(value, 8) } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; - // reject if we are waiting for data in the Promise - // returned by next() and store the error - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - iterator[kError] = err; - return; + validateUint32(value, name) + return value +} + +/** + * @callback validateInteger + * @param {*} value + * @param {string} name + * @param {number} [min] + * @param {number} [max] + * @returns {asserts value is number} + */ + +/** @type {validateInteger} */ +const validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => { + if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value) + if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, 'an integer', value) + if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value) +}) + +/** + * @callback validateInt32 + * @param {*} value + * @param {string} name + * @param {number} [min] + * @param {number} [max] + * @returns {asserts value is number} + */ + +/** @type {validateInt32} */ +const validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => { + // The defaults for min and max correspond to the limits of 32-bit integers. + if (typeof value !== 'number') { + throw new ERR_INVALID_ARG_TYPE(name, 'number', value) + } + if (!NumberIsInteger(value)) { + throw new ERR_OUT_OF_RANGE(name, 'an integer', value) + } + if (value < min || value > max) { + throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value) + } +}) + +/** + * @callback validateUint32 + * @param {*} value + * @param {string} name + * @param {number|boolean} [positive=false] + * @returns {asserts value is number} + */ + +/** @type {validateUint32} */ +const validateUint32 = hideStackFrames((value, name, positive = false) => { + if (typeof value !== 'number') { + throw new ERR_INVALID_ARG_TYPE(name, 'number', value) + } + if (!NumberIsInteger(value)) { + throw new ERR_OUT_OF_RANGE(name, 'an integer', value) + } + const min = positive ? 1 : 0 + // 2 ** 32 === 4294967296 + const max = 4294967295 + if (value < min || value > max) { + throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value) + } +}) + +/** + * @callback validateString + * @param {*} value + * @param {string} name + * @returns {asserts value is string} + */ + +/** @type {validateString} */ +function validateString(value, name) { + if (typeof value !== 'string') throw new ERR_INVALID_ARG_TYPE(name, 'string', value) +} + +/** + * @callback validateNumber + * @param {*} value + * @param {string} name + * @param {number} [min] + * @param {number} [max] + * @returns {asserts value is number} + */ + +/** @type {validateNumber} */ +function validateNumber(value, name, min = undefined, max) { + if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value) + if ( + (min != null && value < min) || + (max != null && value > max) || + ((min != null || max != null) && NumberIsNaN(value)) + ) { + throw new ERR_OUT_OF_RANGE( + name, + `${min != null ? `>= ${min}` : ''}${min != null && max != null ? ' && ' : ''}${max != null ? `<= ${max}` : ''}`, + value + ) + } +} + +/** + * @callback validateOneOf + * @template T + * @param {T} value + * @param {string} name + * @param {T[]} oneOf + */ + +/** @type {validateOneOf} */ +const validateOneOf = hideStackFrames((value, name, oneOf) => { + if (!ArrayPrototypeIncludes(oneOf, value)) { + const allowed = ArrayPrototypeJoin( + ArrayPrototypeMap(oneOf, (v) => (typeof v === 'string' ? `'${v}'` : String(v))), + ', ' + ) + const reason = 'must be one of: ' + allowed + throw new ERR_INVALID_ARG_VALUE(name, value, reason) + } +}) + +/** + * @callback validateBoolean + * @param {*} value + * @param {string} name + * @returns {asserts value is boolean} + */ + +/** @type {validateBoolean} */ +function validateBoolean(value, name) { + if (typeof value !== 'boolean') throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value) +} + +/** + * @param {any} options + * @param {string} key + * @param {boolean} defaultValue + * @returns {boolean} + */ +function getOwnPropertyValueOrDefault(options, key, defaultValue) { + return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key] +} + +/** + * @callback validateObject + * @param {*} value + * @param {string} name + * @param {{ + * allowArray?: boolean, + * allowFunction?: boolean, + * nullable?: boolean + * }} [options] + */ + +/** @type {validateObject} */ +const validateObject = hideStackFrames((value, name, options = null) => { + const allowArray = getOwnPropertyValueOrDefault(options, 'allowArray', false) + const allowFunction = getOwnPropertyValueOrDefault(options, 'allowFunction', false) + const nullable = getOwnPropertyValueOrDefault(options, 'nullable', false) + if ( + (!nullable && value === null) || + (!allowArray && ArrayIsArray(value)) || + (typeof value !== 'object' && (!allowFunction || typeof value !== 'function')) + ) { + throw new ERR_INVALID_ARG_TYPE(name, 'Object', value) + } +}) + +/** + * @callback validateDictionary - We are using the Web IDL Standard definition + * of "dictionary" here, which means any value + * whose Type is either Undefined, Null, or + * Object (which includes functions). + * @param {*} value + * @param {string} name + * @see https://webidl.spec.whatwg.org/#es-dictionary + * @see https://tc39.es/ecma262/#table-typeof-operator-results + */ + +/** @type {validateDictionary} */ +const validateDictionary = hideStackFrames((value, name) => { + if (value != null && typeof value !== 'object' && typeof value !== 'function') { + throw new ERR_INVALID_ARG_TYPE(name, 'a dictionary', value) + } +}) + +/** + * @callback validateArray + * @param {*} value + * @param {string} name + * @param {number} [minLength] + * @returns {asserts value is any[]} + */ + +/** @type {validateArray} */ +const validateArray = hideStackFrames((value, name, minLength = 0) => { + if (!ArrayIsArray(value)) { + throw new ERR_INVALID_ARG_TYPE(name, 'Array', value) + } + if (value.length < minLength) { + const reason = `must be longer than ${minLength}` + throw new ERR_INVALID_ARG_VALUE(name, value, reason) + } +}) + +/** + * @callback validateStringArray + * @param {*} value + * @param {string} name + * @returns {asserts value is string[]} + */ + +/** @type {validateStringArray} */ +function validateStringArray(value, name) { + validateArray(value, name) + for (let i = 0; i < value.length; i++) { + validateString(value[i], `${name}[${i}]`) + } +} + +/** + * @callback validateBooleanArray + * @param {*} value + * @param {string} name + * @returns {asserts value is boolean[]} + */ + +/** @type {validateBooleanArray} */ +function validateBooleanArray(value, name) { + validateArray(value, name) + for (let i = 0; i < value.length; i++) { + validateBoolean(value[i], `${name}[${i}]`) + } +} + +/** + * @callback validateAbortSignalArray + * @param {*} value + * @param {string} name + * @returns {asserts value is AbortSignal[]} + */ + +/** @type {validateAbortSignalArray} */ +function validateAbortSignalArray(value, name) { + validateArray(value, name) + for (let i = 0; i < value.length; i++) { + const signal = value[i] + const indexedName = `${name}[${i}]` + if (signal == null) { + throw new ERR_INVALID_ARG_TYPE(indexedName, 'AbortSignal', signal) } - var resolve = iterator[kLastResolve]; - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); + validateAbortSignal(signal, indexedName) + } +} + +/** + * @param {*} signal + * @param {string} [name='signal'] + * @returns {asserts signal is keyof signals} + */ +function validateSignalName(signal, name = 'signal') { + validateString(signal, name) + if (signals[signal] === undefined) { + if (signals[StringPrototypeToUpperCase(signal)] !== undefined) { + throw new ERR_UNKNOWN_SIGNAL(signal + ' (signals must use all capital letters)') } - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; -module.exports = createReadableStreamAsyncIterator; + throw new ERR_UNKNOWN_SIGNAL(signal) + } +} -/***/ }), +/** + * @callback validateBuffer + * @param {*} buffer + * @param {string} [name='buffer'] + * @returns {asserts buffer is ArrayBufferView} + */ -/***/ 77336: +/** @type {validateBuffer} */ +const validateBuffer = hideStackFrames((buffer, name = 'buffer') => { + if (!isArrayBufferView(buffer)) { + throw new ERR_INVALID_ARG_TYPE(name, ['Buffer', 'TypedArray', 'DataView'], buffer) + } +}) + +/** + * @param {string} data + * @param {string} encoding + */ +function validateEncoding(data, encoding) { + const normalizedEncoding = normalizeEncoding(encoding) + const length = data.length + if (normalizedEncoding === 'hex' && length % 2 !== 0) { + throw new ERR_INVALID_ARG_VALUE('encoding', encoding, `is invalid for data of length ${length}`) + } +} + +/** + * Check that the port number is not NaN when coerced to a number, + * is an integer and that it falls within the legal range of port numbers. + * @param {*} port + * @param {string} [name='Port'] + * @param {boolean} [allowZero=true] + * @returns {number} + */ +function validatePort(port, name = 'Port', allowZero = true) { + if ( + (typeof port !== 'number' && typeof port !== 'string') || + (typeof port === 'string' && StringPrototypeTrim(port).length === 0) || + +port !== +port >>> 0 || + port > 0xffff || + (port === 0 && !allowZero) + ) { + throw new ERR_SOCKET_BAD_PORT(name, port, allowZero) + } + return port | 0 +} + +/** + * @callback validateAbortSignal + * @param {*} signal + * @param {string} name + */ + +/** @type {validateAbortSignal} */ +const validateAbortSignal = hideStackFrames((signal, name) => { + if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) { + throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal) + } +}) + +/** + * @callback validateFunction + * @param {*} value + * @param {string} name + * @returns {asserts value is Function} + */ + +/** @type {validateFunction} */ +const validateFunction = hideStackFrames((value, name) => { + if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value) +}) + +/** + * @callback validatePlainFunction + * @param {*} value + * @param {string} name + * @returns {asserts value is Function} + */ + +/** @type {validatePlainFunction} */ +const validatePlainFunction = hideStackFrames((value, name) => { + if (typeof value !== 'function' || isAsyncFunction(value)) throw new ERR_INVALID_ARG_TYPE(name, 'Function', value) +}) + +/** + * @callback validateUndefined + * @param {*} value + * @param {string} name + * @returns {asserts value is undefined} + */ + +/** @type {validateUndefined} */ +const validateUndefined = hideStackFrames((value, name) => { + if (value !== undefined) throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value) +}) + +/** + * @template T + * @param {T} value + * @param {string} name + * @param {T[]} union + */ +function validateUnion(value, name, union) { + if (!ArrayPrototypeIncludes(union, value)) { + throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value) + } +} + +/* + The rules for the Link header field are described here: + https://www.rfc-editor.org/rfc/rfc8288.html#section-3 + + This regex validates any string surrounded by angle brackets + (not necessarily a valid URI reference) followed by zero or more + link-params separated by semicolons. +*/ +const linkValueRegExp = /^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/ + +/** + * @param {any} value + * @param {string} name + */ +function validateLinkHeaderFormat(value, name) { + if (typeof value === 'undefined' || !RegExpPrototypeExec(linkValueRegExp, value)) { + throw new ERR_INVALID_ARG_VALUE( + name, + value, + 'must be an array or string of format "; rel=preload; as=style"' + ) + } +} + +/** + * @param {any} hints + * @return {string} + */ +function validateLinkHeaderValue(hints) { + if (typeof hints === 'string') { + validateLinkHeaderFormat(hints, 'hints') + return hints + } else if (ArrayIsArray(hints)) { + const hintsLength = hints.length + let result = '' + if (hintsLength === 0) { + return result + } + for (let i = 0; i < hintsLength; i++) { + const link = hints[i] + validateLinkHeaderFormat(link, 'hints') + result += link + if (i !== hintsLength - 1) { + result += ', ' + } + } + return result + } + throw new ERR_INVALID_ARG_VALUE( + 'hints', + hints, + 'must be an array or string of format "; rel=preload; as=style"' + ) +} +module.exports = { + isInt32, + isUint32, + parseFileMode, + validateArray, + validateStringArray, + validateBooleanArray, + validateAbortSignalArray, + validateBoolean, + validateBuffer, + validateDictionary, + validateEncoding, + validateFunction, + validateInt32, + validateInteger, + validateNumber, + validateObject, + validateOneOf, + validatePlainFunction, + validatePort, + validateSignalName, + validateString, + validateUint32, + validateUndefined, + validateUnion, + validateAbortSignal, + validateLinkHeaderValue +} + + +/***/ }), + +/***/ 69220: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var 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; } -function _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; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== 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); } -var _require = __nccwpck_require__(20181), - Buffer = _require.Buffer; -var _require2 = __nccwpck_require__(39023), - inspect = _require2.inspect; -var custom = inspect && inspect.custom || 'inspect'; -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); +const { format, inspect } = __nccwpck_require__(43536) +const { AggregateError: CustomAggregateError } = __nccwpck_require__(50999) + +/* + This file is a reduced and adapted version of the main lib/internal/errors.js file defined at + + https://github.com/nodejs/node/blob/main/lib/internal/errors.js + + Don't try to replace with the original file and keep it up to date (starting from E(...) definitions) + with the upstream file. +*/ + +const AggregateError = globalThis.AggregateError || CustomAggregateError +const kIsNodeError = Symbol('kIsNodeError') +const kTypes = [ + 'string', + 'function', + 'number', + 'object', + // Accept 'Function' and 'Object' as alternative to the lower cased version. + 'Function', + 'Object', + 'boolean', + 'bigint', + 'symbol' +] +const classRegExp = /^([A-Z][a-z0-9]*)+$/ +const nodeInternalPrefix = '__node_internal_' +const codes = {} +function assert(value, message) { + if (!value) { + throw new codes.ERR_INTERNAL_ASSERTION(message) + } +} + +// Only use this for integers! Decimal numbers do not work with this function. +function addNumericalSeparator(val) { + let res = '' + let i = val.length + const start = val[0] === '-' ? 1 : 0 + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}` + } + return `${val.slice(0, i)}${res}` +} +function getMessage(key, msg, args) { + if (typeof msg === 'function') { + assert( + msg.length <= args.length, + // Default options do not count. + `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).` + ) + return msg(...args) + } + const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length + assert( + expectedLength === args.length, + `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).` + ) + if (args.length === 0) { + return msg + } + return format(msg, ...args) } -module.exports = /*#__PURE__*/function () { - function BufferList() { - _classCallCheck(this, BufferList); - this.head = null; - this.tail = null; - this.length = 0; +function E(code, message, Base) { + if (!Base) { + Base = Error } - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; + class NodeError extends Base { + constructor(...args) { + super(getMessage(code, message, args)) } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; + toString() { + return `${this.name} [${code}]: ${this.message}` } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; + } + Object.defineProperties(NodeError.prototype, { + name: { + value: Base.name, + writable: true, + enumerable: false, + configurable: true + }, + toString: { + value() { + return `${this.name} [${code}]: ${this.message}` + }, + writable: true, + enumerable: false, + configurable: true } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) ret += s + p.data; - return ret; + }) + NodeError.prototype.code = code + NodeError.prototype[kIsNodeError] = true + codes[code] = NodeError +} +function hideStackFrames(fn) { + // We rename the functions that will be hidden to cut off the stacktrace + // at the outermost one + const hidden = nodeInternalPrefix + fn.name + Object.defineProperty(fn, 'name', { + value: hidden + }) + return fn +} +function aggregateTwoErrors(innerError, outerError) { + if (innerError && outerError && innerError !== outerError) { + if (Array.isArray(outerError.errors)) { + // If `outerError` is already an `AggregateError`. + outerError.errors.push(innerError) + return outerError } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; + const err = new AggregateError([outerError, innerError], outerError.message) + err.code = outerError.code + return err + } + return innerError || outerError +} +class AbortError extends Error { + constructor(message = 'The operation was aborted', options = undefined) { + if (options !== undefined && typeof options !== 'object') { + throw new codes.ERR_INVALID_ARG_TYPE('options', 'Object', options) + } + super(message, options) + this.code = 'ABORT_ERR' + this.name = 'AbortError' + } +} +E('ERR_ASSERTION', '%s', Error) +E( + 'ERR_INVALID_ARG_TYPE', + (name, expected, actual) => { + assert(typeof name === 'string', "'name' must be a string") + if (!Array.isArray(expected)) { + expected = [expected] + } + let msg = 'The ' + if (name.endsWith(' argument')) { + // For cases like 'first argument' + msg += `${name} ` + } else { + msg += `"${name}" ${name.includes('.') ? 'property' : 'argument'} ` + } + msg += 'must be ' + const types = [] + const instances = [] + const other = [] + for (const value of expected) { + assert(typeof value === 'string', 'All expected entries have to be of type string') + if (kTypes.includes(value)) { + types.push(value.toLowerCase()) + } else if (classRegExp.test(value)) { + instances.push(value) + } else { + assert(value !== 'object', 'The value "object" should be written as "Object"') + other.push(value) } - return ret; } - // Consumes a specified amount of bytes or characters from the buffered data. - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); + // Special handle `object` in case other instances are allowed to outline + // the differences between each other. + if (instances.length > 0) { + const pos = types.indexOf('object') + if (pos !== -1) { + types.splice(types, pos, 1) + instances.push('Object') } - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; } - - // Consumes a specified amount of characters from the buffered data. - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - break; + if (types.length > 0) { + switch (types.length) { + case 1: + msg += `of type ${types[0]}` + break + case 2: + msg += `one of type ${types[0]} or ${types[1]}` + break + default: { + const last = types.pop() + msg += `one of type ${types.join(', ')}, or ${last}` } - ++c; } - this.length -= c; - return ret; + if (instances.length > 0 || other.length > 0) { + msg += ' or ' + } } - - // Consumes a specified amount of bytes from the buffered data. - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - break; + if (instances.length > 0) { + switch (instances.length) { + case 1: + msg += `an instance of ${instances[0]}` + break + case 2: + msg += `an instance of ${instances[0]} or ${instances[1]}` + break + default: { + const last = instances.pop() + msg += `an instance of ${instances.join(', ')}, or ${last}` } - ++c; } - this.length -= c; - return ret; - } - - // Make sure the linked list only shows the minimal necessary information. - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread(_objectSpread({}, options), {}, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); + if (other.length > 0) { + msg += ' or ' + } } - }]); - return BufferList; -}(); - -/***/ }), - -/***/ 65089: -/***/ ((module) => { - -"use strict"; - - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); + switch (other.length) { + case 0: + break + case 1: + if (other[0].toLowerCase() !== other[0]) { + msg += 'an ' + } + msg += `${other[0]}` + break + case 2: + msg += `one of ${other[0]} or ${other[1]}` + break + default: { + const last = other.pop() + msg += `one of ${other.join(', ')}, or ${last}` } } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); + if (actual == null) { + msg += `. Received ${actual}` + } else if (typeof actual === 'function' && actual.name) { + msg += `. Received function ${actual.name}` + } else if (typeof actual === 'object') { + var _actual$constructor + if ( + (_actual$constructor = actual.constructor) !== null && + _actual$constructor !== undefined && + _actual$constructor.name + ) { + msg += `. Received an instance of ${actual.constructor.name}` } else { - process.nextTick(emitCloseNT, _this); + const inspected = inspect(actual, { + depth: -1 + }) + msg += `. Received ${inspected}` } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); } else { - process.nextTick(emitCloseNT, _this); + let inspected = inspect(actual, { + colors: false + }) + if (inspected.length > 25) { + inspected = `${inspected.slice(0, 25)}...` + } + msg += `. Received type ${typeof actual} (${inspected})` } - }); - return this; -} -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} -function emitErrorNT(self, err) { - self.emit('error', err); + return msg + }, + TypeError +) +E( + 'ERR_INVALID_ARG_VALUE', + (name, value, reason = 'is invalid') => { + let inspected = inspect(value) + if (inspected.length > 128) { + inspected = inspected.slice(0, 128) + '...' + } + const type = name.includes('.') ? 'property' : 'argument' + return `The ${type} '${name}' ${reason}. Received ${inspected}` + }, + TypeError +) +E( + 'ERR_INVALID_RETURN_VALUE', + (input, name, value) => { + var _value$constructor + const type = + value !== null && + value !== undefined && + (_value$constructor = value.constructor) !== null && + _value$constructor !== undefined && + _value$constructor.name + ? `instance of ${value.constructor.name}` + : `type ${typeof value}` + return `Expected ${input} to be returned from the "${name}"` + ` function but got ${type}.` + }, + TypeError +) +E( + 'ERR_MISSING_ARGS', + (...args) => { + assert(args.length > 0, 'At least one arg needs to be specified') + let msg + const len = args.length + args = (Array.isArray(args) ? args : [args]).map((a) => `"${a}"`).join(' or ') + switch (len) { + case 1: + msg += `The ${args[0]} argument` + break + case 2: + msg += `The ${args[0]} and ${args[1]} arguments` + break + default: + { + const last = args.pop() + msg += `The ${args.join(', ')}, and ${last} arguments` + } + break + } + return `${msg} must be specified` + }, + TypeError +) +E( + 'ERR_OUT_OF_RANGE', + (str, range, input) => { + assert(range, 'Missing "range" argument') + let received + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)) + } else if (typeof input === 'bigint') { + received = String(input) + const limit = BigInt(2) ** BigInt(32) + if (input > limit || input < -limit) { + received = addNumericalSeparator(received) + } + received += 'n' + } else { + received = inspect(input) + } + return `The value of "${str}" is out of range. It must be ${range}. Received ${received}` + }, + RangeError +) +E('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times', Error) +E('ERR_METHOD_NOT_IMPLEMENTED', 'The %s method is not implemented', Error) +E('ERR_STREAM_ALREADY_FINISHED', 'Cannot call %s after a stream was finished', Error) +E('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable', Error) +E('ERR_STREAM_DESTROYED', 'Cannot call %s after a stream was destroyed', Error) +E('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError) +E('ERR_STREAM_PREMATURE_CLOSE', 'Premature close', Error) +E('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF', Error) +E('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event', Error) +E('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error) +E('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s', TypeError) +module.exports = { + AbortError, + aggregateTwoErrors: hideStackFrames(aggregateTwoErrors), + hideStackFrames, + codes } -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} -module.exports = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy -}; /***/ }), -/***/ 36815: +/***/ 29963: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). - -var ERR_STREAM_PREMATURE_CLOSE = (__nccwpck_require__(25500)/* .codes */ .F).ERR_STREAM_PREMATURE_CLOSE; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; +const Stream = __nccwpck_require__(2203) +if (Stream && process.env.READABLE_STREAM === 'disable') { + const promises = Stream.promises + + // Explicit export naming is needed for ESM + module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer + module.exports._isUint8Array = Stream._isUint8Array + module.exports.isDisturbed = Stream.isDisturbed + module.exports.isErrored = Stream.isErrored + module.exports.isReadable = Stream.isReadable + module.exports.Readable = Stream.Readable + module.exports.Writable = Stream.Writable + module.exports.Duplex = Stream.Duplex + module.exports.Transform = Stream.Transform + module.exports.PassThrough = Stream.PassThrough + module.exports.addAbortSignal = Stream.addAbortSignal + module.exports.finished = Stream.finished + module.exports.destroy = Stream.destroy + module.exports.pipeline = Stream.pipeline + module.exports.compose = Stream.compose + Object.defineProperty(Stream, 'promises', { + configurable: true, + enumerable: true, + get() { + return promises } - callback.apply(this, args); - }; + }) + module.exports.Stream = Stream.Stream +} else { + const CustomStream = __nccwpck_require__(12375) + const promises = __nccwpck_require__(65904) + const originalDestroy = CustomStream.Readable.destroy + module.exports = CustomStream.Readable + + // Explicit export naming is needed for ESM + module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer + module.exports._isUint8Array = CustomStream._isUint8Array + module.exports.isDisturbed = CustomStream.isDisturbed + module.exports.isErrored = CustomStream.isErrored + module.exports.isReadable = CustomStream.isReadable + module.exports.Readable = CustomStream.Readable + module.exports.Writable = CustomStream.Writable + module.exports.Duplex = CustomStream.Duplex + module.exports.Transform = CustomStream.Transform + module.exports.PassThrough = CustomStream.PassThrough + module.exports.addAbortSignal = CustomStream.addAbortSignal + module.exports.finished = CustomStream.finished + module.exports.destroy = CustomStream.destroy + module.exports.destroy = originalDestroy + module.exports.pipeline = CustomStream.pipeline + module.exports.compose = CustomStream.compose + Object.defineProperty(CustomStream, 'promises', { + configurable: true, + enumerable: true, + get() { + return promises + } + }) + module.exports.Stream = CustomStream.Stream } -function noop() {} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - var writableEnded = stream._writableState && stream._writableState.finished; - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - var readableEnded = stream._readableState && stream._readableState.endEmitted; - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - var onerror = function onerror(err) { - callback.call(stream, err); - }; - var onclose = function onclose() { - var err; - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); + +// Allow default importing +module.exports["default"] = module.exports + + +/***/ }), + +/***/ 50999: +/***/ ((module) => { + +"use strict"; + + +/* + This file is a reduced and adapted version of the main lib/internal/per_context/primordials.js file defined at + + https://github.com/nodejs/node/blob/main/lib/internal/per_context/primordials.js + + Don't try to replace with the original file and keep it up to date with the upstream file. +*/ + +// This is a simplified version of AggregateError +class AggregateError extends Error { + constructor(errors) { + if (!Array.isArray(errors)) { + throw new TypeError(`Expected input to be an Array, got ${typeof errors}`) } - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); + let message = '' + for (let i = 0; i < errors.length; i++) { + message += ` ${errors[i].stack}\n` } - }; - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); + super(message) + this.name = 'AggregateError' + this.errors = errors } - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; } -module.exports = eos; +module.exports = { + AggregateError, + ArrayIsArray(self) { + return Array.isArray(self) + }, + ArrayPrototypeIncludes(self, el) { + return self.includes(el) + }, + ArrayPrototypeIndexOf(self, el) { + return self.indexOf(el) + }, + ArrayPrototypeJoin(self, sep) { + return self.join(sep) + }, + ArrayPrototypeMap(self, fn) { + return self.map(fn) + }, + ArrayPrototypePop(self, el) { + return self.pop(el) + }, + ArrayPrototypePush(self, el) { + return self.push(el) + }, + ArrayPrototypeSlice(self, start, end) { + return self.slice(start, end) + }, + Error, + FunctionPrototypeCall(fn, thisArgs, ...args) { + return fn.call(thisArgs, ...args) + }, + FunctionPrototypeSymbolHasInstance(self, instance) { + return Function.prototype[Symbol.hasInstance].call(self, instance) + }, + MathFloor: Math.floor, + Number, + NumberIsInteger: Number.isInteger, + NumberIsNaN: Number.isNaN, + NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER, + NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER, + NumberParseInt: Number.parseInt, + ObjectDefineProperties(self, props) { + return Object.defineProperties(self, props) + }, + ObjectDefineProperty(self, name, prop) { + return Object.defineProperty(self, name, prop) + }, + ObjectGetOwnPropertyDescriptor(self, name) { + return Object.getOwnPropertyDescriptor(self, name) + }, + ObjectKeys(obj) { + return Object.keys(obj) + }, + ObjectSetPrototypeOf(target, proto) { + return Object.setPrototypeOf(target, proto) + }, + Promise, + PromisePrototypeCatch(self, fn) { + return self.catch(fn) + }, + PromisePrototypeThen(self, thenFn, catchFn) { + return self.then(thenFn, catchFn) + }, + PromiseReject(err) { + return Promise.reject(err) + }, + PromiseResolve(val) { + return Promise.resolve(val) + }, + ReflectApply: Reflect.apply, + RegExpPrototypeTest(self, value) { + return self.test(value) + }, + SafeSet: Set, + String, + StringPrototypeSlice(self, start, end) { + return self.slice(start, end) + }, + StringPrototypeToLowerCase(self) { + return self.toLowerCase() + }, + StringPrototypeToUpperCase(self) { + return self.toUpperCase() + }, + StringPrototypeTrim(self) { + return self.trim() + }, + Symbol, + SymbolFor: Symbol.for, + SymbolAsyncIterator: Symbol.asyncIterator, + SymbolHasInstance: Symbol.hasInstance, + SymbolIterator: Symbol.iterator, + SymbolDispose: Symbol.dispose || Symbol('Symbol.dispose'), + SymbolAsyncDispose: Symbol.asyncDispose || Symbol('Symbol.asyncDispose'), + TypedArrayPrototypeSet(self, buf, len) { + return self.set(buf, len) + }, + Boolean, + Uint8Array +} + /***/ }), -/***/ 4659: +/***/ 23539: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -function 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); } } -function _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); }); }; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var 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; } -function _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; } -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 || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var ERR_INVALID_ARG_TYPE = (__nccwpck_require__(25500)/* .codes */ .F).ERR_INVALID_ARG_TYPE; -function from(Readable, iterable, opts) { - var iterator; - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); - // Reading boolean to protect against _read - // being called before last iteration completion. - var reading = false; - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - function next() { - return _next2.apply(this, arguments); +const bufferModule = __nccwpck_require__(20181) +const { format, inspect } = __nccwpck_require__(43536) +const { + codes: { ERR_INVALID_ARG_TYPE } +} = __nccwpck_require__(69220) +const { kResistStopPropagation, AggregateError, SymbolDispose } = __nccwpck_require__(50999) +const AbortSignal = globalThis.AbortSignal || (__nccwpck_require__(17413).AbortSignal) +const AbortController = globalThis.AbortController || (__nccwpck_require__(17413).AbortController) +const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor +const Blob = globalThis.Blob || bufferModule.Blob +/* eslint-disable indent */ +const isBlob = + typeof Blob !== 'undefined' + ? function isBlob(b) { + // eslint-disable-next-line indent + return b instanceof Blob + } + : function isBlob(b) { + return false + } +/* eslint-enable indent */ + +const validateAbortSignal = (signal, name) => { + if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) { + throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal) } - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _yield$iterator$next = yield iterator.next(), - value = _yield$iterator$next.value, - done = _yield$iterator$next.done; - if (done) { - readable.push(null); - } else if (readable.push(yield value)) { - next(); - } else { - reading = false; +} +const validateFunction = (value, name) => { + if (typeof value !== 'function') { + throw new ERR_INVALID_ARG_TYPE(name, 'Function', value) + } +} +module.exports = { + AggregateError, + kEmptyObject: Object.freeze({}), + once(callback) { + let called = false + return function (...args) { + if (called) { + return + } + called = true + callback.apply(this, args) + } + }, + createDeferredPromise: function () { + let resolve + let reject + + // eslint-disable-next-line promise/param-names + const promise = new Promise((res, rej) => { + resolve = res + reject = rej + }) + return { + promise, + resolve, + reject + } + }, + promisify(fn) { + return new Promise((resolve, reject) => { + fn((err, ...args) => { + if (err) { + return reject(err) + } + return resolve(...args) + }) + }) + }, + debuglog() { + return function () {} + }, + format, + inspect, + types: { + isAsyncFunction(fn) { + return fn instanceof AsyncFunction + }, + isArrayBufferView(arr) { + return ArrayBuffer.isView(arr) + } + }, + isBlob, + deprecate(fn, message) { + return fn + }, + addAbortListener: + (__nccwpck_require__(24434).addAbortListener) || + function addAbortListener(signal, listener) { + if (signal === undefined) { + throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal) + } + validateAbortSignal(signal, 'signal') + validateFunction(listener, 'listener') + let removeEventListener + if (signal.aborted) { + queueMicrotask(() => listener()) + } else { + signal.addEventListener('abort', listener, { + __proto__: null, + once: true, + [kResistStopPropagation]: true + }) + removeEventListener = () => { + signal.removeEventListener('abort', listener) } - } catch (err) { - readable.destroy(err); } - }); - return _next2.apply(this, arguments); - } - return readable; + return { + __proto__: null, + [SymbolDispose]() { + var _removeEventListener + ;(_removeEventListener = removeEventListener) === null || _removeEventListener === undefined + ? undefined + : _removeEventListener() + } + } + }, + AbortSignalAny: + AbortSignal.any || + function AbortSignalAny(signals) { + // Fast path if there is only one signal. + if (signals.length === 1) { + return signals[0] + } + const ac = new AbortController() + const abort = () => ac.abort() + signals.forEach((signal) => { + validateAbortSignal(signal, 'signals') + signal.addEventListener('abort', abort, { + once: true + }) + }) + ac.signal.addEventListener( + 'abort', + () => { + signals.forEach((signal) => signal.removeEventListener('abort', abort)) + }, + { + once: true + } + ) + return ac.signal + } } -module.exports = from; +module.exports.promisify.custom = Symbol.for('nodejs.util.promisify.custom') /***/ }), -/***/ 16701: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 43536: +/***/ ((module) => { "use strict"; -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). +/* + This file is a reduced and adapted version of the main lib/internal/util/inspect.js file defined at + + https://github.com/nodejs/node/blob/main/lib/internal/util/inspect.js -var eos; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} -var _require$codes = (__nccwpck_require__(25500)/* .codes */ .F), - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = __nccwpck_require__(36815); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; - - // request.destroy just do .end - .abort is what we want - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} -function call(fn) { - fn(); -} -function pipe(from, to) { - return from.pipe(to); -} -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; + Don't try to replace with the original file and keep it up to date with the upstream file. +*/ +module.exports = { + format(format, ...args) { + // Simplified version of https://nodejs.org/api/util.html#utilformatformat-args + return format.replace(/%([sdifj])/g, function (...[_unused, type]) { + const replacement = args.shift() + if (type === 'f') { + return replacement.toFixed(6) + } else if (type === 'j') { + return JSON.stringify(replacement) + } else if (type === 's' && typeof replacement === 'object') { + const ctor = replacement.constructor !== Object ? replacement.constructor.name : '' + return `${ctor} {}`.trim() + } else { + return replacement.toString() + } + }) + }, + inspect(value) { + // Vastly simplified version of https://nodejs.org/api/util.html#utilinspectobject-options + switch (typeof value) { + case 'string': + if (value.includes("'")) { + if (!value.includes('"')) { + return `"${value}"` + } else if (!value.includes('`') && !value.includes('${')) { + return `\`${value}\`` + } + } + return `'${value}'` + case 'number': + if (isNaN(value)) { + return 'NaN' + } else if (Object.is(value, -0)) { + return String(value) + } + return value + case 'bigint': + return `${String(value)}n` + case 'boolean': + case 'undefined': + return String(value) + case 'object': + return '{}' + } } - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); } -module.exports = pipeline; + /***/ }), -/***/ 54874: +/***/ 12375: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -var ERR_INVALID_OPT_VALUE = (__nccwpck_require__(25500)/* .codes */ .F).ERR_INVALID_OPT_VALUE; -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + +/* replacement start */ + +const { Buffer } = __nccwpck_require__(20181) + +/* replacement end */ + +const { ObjectDefineProperty, ObjectKeys, ReflectApply } = __nccwpck_require__(50999) +const { + promisify: { custom: customPromisify } +} = __nccwpck_require__(23539) +const { streamReturningOperators, promiseReturningOperators } = __nccwpck_require__(11222) +const { + codes: { ERR_ILLEGAL_CONSTRUCTOR } +} = __nccwpck_require__(69220) +const compose = __nccwpck_require__(64999) +const { setDefaultHighWaterMark, getDefaultHighWaterMark } = __nccwpck_require__(54874) +const { pipeline } = __nccwpck_require__(16701) +const { destroyer } = __nccwpck_require__(65089) +const eos = __nccwpck_require__(36815) +const internalBuffer = {} +const promises = __nccwpck_require__(65904) +const utils = __nccwpck_require__(83426) +const Stream = (module.exports = __nccwpck_require__(84128).Stream) +Stream.isDestroyed = utils.isDestroyed +Stream.isDisturbed = utils.isDisturbed +Stream.isErrored = utils.isErrored +Stream.isReadable = utils.isReadable +Stream.isWritable = utils.isWritable +Stream.Readable = __nccwpck_require__(17783) +for (const key of ObjectKeys(streamReturningOperators)) { + const op = streamReturningOperators[key] + function fn(...args) { + if (new.target) { + throw ERR_ILLEGAL_CONSTRUCTOR() + } + return Stream.Readable.from(ReflectApply(op, this, args)) + } + ObjectDefineProperty(fn, 'name', { + __proto__: null, + value: op.name + }) + ObjectDefineProperty(fn, 'length', { + __proto__: null, + value: op.length + }) + ObjectDefineProperty(Stream.Readable.prototype, key, { + __proto__: null, + value: fn, + enumerable: false, + configurable: true, + writable: true + }) } -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); +for (const key of ObjectKeys(promiseReturningOperators)) { + const op = promiseReturningOperators[key] + function fn(...args) { + if (new.target) { + throw ERR_ILLEGAL_CONSTRUCTOR() } - return Math.floor(hwm); + return ReflectApply(op, this, args) + } + ObjectDefineProperty(fn, 'name', { + __proto__: null, + value: op.name + }) + ObjectDefineProperty(fn, 'length', { + __proto__: null, + value: op.length + }) + ObjectDefineProperty(Stream.Readable.prototype, key, { + __proto__: null, + value: fn, + enumerable: false, + configurable: true, + writable: true + }) +} +Stream.Writable = __nccwpck_require__(58939) +Stream.Duplex = __nccwpck_require__(94449) +Stream.Transform = __nccwpck_require__(12135) +Stream.PassThrough = __nccwpck_require__(19173) +Stream.pipeline = pipeline +const { addAbortSignal } = __nccwpck_require__(80652) +Stream.addAbortSignal = addAbortSignal +Stream.finished = eos +Stream.destroy = destroyer +Stream.compose = compose +Stream.setDefaultHighWaterMark = setDefaultHighWaterMark +Stream.getDefaultHighWaterMark = getDefaultHighWaterMark +ObjectDefineProperty(Stream, 'promises', { + __proto__: null, + configurable: true, + enumerable: true, + get() { + return promises + } +}) +ObjectDefineProperty(pipeline, customPromisify, { + __proto__: null, + enumerable: true, + get() { + return promises.pipeline } +}) +ObjectDefineProperty(eos, customPromisify, { + __proto__: null, + enumerable: true, + get() { + return promises.finished + } +}) - // Default value - return state.objectMode ? 16 : 16 * 1024; +// Backwards-compat with node 0.4.x +Stream.Stream = Stream +Stream._isUint8Array = function isUint8Array(value) { + return value instanceof Uint8Array +} +Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) } -module.exports = { - getHighWaterMark: getHighWaterMark -}; + /***/ }), -/***/ 63283: +/***/ 65904: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(2203); - - -/***/ }), +"use strict"; -/***/ 86131: -/***/ ((module, exports, __nccwpck_require__) => { -var Stream = __nccwpck_require__(2203); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; -} else { - exports = module.exports = __nccwpck_require__(86893); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = __nccwpck_require__(38797); - exports.Duplex = __nccwpck_require__(82063); - exports.Transform = __nccwpck_require__(12337); - exports.PassThrough = __nccwpck_require__(35283); - exports.finished = __nccwpck_require__(36815); - exports.pipeline = __nccwpck_require__(16701); +const { ArrayPrototypePop, Promise } = __nccwpck_require__(50999) +const { isIterable, isNodeStream, isWebStream } = __nccwpck_require__(83426) +const { pipelineImpl: pl } = __nccwpck_require__(16701) +const { finished } = __nccwpck_require__(36815) +__nccwpck_require__(12375) +function pipeline(...streams) { + return new Promise((resolve, reject) => { + let signal + let end + const lastArg = streams[streams.length - 1] + if ( + lastArg && + typeof lastArg === 'object' && + !isNodeStream(lastArg) && + !isIterable(lastArg) && + !isWebStream(lastArg) + ) { + const options = ArrayPrototypePop(streams) + signal = options.signal + end = options.end + } + pl( + streams, + (err, value) => { + if (err) { + reject(err) + } else { + resolve(value) + } + }, + { + signal, + end + } + ) + }) +} +module.exports = { + finished, + pipeline } @@ -86326,216 +52022,6 @@ function readdirGlob(pattern, options, cb) { } readdirGlob.ReaddirGlob = ReaddirGlob; -/***/ }), - -/***/ 33967: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var balanced = __nccwpck_require__(59380); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m) return [str]; - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre+ '{' + m.body + '}' + post[k]; - expansions.push(expansion); - } - } else { - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = []; - - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); - } - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - } - - return expansions; -} - - - /***/ }), /***/ 63669: @@ -86570,7 +52056,7 @@ minimatch.sep = path.sep const GLOBSTAR = Symbol('globstar **') minimatch.GLOBSTAR = GLOBSTAR -const expand = __nccwpck_require__(33967) +const expand = __nccwpck_require__(94691) const plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -86722,6 +52208,8 @@ class Minimatch { if (!options) options = {} this.options = options + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined + ? options.maxGlobstarRecursion : 200 this.set = [] this.pattern = pattern this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || @@ -86809,114 +52297,172 @@ class Minimatch { // out of pattern, then that's fine, as long as all // the parts match. matchOne (file, pattern, partial) { - var options = this.options + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0) + } + return this._matchOne(file, pattern, partial, 0, 0) + } - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) + _matchGlobstar (file, pattern, partial, fileIndex, patternIndex) { + // find first globstar from patternIndex + let firstgs = -1 + for (let i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { firstgs = i; break } + } - this.debug('matchOne', file.length, pattern.length) + // find last globstar + let lastgs = -1 + for (let i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { lastgs = i; break } + } - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] + const head = pattern.slice(patternIndex, firstgs) + const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs) + const tail = partial ? [] : pattern.slice(lastgs + 1) - this.debug(pattern, p, f) + // check the head + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length) + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false + } + fileIndex += head.length + } - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true + // check the tail + let fileTailMatch = 0 + if (tail.length) { + if (tail.length + fileIndex > file.length) return false + + const tailStart = file.length - tail.length + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length + } else { + // affordance for stuff like a/**/* matching a/b/ + if (file[file.length - 1] !== '' || + fileIndex + tail.length === file.length) { + return false + } + if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) { + return false } + fileTailMatch = tail.length + 1 + } + } - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] + // if body is empty (single ** between head and tail) + if (!body.length) { + let sawSome = !!fileTailMatch + for (let i = fileIndex; i < file.length - fileTailMatch; i++) { + const f = String(file[i]) + sawSome = true + if (f === '.' || f === '..' || + (!this.options.dot && f.charAt(0) === '.')) { + return false + } + } + return partial || sawSome + } - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + // split body into segments at each GLOBSTAR + const bodySegments = [[[], 0]] + let currentBody = bodySegments[0] + let nonGsParts = 0 + const nonGsPartsSums = [0] + for (const b of body) { + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts) + currentBody = [[], 0] + bodySegments.push(currentBody) + } else { + currentBody[0].push(b) + nonGsParts++ + } + } - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } + let idx = bodySegments.length - 1 + const fileLength = file.length - fileTailMatch + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length) + } - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } + return !!this._matchGlobStarBodySections( + file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch + ) + } + + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + _matchGlobStarBodySections ( + file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail + ) { + const bs = bodySegments[bodyIndex] + if (!bs) { + // just make sure there are no bad dots + for (let i = fileIndex; i < file.length; i++) { + sawTail = true + const f = file[i] + if (f === '.' || f === '..' || + (!this.options.dot && f.charAt(0) === '.')) { + return false } + } + return sawTail + } + + const [body, after] = bs + while (fileIndex <= after) { + const m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ) + // if limit exceeded, no match. intentional false negative, + // acceptable break in correctness for security. + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this._matchGlobStarBodySections( + file, bodySegments, + fileIndex + body.length, bodyIndex + 1, + partial, globStarDepth + 1, sawTail + ) + if (sub !== false) { + return sub + } + } + const f = file[fileIndex] + if (f === '.' || f === '..' || + (!this.options.dot && f.charAt(0) === '.')) { + return false + } + fileIndex++ + } + return partial || null + } + + _matchOne (file, pattern, partial, fileIndex, patternIndex) { + let fi, pi, fl, pl + for ( + fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++ + ) { + this.debug('matchOne loop') + const p = pattern[pi] + const f = file[fi] + + this.debug(pattern, p, f) - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false || p === GLOBSTAR) return false // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. - var hit + let hit if (typeof p === 'string') { hit = f === p this.debug('string match', p, f, hit) @@ -86928,17 +52474,6 @@ class Minimatch { if (!hit) return false } - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - // now either we fell off the end of the pattern, or we're done. if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. @@ -87087,6 +52622,9 @@ class Minimatch { continue } + // coalesce consecutive non-globstar * characters + if (c === '*' && stateChar === '*') continue + // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. @@ -87572,1583 +53110,1377 @@ SafeBuffer.allocUnsafeSlow = function (size) { /***/ }), -/***/ 42560: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 36204: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -;(function (sax) { // wrapper for non-node envs - sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } - sax.SAXParser = SAXParser - sax.SAXStream = SAXStream - sax.createStream = createStream - - // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. - // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), - // since that's the earliest that a buffer overrun could occur. This way, checks are - // as rare as required, but as often as necessary to ensure never crossing this bound. - // Furthermore, buffers are only tested at most once per write(), so passing a very - // large string into write() might have undesirable effects, but this is manageable by - // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme - // edge case, result in creating at most one complete copy of the string passed in. - // Set to Infinity to have unlimited buffers. - sax.MAX_BUFFER_LENGTH = 64 * 1024 - - var buffers = [ - 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', - 'procInstName', 'procInstBody', 'entity', 'attribName', - 'attribValue', 'cdata', 'script' - ] - - sax.EVENTS = [ - 'text', - 'processinginstruction', - 'sgmldeclaration', - 'doctype', - 'comment', - 'opentagstart', - 'attribute', - 'opentag', - 'closetag', - 'opencdata', - 'cdata', - 'closecdata', - 'error', - 'end', - 'ready', - 'script', - 'opennamespace', - 'closenamespace' - ] - - function SAXParser (strict, opt) { - if (!(this instanceof SAXParser)) { - return new SAXParser(strict, opt) - } - - var parser = this - clearBuffers(parser) - parser.q = parser.c = '' - parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - parser.opt = opt || {} - parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags - parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' - parser.tags = [] - parser.closed = parser.closedRoot = parser.sawRoot = false - parser.tag = parser.error = null - parser.strict = !!strict - parser.noscript = !!(strict || parser.opt.noscript) - parser.state = S.BEGIN - parser.strictEntities = parser.opt.strictEntities - parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) - parser.attribList = [] - - // namespaces form a prototype chain. - // it always points at the current tag, - // which protos to its parent tag. - if (parser.opt.xmlns) { - parser.ns = Object.create(rootNS) - } - - // mostly just for error reporting - parser.trackPosition = parser.opt.position !== false - if (parser.trackPosition) { - parser.position = parser.line = parser.column = 0 - } - emit(parser, 'onready') - } - - if (!Object.create) { - Object.create = function (o) { - function F () {} - F.prototype = o - var newf = new F() - return newf - } - } - - if (!Object.keys) { - Object.keys = function (o) { - var a = [] - for (var i in o) if (o.hasOwnProperty(i)) a.push(i) - return a - } - } - - function checkBufferLength (parser) { - var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) - var maxActual = 0 - for (var i = 0, l = buffers.length; i < l; i++) { - var len = parser[buffers[i]].length - if (len > maxAllowed) { - // Text/cdata nodes can get big, and since they're buffered, - // we can get here under normal conditions. - // Avoid issues by emitting the text node now, - // so at least it won't get any bigger. - switch (buffers[i]) { - case 'textNode': - closeText(parser) - break - - case 'cdata': - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - break - - case 'script': - emitNode(parser, 'onscript', parser.script) - parser.script = '' - break +const { EventEmitter } = __nccwpck_require__(29580) +const FIFO = __nccwpck_require__(83867) +const TextDecoder = __nccwpck_require__(97934) + +const StreamError = __nccwpck_require__(45657) + +// if we do a future major, expect queue microtask to be there always, for now a bit defensive +const qmt = + typeof queueMicrotask === 'undefined' ? (fn) => global.process.nextTick(fn) : queueMicrotask + +// 29 bits used total (4 from shared, 14 from read, and 11 from write) +const MAX = (1 << 29) - 1 + +// Shared state +const OPENING = 0b0001 +const PREDESTROYING = 0b0010 +const DESTROYING = 0b0100 +const DESTROYED = 0b1000 + +const NOT_OPENING = MAX ^ OPENING +const NOT_PREDESTROYING = MAX ^ PREDESTROYING + +// Read state (4 bit offset from shared state) +const READ_ACTIVE = 0b00000000000001 << 4 +const READ_UPDATING = 0b00000000000010 << 4 +const READ_PRIMARY = 0b00000000000100 << 4 +const READ_QUEUED = 0b00000000001000 << 4 +const READ_RESUMED = 0b00000000010000 << 4 +const READ_PIPE_DRAINED = 0b00000000100000 << 4 +const READ_ENDING = 0b00000001000000 << 4 +const READ_EMIT_DATA = 0b00000010000000 << 4 +const READ_EMIT_READABLE = 0b00000100000000 << 4 +const READ_EMITTED_READABLE = 0b00001000000000 << 4 +const READ_DONE = 0b00010000000000 << 4 +const READ_NEXT_TICK = 0b00100000000000 << 4 +const READ_NEEDS_PUSH = 0b01000000000000 << 4 +const READ_READ_AHEAD = 0b10000000000000 << 4 + +// Combined read state +const READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED +const READ_ACTIVE_AND_NEEDS_PUSH = READ_ACTIVE | READ_NEEDS_PUSH +const READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE +const READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED +const READ_RESUMED_READ_AHEAD = READ_RESUMED | READ_READ_AHEAD + +const READ_NOT_ACTIVE = MAX ^ READ_ACTIVE +const READ_NON_PRIMARY = MAX ^ READ_PRIMARY +const READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH) +const READ_PUSHED = MAX ^ READ_NEEDS_PUSH +const READ_PAUSED = MAX ^ READ_RESUMED +const READ_NOT_QUEUED = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE) +const READ_NOT_ENDING = MAX ^ READ_ENDING +const READ_PIPE_NOT_DRAINED = MAX ^ READ_FLOWING +const READ_NOT_NEXT_TICK = MAX ^ READ_NEXT_TICK +const READ_NOT_UPDATING = MAX ^ READ_UPDATING +const READ_NO_READ_AHEAD = MAX ^ READ_READ_AHEAD +const READ_PAUSED_NO_READ_AHEAD = MAX ^ READ_RESUMED_READ_AHEAD + +// Write state (18 bit offset, 4 bit offset from shared state and 14 from read state) +const WRITE_ACTIVE = 0b00000000001 << 18 +const WRITE_UPDATING = 0b00000000010 << 18 +const WRITE_PRIMARY = 0b00000000100 << 18 +const WRITE_QUEUED = 0b00000001000 << 18 +const WRITE_UNDRAINED = 0b00000010000 << 18 +const WRITE_DONE = 0b00000100000 << 18 +const WRITE_EMIT_DRAIN = 0b00001000000 << 18 +const WRITE_NEXT_TICK = 0b00010000000 << 18 +const WRITE_WRITING = 0b00100000000 << 18 +const WRITE_FINISHING = 0b01000000000 << 18 +const WRITE_CORKED = 0b10000000000 << 18 + +const WRITE_NOT_ACTIVE = MAX ^ (WRITE_ACTIVE | WRITE_WRITING) +const WRITE_NON_PRIMARY = MAX ^ WRITE_PRIMARY +const WRITE_NOT_FINISHING = MAX ^ (WRITE_ACTIVE | WRITE_FINISHING) +const WRITE_DRAINED = MAX ^ WRITE_UNDRAINED +const WRITE_NOT_QUEUED = MAX ^ WRITE_QUEUED +const WRITE_NOT_NEXT_TICK = MAX ^ WRITE_NEXT_TICK +const WRITE_NOT_UPDATING = MAX ^ WRITE_UPDATING +const WRITE_NOT_CORKED = MAX ^ WRITE_CORKED + +// Combined shared state +const ACTIVE = READ_ACTIVE | WRITE_ACTIVE +const NOT_ACTIVE = MAX ^ ACTIVE +const DONE = READ_DONE | WRITE_DONE +const DESTROY_STATUS = DESTROYING | DESTROYED | PREDESTROYING +const OPEN_STATUS = DESTROY_STATUS | OPENING +const AUTO_DESTROY = DESTROY_STATUS | DONE +const NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY +const ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK +const TICKING = ACTIVE_OR_TICKING & NOT_ACTIVE +const IS_OPENING = OPEN_STATUS | TICKING + +// Combined shared state and read state +const READ_PRIMARY_STATUS = OPEN_STATUS | READ_ENDING | READ_DONE +const READ_STATUS = OPEN_STATUS | READ_DONE | READ_QUEUED +const READ_ENDING_STATUS = OPEN_STATUS | READ_ENDING | READ_QUEUED +const READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | READ_EMITTED_READABLE +const SHOULD_NOT_READ = + OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH | READ_READ_AHEAD +const READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE +const READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY +const READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING + +// Combined write state +const WRITE_PRIMARY_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_DONE +const WRITE_QUEUED_AND_UNDRAINED = WRITE_QUEUED | WRITE_UNDRAINED +const WRITE_QUEUED_AND_ACTIVE = WRITE_QUEUED | WRITE_ACTIVE +const WRITE_DRAIN_STATUS = WRITE_QUEUED | WRITE_UNDRAINED | OPEN_STATUS | WRITE_ACTIVE +const WRITE_STATUS = OPEN_STATUS | WRITE_ACTIVE | WRITE_QUEUED | WRITE_CORKED +const WRITE_PRIMARY_AND_ACTIVE = WRITE_PRIMARY | WRITE_ACTIVE +const WRITE_ACTIVE_AND_WRITING = WRITE_ACTIVE | WRITE_WRITING +const WRITE_FINISHING_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_QUEUED_AND_ACTIVE | WRITE_DONE +const WRITE_BACKPRESSURE_STATUS = WRITE_UNDRAINED | DESTROY_STATUS | WRITE_FINISHING | WRITE_DONE +const WRITE_UPDATE_SYNC_STATUS = WRITE_UPDATING | OPEN_STATUS | WRITE_NEXT_TICK | WRITE_PRIMARY +const WRITE_DROP_DATA = WRITE_FINISHING | WRITE_DONE | DESTROY_STATUS + +const asyncIterator = Symbol.asyncIterator || Symbol('asyncIterator') + +class WritableState { + constructor( + stream, + { highWaterMark = 16384, map = null, mapWritable, byteLength, byteLengthWritable } = {} + ) { + this.stream = stream + this.queue = new FIFO() + this.highWaterMark = highWaterMark + this.buffered = 0 + this.error = null + this.pipeline = null + this.drains = null // if we add more seldomly used helpers we might them into a subobject so its a single ptr + this.byteLength = byteLengthWritable || byteLength || defaultByteLength + this.map = mapWritable || map + this.afterWrite = afterWrite.bind(this) + this.afterUpdateNextTick = updateWriteNT.bind(this) + } + + get ending() { + return (this.stream._duplexState & WRITE_FINISHING) !== 0 + } + + get ended() { + return (this.stream._duplexState & WRITE_DONE) !== 0 + } + + push(data) { + if ((this.stream._duplexState & WRITE_DROP_DATA) !== 0) return false + if (this.map !== null) data = this.map(data) + + this.buffered += this.byteLength(data) + this.queue.push(data) + + if (this.buffered < this.highWaterMark) { + this.stream._duplexState |= WRITE_QUEUED + return true + } - default: - error(parser, 'Max buffer length exceeded: ' + buffers[i]) - } - } - maxActual = Math.max(maxActual, len) + this.stream._duplexState |= WRITE_QUEUED_AND_UNDRAINED + return false + } + + shift() { + const data = this.queue.shift() + + this.buffered -= this.byteLength(data) + if (this.buffered === 0) this.stream._duplexState &= WRITE_NOT_QUEUED + + return data + } + + end(data) { + if (typeof data === 'function') { + this.stream.once('finish', data) + } else if (data !== undefined && data !== null) { + this.push(data) } - // schedule the next check for the earliest possible buffer overrun. - var m = sax.MAX_BUFFER_LENGTH - maxActual - parser.bufferCheckPosition = m + parser.position + + this.stream._duplexState = (this.stream._duplexState | WRITE_FINISHING) & WRITE_NON_PRIMARY } - function clearBuffers (parser) { - for (var i = 0, l = buffers.length; i < l; i++) { - parser[buffers[i]] = '' + autoBatch(data, cb) { + const buffer = [] + const stream = this.stream + + buffer.push(data) + while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) { + buffer.push(stream._writableState.shift()) } + + if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null) + stream._writev(buffer, cb) + } + + update() { + const stream = this.stream + + stream._duplexState |= WRITE_UPDATING + + do { + while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) { + const data = this.shift() + stream._duplexState |= WRITE_ACTIVE_AND_WRITING + stream._write(data, this.afterWrite) + } + + if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary() + } while (this.continueUpdate() === true) + + stream._duplexState &= WRITE_NOT_UPDATING } - function flushBuffers (parser) { - closeText(parser) - if (parser.cdata !== '') { - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' + updateNonPrimary() { + const stream = this.stream + + if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) { + stream._duplexState = stream._duplexState | WRITE_ACTIVE + stream._final(afterFinal.bind(this)) + return + } + + if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { + if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { + stream._duplexState |= ACTIVE + stream._destroy(afterDestroy.bind(this)) + } + return } - if (parser.script !== '') { - emitNode(parser, 'onscript', parser.script) - parser.script = '' + + if ((stream._duplexState & IS_OPENING) === OPENING) { + stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING + stream._open(afterOpen.bind(this)) } } - SAXParser.prototype = { - end: function () { end(this) }, - write: write, - resume: function () { this.error = null; return this }, - close: function () { return this.write(null) }, - flush: function () { flushBuffers(this) } + continueUpdate() { + if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false + this.stream._duplexState &= WRITE_NOT_NEXT_TICK + return true } - var Stream - try { - Stream = (__nccwpck_require__(2203).Stream) - } catch (ex) { - Stream = function () {} + updateCallback() { + if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) { + this.update() + } else { + this.updateNextTick() + } } - if (!Stream) Stream = function () {} - var streamWraps = sax.EVENTS.filter(function (ev) { - return ev !== 'error' && ev !== 'end' - }) + updateNextTick() { + if ((this.stream._duplexState & WRITE_NEXT_TICK) !== 0) return + this.stream._duplexState |= WRITE_NEXT_TICK + if ((this.stream._duplexState & WRITE_UPDATING) === 0) qmt(this.afterUpdateNextTick) + } +} + +class ReadableState { + constructor( + stream, + { highWaterMark = 16384, map = null, mapReadable, byteLength, byteLengthReadable } = {} + ) { + this.stream = stream + this.queue = new FIFO() + this.highWaterMark = highWaterMark === 0 ? 1 : highWaterMark + this.buffered = 0 + this.readAhead = highWaterMark > 0 + this.error = null + this.pipeline = null + this.byteLength = byteLengthReadable || byteLength || defaultByteLength + this.map = mapReadable || map + this.pipeTo = null + this.afterRead = afterRead.bind(this) + this.afterUpdateNextTick = updateReadNT.bind(this) + } + + get ending() { + return (this.stream._duplexState & READ_ENDING) !== 0 + } - function createStream (strict, opt) { - return new SAXStream(strict, opt) + get ended() { + return (this.stream._duplexState & READ_DONE) !== 0 } - function SAXStream (strict, opt) { - if (!(this instanceof SAXStream)) { - return new SAXStream(strict, opt) + pipe(pipeTo, cb) { + if (this.pipeTo !== null) throw StreamError.BAD_ARGUMENT('Can only pipe to one destination') + if (typeof cb !== 'function') cb = null + + this.stream._duplexState |= READ_PIPE_DRAINED + this.pipeTo = pipeTo + this.pipeline = new Pipeline(this.stream, pipeTo, cb) + + if (cb) this.stream.on('error', noop) // We already error handle this so supress crashes + + if (isStreamx(pipeTo)) { + pipeTo._writableState.pipeline = this.pipeline + if (cb) pipeTo.on('error', noop) // We already error handle this so supress crashes + pipeTo.on('finish', this.pipeline.finished.bind(this.pipeline)) // TODO: just call finished from pipeTo itself + } else { + const onerror = this.pipeline.done.bind(this.pipeline, pipeTo) + const onclose = this.pipeline.done.bind(this.pipeline, pipeTo, null) // onclose has a weird bool arg + pipeTo.on('error', onerror) + pipeTo.on('close', onclose) + pipeTo.on('finish', this.pipeline.finished.bind(this.pipeline)) } - Stream.apply(this) + pipeTo.on('drain', afterDrain.bind(this)) + this.stream.emit('piping', pipeTo) + pipeTo.emit('pipe', this.stream) + } - this._parser = new SAXParser(strict, opt) - this.writable = true - this.readable = true + push(data) { + const stream = this.stream - var me = this + if (data === null) { + this.highWaterMark = 0 + stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED + return false + } - this._parser.onend = function () { - me.emit('end') + if (this.map !== null) { + data = this.map(data) + if (data === null) { + stream._duplexState &= READ_PUSHED + return this.buffered < this.highWaterMark + } } - this._parser.onerror = function (er) { - me.emit('error', er) + this.buffered += this.byteLength(data) + this.queue.push(data) + + stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED + + return this.buffered < this.highWaterMark + } + + shift() { + const data = this.queue.shift() - // if didn't throw, then means error was handled. - // go ahead and clear error, so we can write again. - me._parser.error = null + this.buffered -= this.byteLength(data) + if (this.buffered === 0) { + this.stream._duplexState &= READ_NOT_QUEUED } - this._decoder = null + return data + } - streamWraps.forEach(function (ev) { - Object.defineProperty(me, 'on' + ev, { - get: function () { - return me._parser['on' + ev] - }, - set: function (h) { - if (!h) { - me.removeAllListeners(ev) - me._parser['on' + ev] = h - return h - } - me.on(ev, h) - }, - enumerable: true, - configurable: false - }) - }) + unshift(data) { + const pending = [this.map !== null ? this.map(data) : data] + while (this.buffered > 0) pending.push(this.shift()) + + for (let i = 0; i < pending.length - 1; i++) { + const data = pending[i] + this.buffered += this.byteLength(data) + this.queue.push(data) + } + + this.push(pending[pending.length - 1]) } - SAXStream.prototype = Object.create(Stream.prototype, { - constructor: { - value: SAXStream + read() { + const stream = this.stream + + if ((stream._duplexState & READ_STATUS) === READ_QUEUED) { + const data = this.shift() + + if (this.pipeTo !== null && this.pipeTo.write(data) === false) { + stream._duplexState &= READ_PIPE_NOT_DRAINED + } + + if ((stream._duplexState & READ_EMIT_DATA) !== 0) { + stream.emit('data', data) + } + + return data } - }) - SAXStream.prototype.write = function (data) { - if (typeof Buffer === 'function' && - typeof Buffer.isBuffer === 'function' && - Buffer.isBuffer(data)) { - if (!this._decoder) { - var SD = (__nccwpck_require__(13193).StringDecoder) - this._decoder = new SD('utf8') + if (this.readAhead === false) { + stream._duplexState |= READ_READ_AHEAD + this.updateNextTick() + } + + return null + } + + drain() { + const stream = this.stream + + while ( + (stream._duplexState & READ_STATUS) === READ_QUEUED && + (stream._duplexState & READ_FLOWING) !== 0 + ) { + const data = this.shift() + + if (this.pipeTo !== null && this.pipeTo.write(data) === false) { + stream._duplexState &= READ_PIPE_NOT_DRAINED + } + + if ((stream._duplexState & READ_EMIT_DATA) !== 0) { + stream.emit('data', data) } - data = this._decoder.write(data) } + } - this._parser.write(data.toString()) - this.emit('data', data) - return true + update() { + const stream = this.stream + + stream._duplexState |= READ_UPDATING + + do { + this.drain() + + while ( + this.buffered < this.highWaterMark && + (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD + ) { + stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH + stream._read(this.afterRead) + this.drain() + } + + if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) { + stream._duplexState |= READ_EMITTED_READABLE + stream.emit('readable') + } + + if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) { + this.updateNonPrimary() + } + } while (this.continueUpdate() === true) + + stream._duplexState &= READ_NOT_UPDATING } - SAXStream.prototype.end = function (chunk) { - if (chunk && chunk.length) { - this.write(chunk) + updateNonPrimary() { + const stream = this.stream + + if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) { + stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING + stream.emit('end') + + if ((stream._duplexState & AUTO_DESTROY) === DONE) { + stream._duplexState |= DESTROYING + } + + if (this.pipeTo !== null) { + this.pipeTo.end() + } + } + + if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { + if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { + stream._duplexState |= ACTIVE + stream._destroy(afterDestroy.bind(this)) + } + return + } + + if ((stream._duplexState & IS_OPENING) === OPENING) { + stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING + stream._open(afterOpen.bind(this)) } - this._parser.end() - return true } - SAXStream.prototype.on = function (ev, handler) { - var me = this - if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { - me._parser['on' + ev] = function () { - var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) - args.splice(0, 0, ev) - me.emit.apply(me, args) - } - } - - return Stream.prototype.on.call(me, ev, handler) - } - - // this really needs to be replaced with character classes. - // XML allows all manner of ridiculous numbers and digits. - var CDATA = '[CDATA[' - var DOCTYPE = 'DOCTYPE' - var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' - var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' - var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } - - // http://www.w3.org/TR/REC-xml/#NT-NameStartChar - // This implementation works on strings, a single character at a time - // as such, it cannot ever support astral-plane characters (10000-EFFFF) - // without a significant breaking change to either this parser, or the - // JavaScript language. Implementation of an emoji-capable xml parser - // is left as an exercise for the reader. - var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - - var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ - - var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ - - function isWhitespace (c) { - return c === ' ' || c === '\n' || c === '\r' || c === '\t' - } - - function isQuote (c) { - return c === '"' || c === '\'' - } - - function isAttribEnd (c) { - return c === '>' || isWhitespace(c) - } - - function isMatch (regex, c) { - return regex.test(c) - } - - function notMatch (regex, c) { - return !isMatch(regex, c) - } - - var S = 0 - sax.STATE = { - BEGIN: S++, // leading byte order mark or whitespace - BEGIN_WHITESPACE: S++, // leading whitespace - TEXT: S++, // general stuff - TEXT_ENTITY: S++, // & and such. - OPEN_WAKA: S++, // < - SGML_DECL: S++, // - SCRIPT: S++, // ]/i, + }, + { + id: 'html-javascript-protocol', + description: 'javascript: URI scheme (with optional whitespace/encoding)', + // Handles javascript:, j\u0061vascript:, and whitespace variants + pattern: /j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i, + }, + { + id: 'html-vbscript-protocol', + description: 'vbscript: URI scheme', + pattern: /vbscript[\t\n\r ]*:/i, + }, + { + id: 'html-data-html', + description: 'data:text/html URI — can execute scripts in browsers', + pattern: /data[\t\n\r ]*:[\t\n\r ]*text\/html/i, + }, + { + id: 'html-data-xhtml', + description: 'data:application/xhtml+xml URI', + pattern: /data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i, + }, + { + id: 'html-data-svg', + description: 'data:image/svg+xml URI — can execute scripts', + pattern: /data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i, + }, + { + id: 'html-inline-event-handler', + description: 'Inline event handler attributes: onclick=, onerror=, onload=, etc.', + // \bon ensures we match a word boundary so "phonetic=" is not caught + pattern: /\bon\w{1,30}\s*=/i, + }, + { + id: 'html-entity-obfuscated-script', + description: 'HTML-entity-encoded ', 'HTML') // true + * isUnsafe('hello world', 'HTML') // false + * isUnsafe('value', ['HTML', 'SQL']) // false + * isUnsafe('value', /my-pattern/i) // false + */ +function isUnsafe(value, context) { + assertString(value); + assertContext(context); + + // Custom RegExp — caller-supplied pattern + if (context instanceof RegExp) { + return context.test(value); + } + + // Single named context + if (typeof context === 'string') { + return matchContext(value, context) !== null; + } + + // Array of named contexts — unsafe if ANY context matches + for (const c of context) { + if (matchContext(value, c) !== null) return true; + } + return false; +} + +/** + * Like `isUnsafe`, but instead of a boolean returns the first `MatchResult` + * describing **why** the value was flagged, or `null` if it is safe. + * + * Useful for logging, error messages, or policy reporting. + * + * @param {string} value + * @param {ContextName|ContextName[]|RegExp} context + * @returns {MatchResult|null} + * + * @example + * whyUnsafe('', 'HTML') + * // { context: 'HTML', id: 'html-script-open', description: '...', pattern: /.../ } + */ +function whyUnsafe(value, context) { + assertString(value); + assertContext(context); + + if (context instanceof RegExp) { + return context.test(value) + ? { context: 'CUSTOM', id: 'custom-regex', description: 'Matched caller-supplied pattern', pattern: context } + : null; + } + + if (typeof context === 'string') { + return matchContext(value, context); + } + + for (const c of context) { + const result = matchContext(value, c); + if (result !== null) return result; + } + return null; +} + +/** + * Returns all matching rules across the given context(s), or an empty array + * if the value is safe. Useful for comprehensive auditing. + * + * @param {string} value + * @param {ContextName|ContextName[]|RegExp} context + * @returns {MatchResult[]} + */ +function allUnsafe(value, context) { + assertString(value); + assertContext(context); + + const results = []; + + if (context instanceof RegExp) { + if (context.test(value)) { + results.push({ context: 'CUSTOM', id: 'custom-regex', description: 'Matched caller-supplied pattern', pattern: context }); } - levelTwoFileOptimize(parts) { - if (!Array.isArray(parts)) { - parts = this.slashSplit(parts); - } - let didSomething = false; - do { - didSomething = false; - //
// -> 
/
-            if (!this.preserveMultipleSlashes) {
-                for (let i = 1; i < parts.length - 1; i++) {
-                    const p = parts[i];
-                    // don't squeeze out UNC patterns
-                    if (i === 1 && p === '' && parts[0] === '')
-                        continue;
-                    if (p === '.' || p === '') {
-                        didSomething = true;
-                        parts.splice(i, 1);
-                        i--;
-                    }
-                }
-                if (parts[0] === '.' &&
-                    parts.length === 2 &&
-                    (parts[1] === '.' || parts[1] === '')) {
-                    didSomething = true;
-                    parts.pop();
-                }
-            }
-            // 
/

/../ ->

/
-            let dd = 0;
-            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                const p = parts[dd - 1];
-                if (p && p !== '.' && p !== '..' && p !== '**') {
-                    didSomething = true;
-                    parts.splice(dd - 1, 2);
-                    dd -= 2;
-                }
-            }
-        } while (didSomething);
-        return parts.length === 0 ? [''] : parts;
+    return results;
+  }
+
+  const contexts = typeof context === 'string' ? [context] : context;
+
+  for (const c of contexts) {
+    const patterns = CONTEXT_REGISTRY[c];
+    for (const rule of patterns) {
+      if (rule.pattern.test(value)) {
+        results.push({ context: c, id: rule.id, description: rule.description, pattern: rule.pattern });
+      }
     }
-    // First phase: single-pattern processing
-    // 
 is 1 or more portions
-    //  is 1 or more portions
-    // 

is any portion other than ., .., '', or ** - // is . or '' - // - // **/.. is *brutal* for filesystem walking performance, because - // it effectively resets the recursive walk each time it occurs, - // and ** cannot be reduced out by a .. pattern part like a regexp - // or most strings (other than .., ., and '') can be. - // - //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - //

// -> 
/
-    // 
/

/../ ->

/
-    // **/**/ -> **/
-    //
-    // **/*/ -> */**/ <== not valid because ** doesn't follow
-    // this WOULD be allowed if ** did follow symlinks, or * didn't
-    firstPhasePreProcess(globParts) {
-        let didSomething = false;
-        do {
-            didSomething = false;
-            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - for (let parts of globParts) { - let gs = -1; - while (-1 !== (gs = parts.indexOf('**', gs + 1))) { - let gss = gs; - while (parts[gss + 1] === '**') { - //

/**/**/ -> 
/**/
-                        gss++;
-                    }
-                    // eg, if gs is 2 and gss is 4, that means we have 3 **
-                    // parts, and can remove 2 of them.
-                    if (gss > gs) {
-                        parts.splice(gs + 1, gss - gs);
-                    }
-                    let next = parts[gs + 1];
-                    const p = parts[gs + 2];
-                    const p2 = parts[gs + 3];
-                    if (next !== '..')
-                        continue;
-                    if (!p ||
-                        p === '.' ||
-                        p === '..' ||
-                        !p2 ||
-                        p2 === '.' ||
-                        p2 === '..') {
-                        continue;
-                    }
-                    didSomething = true;
-                    // edit parts in place, and push the new one
-                    parts.splice(gs, 1);
-                    const other = parts.slice(0);
-                    other[gs] = '**';
-                    globParts.push(other);
-                    gs--;
-                }
-                // 
// -> 
/
-                if (!this.preserveMultipleSlashes) {
-                    for (let i = 1; i < parts.length - 1; i++) {
-                        const p = parts[i];
-                        // don't squeeze out UNC patterns
-                        if (i === 1 && p === '' && parts[0] === '')
-                            continue;
-                        if (p === '.' || p === '') {
-                            didSomething = true;
-                            parts.splice(i, 1);
-                            i--;
-                        }
-                    }
-                    if (parts[0] === '.' &&
-                        parts.length === 2 &&
-                        (parts[1] === '.' || parts[1] === '')) {
-                        didSomething = true;
-                        parts.pop();
-                    }
-                }
-                // 
/

/../ ->

/
-                let dd = 0;
-                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                    const p = parts[dd - 1];
-                    if (p && p !== '.' && p !== '..' && p !== '**') {
-                        didSomething = true;
-                        const needDot = dd === 1 && parts[dd + 1] === '**';
-                        const splin = needDot ? ['.'] : [];
-                        parts.splice(dd - 1, 2, ...splin);
-                        if (parts.length === 0)
-                            parts.push('');
-                        dd -= 2;
-                    }
-                }
-            }
-        } while (didSomething);
-        return globParts;
+  }
+
+  return results;
+}
+
+
+/* harmony default export */ const src = ((/* unused pure expression or super */ null && (isUnsafe)));
+;// CONCATENATED MODULE: ./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
+
+///@ts-check
+
+
+
+
+
+
+
+
+
+
+
+
+// const regx =
+//   '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
+//   .replace(/NAME/g, util.nameRegexp);
+
+//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g");
+//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g");
+
+// Helper functions for attribute and namespace handling
+
+/**
+ * Extract raw attributes (without prefix) from prefixed attribute map
+ * @param {object} prefixedAttrs - Attributes with prefix from buildAttributesMap
+ * @param {object} options - Parser options containing attributeNamePrefix
+ * @returns {object} Raw attributes for matcher
+ */
+function extractRawAttributes(prefixedAttrs, options) {
+  if (!prefixedAttrs) return {};
+
+  // Handle attributesGroupName option
+  const attrs = options.attributesGroupName
+    ? prefixedAttrs[options.attributesGroupName]
+    : prefixedAttrs;
+
+  if (!attrs) return {};
+
+  const rawAttrs = {};
+  for (const key in attrs) {
+    // Remove the attribute prefix to get raw name
+    if (key.startsWith(options.attributeNamePrefix)) {
+      const rawName = key.substring(options.attributeNamePrefix.length);
+      rawAttrs[rawName] = attrs[key];
+    } else {
+      // Attribute without prefix (shouldn't normally happen, but be safe)
+      rawAttrs[key] = attrs[key];
     }
-    // second phase: multi-pattern dedupes
-    // {
/*/,
/

/} ->

/*/
-    // {
/,
/} -> 
/
-    // {
/**/,
/} -> 
/**/
-    //
-    // {
/**/,
/**/

/} ->

/**/
-    // ^-- not valid because ** doens't follow symlinks
-    secondPhasePreProcess(globParts) {
-        for (let i = 0; i < globParts.length - 1; i++) {
-            for (let j = i + 1; j < globParts.length; j++) {
-                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
-                if (matched) {
-                    globParts[i] = [];
-                    globParts[j] = matched;
-                    break;
-                }
-            }
-        }
-        return globParts.filter(gs => gs.length);
+  }
+  return rawAttrs;
+}
+
+/**
+ * Extract namespace from raw tag name
+ * @param {string} rawTagName - Tag name possibly with namespace (e.g., "soap:Envelope")
+ * @returns {string|undefined} Namespace or undefined
+ */
+function extractNamespace(rawTagName) {
+  if (!rawTagName || typeof rawTagName !== 'string') return undefined;
+
+  const colonIndex = rawTagName.indexOf(':');
+  if (colonIndex !== -1 && colonIndex > 0) {
+    const ns = rawTagName.substring(0, colonIndex);
+    // Don't treat xmlns as a namespace
+    if (ns !== 'xmlns') {
+      return ns;
     }
-    partsMatch(a, b, emptyGSMatch = false) {
-        let ai = 0;
-        let bi = 0;
-        let result = [];
-        let which = '';
-        while (ai < a.length && bi < b.length) {
-            if (a[ai] === b[bi]) {
-                result.push(which === 'b' ? b[bi] : a[ai]);
-                ai++;
-                bi++;
-            }
-            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
-                result.push(a[ai]);
-                ai++;
-            }
-            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
-                result.push(b[bi]);
-                bi++;
-            }
-            else if (a[ai] === '*' &&
-                b[bi] &&
-                (this.options.dot || !b[bi].startsWith('.')) &&
-                b[bi] !== '**') {
-                if (which === 'b')
-                    return false;
-                which = 'a';
-                result.push(a[ai]);
-                ai++;
-                bi++;
-            }
-            else if (b[bi] === '*' &&
-                a[ai] &&
-                (this.options.dot || !a[ai].startsWith('.')) &&
-                a[ai] !== '**') {
-                if (which === 'a')
-                    return false;
-                which = 'b';
-                result.push(b[bi]);
-                ai++;
-                bi++;
-            }
-            else {
-                return false;
-            }
-        }
-        // if we fall out of the loop, it means they two are identical
-        // as long as their lengths match
-        return a.length === b.length && result;
+  }
+  return undefined;
+}
+
+class OrderedObjParser {
+  constructor(options, externalEntities) {
+    this.options = options;
+    this.currentNode = null;
+    this.tagsNodeStack = [];
+    this.parseXml = parseXml;
+    this.parseTextData = parseTextData;
+    this.resolveNameSpace = resolveNameSpace;
+    this.buildAttributesMap = buildAttributesMap;
+    this.isItStopNode = isItStopNode;
+    this.replaceEntitiesValue = OrderedObjParser_replaceEntitiesValue;
+    this.readStopNodeData = readStopNodeData;
+    this.saveTextToParentTag = saveTextToParentTag;
+    this.addChild = addChild;
+    this.ignoreAttributesFn = ignoreAttributes_getIgnoreAttributesFn(this.options.ignoreAttributes)
+    this.entityExpansionCount = 0;
+    this.currentExpandedLength = 0;
+    let namedEntities = { ...XML };
+    if (this.options.entityDecoder) {
+      this.entityDecoder = this.options.entityDecoder
+    } else {
+      if (typeof this.options.htmlEntities === "object") namedEntities = this.options.htmlEntities;
+      else if (this.options.htmlEntities === true) namedEntities = { ...COMMON_HTML, ...CURRENCY };
+      this.entityDecoder = new EntityDecoder({
+        namedEntities: { ...namedEntities, ...externalEntities },
+        numericAllowed: this.options.htmlEntities,
+        limit: {
+          maxTotalExpansions: this.options.processEntities.maxTotalExpansions,
+          maxExpandedLength: this.options.processEntities.maxExpandedLength,
+          applyLimitsTo: this.options.processEntities.appliesTo,
+        },
+        // onExternalEntity: (name, value) => isUnsafe(value) ? 'block' : 'allow',
+        onInputEntity: (name, value) =>
+          //TODO: VALID_CONTEXTS.HTML should be set only if this.options.htmlEntities
+          isUnsafe(value, [VALID_CONTEXTS.HTML, VALID_CONTEXTS.XML])
+            ? ENTITY_ACTION.BLOCK : ENTITY_ACTION.ALLOW,
+
+        //postCheck: resolved => resolved
+      });
     }
-    parseNegate() {
-        if (this.nonegate)
-            return;
-        const pattern = this.pattern;
-        let negate = false;
-        let negateOffset = 0;
-        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
-            negate = !negate;
-            negateOffset++;
+
+    // Initialize path matcher for path-expression-matcher
+    this.matcher = new Matcher();
+    this.readonlyMatcher = this.matcher.readOnly();
+
+    // Flag to track if current node is a stop node (optimization)
+    this.isCurrentNodeStopNode = false;
+
+    // Pre-compile stopNodes expressions
+    this.stopNodeExpressionsSet = new ExpressionSet();
+    const stopNodesOpts = this.options.stopNodes;
+    if (stopNodesOpts && stopNodesOpts.length > 0) {
+      for (let i = 0; i < stopNodesOpts.length; i++) {
+        const stopNodeExp = stopNodesOpts[i];
+        if (typeof stopNodeExp === 'string') {
+          // Convert string to Expression object
+          this.stopNodeExpressionsSet.add(new Expression(stopNodeExp));
+        } else if (stopNodeExp instanceof Expression) {
+          // Already an Expression object
+          this.stopNodeExpressionsSet.add(stopNodeExp);
         }
-        if (negateOffset)
-            this.pattern = pattern.slice(negateOffset);
-        this.negate = negate;
+      }
+      this.stopNodeExpressionsSet.seal();
     }
-    // set partial to true to test if, for example,
-    // "/a/b" matches the start of "/*/b/*/d"
-    // Partial means, if you run out of file before you run
-    // out of pattern, then that's fine, as long as all
-    // the parts match.
-    matchOne(file, pattern, partial = false) {
-        let fileStartIndex = 0;
-        let patternStartIndex = 0;
-        // UNC paths like //?/X:/... can match X:/... and vice versa
-        // Drive letters in absolute drive or unc paths are always compared
-        // case-insensitively.
-        if (this.isWindows) {
-            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
-            const fileUNC = !fileDrive &&
-                file[0] === '' &&
-                file[1] === '' &&
-                file[2] === '?' &&
-                /^[a-z]:$/i.test(file[3]);
-            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
-            const patternUNC = !patternDrive &&
-                pattern[0] === '' &&
-                pattern[1] === '' &&
-                pattern[2] === '?' &&
-                typeof pattern[3] === 'string' &&
-                /^[a-z]:$/i.test(pattern[3]);
-            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
-            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
-            if (typeof fdi === 'number' && typeof pdi === 'number') {
-                const [fd, pd] = [
-                    file[fdi],
-                    pattern[pdi],
-                ];
-                if (fd.toLowerCase() === pd.toLowerCase()) {
-                    pattern[pdi] = fd;
-                    patternStartIndex = pdi;
-                    fileStartIndex = fdi;
-                }
-            }
-        }
-        // resolve and reduce . and .. portions in the file as well.
-        // dont' need to do the second phase, because it's only one string[]
-        const { optimizationLevel = 1 } = this.options;
-        if (optimizationLevel >= 2) {
-            file = this.levelTwoFileOptimize(file);
-        }
-        if (pattern.includes(exports.GLOBSTAR)) {
-            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
-        }
-        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+  }
+
+}
+
+
+/**
+ * @param {string} val
+ * @param {string} tagName
+ * @param {string|Matcher} jPath - jPath string or Matcher instance based on options.jPath
+ * @param {boolean} dontTrim
+ * @param {boolean} hasAttributes
+ * @param {boolean} isLeafNode
+ * @param {boolean} escapeEntities
+ */
+function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
+  const options = this.options;
+  if (val !== undefined) {
+    if (options.trimValues && !dontTrim) {
+      val = val.trim();
     }
-    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
-        const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);
-        const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);
-        const [head, body, tail] = partial ? [
-            pattern.slice(patternIndex, firstgs),
-            pattern.slice(firstgs + 1),
-            [],
-        ] : [
-            pattern.slice(patternIndex, firstgs),
-            pattern.slice(firstgs + 1, lastgs),
-            pattern.slice(lastgs + 1),
-        ];
-        if (head.length) {
-            const fileHead = file.slice(fileIndex, fileIndex + head.length);
-            if (!this.#matchOne(fileHead, head, partial, 0, 0))
-                return false;
-            fileIndex += head.length;
-        }
-        let fileTailMatch = 0;
-        if (tail.length) {
-            if (tail.length + fileIndex > file.length)
-                return false;
-            let tailStart = file.length - tail.length;
-            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
-                fileTailMatch = tail.length;
-            }
-            else {
-                if (file[file.length - 1] !== '' ||
-                    fileIndex + tail.length === file.length) {
-                    return false;
-                }
-                tailStart--;
-                if (!this.#matchOne(file, tail, partial, tailStart, 0))
-                    return false;
-                fileTailMatch = tail.length + 1;
-            }
-        }
-        if (!body.length) {
-            let sawSome = !!fileTailMatch;
-            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
-                const f = String(file[i]);
-                sawSome = true;
-                if (f === '.' || f === '..' ||
-                    (!this.options.dot && f.startsWith('.'))) {
-                    return false;
-                }
-            }
-            return partial || sawSome;
-        }
-        const bodySegments = [[[], 0]];
-        let currentBody = bodySegments[0];
-        let nonGsParts = 0;
-        const nonGsPartsSums = [0];
-        for (const b of body) {
-            if (b === exports.GLOBSTAR) {
-                nonGsPartsSums.push(nonGsParts);
-                currentBody = [[], 0];
-                bodySegments.push(currentBody);
-            }
-            else {
-                currentBody[0].push(b);
-                nonGsParts++;
-            }
-        }
-        let i = bodySegments.length - 1;
-        const fileLength = file.length - fileTailMatch;
-        for (const b of bodySegments) {
-            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+    if (val.length > 0) {
+      if (!escapeEntities) val = this.replaceEntitiesValue(val, tagName, jPath);
+
+      // Pass jPath string or matcher based on options.jPath setting
+      const jPathOrMatcher = options.jPath ? jPath.toString() : jPath;
+      const newval = options.tagValueProcessor(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode);
+      if (newval === null || newval === undefined) {
+        //don't parse
+        return val;
+      } else if (typeof newval !== typeof val || newval !== val) {
+        //overwrite
+        return newval;
+      } else if (options.trimValues) {
+        return parseValue(val, options.parseTagValue, options.numberParseOptions);
+      } else {
+        const trimmedVal = val.trim();
+        if (trimmedVal === val) {
+          return parseValue(val, options.parseTagValue, options.numberParseOptions);
+        } else {
+          return val;
         }
-        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+      }
     }
-    #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
-        const bs = bodySegments[bodyIndex];
-        if (!bs) {
-            for (let i = fileIndex; i < file.length; i++) {
-                sawTail = true;
-                const f = file[i];
-                if (f === '.' || f === '..' ||
-                    (!this.options.dot && f.startsWith('.'))) {
-                    return false;
-                }
-            }
-            return sawTail;
-        }
-        const [body, after] = bs;
-        while (fileIndex <= after) {
-            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
-            if (m && globStarDepth < this.maxGlobstarRecursion) {
-                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
-                if (sub !== false)
-                    return sub;
-            }
-            const f = file[fileIndex];
-            if (f === '.' || f === '..' ||
-                (!this.options.dot && f.startsWith('.'))) {
-                return false;
-            }
-            fileIndex++;
-        }
-        return partial || null;
+  }
+}
+
+function resolveNameSpace(tagname) {
+  if (this.options.removeNSPrefix) {
+    const tags = tagname.split(':');
+    const prefix = tagname.charAt(0) === '/' ? '/' : '';
+    if (tags[0] === 'xmlns') {
+      return '';
     }
-    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
-        let fi;
-        let pi;
-        let pl;
-        let fl;
-        for (fi = fileIndex, pi = patternIndex,
-            fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
-            this.debug('matchOne loop');
-            let p = pattern[pi];
-            let f = file[fi];
-            this.debug(pattern, p, f);
-            /* c8 ignore start */
-            if (p === false || p === exports.GLOBSTAR)
-                return false;
-            /* c8 ignore stop */
-            let hit;
-            if (typeof p === 'string') {
-                hit = f === p;
-                this.debug('string match', p, f, hit);
-            }
-            else {
-                hit = p.test(f);
-                this.debug('pattern match', p, f, hit);
-            }
-            if (!hit)
-                return false;
-        }
-        if (fi === fl && pi === pl) {
-            return true;
-        }
-        else if (fi === fl) {
-            return partial;
-        }
-        else if (pi === pl) {
-            return fi === fl - 1 && file[fi] === '';
-            /* c8 ignore start */
-        }
-        else {
-            throw new Error('wtf?');
-        }
-        /* c8 ignore stop */
+    if (tags.length === 2) {
+      tagname = prefix + tags[1];
     }
-    braceExpand() {
-        return (0, exports.braceExpand)(this.pattern, this.options);
+  }
+  return tagname;
+}
+
+//TODO: change regex to capture NS
+//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm");
+const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
+
+function buildAttributesMap(attrStr, jPath, tagName, force = false) {
+  const options = this.options;
+  if (force === true || (options.ignoreAttributes !== true && typeof attrStr === 'string')) {
+    // attrStr = attrStr.replace(/\r?\n/g, ' ');
+    //attrStr = attrStr || attrStr.trim();
+
+    const matches = getAllMatches(attrStr, attrsRegx);
+    const len = matches.length; //don't make it inline
+    const attrs = {};
+
+    // Pre-process values once: trim + entity replacement
+    // Reused in both matcher update and second pass
+    const processedVals = new Array(len);
+    let hasRawAttrs = false;
+    const rawAttrsForMatcher = {};
+
+    for (let i = 0; i < len; i++) {
+      const attrName = this.resolveNameSpace(matches[i][1]);
+      const oldVal = matches[i][4];
+
+      if (attrName.length && oldVal !== undefined) {
+        let val = oldVal;
+        if (options.trimValues) val = val.trim();
+        val = this.replaceEntitiesValue(val, tagName, this.readonlyMatcher);
+        processedVals[i] = val;
+
+        rawAttrsForMatcher[attrName] = val;
+        hasRawAttrs = true;
+      }
     }
-    parse(pattern) {
-        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
-        const options = this.options;
-        // shortcuts
-        if (pattern === '**')
-            return exports.GLOBSTAR;
-        if (pattern === '')
-            return '';
-        // far and away, the most common glob pattern parts are
-        // *, *.*, and *.  Add a fast check method for those.
-        let m;
-        let fastTest = null;
-        if ((m = pattern.match(starRE))) {
-            fastTest = options.dot ? starTestDot : starTest;
+
+    // Update matcher ONCE before second pass, if applicable
+    if (hasRawAttrs && typeof jPath === 'object' && jPath.updateCurrent) {
+      jPath.updateCurrent(rawAttrsForMatcher);
+    }
+
+    // Hoist toString() once — path doesn't change during attribute processing
+    const jPathStr = options.jPath ? jPath.toString() : this.readonlyMatcher;
+
+    // Second pass: apply processors, build final attrs
+    let hasAttrs = false;
+    for (let i = 0; i < len; i++) {
+      const attrName = this.resolveNameSpace(matches[i][1]);
+
+      if (this.ignoreAttributesFn(attrName, jPathStr)) continue;
+
+      let aName = options.attributeNamePrefix + attrName;
+
+      if (attrName.length) {
+        if (options.transformAttributeName) {
+          aName = options.transformAttributeName(aName);
         }
-        else if ((m = pattern.match(starDotExtRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? starDotExtTestNocaseDot
-                    : starDotExtTestNocase
-                : options.dot
-                    ? starDotExtTestDot
-                    : starDotExtTest)(m[1]);
+        aName = sanitizeName(aName, options);
+
+        if (matches[i][4] !== undefined) {
+          // Reuse already-processed value — no double entity replacement
+          const oldVal = processedVals[i];
+
+          const newVal = options.attributeValueProcessor(attrName, oldVal, jPathStr);
+          if (newVal === null || newVal === undefined) {
+            attrs[aName] = oldVal;
+          } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {
+            attrs[aName] = newVal;
+          } else {
+            attrs[aName] = parseValue(oldVal, options.parseAttributeValue, options.numberParseOptions);
+          }
+          hasAttrs = true;
+        } else if (options.allowBooleanAttributes) {
+          attrs[aName] = true;
+          hasAttrs = true;
+        }
+      }
+    }
+
+    if (!hasAttrs) return;
+
+    if (options.attributesGroupName && !options.preserveOrder) {
+      const attrCollection = {};
+      attrCollection[options.attributesGroupName] = attrs;
+      return attrCollection;
+    }
+    return attrs;
+  }
+}
+const parseXml = function (xmlData) {
+  xmlData = xmlData.replace(/\r\n?/g, "\n"); //TODO: remove this line
+  const xmlObj = new XmlNode('!xml');
+  let currentNode = xmlObj;
+  let textData = "";
+
+  // Reset matcher for new document
+  this.matcher.reset();
+  this.entityDecoder.reset();
+
+  // Reset entity expansion counters for this document
+  this.entityExpansionCount = 0;
+  this.currentExpandedLength = 0;
+  const options = this.options;
+  const docTypeReader = new DocTypeReader(options.processEntities);
+  const xmlLen = xmlData.length;
+  for (let i = 0; i < xmlLen; i++) {//for each char in XML data
+    const ch = xmlData[i];
+    if (ch === '<') {
+      // const nextIndex = i+1;
+      // const _2ndChar = xmlData[nextIndex];
+      const c1 = xmlData.charCodeAt(i + 1);
+      if (c1 === 47) {//Closing Tag '/'
+        const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.")
+        let tagName = xmlData.substring(i + 2, closeIndex).trim();
+
+        if (options.removeNSPrefix) {
+          const colonIndex = tagName.indexOf(":");
+          if (colonIndex !== -1) {
+            tagName = tagName.substr(colonIndex + 1);
+          }
         }
-        else if ((m = pattern.match(qmarksRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? qmarksTestNocaseDot
-                    : qmarksTestNocase
-                : options.dot
-                    ? qmarksTestDot
-                    : qmarksTest)(m);
+
+        tagName = transformTagName(options.transformTagName, tagName, "", options).tagName;
+
+        if (currentNode) {
+          textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
         }
-        else if ((m = pattern.match(starDotStarRE))) {
-            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+
+        //check if last tag of nested tag was unpaired tag
+        const lastTagName = this.matcher.getCurrentTag();
+        if (tagName && options.unpairedTagsSet.has(tagName)) {
+          throw new Error(`Unpaired tag can not be used as closing tag: `);
         }
-        else if ((m = pattern.match(dotStarRE))) {
-            fastTest = dotStarTest;
+        if (lastTagName && options.unpairedTagsSet.has(lastTagName)) {
+          // Pop the unpaired tag
+          this.matcher.pop();
+          this.tagsNodeStack.pop();
         }
-        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
-        if (fastTest && typeof re === 'object') {
-            // Avoids overriding in frozen environments
-            Reflect.defineProperty(re, 'test', { value: fastTest });
+        // Pop the closing tag
+        this.matcher.pop();
+        this.isCurrentNodeStopNode = false; // Reset flag when closing tag
+
+        currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
+        textData = "";
+        i = closeIndex;
+      } else if (c1 === 63) { //'?'
+
+        let tagData = readTagExp(xmlData, i, false, "?>");
+        if (!tagData) throw new Error("Pi Tag is not closed.");
+
+        textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
+        const attsMap = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName, true);
+        if (attsMap) {
+          const ver = attsMap[this.options.attributeNamePrefix + "version"];
+          this.entityDecoder.setXmlVersion(Number(ver) || 1.0);
+          docTypeReader.setXmlVersion(Number(ver) || 1.0);
         }
-        return re;
-    }
-    makeRe() {
-        if (this.regexp || this.regexp === false)
-            return this.regexp;
-        // at this point, this.set is a 2d array of partial
-        // pattern strings, or "**".
-        //
-        // It's better to use .match().  This function shouldn't
-        // be used, really, but it's pretty convenient sometimes,
-        // when you just want to work with a regex.
-        const set = this.set;
-        if (!set.length) {
-            this.regexp = false;
-            return this.regexp;
+        if ((options.ignoreDeclaration && tagData.tagName === "?xml") || options.ignorePiTags) {
+          //do nothing
+        } else {
+
+          const childNode = new XmlNode(tagData.tagName);
+          childNode.add(options.textNodeName, "");
+
+          if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent && options.ignoreAttributes !== true) {
+            childNode[":@"] = attsMap
+          }
+          this.addChild(currentNode, childNode, this.readonlyMatcher, i);
         }
-        const options = this.options;
-        const twoStar = options.noglobstar
-            ? star
-            : options.dot
-                ? twoStarDot
-                : twoStarNoDot;
-        const flags = new Set(options.nocase ? ['i'] : []);
-        // regexpify non-globstar patterns
-        // if ** is only item, then we just do one twoStar
-        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
-        // if ** is last, append (\/twoStar|) to previous
-        // if ** is in the middle, append (\/|\/twoStar\/) to previous
-        // then filter out GLOBSTAR symbols
-        let re = set
-            .map(pattern => {
-            const pp = pattern.map(p => {
-                if (p instanceof RegExp) {
-                    for (const f of p.flags.split(''))
-                        flags.add(f);
-                }
-                return typeof p === 'string'
-                    ? regExpEscape(p)
-                    : p === exports.GLOBSTAR
-                        ? exports.GLOBSTAR
-                        : p._src;
-            });
-            pp.forEach((p, i) => {
-                const next = pp[i + 1];
-                const prev = pp[i - 1];
-                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
-                    return;
-                }
-                if (prev === undefined) {
-                    if (next !== undefined && next !== exports.GLOBSTAR) {
-                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
-                    }
-                    else {
-                        pp[i] = twoStar;
-                    }
-                }
-                else if (next === undefined) {
-                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
-                }
-                else if (next !== exports.GLOBSTAR) {
-                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
-                    pp[i + 1] = exports.GLOBSTAR;
-                }
-            });
-            return pp.filter(p => p !== exports.GLOBSTAR).join('/');
-        })
-            .join('|');
-        // need to wrap in parens if we had more than one thing with |,
-        // otherwise only the first will be anchored to ^ and the last to $
-        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
-        // must match entire pattern
-        // ending in a * or ** will make it less strict.
-        re = '^' + open + re + close + '$';
-        // can match anything, as long as it's not this.
-        if (this.negate)
-            re = '^(?!' + re + ').+$';
-        try {
-            this.regexp = new RegExp(re, [...flags].join(''));
-            /* c8 ignore start */
+
+
+        i = tagData.closeIndex + 1;
+      } else if (c1 === 33
+        && xmlData.charCodeAt(i + 2) === 45
+        && xmlData.charCodeAt(i + 3) === 45) { //'!--'
+        const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed.")
+        if (options.commentPropName) {
+          const comment = xmlData.substring(i + 4, endIndex - 2);
+
+          textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
+
+          currentNode.add(options.commentPropName, [{ [options.textNodeName]: comment }]);
         }
-        catch (ex) {
-            // should be impossible
-            this.regexp = false;
+        i = endIndex;
+      } else if (c1 === 33
+        && xmlData.charCodeAt(i + 2) === 68) { //'!D'
+        const result = docTypeReader.readDocType(xmlData, i);
+        this.entityDecoder.addInputEntities(result.entities);
+        i = result.i;
+      } else if (c1 === 33
+        && xmlData.charCodeAt(i + 2) === 91) { // '!['
+        const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
+        const tagExp = xmlData.substring(i + 9, closeIndex);
+
+        textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
+
+        let val = this.parseTextData(tagExp, currentNode.tagname, this.readonlyMatcher, true, false, true, true);
+        if (val == undefined) val = "";
+
+        //cdata should be set even if it is 0 length string
+        if (options.cdataPropName) {
+          currentNode.add(options.cdataPropName, [{ [options.textNodeName]: tagExp }]);
+        } else {
+          currentNode.add(options.textNodeName, val);
         }
-        /* c8 ignore stop */
-        return this.regexp;
-    }
-    slashSplit(p) {
-        // if p starts with // on windows, we preserve that
-        // so that UNC paths aren't broken.  Otherwise, any number of
-        // / characters are coalesced into one, unless
-        // preserveMultipleSlashes is set to true.
-        if (this.preserveMultipleSlashes) {
-            return p.split('/');
+
+        i = closeIndex + 2;
+      } else {//Opening tag
+        let result = readTagExp(xmlData, i, options.removeNSPrefix);
+
+        // Safety check: readTagExp can return undefined
+        if (!result) {
+          // Log context for debugging
+          const context = xmlData.substring(Math.max(0, i - 50), Math.min(xmlLen, i + 50));
+          throw new Error(`readTagExp returned undefined at position ${i}. Context: "${context}"`);
         }
-        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
-            // add an extra '' for the one we lose
-            return ['', ...p.split(/\/+/)];
+
+        let tagName = result.tagName;
+        const rawTagName = result.rawTagName;
+        let tagExp = result.tagExp;
+        let attrExpPresent = result.attrExpPresent;
+        let closeIndex = result.closeIndex;
+
+        ({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));
+
+        if (options.strictReservedNames &&
+          (tagName === options.commentPropName
+            || tagName === options.cdataPropName
+            || tagName === options.textNodeName
+            || tagName === options.attributesGroupName
+          )) {
+          throw new Error(`Invalid tag name: ${tagName}`);
         }
-        else {
-            return p.split(/\/+/);
+
+        //save text as child node
+        if (currentNode && textData) {
+          if (currentNode.tagname !== '!xml') {
+            //when nested tag is found
+            textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher, false);
+          }
         }
-    }
-    match(f, partial = this.partial) {
-        this.debug('match', f, this.pattern);
-        // short-circuit in the case of busted things.
-        // comments, etc.
-        if (this.comment) {
-            return false;
+
+        //check if last tag was unpaired tag
+        const lastTag = currentNode;
+        if (lastTag && options.unpairedTagsSet.has(lastTag.tagname)) {
+          currentNode = this.tagsNodeStack.pop();
+          this.matcher.pop();
         }
-        if (this.empty) {
-            return f === '';
+
+        // Clean up self-closing syntax BEFORE processing attributes
+        // This is where tagExp gets the trailing / removed
+        let isSelfClosing = false;
+        if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
+          isSelfClosing = true;
+          if (tagName[tagName.length - 1] === "/") {
+            tagName = tagName.substr(0, tagName.length - 1);
+            tagExp = tagName;
+          } else {
+            tagExp = tagExp.substr(0, tagExp.length - 1);
+          }
+
+          // Re-check attrExpPresent after cleaning
+          attrExpPresent = (tagName !== tagExp);
         }
-        if (f === '/' && partial) {
-            return true;
+
+        // Now process attributes with CLEAN tagExp (no trailing /)
+        let prefixedAttrs = null;
+        let rawAttrs = {};
+        let namespace = undefined;
+
+        // Extract namespace from rawTagName
+        namespace = extractNamespace(rawTagName);
+
+        // Push tag to matcher FIRST (with empty attrs for now) so callbacks see correct path
+        if (tagName !== xmlObj.tagname) {
+          this.matcher.push(tagName, {}, namespace);
         }
-        const options = this.options;
-        // windows: need to use /, not \
-        if (this.isWindows) {
-            f = f.split('\\').join('/');
+
+        // Now build attributes - callbacks will see correct matcher state
+        if (tagName !== tagExp && attrExpPresent) {
+          // Build attributes (returns prefixed attributes for the tree)
+          // Note: buildAttributesMap now internally updates the matcher with raw attributes
+          prefixedAttrs = this.buildAttributesMap(tagExp, this.matcher, tagName);
+
+          if (prefixedAttrs) {
+            // Extract raw attributes (without prefix) for our use
+            //TODO: seems a performance overhead
+            rawAttrs = extractRawAttributes(prefixedAttrs, options);
+          }
         }
-        // treat the test path as a set of pathparts.
-        const ff = this.slashSplit(f);
-        this.debug(this.pattern, 'split', ff);
-        // just ONE of the pattern sets in this.set needs to match
-        // in order for it to be valid.  If negating, then just one
-        // match means that we have failed.
-        // Either way, return on the first hit.
-        const set = this.set;
-        this.debug(this.pattern, 'set', set);
-        // Find the basename of the path by looking for the last non-empty segment
-        let filename = ff[ff.length - 1];
-        if (!filename) {
-            for (let i = ff.length - 2; !filename && i >= 0; i--) {
-                filename = ff[i];
-            }
+
+        // Now check if this is a stop node (after attributes are set)
+        if (tagName !== xmlObj.tagname) {
+          this.isCurrentNodeStopNode = this.isItStopNode();
         }
-        for (let i = 0; i < set.length; i++) {
-            const pattern = set[i];
-            let file = ff;
-            if (options.matchBase && pattern.length === 1) {
-                file = [filename];
+
+        const startIndex = i;
+        if (this.isCurrentNodeStopNode) {
+          let tagContent = "";
+
+          // For self-closing tags, content is empty
+          if (isSelfClosing) {
+            i = result.closeIndex;
+          }
+          //unpaired tag
+          else if (options.unpairedTagsSet.has(tagName)) {
+            i = result.closeIndex;
+          }
+          //normal tag
+          else {
+            //read until closing tag is found
+            const result = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
+            if (!result) throw new Error(`Unexpected end of ${rawTagName}`);
+            i = result.i;
+            tagContent = result.tagContent;
+          }
+
+          const childNode = new XmlNode(tagName);
+
+          if (prefixedAttrs) {
+            childNode[":@"] = prefixedAttrs;
+          }
+
+          // For stop nodes, store raw content as-is without any processing
+          childNode.add(options.textNodeName, tagContent);
+
+          this.matcher.pop(); // Pop the stop node tag
+          this.isCurrentNodeStopNode = false; // Reset flag
+
+          this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
+        } else {
+          //selfClosing tag
+          if (isSelfClosing) {
+            ({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));
+
+            const childNode = new XmlNode(tagName);
+            if (prefixedAttrs) {
+              childNode[":@"] = prefixedAttrs;
             }
-            const hit = this.matchOne(file, pattern, partial);
-            if (hit) {
-                if (options.flipNegate) {
-                    return true;
-                }
-                return !this.negate;
+            this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
+            this.matcher.pop(); // Pop self-closing tag
+            this.isCurrentNodeStopNode = false; // Reset flag
+          }
+          else if (options.unpairedTagsSet.has(tagName)) {//unpaired tag
+            const childNode = new XmlNode(tagName);
+            if (prefixedAttrs) {
+              childNode[":@"] = prefixedAttrs;
+            }
+            this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
+            this.matcher.pop(); // Pop unpaired tag
+            this.isCurrentNodeStopNode = false; // Reset flag
+            i = result.closeIndex;
+            // Continue to next iteration without changing currentNode
+            continue;
+          }
+          //opening tag
+          else {
+            const childNode = new XmlNode(tagName);
+            if (this.tagsNodeStack.length > options.maxNestedTags) {
+              throw new Error("Maximum nested tags exceeded");
             }
+            this.tagsNodeStack.push(currentNode);
+
+            if (prefixedAttrs) {
+              childNode[":@"] = prefixedAttrs;
+            }
+            this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
+            currentNode = childNode;
+          }
+          textData = "";
+          i = closeIndex;
         }
-        // didn't get any hits.  this is success if it's a negative
-        // pattern, failure otherwise.
-        if (options.flipNegate) {
-            return false;
-        }
-        return this.negate;
+      }
+    } else {
+      textData += xmlData[i];
     }
-    static defaults(def) {
-        return exports.minimatch.defaults(def).Minimatch;
+  }
+  return xmlObj.child;
+}
+
+function addChild(currentNode, childNode, matcher, startIndex) {
+  // unset startIndex if not requested
+  if (!this.options.captureMetaData) startIndex = undefined;
+
+  // Pass jPath string or matcher based on options.jPath setting
+  const jPathOrMatcher = this.options.jPath ? matcher.toString() : matcher;
+  const result = this.options.updateTag(childNode.tagname, jPathOrMatcher, childNode[":@"])
+  if (result === false) {
+    //do nothing
+  } else if (typeof result === "string") {
+    childNode.tagname = result
+    currentNode.addChild(childNode, startIndex);
+  } else {
+    currentNode.addChild(childNode, startIndex);
+  }
+}
+
+/**
+ * @param {object} val - Entity object with regex and val properties
+ * @param {string} tagName - Tag name
+ * @param {string|Matcher} jPath - jPath string or Matcher instance based on options.jPath
+ */
+function OrderedObjParser_replaceEntitiesValue(val, tagName, jPath) {
+  const entityConfig = this.options.processEntities;
+
+  if (!entityConfig || !entityConfig.enabled) {
+    return val;
+  }
+
+  // Check if tag is allowed to contain entities
+  if (entityConfig.allowedTags) {
+    const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;
+    const allowed = Array.isArray(entityConfig.allowedTags)
+      ? entityConfig.allowedTags.includes(tagName)
+      : entityConfig.allowedTags(tagName, jPathOrMatcher);
+
+    if (!allowed) {
+      return val;
+    }
+  }
+
+  // Apply custom tag filter if provided
+  if (entityConfig.tagFilter) {
+    const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;
+    if (!entityConfig.tagFilter(tagName, jPathOrMatcher)) {
+      return val; // Skip based on custom filter
     }
+  }
+
+  return this.entityDecoder.decode(val);
 }
-exports.Minimatch = Minimatch;
-/* c8 ignore start */
-var ast_js_2 = __nccwpck_require__(31803);
-Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } }));
-var escape_js_2 = __nccwpck_require__(10800);
-Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } }));
-var unescape_js_2 = __nccwpck_require__(70851);
-Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } }));
-/* c8 ignore stop */
-exports.minimatch.AST = ast_js_1.AST;
-exports.minimatch.Minimatch = Minimatch;
-exports.minimatch.escape = escape_js_1.escape;
-exports.minimatch.unescape = unescape_js_1.unescape;
-//# sourceMappingURL=index.js.map
 
-/***/ }),
 
-/***/ 70851:
-/***/ ((__unused_webpack_module, exports) => {
+function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {
+  if (textData) { //store previously collected data as textNode
+    if (isLeafNode === undefined) isLeafNode = parentNode.child.length === 0
 
-"use strict";
+    textData = this.parseTextData(textData,
+      parentNode.tagname,
+      matcher,
+      false,
+      parentNode[":@"] ? Object.keys(parentNode[":@"]).length !== 0 : false,
+      isLeafNode);
+
+    if (textData !== undefined && textData !== "")
+      parentNode.add(this.options.textNodeName, textData);
+    textData = "";
+  }
+  return textData;
+}
 
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.unescape = void 0;
 /**
- * Un-escape a string that has been escaped with {@link escape}.
- *
- * If the {@link windowsPathsNoEscape} option is used, then square-brace
- * escapes are removed, but not backslash escapes.  For example, it will turn
- * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
- * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
- *
- * When `windowsPathsNoEscape` is not set, then both brace escapes and
- * backslash escapes are removed.
- *
- * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
- * or unescaped.
+ * @param {Array} stopNodeExpressions - Array of compiled Expression objects
+ * @param {Matcher} matcher - Current path matcher
  */
-const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
-    return windowsPathsNoEscape
-        ? s.replace(/\[([^\/\\])\]/g, '$1')
-        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
-};
-exports.unescape = unescape;
-//# sourceMappingURL=unescape.js.map
+function isItStopNode() {
+  if (this.stopNodeExpressionsSet.size === 0) return false;
 
-/***/ }),
+  return this.matcher.matchesAny(this.stopNodeExpressionsSet);
+}
 
-/***/ 78275:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+/**
+ * Returns the tag Expression and where it is ending handling single-double quotes situation
+ * @param {string} xmlData 
+ * @param {number} i starting index
+ * @returns 
+ */
+function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
+  //TODO: ignore boolean attributes in tag expression
+  //TODO: if ignore attributes, dont read full attribute expression but the end. But read for xml declaration
+  let attrBoundary = 0;
+  const len = xmlData.length;
+  const closeCode0 = closingChar.charCodeAt(0);
+  const closeCode1 = closingChar.length > 1 ? closingChar.charCodeAt(1) : -1;
 
-"use strict";
+  let result = '';
+  let segmentStart = i;
+
+  for (let index = i; index < len; index++) {
+    const code = xmlData.charCodeAt(index);
+
+    if (attrBoundary) {
+      if (code === attrBoundary) attrBoundary = 0;
+    } else if (code === 34 || code === 39) { // " or '
+      attrBoundary = code;
+    } else if (code === closeCode0) {
+      if (closeCode1 !== -1) {
+        if (xmlData.charCodeAt(index + 1) === closeCode1) {
+          result += xmlData.substring(segmentStart, index);
+          return { data: result, index };
+        }
+      } else {
+        result += xmlData.substring(segmentStart, index);
+        return { data: result, index };
+      }
+    } else if (code === 9 && !attrBoundary) { // \t - only replace with space outside attribute values
+      // Flush accumulated segment, add space, start new segment
+      result += xmlData.substring(segmentStart, index) + ' ';
+      segmentStart = index + 1;
+    }
+  }
+}
+
+function findClosingIndex(xmlData, str, i, errMsg) {
+  const closingIndex = xmlData.indexOf(str, i);
+  if (closingIndex === -1) {
+    throw new Error(errMsg)
+  } else {
+    return closingIndex + str.length - 1;
+  }
+}
+
+function findClosingChar(xmlData, char, i, errMsg) {
+  const closingIndex = xmlData.indexOf(char, i);
+  if (closingIndex === -1) throw new Error(errMsg);
+  return closingIndex; // no offset needed
+}
+
+function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
+  const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
+  if (!result) return;
+  let tagExp = result.data;
+  const closeIndex = result.index;
+  const separatorIndex = tagExp.search(/\s/);
+  let tagName = tagExp;
+  let attrExpPresent = true;
+  if (separatorIndex !== -1) {//separate tag name and attributes expression
+    tagName = tagExp.substring(0, separatorIndex);
+    tagExp = tagExp.substring(separatorIndex + 1).trimStart();
+  }
+
+  const rawTagName = tagName;
+  if (removeNSPrefix) {
+    const colonIndex = tagName.indexOf(":");
+    if (colonIndex !== -1) {
+      tagName = tagName.substr(colonIndex + 1);
+      attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
+    }
+  }
+
+  return {
+    tagName: tagName,
+    tagExp: tagExp,
+    closeIndex: closeIndex,
+    attrExpPresent: attrExpPresent,
+    rawTagName: rawTagName,
+  }
+}
+/**
+ * find paired tag for a stop node
+ * @param {string} xmlData 
+ * @param {string} tagName 
+ * @param {number} i 
+ */
+function readStopNodeData(xmlData, tagName, i) {
+  const startIndex = i;
+  // Starting at 1 since we already have an open tag
+  let openTagCount = 1;
+
+  const xmllen = xmlData.length;
+  for (; i < xmllen; i++) {
+    if (xmlData[i] === "<") {
+      const c1 = xmlData.charCodeAt(i + 1);
+      if (c1 === 47) {//close tag '/'
+        const closeIndex = findClosingChar(xmlData, ">", i, `${tagName} is not closed`);
+        let closeTagName = xmlData.substring(i + 2, closeIndex).trim();
+        if (closeTagName === tagName) {
+          openTagCount--;
+          if (openTagCount === 0) {
+            return {
+              tagContent: xmlData.substring(startIndex, i),
+              i: closeIndex
+            }
+          }
+        }
+        i = closeIndex;
+      } else if (c1 === 63) { //?
+        const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed.")
+        i = closeIndex;
+      } else if (c1 === 33
+        && xmlData.charCodeAt(i + 2) === 45
+        && xmlData.charCodeAt(i + 3) === 45) { // '!--'
+        const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed.")
+        i = closeIndex;
+      } else if (c1 === 33
+        && xmlData.charCodeAt(i + 2) === 91) { // '!['
+        const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
+        i = closeIndex;
+      } else {
+        const tagData = readTagExp(xmlData, i, false)
+
+        if (tagData) {
+          const openTagName = tagData && tagData.tagName;
+          if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
+            openTagCount++;
+          }
+          i = tagData.closeIndex;
+        }
+      }
+    }
+  }//end for loop
+}
+
+function parseValue(val, shouldParse, options) {
+  if (shouldParse && typeof val === 'string') {
+    //console.log(options)
+    const newval = val.trim();
+    if (newval === 'true') return true;
+    else if (newval === 'false') return false;
+    else return toNumber(val, options);
+  } else {
+    if (isExist(val)) {
+      return val;
+    } else {
+      return '';
+    }
+  }
+}
+
+function fromCodePoint(str, base, prefix) {
+  const codePoint = Number.parseInt(str, base);
+
+  if (codePoint >= 0 && codePoint <= 0x10FFFF) {
+    return String.fromCodePoint(codePoint);
+  } else {
+    return prefix + str + ";";
+  }
+}
+
+function transformTagName(fn, tagName, tagExp, options) {
+  if (fn) {
+    const newTagName = fn(tagName);
+    if (tagExp === tagName) {
+      tagExp = newTagName
+    }
+    tagName = newTagName;
+  }
+  tagName = sanitizeName(tagName, options);
+  return { tagName, tagExp };
+}
+
+
+
+function sanitizeName(name, options) {
+  if (criticalProperties.includes(name)) {
+    throw new Error(`[SECURITY] Invalid name: "${name}" is a reserved JavaScript keyword that could cause prototype pollution`);
+  } else if (DANGEROUS_PROPERTY_NAMES.includes(name)) {
+    return options.onDangerousProperty(name);
+  }
+  return name;
+}
+;// CONCATENATED MODULE: ./node_modules/fast-xml-parser/src/xmlparser/node2json.js
+
+
+
+
+
+const node2json_METADATA_SYMBOL = XmlNode.getMetaDataSymbol();
 
-var __importDefault = (this && this.__importDefault) || function (mod) {
-    return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.Minipass = exports.isWritable = exports.isReadable = exports.isStream = void 0;
-const proc = typeof process === 'object' && process
-    ? process
-    : {
-        stdout: null,
-        stderr: null,
-    };
-const node_events_1 = __nccwpck_require__(78474);
-const node_stream_1 = __importDefault(__nccwpck_require__(57075));
-const node_string_decoder_1 = __nccwpck_require__(46193);
 /**
- * Return true if the argument is a Minipass stream, Node stream, or something
- * else that Minipass can interact with.
+ * Helper function to strip attribute prefix from attribute map
+ * @param {object} attrs - Attributes with prefix (e.g., {"@_class": "code"})
+ * @param {string} prefix - Attribute prefix to remove (e.g., "@_")
+ * @returns {object} Attributes without prefix (e.g., {"class": "code"})
  */
-const isStream = (s) => !!s &&
-    typeof s === 'object' &&
-    (s instanceof Minipass ||
-        s instanceof node_stream_1.default ||
-        (0, exports.isReadable)(s) ||
-        (0, exports.isWritable)(s))
+function stripAttributePrefix(attrs, prefix) {
+  if (!attrs || typeof attrs !== 'object') return {};
+  if (!prefix) return attrs;
+
+  const rawAttrs = {};
+  for (const key in attrs) {
+    if (key.startsWith(prefix)) {
+      const rawName = key.substring(prefix.length);
+      rawAttrs[rawName] = attrs[key];
+    } else {
+      // Attribute without prefix (shouldn't normally happen, but be safe)
+      rawAttrs[key] = attrs[key];
+    }
+  }
+  return rawAttrs;
+}
+
 /**
- * Return true if the argument is a valid {@link Minipass.Readable}
+ * 
+ * @param {array} node 
+ * @param {any} options 
+ * @param {Matcher} matcher - Path matcher instance
+ * @returns 
  */
-;
-exports.isStream = isStream;
+function prettify(node, options, matcher, readonlyMatcher) {
+  return compress(node, options, matcher, readonlyMatcher);
+}
+
 /**
- * Return true if the argument is a valid {@link Minipass.Readable}
+ * @param {array} arr 
+ * @param {object} options 
+ * @param {Matcher} matcher - Path matcher instance
+ * @returns object
  */
-const isReadable = (s) => !!s &&
-    typeof s === 'object' &&
-    s instanceof node_events_1.EventEmitter &&
-    typeof s.pipe === 'function' &&
-    // node core Writable streams have a pipe() method, but it throws
-    s.pipe !== node_stream_1.default.Writable.prototype.pipe
+function compress(arr, options, matcher, readonlyMatcher) {
+  let text;
+  const compressedObj = {}; //This is intended to be a plain object
+  for (let i = 0; i < arr.length; i++) {
+    const tagObj = arr[i];
+    const property = node2json_propName(tagObj);
+
+    // Push current property to matcher WITH RAW ATTRIBUTES (no prefix)
+    if (property !== undefined && property !== options.textNodeName) {
+      const rawAttrs = stripAttributePrefix(
+        tagObj[":@"] || {},
+        options.attributeNamePrefix
+      );
+      matcher.push(property, rawAttrs);
+    }
+
+    if (property === options.textNodeName) {
+      if (text === undefined) text = tagObj[property];
+      else text += "" + tagObj[property];
+    } else if (property === undefined) {
+      continue;
+    } else if (tagObj[property]) {
+
+      let val = compress(tagObj[property], options, matcher, readonlyMatcher);
+      const isLeaf = isLeafTag(val, options);
+
+      if (Object.keys(val).length === 0 && options.alwaysCreateTextNode) {
+        val[options.textNodeName] = "";
+      }
+
+      if (tagObj[":@"]) {
+        assignAttributes(val, tagObj[":@"], readonlyMatcher, options);
+      } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode) {
+        val = val[options.textNodeName];
+      } else if (Object.keys(val).length === 0) {
+        if (options.alwaysCreateTextNode) val[options.textNodeName] = "";
+        else val = "";
+      }
+
+      if (tagObj[node2json_METADATA_SYMBOL] !== undefined && typeof val === "object" && val !== null) {
+        val[node2json_METADATA_SYMBOL] = tagObj[node2json_METADATA_SYMBOL]; // copy over metadata
+      }
+
+
+      if (compressedObj[property] !== undefined && Object.prototype.hasOwnProperty.call(compressedObj, property)) {
+        if (!Array.isArray(compressedObj[property])) {
+          compressedObj[property] = [compressedObj[property]];
+        }
+        compressedObj[property].push(val);
+      } else {
+        //TODO: if a node is not an array, then check if it should be an array
+        //also determine if it is a leaf node
+
+        // Pass jPath string or readonlyMatcher based on options.jPath setting
+        const jPathOrMatcher = options.jPath ? readonlyMatcher.toString() : readonlyMatcher;
+        if (options.isArray(property, jPathOrMatcher, isLeaf)) {
+          compressedObj[property] = [val];
+        } else {
+          compressedObj[property] = val;
+        }
+      }
+
+      // Pop property from matcher after processing
+      if (property !== undefined && property !== options.textNodeName) {
+        matcher.pop();
+      }
+    }
+
+  }
+  // if(text && text.length > 0) compressedObj[options.textNodeName] = text;
+  if (typeof text === "string") {
+    if (text.length > 0) compressedObj[options.textNodeName] = text;
+  } else if (text !== undefined) compressedObj[options.textNodeName] = text;
+
+
+  return compressedObj;
+}
+
+function node2json_propName(obj) {
+  const keys = Object.keys(obj);
+  for (let i = 0; i < keys.length; i++) {
+    const key = keys[i];
+    if (key !== ":@") return key;
+  }
+}
+
+function assignAttributes(obj, attrMap, readonlyMatcher, options) {
+  if (attrMap) {
+    const keys = Object.keys(attrMap);
+    const len = keys.length; //don't make it inline
+    for (let i = 0; i < len; i++) {
+      const atrrName = keys[i];  // This is the PREFIXED name (e.g., "@_class")
+
+      // Strip prefix for matcher path (for isArray callback)
+      const rawAttrName = atrrName.startsWith(options.attributeNamePrefix)
+        ? atrrName.substring(options.attributeNamePrefix.length)
+        : atrrName;
+
+      // For attributes, we need to create a temporary path
+      // Pass jPath string or matcher based on options.jPath setting
+      const jPathOrMatcher = options.jPath
+        ? readonlyMatcher.toString() + "." + rawAttrName
+        : readonlyMatcher;
+
+      if (options.isArray(atrrName, jPathOrMatcher, true, true)) {
+        obj[atrrName] = [attrMap[atrrName]];
+      } else {
+        obj[atrrName] = attrMap[atrrName];
+      }
+    }
+  }
+}
+
+function isLeafTag(obj, options) {
+  const { textNodeName } = options;
+  const propCount = Object.keys(obj).length;
+
+  if (propCount === 0) {
+    return true;
+  }
+
+  if (
+    propCount === 1 &&
+    (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)
+  ) {
+    return true;
+  }
+
+  return false;
+}
+;// CONCATENATED MODULE: ./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
+
+
+
+
+
+
+class XMLParser {
+
+    constructor(options) {
+        this.externalEntities = {};
+        this.options = buildOptions(options);
+
+    }
+    /**
+     * Parse XML dats to JS object 
+     * @param {string|Uint8Array} xmlData 
+     * @param {boolean|Object} validationOption 
+     */
+    parse(xmlData, validationOption) {
+        if (typeof xmlData !== "string" && xmlData.toString) {
+            xmlData = xmlData.toString();
+        } else if (typeof xmlData !== "string") {
+            throw new Error("XML data is accepted in String or Bytes[] form.")
+        }
+
+        if (validationOption) {
+            if (validationOption === true) validationOption = {}; //validate with default options
+
+            const result = validator_validate(xmlData, validationOption);
+            if (result !== true) {
+                throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`)
+            }
+        }
+        const orderedObjParser = new OrderedObjParser(this.options, this.externalEntities);
+        // orderedObjParser.entityDecoder.setExternalEntities(this.externalEntities);
+        const orderedResult = orderedObjParser.parseXml(xmlData);
+        if (this.options.preserveOrder || orderedResult === undefined) return orderedResult;
+        else return prettify(orderedResult, this.options, orderedObjParser.matcher, orderedObjParser.readonlyMatcher);
+    }
+
+    /**
+     * Add Entity which is not by default supported by this library
+     * @param {string} key 
+     * @param {string} value 
+     */
+    addEntity(key, value) {
+        if (value.indexOf("&") !== -1) {
+            throw new Error("Entity value can't have '&'")
+        } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) {
+            throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'")
+        } else if (value === "&") {
+            throw new Error("An entity with value '&' is not permitted");
+        } else {
+            this.externalEntities[key] = value;
+        }
+    }
+
+    /**
+     * Returns a Symbol that can be used to access the metadata
+     * property on a node.
+     * 
+     * If Symbol is not available in the environment, an ordinary property is used
+     * and the name of the property is here returned.
+     * 
+     * The XMLMetaData property is only present when `captureMetaData`
+     * is true in the options.
+     */
+    static getMetaDataSymbol() {
+        return XmlNode.getMetaDataSymbol();
+    }
+}
+;// CONCATENATED MODULE: ./node_modules/@azure/core-xml/dist/esm/xml.common.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 /**
- * Return true if the argument is a valid {@link Minipass.Writable}
+ * Default key used to access the XML attributes.
  */
-;
-exports.isReadable = isReadable;
+const xml_common_XML_ATTRKEY = "$";
 /**
- * Return true if the argument is a valid {@link Minipass.Writable}
+ * Default key used to access the XML value content.
  */
-const isWritable = (s) => !!s &&
-    typeof s === 'object' &&
-    s instanceof node_events_1.EventEmitter &&
-    typeof s.write === 'function' &&
-    typeof s.end === 'function';
-exports.isWritable = isWritable;
-const EOF = Symbol('EOF');
-const MAYBE_EMIT_END = Symbol('maybeEmitEnd');
-const EMITTED_END = Symbol('emittedEnd');
-const EMITTING_END = Symbol('emittingEnd');
-const EMITTED_ERROR = Symbol('emittedError');
-const CLOSED = Symbol('closed');
-const READ = Symbol('read');
-const FLUSH = Symbol('flush');
-const FLUSHCHUNK = Symbol('flushChunk');
-const ENCODING = Symbol('encoding');
-const DECODER = Symbol('decoder');
-const FLOWING = Symbol('flowing');
-const PAUSED = Symbol('paused');
-const RESUME = Symbol('resume');
-const BUFFER = Symbol('buffer');
-const PIPES = Symbol('pipes');
-const BUFFERLENGTH = Symbol('bufferLength');
-const BUFFERPUSH = Symbol('bufferPush');
-const BUFFERSHIFT = Symbol('bufferShift');
-const OBJECTMODE = Symbol('objectMode');
-// internal event when stream is destroyed
-const DESTROYED = Symbol('destroyed');
-// internal event when stream has an error
-const ERROR = Symbol('error');
-const EMITDATA = Symbol('emitData');
-const EMITEND = Symbol('emitEnd');
-const EMITEND2 = Symbol('emitEnd2');
-const ASYNC = Symbol('async');
-const ABORT = Symbol('abort');
-const ABORTED = Symbol('aborted');
-const SIGNAL = Symbol('signal');
-const DATALISTENERS = Symbol('dataListeners');
-const DISCARDED = Symbol('discarded');
-const defer = (fn) => Promise.resolve().then(fn);
-const nodefer = (fn) => fn();
-const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';
-const isArrayBufferLike = (b) => b instanceof ArrayBuffer ||
-    (!!b &&
-        typeof b === 'object' &&
-        b.constructor &&
-        b.constructor.name === 'ArrayBuffer' &&
-        b.byteLength >= 0);
-const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
+const xml_common_XML_CHARKEY = "_";
+//# sourceMappingURL=xml.common.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/core-xml/dist/esm/xml.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+function getCommonOptions(options) {
+    return {
+        attributesGroupName: xml_common_XML_ATTRKEY,
+        textNodeName: options.xmlCharKey ?? xml_common_XML_CHARKEY,
+        ignoreAttributes: false,
+        suppressBooleanAttributes: false,
+    };
+}
+function getSerializerOptions(options = {}) {
+    return {
+        ...getCommonOptions(options),
+        attributeNamePrefix: "@_",
+        format: true,
+        suppressEmptyNode: true,
+        indentBy: "",
+        rootNodeName: options.rootName ?? "root",
+        cdataPropName: options.cdataPropName ?? "__cdata",
+    };
+}
+function getParserOptions(options = {}) {
+    return {
+        ...getCommonOptions(options),
+        parseAttributeValue: false,
+        parseTagValue: false,
+        attributeNamePrefix: "",
+        stopNodes: options.stopNodes,
+        processEntities: true,
+        trimValues: false,
+    };
+}
 /**
- * Internal class representing a pipe to a destination stream.
- *
- * @internal
+ * Converts given JSON object to XML string
+ * @param obj - JSON object to be converted into XML string
+ * @param opts - Options that govern the XML building of given JSON object
+ * `rootName` indicates the name of the root element in the resulting XML
  */
-class Pipe {
-    src;
-    dest;
-    opts;
-    ondrain;
-    constructor(src, dest, opts) {
-        this.src = src;
-        this.dest = dest;
-        this.opts = opts;
-        this.ondrain = () => src[RESUME]();
-        this.dest.on('drain', this.ondrain);
-    }
-    unpipe() {
-        this.dest.removeListener('drain', this.ondrain);
-    }
-    // only here for the prototype
-    /* c8 ignore start */
-    proxyErrors(_er) { }
-    /* c8 ignore stop */
-    end() {
-        this.unpipe();
-        if (this.opts.end)
-            this.dest.end();
-    }
+function stringifyXML(obj, opts = {}) {
+    const parserOptions = getSerializerOptions(opts);
+    const j2x = new json2xml(parserOptions);
+    const node = { [parserOptions.rootNodeName]: obj };
+    const xmlData = j2x.build(node);
+    return `${xmlData}`.replace(/\n/g, "");
 }
 /**
- * Internal class representing a pipe to a destination stream where
- * errors are proxied.
- *
- * @internal
+ * Converts given XML string into JSON
+ * @param str - String containing the XML content to be parsed into JSON
+ * @param opts - Options that govern the parsing of given xml string
+ * `includeRoot` indicates whether the root element is to be included or not in the output
  */
-class PipeProxyErrors extends Pipe {
-    unpipe() {
-        this.src.removeListener('error', this.proxyErrors);
-        super.unpipe();
+async function parseXML(str, opts = {}) {
+    if (!str) {
+        throw new Error("Document is empty");
     }
-    constructor(src, dest, opts) {
-        super(src, dest, opts);
-        this.proxyErrors = (er) => this.dest.emit('error', er);
-        src.on('error', this.proxyErrors);
+    const validation = XMLValidator.validate(str);
+    if (validation !== true) {
+        throw validation;
     }
+    const parser = new XMLParser(getParserOptions(opts));
+    const parsedXml = parser.parse(str);
+    // Remove the  node.
+    // This is a change in behavior on fxp v4. Issue #424
+    if (parsedXml["?xml"]) {
+        delete parsedXml["?xml"];
+    }
+    if (!opts.includeRoot) {
+        for (const key of Object.keys(parsedXml)) {
+            const value = parsedXml[key];
+            return typeof value === "object" ? { ...value } : value;
+        }
+    }
+    return parsedXml;
 }
-const isObjectModeOptions = (o) => !!o.objectMode;
-const isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer';
+//# sourceMappingURL=xml.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/log.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
 /**
- * Main export, the Minipass class
- *
- * `RType` is the type of data emitted, defaults to Buffer
- *
- * `WType` is the type of data to be written, if RType is buffer or string,
- * then any {@link Minipass.ContiguousData} is allowed.
- *
- * `Events` is the set of event handler signatures that this object
- * will emit, see {@link Minipass.Events}
+ * The `@azure/logger` configuration for this package.
  */
-class Minipass extends node_events_1.EventEmitter {
-    [FLOWING] = false;
-    [PAUSED] = false;
-    [PIPES] = [];
-    [BUFFER] = [];
-    [OBJECTMODE];
-    [ENCODING];
-    [ASYNC];
-    [DECODER];
-    [EOF] = false;
-    [EMITTED_END] = false;
-    [EMITTING_END] = false;
-    [CLOSED] = false;
-    [EMITTED_ERROR] = null;
-    [BUFFERLENGTH] = 0;
-    [DESTROYED] = false;
-    [SIGNAL];
-    [ABORTED] = false;
-    [DATALISTENERS] = 0;
-    [DISCARDED] = false;
+const storage_blob_dist_esm_log_logger = esm_createClientLogger("storage-blob");
+//# sourceMappingURL=log.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/BuffersStream.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * This class generates a readable stream from the data in an array of buffers.
+ */
+class BuffersStream extends external_node_stream_.Readable {
+    buffers;
+    byteLength;
     /**
-     * true if the stream can be written
+     * The offset of data to be read in the current buffer.
      */
-    writable = true;
+    byteOffsetInCurrentBuffer;
     /**
-     * true if the stream can be read
+     * The index of buffer to be read in the array of buffers.
      */
-    readable = true;
+    bufferIndex;
     /**
-     * If `RType` is Buffer, then options do not need to be provided.
-     * Otherwise, an options object must be provided to specify either
-     * {@link Minipass.SharedOptions.objectMode} or
-     * {@link Minipass.SharedOptions.encoding}, as appropriate.
+     * The total length of data already read.
      */
-    constructor(...args) {
-        const options = (args[0] ||
-            {});
-        super();
-        if (options.objectMode && typeof options.encoding === 'string') {
-            throw new TypeError('Encoding and objectMode may not be used together');
-        }
-        if (isObjectModeOptions(options)) {
-            this[OBJECTMODE] = true;
-            this[ENCODING] = null;
-        }
-        else if (isEncodingOptions(options)) {
-            this[ENCODING] = options.encoding;
-            this[OBJECTMODE] = false;
-        }
-        else {
-            this[OBJECTMODE] = false;
-            this[ENCODING] = null;
+    pushedBytesLength;
+    /**
+     * Creates an instance of BuffersStream that will emit the data
+     * contained in the array of buffers.
+     *
+     * @param buffers - Array of buffers containing the data
+     * @param byteLength - The total length of data contained in the buffers
+     */
+    constructor(buffers, byteLength, options) {
+        super(options);
+        this.buffers = buffers;
+        this.byteLength = byteLength;
+        this.byteOffsetInCurrentBuffer = 0;
+        this.bufferIndex = 0;
+        this.pushedBytesLength = 0;
+        // check byteLength is no larger than buffers[] total length
+        let buffersLength = 0;
+        for (const buf of this.buffers) {
+            buffersLength += buf.byteLength;
         }
-        this[ASYNC] = !!options.async;
-        this[DECODER] = this[ENCODING]
-            ? new node_string_decoder_1.StringDecoder(this[ENCODING])
-            : null;
-        //@ts-ignore - private option for debugging and testing
-        if (options && options.debugExposeBuffer === true) {
-            Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] });
+        if (buffersLength < this.byteLength) {
+            throw new Error("Data size shouldn't be larger than the total length of buffers.");
         }
-        //@ts-ignore - private option for debugging and testing
-        if (options && options.debugExposePipes === true) {
-            Object.defineProperty(this, 'pipes', { get: () => this[PIPES] });
+    }
+    /**
+     * Internal _read() that will be called when the stream wants to pull more data in.
+     *
+     * @param size - Optional. The size of data to be read
+     */
+    _read(size) {
+        if (this.pushedBytesLength >= this.byteLength) {
+            this.push(null);
         }
-        const { signal } = options;
-        if (signal) {
-            this[SIGNAL] = signal;
-            if (signal.aborted) {
-                this[ABORT]();
+        if (!size) {
+            size = this.readableHighWaterMark;
+        }
+        const outBuffers = [];
+        let i = 0;
+        while (i < size && this.pushedBytesLength < this.byteLength) {
+            // The last buffer may be longer than the data it contains.
+            const remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength;
+            const remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer;
+            const remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers);
+            if (remaining > size - i) {
+                // chunkSize = size - i
+                const end = this.byteOffsetInCurrentBuffer + size - i;
+                outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));
+                this.pushedBytesLength += size - i;
+                this.byteOffsetInCurrentBuffer = end;
+                i = size;
+                break;
             }
             else {
-                signal.addEventListener('abort', () => this[ABORT]());
+                // chunkSize = remaining
+                const end = this.byteOffsetInCurrentBuffer + remaining;
+                outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));
+                if (remaining === remainingCapacityInThisBuffer) {
+                    // this.buffers[this.bufferIndex] used up, shift to next one
+                    this.byteOffsetInCurrentBuffer = 0;
+                    this.bufferIndex++;
+                }
+                else {
+                    this.byteOffsetInCurrentBuffer = end;
+                }
+                this.pushedBytesLength += remaining;
+                i += remaining;
             }
         }
+        if (outBuffers.length > 1) {
+            this.push(Buffer.concat(outBuffers));
+        }
+        else if (outBuffers.length === 1) {
+            this.push(outBuffers[0]);
+        }
     }
+}
+//# sourceMappingURL=BuffersStream.js.map
+// EXTERNAL MODULE: external "node:buffer"
+var external_node_buffer_ = __nccwpck_require__(4573);
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/PooledBuffer.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+/**
+ * maxBufferLength is max size of each buffer in the pooled buffers.
+ */
+const maxBufferLength = external_node_buffer_.constants.MAX_LENGTH;
+/**
+ * This class provides a buffer container which conceptually has no hard size limit.
+ * It accepts a capacity, an array of input buffers and the total length of input data.
+ * It will allocate an internal "buffer" of the capacity and fill the data in the input buffers
+ * into the internal "buffer" serially with respect to the total length.
+ * Then by calling PooledBuffer.getReadableStream(), you can get a readable stream
+ * assembled from all the data in the internal "buffer".
+ */
+class PooledBuffer {
     /**
-     * The amount of data stored in the buffer waiting to be read.
-     *
-     * For Buffer strings, this will be the total byte length.
-     * For string encoding streams, this will be the string character length,
-     * according to JavaScript's `string.length` logic.
-     * For objectMode streams, this is a count of the items waiting to be
-     * emitted.
+     * Internal buffers used to keep the data.
+     * Each buffer has a length of the maxBufferLength except last one.
      */
-    get bufferLength() {
-        return this[BUFFERLENGTH];
-    }
+    buffers = [];
     /**
-     * The `BufferEncoding` currently in use, or `null`
+     * The total size of internal buffers.
      */
-    get encoding() {
-        return this[ENCODING];
-    }
+    capacity;
     /**
-     * @deprecated - This is a read only property
+     * The total size of data contained in internal buffers.
      */
-    set encoding(_enc) {
-        throw new Error('Encoding must be set at instantiation time');
-    }
+    _size;
     /**
-     * @deprecated - Encoding may only be set at instantiation time
+     * The size of the data contained in the pooled buffers.
      */
-    setEncoding(_enc) {
-        throw new Error('Encoding must be set at instantiation time');
+    get size() {
+        return this._size;
+    }
+    constructor(capacity, buffers, totalLength) {
+        this.capacity = capacity;
+        this._size = 0;
+        // allocate
+        const bufferNum = Math.ceil(capacity / maxBufferLength);
+        for (let i = 0; i < bufferNum; i++) {
+            let len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength;
+            if (len === 0) {
+                len = maxBufferLength;
+            }
+            this.buffers.push(Buffer.allocUnsafe(len));
+        }
+        if (buffers) {
+            this.fill(buffers, totalLength);
+        }
     }
     /**
-     * True if this is an objectMode stream
+     * Fill the internal buffers with data in the input buffers serially
+     * with respect to the total length and the total capacity of the internal buffers.
+     * Data copied will be shift out of the input buffers.
+     *
+     * @param buffers - Input buffers containing the data to be filled in the pooled buffer
+     * @param totalLength - Total length of the data to be filled in.
+     *
      */
-    get objectMode() {
-        return this[OBJECTMODE];
+    fill(buffers, totalLength) {
+        this._size = Math.min(this.capacity, totalLength);
+        let i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0;
+        while (totalCopiedNum < this._size) {
+            const source = buffers[i];
+            const target = this.buffers[j];
+            const copiedNum = source.copy(target, targetOffset, sourceOffset);
+            totalCopiedNum += copiedNum;
+            sourceOffset += copiedNum;
+            targetOffset += copiedNum;
+            if (sourceOffset === source.length) {
+                i++;
+                sourceOffset = 0;
+            }
+            if (targetOffset === target.length) {
+                j++;
+                targetOffset = 0;
+            }
+        }
+        // clear copied from source buffers
+        buffers.splice(0, i);
+        if (buffers.length > 0) {
+            buffers[0] = buffers[0].slice(sourceOffset);
+        }
     }
     /**
-     * @deprecated - This is a read-only property
+     * Get the readable stream assembled from all the data in the internal buffers.
+     *
      */
-    set objectMode(_om) {
-        throw new Error('objectMode must be set at instantiation time');
+    getReadableStream() {
+        return new BuffersStream(this.buffers, this.size);
     }
+}
+//# sourceMappingURL=PooledBuffer.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/BufferScheduler.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+/**
+ * This class accepts a Node.js Readable stream as input, and keeps reading data
+ * from the stream into the internal buffer structure, until it reaches maxBuffers.
+ * Every available buffer will try to trigger outgoingHandler.
+ *
+ * The internal buffer structure includes an incoming buffer array, and a outgoing
+ * buffer array. The incoming buffer array includes the "empty" buffers can be filled
+ * with new incoming data. The outgoing array includes the filled buffers to be
+ * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize.
+ *
+ * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING
+ *
+ * NUM_OF_ALL_BUFFERS lesser than or equal to maxBuffers
+ *
+ * PERFORMANCE IMPROVEMENT TIPS:
+ * 1. Input stream highWaterMark is better to set a same value with bufferSize
+ *    parameter, which will avoid Buffer.concat() operations.
+ * 2. concurrency should set a smaller value than maxBuffers, which is helpful to
+ *    reduce the possibility when a outgoing handler waits for the stream data.
+ *    in this situation, outgoing handlers are blocked.
+ *    Outgoing queue shouldn't be empty.
+ */
+class BufferScheduler {
     /**
-     * true if this is an async stream
+     * Size of buffers in incoming and outgoing queues. This class will try to align
+     * data read from Readable stream into buffer chunks with bufferSize defined.
      */
-    get ['async']() {
-        return this[ASYNC];
-    }
+    bufferSize;
     /**
-     * Set to true to make this stream async.
-     *
-     * Once set, it cannot be unset, as this would potentially cause incorrect
-     * behavior.  Ie, a sync stream can be made async, but an async stream
-     * cannot be safely made sync.
+     * How many buffers can be created or maintained.
      */
-    set ['async'](a) {
-        this[ASYNC] = this[ASYNC] || !!a;
-    }
-    // drop everything and get out of the flow completely
-    [ABORT]() {
-        this[ABORTED] = true;
-        this.emit('abort', this[SIGNAL]?.reason);
-        this.destroy(this[SIGNAL]?.reason);
-    }
+    maxBuffers;
     /**
-     * True if the stream has been aborted.
+     * A Node.js Readable stream.
      */
-    get aborted() {
-        return this[ABORTED];
-    }
+    readable;
     /**
-     * No-op setter. Stream aborted status is set via the AbortSignal provided
-     * in the constructor options.
+     * OutgoingHandler is an async function triggered by BufferScheduler when there
+     * are available buffers in outgoing array.
      */
-    set aborted(_) { }
-    write(chunk, encoding, cb) {
-        if (this[ABORTED])
-            return false;
-        if (this[EOF])
-            throw new Error('write after end');
-        if (this[DESTROYED]) {
-            this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' }));
-            return true;
-        }
-        if (typeof encoding === 'function') {
-            cb = encoding;
-            encoding = 'utf8';
-        }
-        if (!encoding)
-            encoding = 'utf8';
-        const fn = this[ASYNC] ? defer : nodefer;
-        // convert array buffers and typed array views into buffers
-        // at some point in the future, we may want to do the opposite!
-        // leave strings and buffers as-is
-        // anything is only allowed if in object mode, so throw
-        if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
-            if (isArrayBufferView(chunk)) {
-                //@ts-ignore - sinful unsafe type changing
-                chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
-            }
-            else if (isArrayBufferLike(chunk)) {
-                //@ts-ignore - sinful unsafe type changing
-                chunk = Buffer.from(chunk);
-            }
-            else if (typeof chunk !== 'string') {
-                throw new Error('Non-contiguous data written to non-objectMode stream');
-            }
-        }
-        // handle object mode up front, since it's simpler
-        // this yields better performance, fewer checks later.
-        if (this[OBJECTMODE]) {
-            // maybe impossible?
-            /* c8 ignore start */
-            if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
-                this[FLUSH](true);
-            /* c8 ignore stop */
-            if (this[FLOWING])
-                this.emit('data', chunk);
-            else
-                this[BUFFERPUSH](chunk);
-            if (this[BUFFERLENGTH] !== 0)
-                this.emit('readable');
-            if (cb)
-                fn(cb);
-            return this[FLOWING];
-        }
-        // at this point the chunk is a buffer or string
-        // don't buffer it up or send it to the decoder
-        if (!chunk.length) {
-            if (this[BUFFERLENGTH] !== 0)
-                this.emit('readable');
-            if (cb)
-                fn(cb);
-            return this[FLOWING];
+    outgoingHandler;
+    /**
+     * An internal event emitter.
+     */
+    emitter = new external_events_.EventEmitter();
+    /**
+     * Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers)
+     */
+    concurrency;
+    /**
+     * An internal offset marker to track data offset in bytes of next outgoingHandler.
+     */
+    offset = 0;
+    /**
+     * An internal marker to track whether stream is end.
+     */
+    isStreamEnd = false;
+    /**
+     * An internal marker to track whether stream or outgoingHandler returns error.
+     */
+    isError = false;
+    /**
+     * How many handlers are executing.
+     */
+    executingOutgoingHandlers = 0;
+    /**
+     * Encoding of the input Readable stream which has string data type instead of Buffer.
+     */
+    encoding;
+    /**
+     * How many buffers have been allocated.
+     */
+    numBuffers = 0;
+    /**
+     * Because this class doesn't know how much data every time stream pops, which
+     * is defined by highWaterMarker of the stream. So BufferScheduler will cache
+     * data received from the stream, when data in unresolvedDataArray exceeds the
+     * blockSize defined, it will try to concat a blockSize of buffer, fill into available
+     * buffers from incoming and push to outgoing array.
+     */
+    unresolvedDataArray = [];
+    /**
+     * How much data consisted in unresolvedDataArray.
+     */
+    unresolvedLength = 0;
+    /**
+     * The array includes all the available buffers can be used to fill data from stream.
+     */
+    incoming = [];
+    /**
+     * The array (queue) includes all the buffers filled from stream data.
+     */
+    outgoing = [];
+    /**
+     * Creates an instance of BufferScheduler.
+     *
+     * @param readable - A Node.js Readable stream
+     * @param bufferSize - Buffer size of every maintained buffer
+     * @param maxBuffers - How many buffers can be allocated
+     * @param outgoingHandler - An async function scheduled to be
+     *                                          triggered when a buffer fully filled
+     *                                          with stream data
+     * @param concurrency - Concurrency of executing outgoingHandlers (>0)
+     * @param encoding - [Optional] Encoding of Readable stream when it's a string stream
+     */
+    constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) {
+        if (bufferSize <= 0) {
+            throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);
         }
-        // fast-path writing strings of same encoding to a stream with
-        // an empty buffer, skipping the buffer/decoder dance
-        if (typeof chunk === 'string' &&
-            // unless it is a string already ready for us to use
-            !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) {
-            //@ts-ignore - sinful unsafe type change
-            chunk = Buffer.from(chunk, encoding);
+        if (maxBuffers <= 0) {
+            throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);
         }
-        if (Buffer.isBuffer(chunk) && this[ENCODING]) {
-            //@ts-ignore - sinful unsafe type change
-            chunk = this[DECODER].write(chunk);
+        if (concurrency <= 0) {
+            throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);
         }
-        // Note: flushing CAN potentially switch us into not-flowing mode
-        if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
-            this[FLUSH](true);
-        if (this[FLOWING])
-            this.emit('data', chunk);
-        else
-            this[BUFFERPUSH](chunk);
-        if (this[BUFFERLENGTH] !== 0)
-            this.emit('readable');
-        if (cb)
-            fn(cb);
-        return this[FLOWING];
+        this.bufferSize = bufferSize;
+        this.maxBuffers = maxBuffers;
+        this.readable = readable;
+        this.outgoingHandler = outgoingHandler;
+        this.concurrency = concurrency;
+        this.encoding = encoding;
     }
     /**
-     * Low-level explicit read method.
+     * Start the scheduler, will return error when stream of any of the outgoingHandlers
+     * returns error.
      *
-     * In objectMode, the argument is ignored, and one item is returned if
-     * available.
+     */
+    async do() {
+        return new Promise((resolve, reject) => {
+            this.readable.on("data", (data) => {
+                data = typeof data === "string" ? Buffer.from(data, this.encoding) : data;
+                this.appendUnresolvedData(data);
+                if (!this.resolveData()) {
+                    this.readable.pause();
+                }
+            });
+            this.readable.on("error", (err) => {
+                this.emitter.emit("error", err);
+            });
+            this.readable.on("end", () => {
+                this.isStreamEnd = true;
+                this.emitter.emit("checkEnd");
+            });
+            this.emitter.on("error", (err) => {
+                this.isError = true;
+                this.readable.pause();
+                reject(err);
+            });
+            this.emitter.on("checkEnd", () => {
+                if (this.outgoing.length > 0) {
+                    this.triggerOutgoingHandlers();
+                    return;
+                }
+                if (this.isStreamEnd && this.executingOutgoingHandlers === 0) {
+                    if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) {
+                        const buffer = this.shiftBufferFromUnresolvedDataArray();
+                        this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset)
+                            .then(resolve)
+                            .catch(reject);
+                    }
+                    else if (this.unresolvedLength >= this.bufferSize) {
+                        return;
+                    }
+                    else {
+                        resolve();
+                    }
+                }
+            });
+        });
+    }
+    /**
+     * Insert a new data into unresolved array.
      *
-     * `n` is the number of bytes (or in the case of encoding streams,
-     * characters) to consume. If `n` is not provided, then the entire buffer
-     * is returned, or `null` is returned if no data is available.
+     * @param data -
+     */
+    appendUnresolvedData(data) {
+        this.unresolvedDataArray.push(data);
+        this.unresolvedLength += data.length;
+    }
+    /**
+     * Try to shift a buffer with size in blockSize. The buffer returned may be less
+     * than blockSize when data in unresolvedDataArray is less than bufferSize.
      *
-     * If `n` is greater that the amount of data in the internal buffer,
-     * then `null` is returned.
      */
-    read(n) {
-        if (this[DESTROYED])
-            return null;
-        this[DISCARDED] = false;
-        if (this[BUFFERLENGTH] === 0 ||
-            n === 0 ||
-            (n && n > this[BUFFERLENGTH])) {
-            this[MAYBE_EMIT_END]();
-            return null;
-        }
-        if (this[OBJECTMODE])
-            n = null;
-        if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
-            // not object mode, so if we have an encoding, then RType is string
-            // otherwise, must be Buffer
-            this[BUFFER] = [
-                (this[ENCODING]
-                    ? this[BUFFER].join('')
-                    : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])),
-            ];
+    shiftBufferFromUnresolvedDataArray(buffer) {
+        if (!buffer) {
+            buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength);
         }
-        const ret = this[READ](n || null, this[BUFFER][0]);
-        this[MAYBE_EMIT_END]();
-        return ret;
-    }
-    [READ](n, chunk) {
-        if (this[OBJECTMODE])
-            this[BUFFERSHIFT]();
         else {
-            const c = chunk;
-            if (n === c.length || n === null)
-                this[BUFFERSHIFT]();
-            else if (typeof c === 'string') {
-                this[BUFFER][0] = c.slice(n);
-                chunk = c.slice(0, n);
-                this[BUFFERLENGTH] -= n;
-            }
-            else {
-                this[BUFFER][0] = c.subarray(n);
-                chunk = c.subarray(0, n);
-                this[BUFFERLENGTH] -= n;
-            }
-        }
-        this.emit('data', chunk);
-        if (!this[BUFFER].length && !this[EOF])
-            this.emit('drain');
-        return chunk;
-    }
-    end(chunk, encoding, cb) {
-        if (typeof chunk === 'function') {
-            cb = chunk;
-            chunk = undefined;
-        }
-        if (typeof encoding === 'function') {
-            cb = encoding;
-            encoding = 'utf8';
-        }
-        if (chunk !== undefined)
-            this.write(chunk, encoding);
-        if (cb)
-            this.once('end', cb);
-        this[EOF] = true;
-        this.writable = false;
-        // if we haven't written anything, then go ahead and emit,
-        // even if we're not reading.
-        // we'll re-emit if a new 'end' listener is added anyway.
-        // This makes MP more suitable to write-only use cases.
-        if (this[FLOWING] || !this[PAUSED])
-            this[MAYBE_EMIT_END]();
-        return this;
-    }
-    // don't let the internal resume be overwritten
-    [RESUME]() {
-        if (this[DESTROYED])
-            return;
-        if (!this[DATALISTENERS] && !this[PIPES].length) {
-            this[DISCARDED] = true;
+            buffer.fill(this.unresolvedDataArray, this.unresolvedLength);
         }
-        this[PAUSED] = false;
-        this[FLOWING] = true;
-        this.emit('resume');
-        if (this[BUFFER].length)
-            this[FLUSH]();
-        else if (this[EOF])
-            this[MAYBE_EMIT_END]();
-        else
-            this.emit('drain');
+        this.unresolvedLength -= buffer.size;
+        return buffer;
     }
     /**
-     * Resume the stream if it is currently in a paused state
+     * Resolve data in unresolvedDataArray. For every buffer with size in blockSize
+     * shifted, it will try to get (or allocate a buffer) from incoming, and fill it,
+     * then push it into outgoing to be handled by outgoing handler.
      *
-     * If called when there are no pipe destinations or `data` event listeners,
-     * this will place the stream in a "discarded" state, where all data will
-     * be thrown away. The discarded state is removed if a pipe destination or
-     * data handler is added, if pause() is called, or if any synchronous or
-     * asynchronous iteration is started.
+     * Return false when available buffers in incoming are not enough, else true.
+     *
+     * @returns Return false when buffers in incoming are not enough, else true.
      */
-    resume() {
-        return this[RESUME]();
+    resolveData() {
+        while (this.unresolvedLength >= this.bufferSize) {
+            let buffer;
+            if (this.incoming.length > 0) {
+                buffer = this.incoming.shift();
+                this.shiftBufferFromUnresolvedDataArray(buffer);
+            }
+            else {
+                if (this.numBuffers < this.maxBuffers) {
+                    buffer = this.shiftBufferFromUnresolvedDataArray();
+                    this.numBuffers++;
+                }
+                else {
+                    // No available buffer, wait for buffer returned
+                    return false;
+                }
+            }
+            this.outgoing.push(buffer);
+            this.triggerOutgoingHandlers();
+        }
+        return true;
     }
     /**
-     * Pause the stream
+     * Try to trigger a outgoing handler for every buffer in outgoing. Stop when
+     * concurrency reaches.
      */
-    pause() {
-        this[FLOWING] = false;
-        this[PAUSED] = true;
-        this[DISCARDED] = false;
+    async triggerOutgoingHandlers() {
+        let buffer;
+        do {
+            if (this.executingOutgoingHandlers >= this.concurrency) {
+                return;
+            }
+            buffer = this.outgoing.shift();
+            if (buffer) {
+                this.triggerOutgoingHandler(buffer);
+            }
+        } while (buffer);
     }
     /**
-     * true if the stream has been forcibly destroyed
+     * Trigger a outgoing handler for a buffer shifted from outgoing.
+     *
+     * @param buffer -
      */
-    get destroyed() {
-        return this[DESTROYED];
+    async triggerOutgoingHandler(buffer) {
+        const bufferLength = buffer.size;
+        this.executingOutgoingHandlers++;
+        this.offset += bufferLength;
+        try {
+            await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);
+        }
+        catch (err) {
+            this.emitter.emit("error", err);
+            return;
+        }
+        this.executingOutgoingHandlers--;
+        this.reuseBuffer(buffer);
+        this.emitter.emit("checkEnd");
     }
     /**
-     * true if the stream is currently in a flowing state, meaning that
-     * any writes will be immediately emitted.
+     * Return buffer used by outgoing handler into incoming.
+     *
+     * @param buffer -
      */
-    get flowing() {
-        return this[FLOWING];
+    reuseBuffer(buffer) {
+        this.incoming.push(buffer);
+        if (!this.isError && this.resolveData() && !this.isStreamEnd) {
+            this.readable.resume();
+        }
     }
-    /**
-     * true if the stream is currently in a paused state
-     */
-    get paused() {
-        return this[PAUSED];
+}
+//# sourceMappingURL=BufferScheduler.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/esm/AbortError.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+/**
+ * This error is thrown when an asynchronous operation has been aborted.
+ * Check for this error by testing the `name` that the name property of the
+ * error matches `"AbortError"`.
+ *
+ * @example
+ * ```ts
+ * const controller = new AbortController();
+ * controller.abort();
+ * try {
+ *   doAsyncWork(controller.signal)
+ * } catch (e) {
+ *   if (e.name === 'AbortError') {
+ *     // handle abort error here.
+ *   }
+ * }
+ * ```
+ */
+class esm_AbortError_AbortError extends Error {
+    constructor(message) {
+        super(message);
+        this.name = "AbortError";
     }
-    [BUFFERPUSH](chunk) {
-        if (this[OBJECTMODE])
-            this[BUFFERLENGTH] += 1;
-        else
-            this[BUFFERLENGTH] += chunk.length;
-        this[BUFFER].push(chunk);
+}
+//# sourceMappingURL=AbortError.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/node_modules/@azure/abort-controller/dist/esm/index.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: external "node:module"
+const external_node_module_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module");
+// EXTERNAL MODULE: external "node:path"
+var external_node_path_ = __nccwpck_require__(76760);
+// EXTERNAL MODULE: external "node:url"
+var external_node_url_ = __nccwpck_require__(73136);
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/crc64.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// ESM-COMPAT-START (this block is stripped from dist/commonjs by copyJSFiles.cjs)
+// In ESM under Node, `require`, `__filename`, and `__dirname` are not defined.
+// Synthesize them from `import.meta.url` so the Emscripten Node branch below works as-is.
+// Specifiers are held in variables to prevent web bundlers from statically resolving `node:*`.
+// The detection check below MUST stay byte-for-byte identical to the Emscripten-generated
+// `ENVIRONMENT_IS_NODE` check later in this file; otherwise the polyfill and the Node branch
+// can disagree and the ESM `ReferenceError: require is not defined` bug returns.
+
+
+
+const __isNode__ =
+  typeof process === "object" &&
+  typeof process.versions === "object" &&
+  typeof process.versions.node === "string";
+let crc64_require;
+let crc64_filename;
+let crc64_dirname;
+if (__isNode__) {
+  crc64_require = (0,external_node_module_namespaceObject.createRequire)(import.meta.url);
+  crc64_filename = (0,external_node_url_.fileURLToPath)(import.meta.url);
+  crc64_dirname = (0,external_node_path_.dirname)(crc64_filename);
+}
+// ESM-COMPAT-END
+
+var NativeCRC64 = (() => {
+  var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
+  if (typeof crc64_filename !== 'undefined') _scriptDir = _scriptDir || crc64_filename;
+  return (
+function(NativeCRC64) {
+  NativeCRC64 = NativeCRC64 || {};
+
+
+
+// The Module object: Our interface to the outside world. We import
+// and export values on it. There are various ways Module can be used:
+// 1. Not defined. We create it here
+// 2. A function parameter, function(Module) { ..generated code.. }
+// 3. pre-run appended it, var Module = {}; ..generated code..
+// 4. External script tag defines var Module.
+// We need to check if Module already exists (e.g. case 3 above).
+// Substitution will be replaced with actual code on later stage of the build,
+// this way Closure Compiler will not mangle it (e.g. case 4. above).
+// Note that if you want to run closure, and also to use Module
+// after the generated code, you will need to define   var Module = {};
+// before the code. Then that object will be used in the code, and you
+// can continue to use Module afterwards as well.
+var Module = typeof NativeCRC64 != 'undefined' ? NativeCRC64 : {};
+
+// See https://caniuse.com/mdn-javascript_builtins_object_assign
+
+// See https://caniuse.com/mdn-javascript_builtins_bigint64array
+
+// Set up the promise that indicates the Module is initialized
+var readyPromiseResolve, readyPromiseReject;
+Module['ready'] = new Promise(function(resolve, reject) {
+  readyPromiseResolve = resolve;
+  readyPromiseReject = reject;
+});
+["_malloc","_free","_emscripten_bind_VoidPtr___destroy___0","_emscripten_bind_Crc64Hash_Crc64Hash_0","_emscripten_bind_Crc64Hash_OnAppend_2","_emscripten_bind_Crc64Hash_OnFinal_3","_emscripten_bind_Crc64Hash___destroy___0","_fflush","onRuntimeInitialized"].forEach((prop) => {
+  if (!Object.getOwnPropertyDescriptor(Module['ready'], prop)) {
+    Object.defineProperty(Module['ready'], prop, {
+      get: () => abort('You are getting ' + prop + ' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),
+      set: () => abort('You are setting ' + prop + ' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),
+    });
+  }
+});
+
+// --pre-jses are emitted after the Module integration code, so that they can
+// refer to Module (if they choose; they can also define Module)
+
+
+// Sometimes an existing Module object exists with properties
+// meant to overwrite the default module functionality. Here
+// we collect those properties and reapply _after_ we configure
+// the current environment's defaults to avoid having to be so
+// defensive during initialization.
+var moduleOverrides = Object.assign({}, Module);
+
+var arguments_ = [];
+var thisProgram = './this.program';
+var quit_ = (status, toThrow) => {
+  throw toThrow;
+};
+
+// Determine the runtime environment we are in. You can customize this by
+// setting the ENVIRONMENT setting at compile time (see settings.js).
+
+// Attempt to auto-detect the environment
+var ENVIRONMENT_IS_WEB = typeof window == 'object';
+var ENVIRONMENT_IS_WORKER = typeof importScripts == 'function';
+// N.b. Electron.js environment is simultaneously a NODE-environment, but
+// also a web environment.
+var ENVIRONMENT_IS_NODE = typeof process == 'object' && typeof process.versions == 'object' && typeof process.versions.node == 'string';
+var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
+
+if (Module['ENVIRONMENT']) {
+  throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');
+}
+
+// `/` should be present at the end if `scriptDirectory` is not empty
+var scriptDirectory = '';
+function locateFile(path) {
+  if (Module['locateFile']) {
+    return Module['locateFile'](path, scriptDirectory);
+  }
+  return scriptDirectory + path;
+}
+
+// Hooks that are implemented differently in different runtime environments.
+var read_,
+    readAsync,
+    readBinary,
+    setWindowTitle;
+
+// Normally we don't log exceptions but instead let them bubble out the top
+// level where the embedding environment (e.g. the browser) can handle
+// them.
+// However under v8 and node we sometimes exit the process direcly in which case
+// its up to use us to log the exception before exiting.
+// If we fix https://github.com/emscripten-core/emscripten/issues/15080
+// this may no longer be needed under node.
+function logExceptionOnExit(e) {
+  if (e instanceof ExitStatus) return;
+  let toLog = e;
+  if (e && typeof e == 'object' && e.stack) {
+    toLog = [e, e.stack];
+  }
+  err('exiting due to exception: ' + toLog);
+}
+
+if (ENVIRONMENT_IS_NODE) {
+  if (typeof process == 'undefined' || !process.release || process.release.name !== 'node') throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
+  // `require()` is no-op in an ESM module, use `createRequire()` to construct
+  // the require()` function.  This is only necessary for multi-environment
+  // builds, `-sENVIRONMENT=node` emits a static import declaration instead.
+  // TODO: Swap all `require()`'s with `import()`'s?
+  // These modules will usually be used on Node.js. Load them eagerly to avoid
+  // the complexity of lazy-loading.
+  var fs = crc64_require('fs');
+  var nodePath = crc64_require('path');
+
+  if (ENVIRONMENT_IS_WORKER) {
+    scriptDirectory = nodePath.dirname(scriptDirectory) + '/';
+  } else {
+    scriptDirectory = crc64_dirname + '/';
+  }
+
+// include: node_shell_read.js
+
+
+read_ = (filename, binary) => {
+  // We need to re-wrap `file://` strings to URLs. Normalizing isn't
+  // necessary in that case, the path should already be absolute.
+  filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename);
+  return fs.readFileSync(filename, binary ? undefined : 'utf8');
+};
+
+readBinary = (filename) => {
+  var ret = read_(filename, true);
+  if (!ret.buffer) {
+    ret = new Uint8Array(ret);
+  }
+  assert(ret.buffer);
+  return ret;
+};
+
+readAsync = (filename, onload, onerror) => {
+  // See the comment in the `read_` function.
+  filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename);
+  fs.readFile(filename, function(err, data) {
+    if (err) onerror(err);
+    else onload(data.buffer);
+  });
+};
+
+// end include: node_shell_read.js
+  if (process['argv'].length > 1) {
+    thisProgram = process['argv'][1].replace(/\\/g, '/');
+  }
+
+  arguments_ = process['argv'].slice(2);
+
+  // MODULARIZE will export the module in the proper place outside, we don't need to export here
+
+  process['on']('uncaughtException', function(ex) {
+    // suppress ExitStatus exceptions from showing an error
+    if (!(ex instanceof ExitStatus)) {
+      throw ex;
     }
-    [BUFFERSHIFT]() {
-        if (this[OBJECTMODE])
-            this[BUFFERLENGTH] -= 1;
-        else
-            this[BUFFERLENGTH] -= this[BUFFER][0].length;
-        return this[BUFFER].shift();
+  });
+
+  // Without this older versions of node (< v15) will log unhandled rejections
+  // but return 0, which is not normally the desired behaviour.  This is
+  // not be needed with node v15 and about because it is now the default
+  // behaviour:
+  // See https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
+  process['on']('unhandledRejection', function(reason) { throw reason; });
+
+  quit_ = (status, toThrow) => {
+    if (keepRuntimeAlive()) {
+      process['exitCode'] = status;
+      throw toThrow;
     }
-    [FLUSH](noDrain = false) {
-        do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&
-            this[BUFFER].length);
-        if (!noDrain && !this[BUFFER].length && !this[EOF])
-            this.emit('drain');
+    logExceptionOnExit(toThrow);
+    process['exit'](status);
+  };
+
+  Module['inspect'] = function () { return '[Emscripten Module object]'; };
+
+} else
+if (ENVIRONMENT_IS_SHELL) {
+
+  if ((typeof process == 'object' && typeof crc64_require === 'function') || typeof window == 'object' || typeof importScripts == 'function') throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
+
+  if (typeof read != 'undefined') {
+    read_ = function shell_read(f) {
+      return read(f);
+    };
+  }
+
+  readBinary = function readBinary(f) {
+    let data;
+    if (typeof readbuffer == 'function') {
+      return new Uint8Array(readbuffer(f));
     }
-    [FLUSHCHUNK](chunk) {
-        this.emit('data', chunk);
-        return this[FLOWING];
+    data = read(f, 'binary');
+    assert(typeof data == 'object');
+    return data;
+  };
+
+  readAsync = function readAsync(f, onload, onerror) {
+    setTimeout(() => onload(readBinary(f)), 0);
+  };
+
+  if (typeof scriptArgs != 'undefined') {
+    arguments_ = scriptArgs;
+  } else if (typeof arguments != 'undefined') {
+    arguments_ = arguments;
+  }
+
+  if (typeof quit == 'function') {
+    quit_ = (status, toThrow) => {
+      logExceptionOnExit(toThrow);
+      quit(status);
+    };
+  }
+
+  if (typeof print != 'undefined') {
+    // Prefer to use print/printErr where they exist, as they usually work better.
+    if (typeof console == 'undefined') console = /** @type{!Console} */({});
+    console.log = /** @type{!function(this:Console, ...*): undefined} */ (print);
+    console.warn = console.error = /** @type{!function(this:Console, ...*): undefined} */ (typeof printErr != 'undefined' ? printErr : print);
+  }
+
+} else
+
+// Note that this includes Node.js workers when relevant (pthreads is enabled).
+// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and
+// ENVIRONMENT_IS_NODE.
+if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
+  if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled
+    scriptDirectory = self.location.href;
+  } else if (typeof document != 'undefined' && document.currentScript) { // web
+    scriptDirectory = document.currentScript.src;
+  }
+  // When MODULARIZE, this JS may be executed later, after document.currentScript
+  // is gone, so we saved it, and we use it here instead of any other info.
+  if (_scriptDir) {
+    scriptDirectory = _scriptDir;
+  }
+  // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them.
+  // otherwise, slice off the final part of the url to find the script directory.
+  // if scriptDirectory does not contain a slash, lastIndexOf will return -1,
+  // and scriptDirectory will correctly be replaced with an empty string.
+  // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #),
+  // they are removed because they could contain a slash.
+  if (scriptDirectory.indexOf('blob:') !== 0) {
+    scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf('/')+1);
+  } else {
+    scriptDirectory = '';
+  }
+
+  if (!(typeof window == 'object' || typeof importScripts == 'function')) throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
+
+  // Differentiate the Web Worker from the Node Worker case, as reading must
+  // be done differently.
+  {
+// include: web_or_worker_shell_read.js
+
+
+  read_ = (url) => {
+      var xhr = new XMLHttpRequest();
+      xhr.open('GET', url, false);
+      xhr.send(null);
+      return xhr.responseText;
+  }
+
+  if (ENVIRONMENT_IS_WORKER) {
+    readBinary = (url) => {
+        var xhr = new XMLHttpRequest();
+        xhr.open('GET', url, false);
+        xhr.responseType = 'arraybuffer';
+        xhr.send(null);
+        return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response));
+    };
+  }
+
+  readAsync = (url, onload, onerror) => {
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', url, true);
+    xhr.responseType = 'arraybuffer';
+    xhr.onload = () => {
+      if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
+        onload(xhr.response);
+        return;
+      }
+      onerror();
+    };
+    xhr.onerror = onerror;
+    xhr.send(null);
+  }
+
+// end include: web_or_worker_shell_read.js
+  }
+
+  setWindowTitle = (title) => document.title = title;
+} else
+{
+  throw new Error('environment detection error');
+}
+
+var out = Module['print'] || console.log.bind(console);
+var err = Module['printErr'] || console.warn.bind(console);
+
+// Merge back in the overrides
+Object.assign(Module, moduleOverrides);
+// Free the object hierarchy contained in the overrides, this lets the GC
+// reclaim data used e.g. in memoryInitializerRequest, which is a large typed array.
+moduleOverrides = null;
+checkIncomingModuleAPI();
+
+// Emit code to handle expected values on the Module object. This applies Module.x
+// to the proper local x. This has two benefits: first, we only emit it if it is
+// expected to arrive, and second, by using a local everywhere else that can be
+// minified.
+
+if (Module['arguments']) arguments_ = Module['arguments'];legacyModuleProp('arguments', 'arguments_');
+
+if (Module['thisProgram']) thisProgram = Module['thisProgram'];legacyModuleProp('thisProgram', 'thisProgram');
+
+if (Module['quit']) quit_ = Module['quit'];legacyModuleProp('quit', 'quit_');
+
+// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message
+// Assertions on removed incoming Module JS APIs.
+assert(typeof Module['memoryInitializerPrefixURL'] == 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead');
+assert(typeof Module['pthreadMainPrefixURL'] == 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead');
+assert(typeof Module['cdInitializerPrefixURL'] == 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead');
+assert(typeof Module['filePackagePrefixURL'] == 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead');
+assert(typeof Module['read'] == 'undefined', 'Module.read option was removed (modify read_ in JS)');
+assert(typeof Module['readAsync'] == 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)');
+assert(typeof Module['readBinary'] == 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)');
+assert(typeof Module['setWindowTitle'] == 'undefined', 'Module.setWindowTitle option was removed (modify setWindowTitle in JS)');
+assert(typeof Module['TOTAL_MEMORY'] == 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY');
+legacyModuleProp('read', 'read_');
+legacyModuleProp('readAsync', 'readAsync');
+legacyModuleProp('readBinary', 'readBinary');
+legacyModuleProp('setWindowTitle', 'setWindowTitle');
+var IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js';
+var PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js';
+var WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js';
+var NODEFS = 'NODEFS is no longer included by default; build with -lnodefs.js';
+
+assert(!ENVIRONMENT_IS_SHELL, "shell environment detected but not enabled at build time.  Add 'shell' to `-sENVIRONMENT` to enable.");
+
+
+
+
+var STACK_ALIGN = 16;
+var POINTER_SIZE = 4;
+
+function getNativeTypeSize(type) {
+  switch (type) {
+    case 'i1': case 'i8': case 'u8': return 1;
+    case 'i16': case 'u16': return 2;
+    case 'i32': case 'u32': return 4;
+    case 'i64': case 'u64': return 8;
+    case 'float': return 4;
+    case 'double': return 8;
+    default: {
+      if (type[type.length - 1] === '*') {
+        return POINTER_SIZE;
+      }
+      if (type[0] === 'i') {
+        const bits = Number(type.substr(1));
+        assert(bits % 8 === 0, 'getNativeTypeSize invalid bits ' + bits + ', type ' + type);
+        return bits / 8;
+      }
+      return 0;
     }
-    /**
-     * Pipe all data emitted by this stream into the destination provided.
-     *
-     * Triggers the flow of data.
-     */
-    pipe(dest, opts) {
-        if (this[DESTROYED])
-            return dest;
-        this[DISCARDED] = false;
-        const ended = this[EMITTED_END];
-        opts = opts || {};
-        if (dest === proc.stdout || dest === proc.stderr)
-            opts.end = false;
-        else
-            opts.end = opts.end !== false;
-        opts.proxyErrors = !!opts.proxyErrors;
-        // piping an ended stream ends immediately
-        if (ended) {
-            if (opts.end)
-                dest.end();
+  }
+}
+
+// include: runtime_debug.js
+
+
+function legacyModuleProp(prop, newName) {
+  if (!Object.getOwnPropertyDescriptor(Module, prop)) {
+    Object.defineProperty(Module, prop, {
+      configurable: true,
+      get: function() {
+        abort('Module.' + prop + ' has been replaced with plain ' + newName + ' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)');
+      }
+    });
+  }
+}
+
+function ignoredModuleProp(prop) {
+  if (Object.getOwnPropertyDescriptor(Module, prop)) {
+    abort('`Module.' + prop + '` was supplied but `' + prop + '` not included in INCOMING_MODULE_JS_API');
+  }
+}
+
+// forcing the filesystem exports a few things by default
+function isExportedByForceFilesystem(name) {
+  return name === 'FS_createPath' ||
+         name === 'FS_createDataFile' ||
+         name === 'FS_createPreloadedFile' ||
+         name === 'FS_unlink' ||
+         name === 'addRunDependency' ||
+         // The old FS has some functionality that WasmFS lacks.
+         name === 'FS_createLazyFile' ||
+         name === 'FS_createDevice' ||
+         name === 'removeRunDependency';
+}
+
+function missingLibrarySymbol(sym) {
+  if (typeof globalThis !== 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) {
+    Object.defineProperty(globalThis, sym, {
+      configurable: true,
+      get: function() {
+        // Can't `abort()` here because it would break code that does runtime
+        // checks.  e.g. `if (typeof SDL === 'undefined')`.
+        var msg = '`' + sym + '` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';
+        // DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in
+        // library.js, which means $name for a JS name with no prefix, or name
+        // for a JS name like _name.
+        var librarySymbol = sym;
+        if (!librarySymbol.startsWith('_')) {
+          librarySymbol = '$' + sym;
         }
-        else {
-            // "as" here just ignores the WType, which pipes don't care about,
-            // since they're only consuming from us, and writing to the dest
-            this[PIPES].push(!opts.proxyErrors
-                ? new Pipe(this, dest, opts)
-                : new PipeProxyErrors(this, dest, opts));
-            if (this[ASYNC])
-                defer(() => this[RESUME]());
-            else
-                this[RESUME]();
+        msg += " (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=" + librarySymbol + ")";
+        if (isExportedByForceFilesystem(sym)) {
+          msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
         }
-        return dest;
-    }
-    /**
-     * Fully unhook a piped destination stream.
-     *
-     * If the destination stream was the only consumer of this stream (ie,
-     * there are no other piped destinations or `'data'` event listeners)
-     * then the flow of data will stop until there is another consumer or
-     * {@link Minipass#resume} is explicitly called.
-     */
-    unpipe(dest) {
-        const p = this[PIPES].find(p => p.dest === dest);
-        if (p) {
-            if (this[PIPES].length === 1) {
-                if (this[FLOWING] && this[DATALISTENERS] === 0) {
-                    this[FLOWING] = false;
-                }
-                this[PIPES] = [];
-            }
-            else
-                this[PIPES].splice(this[PIPES].indexOf(p), 1);
-            p.unpipe();
+        warnOnce(msg);
+        return undefined;
+      }
+    });
+  }
+}
+
+function unexportedRuntimeSymbol(sym) {
+  if (!Object.getOwnPropertyDescriptor(Module, sym)) {
+    Object.defineProperty(Module, sym, {
+      configurable: true,
+      get: function() {
+        var msg = "'" + sym + "' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";
+        if (isExportedByForceFilesystem(sym)) {
+          msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
         }
+        abort(msg);
+      }
+    });
+  }
+}
+
+// end include: runtime_debug.js
+
+
+// === Preamble library stuff ===
+
+// Documentation for the public APIs defined in this file must be updated in:
+//    site/source/docs/api_reference/preamble.js.rst
+// A prebuilt local version of the documentation is available at:
+//    site/build/text/docs/api_reference/preamble.js.txt
+// You can also build docs locally as HTML or other formats in site/
+// An online HTML version (which may be of a different version of Emscripten)
+//    is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
+
+var wasmBinary;
+if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];legacyModuleProp('wasmBinary', 'wasmBinary');
+var noExitRuntime = Module['noExitRuntime'] || true;legacyModuleProp('noExitRuntime', 'noExitRuntime');
+
+if (typeof WebAssembly != 'object') {
+  abort('no native wasm support detected');
+}
+
+// Wasm globals
+
+var wasmMemory;
+
+//========================================
+// Runtime essentials
+//========================================
+
+// whether we are quitting the application. no code should run after this.
+// set in exit() and abort()
+var ABORT = false;
+
+// set by exit() and abort().  Passed to 'onExit' handler.
+// NOTE: This is also used as the process return code code in shell environments
+// but only when noExitRuntime is false.
+var EXITSTATUS;
+
+/** @type {function(*, string=)} */
+function assert(condition, text) {
+  if (!condition) {
+    abort('Assertion failed' + (text ? ': ' + text : ''));
+  }
+}
+
+// We used to include malloc/free by default in the past. Show a helpful error in
+// builds with assertions.
+
+// include: runtime_strings.js
+
+
+// runtime_strings.js: String related runtime functions that are part of both
+// MINIMAL_RUNTIME and regular runtime.
+
+var UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined;
+
+/**
+ * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
+ * array that contains uint8 values, returns a copy of that string as a
+ * Javascript String object.
+ * heapOrArray is either a regular array, or a JavaScript typed array view.
+ * @param {number} idx
+ * @param {number=} maxBytesToRead
+ * @return {string}
+ */
+function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) {
+  var endIdx = idx + maxBytesToRead;
+  var endPtr = idx;
+  // TextDecoder needs to know the byte length in advance, it doesn't stop on
+  // null terminator by itself.  Also, use the length info to avoid running tiny
+  // strings through TextDecoder, since .subarray() allocates garbage.
+  // (As a tiny code save trick, compare endPtr against endIdx using a negation,
+  // so that undefined means Infinity)
+  while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
+
+  if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
+    return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
+  }
+  var str = '';
+  // If building with TextDecoder, we have already computed the string length
+  // above, so test loop end condition against that
+  while (idx < endPtr) {
+    // For UTF8 byte structure, see:
+    // http://en.wikipedia.org/wiki/UTF-8#Description
+    // https://www.ietf.org/rfc/rfc2279.txt
+    // https://tools.ietf.org/html/rfc3629
+    var u0 = heapOrArray[idx++];
+    if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }
+    var u1 = heapOrArray[idx++] & 63;
+    if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }
+    var u2 = heapOrArray[idx++] & 63;
+    if ((u0 & 0xF0) == 0xE0) {
+      u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
+    } else {
+      if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte ' + ptrToString(u0) + ' encountered when deserializing a UTF-8 string in wasm memory to a JS string!');
+      u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);
     }
-    /**
-     * Alias for {@link Minipass#on}
-     */
-    addListener(ev, handler) {
-        return this.on(ev, handler);
-    }
-    /**
-     * Mostly identical to `EventEmitter.on`, with the following
-     * behavior differences to prevent data loss and unnecessary hangs:
-     *
-     * - Adding a 'data' event handler will trigger the flow of data
-     *
-     * - Adding a 'readable' event handler when there is data waiting to be read
-     *   will cause 'readable' to be emitted immediately.
-     *
-     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
-     *   already passed will cause the event to be emitted immediately and all
-     *   handlers removed.
-     *
-     * - Adding an 'error' event handler after an error has been emitted will
-     *   cause the event to be re-emitted immediately with the error previously
-     *   raised.
-     */
-    on(ev, handler) {
-        const ret = super.on(ev, handler);
-        if (ev === 'data') {
-            this[DISCARDED] = false;
-            this[DATALISTENERS]++;
-            if (!this[PIPES].length && !this[FLOWING]) {
-                this[RESUME]();
-            }
-        }
-        else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {
-            super.emit('readable');
-        }
-        else if (isEndish(ev) && this[EMITTED_END]) {
-            super.emit(ev);
-            this.removeAllListeners(ev);
-        }
-        else if (ev === 'error' && this[EMITTED_ERROR]) {
-            const h = handler;
-            if (this[ASYNC])
-                defer(() => h.call(this, this[EMITTED_ERROR]));
-            else
-                h.call(this, this[EMITTED_ERROR]);
-        }
-        return ret;
+
+    if (u0 < 0x10000) {
+      str += String.fromCharCode(u0);
+    } else {
+      var ch = u0 - 0x10000;
+      str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
     }
-    /**
-     * Alias for {@link Minipass#off}
-     */
-    removeListener(ev, handler) {
-        return this.off(ev, handler);
+  }
+  return str;
+}
+
+/**
+ * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
+ * emscripten HEAP, returns a copy of that string as a Javascript String object.
+ *
+ * @param {number} ptr
+ * @param {number=} maxBytesToRead - An optional length that specifies the
+ *   maximum number of bytes to read. You can omit this parameter to scan the
+ *   string until the first \0 byte. If maxBytesToRead is passed, and the string
+ *   at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
+ *   string will cut short at that byte index (i.e. maxBytesToRead will not
+ *   produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing
+ *   frequent uses of UTF8ToString() with and without maxBytesToRead may throw
+ *   JS JIT optimizations off, so it is worth to consider consistently using one
+ * @return {string}
+ */
+function UTF8ToString(ptr, maxBytesToRead) {
+  return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '';
+}
+
+/**
+ * Copies the given Javascript String object 'str' to the given byte array at
+ * address 'outIdx', encoded in UTF8 form and null-terminated. The copy will
+ * require at most str.length*4+1 bytes of space in the HEAP.  Use the function
+ * lengthBytesUTF8 to compute the exact number of bytes (excluding null
+ * terminator) that this function will write.
+ *
+ * @param {string} str - The Javascript string to copy.
+ * @param {ArrayBufferView|Array} heap - The array to copy to. Each
+ *                                               index in this array is assumed
+ *                                               to be one 8-byte element.
+ * @param {number} outIdx - The starting offset in the array to begin the copying.
+ * @param {number} maxBytesToWrite - The maximum number of bytes this function
+ *                                   can write to the array.  This count should
+ *                                   include the null terminator, i.e. if
+ *                                   maxBytesToWrite=1, only the null terminator
+ *                                   will be written and nothing else.
+ *                                   maxBytesToWrite=0 does not write any bytes
+ *                                   to the output, not even the null
+ *                                   terminator.
+ * @return {number} The number of bytes written, EXCLUDING the null terminator.
+ */
+function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
+  // Parameter maxBytesToWrite is not optional. Negative values, 0, null,
+  // undefined and false each don't write out any bytes.
+  if (!(maxBytesToWrite > 0))
+    return 0;
+
+  var startIdx = outIdx;
+  var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
+  for (var i = 0; i < str.length; ++i) {
+    // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
+    // unit, not a Unicode code point of the character! So decode
+    // UTF16->UTF32->UTF8.
+    // See http://unicode.org/faq/utf_bom.html#utf16-3
+    // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description
+    // and https://www.ietf.org/rfc/rfc2279.txt
+    // and https://tools.ietf.org/html/rfc3629
+    var u = str.charCodeAt(i); // possibly a lead surrogate
+    if (u >= 0xD800 && u <= 0xDFFF) {
+      var u1 = str.charCodeAt(++i);
+      u = 0x10000 + ((u & 0x3FF) << 10) | (u1 & 0x3FF);
     }
-    /**
-     * Mostly identical to `EventEmitter.off`
-     *
-     * If a 'data' event handler is removed, and it was the last consumer
-     * (ie, there are no pipe destinations or other 'data' event listeners),
-     * then the flow of data will stop until there is another consumer or
-     * {@link Minipass#resume} is explicitly called.
-     */
-    off(ev, handler) {
-        const ret = super.off(ev, handler);
-        // if we previously had listeners, and now we don't, and we don't
-        // have any pipes, then stop the flow, unless it's been explicitly
-        // put in a discarded flowing state via stream.resume().
-        if (ev === 'data') {
-            this[DATALISTENERS] = this.listeners('data').length;
-            if (this[DATALISTENERS] === 0 &&
-                !this[DISCARDED] &&
-                !this[PIPES].length) {
-                this[FLOWING] = false;
-            }
-        }
-        return ret;
+    if (u <= 0x7F) {
+      if (outIdx >= endIdx) break;
+      heap[outIdx++] = u;
+    } else if (u <= 0x7FF) {
+      if (outIdx + 1 >= endIdx) break;
+      heap[outIdx++] = 0xC0 | (u >> 6);
+      heap[outIdx++] = 0x80 | (u & 63);
+    } else if (u <= 0xFFFF) {
+      if (outIdx + 2 >= endIdx) break;
+      heap[outIdx++] = 0xE0 | (u >> 12);
+      heap[outIdx++] = 0x80 | ((u >> 6) & 63);
+      heap[outIdx++] = 0x80 | (u & 63);
+    } else {
+      if (outIdx + 3 >= endIdx) break;
+      if (u > 0x10FFFF) warnOnce('Invalid Unicode code point ' + ptrToString(u) + ' encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).');
+      heap[outIdx++] = 0xF0 | (u >> 18);
+      heap[outIdx++] = 0x80 | ((u >> 12) & 63);
+      heap[outIdx++] = 0x80 | ((u >> 6) & 63);
+      heap[outIdx++] = 0x80 | (u & 63);
     }
-    /**
-     * Mostly identical to `EventEmitter.removeAllListeners`
-     *
-     * If all 'data' event handlers are removed, and they were the last consumer
-     * (ie, there are no pipe destinations), then the flow of data will stop
-     * until there is another consumer or {@link Minipass#resume} is explicitly
-     * called.
-     */
-    removeAllListeners(ev) {
-        const ret = super.removeAllListeners(ev);
-        if (ev === 'data' || ev === undefined) {
-            this[DATALISTENERS] = 0;
-            if (!this[DISCARDED] && !this[PIPES].length) {
-                this[FLOWING] = false;
-            }
-        }
-        return ret;
+  }
+  // Null-terminate the pointer to the buffer.
+  heap[outIdx] = 0;
+  return outIdx - startIdx;
+}
+
+/**
+ * Copies the given Javascript String object 'str' to the emscripten HEAP at
+ * address 'outPtr', null-terminated and encoded in UTF8 form. The copy will
+ * require at most str.length*4+1 bytes of space in the HEAP.
+ * Use the function lengthBytesUTF8 to compute the exact number of bytes
+ * (excluding null terminator) that this function will write.
+ *
+ * @return {number} The number of bytes written, EXCLUDING the null terminator.
+ */
+function stringToUTF8(str, outPtr, maxBytesToWrite) {
+  assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
+  return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite);
+}
+
+/**
+ * Returns the number of bytes the given Javascript string takes if encoded as a
+ * UTF8 byte array, EXCLUDING the null terminator byte.
+ *
+ * @param {string} str - JavaScript string to operator on
+ * @return {number} Length, in bytes, of the UTF8 encoded string.
+ */
+function lengthBytesUTF8(str) {
+  var len = 0;
+  for (var i = 0; i < str.length; ++i) {
+    // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
+    // unit, not a Unicode code point of the character! So decode
+    // UTF16->UTF32->UTF8.
+    // See http://unicode.org/faq/utf_bom.html#utf16-3
+    var c = str.charCodeAt(i); // possibly a lead surrogate
+    if (c <= 0x7F) {
+      len++;
+    } else if (c <= 0x7FF) {
+      len += 2;
+    } else if (c >= 0xD800 && c <= 0xDFFF) {
+      len += 4; ++i;
+    } else {
+      len += 3;
     }
-    /**
-     * true if the 'end' event has been emitted
-     */
-    get emittedEnd() {
-        return this[EMITTED_END];
+  }
+  return len;
+}
+
+// end include: runtime_strings.js
+// Memory management
+
+var HEAP,
+/** @type {!ArrayBuffer} */
+  buffer,
+/** @type {!Int8Array} */
+  HEAP8,
+/** @type {!Uint8Array} */
+  HEAPU8,
+/** @type {!Int16Array} */
+  HEAP16,
+/** @type {!Uint16Array} */
+  HEAPU16,
+/** @type {!Int32Array} */
+  HEAP32,
+/** @type {!Uint32Array} */
+  HEAPU32,
+/** @type {!Float32Array} */
+  HEAPF32,
+/** @type {!Float64Array} */
+  HEAPF64;
+
+function updateGlobalBufferAndViews(buf) {
+  buffer = buf;
+  Module['HEAP8'] = HEAP8 = new Int8Array(buf);
+  Module['HEAP16'] = HEAP16 = new Int16Array(buf);
+  Module['HEAP32'] = HEAP32 = new Int32Array(buf);
+  Module['HEAPU8'] = HEAPU8 = new Uint8Array(buf);
+  Module['HEAPU16'] = HEAPU16 = new Uint16Array(buf);
+  Module['HEAPU32'] = HEAPU32 = new Uint32Array(buf);
+  Module['HEAPF32'] = HEAPF32 = new Float32Array(buf);
+  Module['HEAPF64'] = HEAPF64 = new Float64Array(buf);
+}
+
+var STACK_SIZE = 5242880;
+if (Module['STACK_SIZE']) assert(STACK_SIZE === Module['STACK_SIZE'], 'the stack size can no longer be determined at runtime')
+
+var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 16777216;legacyModuleProp('INITIAL_MEMORY', 'INITIAL_MEMORY');
+
+assert(INITIAL_MEMORY >= STACK_SIZE, 'INITIAL_MEMORY should be larger than STACK_SIZE, was ' + INITIAL_MEMORY + '! (STACK_SIZE=' + STACK_SIZE + ')');
+
+// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
+assert(typeof Int32Array != 'undefined' && typeof Float64Array !== 'undefined' && Int32Array.prototype.subarray != undefined && Int32Array.prototype.set != undefined,
+       'JS engine does not provide full typed array support');
+
+// If memory is defined in wasm, the user can't provide it.
+assert(!Module['wasmMemory'], 'Use of `wasmMemory` detected.  Use -sIMPORTED_MEMORY to define wasmMemory externally');
+assert(INITIAL_MEMORY == 16777216, 'Detected runtime INITIAL_MEMORY setting.  Use -sIMPORTED_MEMORY to define wasmMemory dynamically');
+
+// include: runtime_init_table.js
+// In regular non-RELOCATABLE mode the table is exported
+// from the wasm module and this will be assigned once
+// the exports are available.
+var wasmTable;
+
+// end include: runtime_init_table.js
+// include: runtime_stack_check.js
+
+
+// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
+function writeStackCookie() {
+  var max = _emscripten_stack_get_end();
+  assert((max & 3) == 0);
+  // If the stack ends at address zero we write our cookies 4 bytes into the
+  // stack.  This prevents interference with the (separate) address-zero check
+  // below.
+  if (max == 0) {
+    max += 4;
+  }
+  // The stack grow downwards towards _emscripten_stack_get_end.
+  // We write cookies to the final two words in the stack and detect if they are
+  // ever overwritten.
+  HEAPU32[((max)>>2)] = 0x2135467;
+  HEAPU32[(((max)+(4))>>2)] = 0x89BACDFE;
+  // Also test the global address 0 for integrity.
+  HEAPU32[0] = 0x63736d65; /* 'emsc' */
+}
+
+function checkStackCookie() {
+  if (ABORT) return;
+  var max = _emscripten_stack_get_end();
+  // See writeStackCookie().
+  if (max == 0) {
+    max += 4;
+  }
+  var cookie1 = HEAPU32[((max)>>2)];
+  var cookie2 = HEAPU32[(((max)+(4))>>2)];
+  if (cookie1 != 0x2135467 || cookie2 != 0x89BACDFE) {
+    abort('Stack overflow! Stack cookie has been overwritten at ' + ptrToString(max) + ', expected hex dwords 0x89BACDFE and 0x2135467, but received ' + ptrToString(cookie2) + ' ' + ptrToString(cookie1));
+  }
+  // Also test the global address 0 for integrity.
+  if (HEAPU32[0] !== 0x63736d65 /* 'emsc' */) {
+    abort('Runtime error: The application has corrupted its heap memory area (address zero)!');
+  }
+}
+
+// end include: runtime_stack_check.js
+// include: runtime_assertions.js
+
+
+// Endianness check
+(function() {
+  var h16 = new Int16Array(1);
+  var h8 = new Int8Array(h16.buffer);
+  h16[0] = 0x6373;
+  if (h8[0] !== 0x73 || h8[1] !== 0x63) throw 'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)';
+})();
+
+// end include: runtime_assertions.js
+var __ATPRERUN__  = []; // functions called before the runtime is initialized
+var __ATINIT__    = []; // functions called during startup
+var __ATEXIT__    = []; // functions called during shutdown
+var __ATPOSTRUN__ = []; // functions called after the main() is called
+
+var runtimeInitialized = false;
+
+function keepRuntimeAlive() {
+  return noExitRuntime;
+}
+
+function preRun() {
+
+  if (Module['preRun']) {
+    if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
+    while (Module['preRun'].length) {
+      addOnPreRun(Module['preRun'].shift());
     }
-    [MAYBE_EMIT_END]() {
-        if (!this[EMITTING_END] &&
-            !this[EMITTED_END] &&
-            !this[DESTROYED] &&
-            this[BUFFER].length === 0 &&
-            this[EOF]) {
-            this[EMITTING_END] = true;
-            this.emit('end');
-            this.emit('prefinish');
-            this.emit('finish');
-            if (this[CLOSED])
-                this.emit('close');
-            this[EMITTING_END] = false;
-        }
+  }
+
+  callRuntimeCallbacks(__ATPRERUN__);
+}
+
+function initRuntime() {
+  assert(!runtimeInitialized);
+  runtimeInitialized = true;
+
+  checkStackCookie();
+
+  
+  callRuntimeCallbacks(__ATINIT__);
+}
+
+function postRun() {
+  checkStackCookie();
+
+  if (Module['postRun']) {
+    if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
+    while (Module['postRun'].length) {
+      addOnPostRun(Module['postRun'].shift());
     }
-    /**
-     * Mostly identical to `EventEmitter.emit`, with the following
-     * behavior differences to prevent data loss and unnecessary hangs:
-     *
-     * If the stream has been destroyed, and the event is something other
-     * than 'close' or 'error', then `false` is returned and no handlers
-     * are called.
-     *
-     * If the event is 'end', and has already been emitted, then the event
-     * is ignored. If the stream is in a paused or non-flowing state, then
-     * the event will be deferred until data flow resumes. If the stream is
-     * async, then handlers will be called on the next tick rather than
-     * immediately.
-     *
-     * If the event is 'close', and 'end' has not yet been emitted, then
-     * the event will be deferred until after 'end' is emitted.
-     *
-     * If the event is 'error', and an AbortSignal was provided for the stream,
-     * and there are no listeners, then the event is ignored, matching the
-     * behavior of node core streams in the presense of an AbortSignal.
-     *
-     * If the event is 'finish' or 'prefinish', then all listeners will be
-     * removed after emitting the event, to prevent double-firing.
-     */
-    emit(ev, ...args) {
-        const data = args[0];
-        // error and close are only events allowed after calling destroy()
-        if (ev !== 'error' &&
-            ev !== 'close' &&
-            ev !== DESTROYED &&
-            this[DESTROYED]) {
-            return false;
-        }
-        else if (ev === 'data') {
-            return !this[OBJECTMODE] && !data
-                ? false
-                : this[ASYNC]
-                    ? (defer(() => this[EMITDATA](data)), true)
-                    : this[EMITDATA](data);
-        }
-        else if (ev === 'end') {
-            return this[EMITEND]();
-        }
-        else if (ev === 'close') {
-            this[CLOSED] = true;
-            // don't emit close before 'end' and 'finish'
-            if (!this[EMITTED_END] && !this[DESTROYED])
-                return false;
-            const ret = super.emit('close');
-            this.removeAllListeners('close');
-            return ret;
-        }
-        else if (ev === 'error') {
-            this[EMITTED_ERROR] = data;
-            super.emit(ERROR, data);
-            const ret = !this[SIGNAL] || this.listeners('error').length
-                ? super.emit('error', data)
-                : false;
-            this[MAYBE_EMIT_END]();
-            return ret;
+  }
+
+  callRuntimeCallbacks(__ATPOSTRUN__);
+}
+
+function addOnPreRun(cb) {
+  __ATPRERUN__.unshift(cb);
+}
+
+function addOnInit(cb) {
+  __ATINIT__.unshift(cb);
+}
+
+function addOnExit(cb) {
+}
+
+function addOnPostRun(cb) {
+  __ATPOSTRUN__.unshift(cb);
+}
+
+// include: runtime_math.js
+
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
+
+assert(Math.imul, 'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
+assert(Math.fround, 'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
+assert(Math.clz32, 'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
+assert(Math.trunc, 'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
+
+// end include: runtime_math.js
+// A counter of dependencies for calling run(). If we need to
+// do asynchronous work before running, increment this and
+// decrement it. Incrementing must happen in a place like
+// Module.preRun (used by emcc to add file preloading).
+// Note that you can add dependencies in preRun, even though
+// it happens right before run - run will be postponed until
+// the dependencies are met.
+var runDependencies = 0;
+var runDependencyWatcher = null;
+var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
+var runDependencyTracking = {};
+
+function getUniqueRunDependency(id) {
+  var orig = id;
+  while (1) {
+    if (!runDependencyTracking[id]) return id;
+    id = orig + Math.random();
+  }
+}
+
+function addRunDependency(id) {
+  runDependencies++;
+
+  if (Module['monitorRunDependencies']) {
+    Module['monitorRunDependencies'](runDependencies);
+  }
+
+  if (id) {
+    assert(!runDependencyTracking[id]);
+    runDependencyTracking[id] = 1;
+    if (runDependencyWatcher === null && typeof setInterval != 'undefined') {
+      // Check for missing dependencies every few seconds
+      runDependencyWatcher = setInterval(function() {
+        if (ABORT) {
+          clearInterval(runDependencyWatcher);
+          runDependencyWatcher = null;
+          return;
         }
-        else if (ev === 'resume') {
-            const ret = super.emit('resume');
-            this[MAYBE_EMIT_END]();
-            return ret;
+        var shown = false;
+        for (var dep in runDependencyTracking) {
+          if (!shown) {
+            shown = true;
+            err('still waiting on run dependencies:');
+          }
+          err('dependency: ' + dep);
         }
-        else if (ev === 'finish' || ev === 'prefinish') {
-            const ret = super.emit(ev);
-            this.removeAllListeners(ev);
-            return ret;
+        if (shown) {
+          err('(end of list)');
         }
-        // Some other unknown event
-        const ret = super.emit(ev, ...args);
-        this[MAYBE_EMIT_END]();
-        return ret;
+      }, 10000);
     }
-    [EMITDATA](data) {
-        for (const p of this[PIPES]) {
-            if (p.dest.write(data) === false)
-                this.pause();
-        }
-        const ret = this[DISCARDED] ? false : super.emit('data', data);
-        this[MAYBE_EMIT_END]();
-        return ret;
+  } else {
+    err('warning: run dependency added without ID');
+  }
+}
+
+function removeRunDependency(id) {
+  runDependencies--;
+
+  if (Module['monitorRunDependencies']) {
+    Module['monitorRunDependencies'](runDependencies);
+  }
+
+  if (id) {
+    assert(runDependencyTracking[id]);
+    delete runDependencyTracking[id];
+  } else {
+    err('warning: run dependency removed without ID');
+  }
+  if (runDependencies == 0) {
+    if (runDependencyWatcher !== null) {
+      clearInterval(runDependencyWatcher);
+      runDependencyWatcher = null;
+    }
+    if (dependenciesFulfilled) {
+      var callback = dependenciesFulfilled;
+      dependenciesFulfilled = null;
+      callback(); // can add another dependenciesFulfilled
+    }
+  }
+}
+
+/** @param {string|number=} what */
+function abort(what) {
+  if (Module['onAbort']) {
+    Module['onAbort'](what);
+  }
+
+  what = 'Aborted(' + what + ')';
+  // TODO(sbc): Should we remove printing and leave it up to whoever
+  // catches the exception?
+  err(what);
+
+  ABORT = true;
+  EXITSTATUS = 1;
+
+  // Use a wasm runtime error, because a JS error might be seen as a foreign
+  // exception, which means we'd run destructors on it. We need the error to
+  // simply make the program stop.
+  // FIXME This approach does not work in Wasm EH because it currently does not assume
+  // all RuntimeErrors are from traps; it decides whether a RuntimeError is from
+  // a trap or not based on a hidden field within the object. So at the moment
+  // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that
+  // allows this in the wasm spec.
+
+  // Suppress closure compiler warning here. Closure compiler's builtin extern
+  // defintion for WebAssembly.RuntimeError claims it takes no arguments even
+  // though it can.
+  // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.
+  /** @suppress {checkTypes} */
+  var e = new WebAssembly.RuntimeError(what);
+
+  readyPromiseReject(e);
+  // Throw the error whether or not MODULARIZE is set because abort is used
+  // in code paths apart from instantiation where an exception is expected
+  // to be thrown when abort is called.
+  throw e;
+}
+
+// {{MEM_INITIALIZER}}
+
+// include: memoryprofiler.js
+
+
+// end include: memoryprofiler.js
+// show errors on likely calls to FS when it was not included
+var FS = {
+  error: function() {
+    abort('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM');
+  },
+  init: function() { FS.error() },
+  createDataFile: function() { FS.error() },
+  createPreloadedFile: function() { FS.error() },
+  createLazyFile: function() { FS.error() },
+  open: function() { FS.error() },
+  mkdev: function() { FS.error() },
+  registerDevice: function() { FS.error() },
+  analyzePath: function() { FS.error() },
+  loadFilesFromDB: function() { FS.error() },
+
+  ErrnoError: function ErrnoError() { FS.error() },
+};
+Module['FS_createDataFile'] = FS.createDataFile;
+Module['FS_createPreloadedFile'] = FS.createPreloadedFile;
+
+// include: URIUtils.js
+
+
+// Prefix of data URIs emitted by SINGLE_FILE and related options.
+var dataURIPrefix = 'data:application/octet-stream;base64,';
+
+// Indicates whether filename is a base64 data URI.
+function isDataURI(filename) {
+  // Prefix of data URIs emitted by SINGLE_FILE and related options.
+  return filename.startsWith(dataURIPrefix);
+}
+
+// Indicates whether filename is delivered via file protocol (as opposed to http/https)
+function isFileURI(filename) {
+  return filename.startsWith('file://');
+}
+
+// end include: URIUtils.js
+/** @param {boolean=} fixedasm */
+function createExportWrapper(name, fixedasm) {
+  return function() {
+    var displayName = name;
+    var asm = fixedasm;
+    if (!fixedasm) {
+      asm = Module['asm'];
+    }
+    assert(runtimeInitialized, 'native function `' + displayName + '` called before runtime initialization');
+    if (!asm[name]) {
+      assert(asm[name], 'exported native function `' + displayName + '` not found');
+    }
+    return asm[name].apply(null, arguments);
+  };
+}
+
+var wasmBinaryFile;
+  wasmBinaryFile = 'crc64.wasm';
+  if (!isDataURI(wasmBinaryFile)) {
+    wasmBinaryFile = locateFile(wasmBinaryFile);
+  }
+
+var binaryInString = ["AGFzbQEAAAABzYCAgAAMYAF/AX9gAAF/YAF/AGAAAGADf35/AX5gA39/fwBgBH9/f38AYAN/f38Bf2AFf39",
+"/f38Bf2AEf39/fwF/YAR/f35/AX5gBH9+f38BfwKPgYCAAAUDZW52BWFib3J0AAMDZW52FmVtc2NyaXB0ZW",
+"5fcmVzaXplX2hlYXAAABZ3YXNpX3NuYXBzaG90X3ByZXZpZXcxCGZkX2Nsb3NlAAAWd2FzaV9zbmFwc2hvd",
+"F9wcmV2aWV3MQhmZF93cml0ZQAJFndhc2lfc25hcHNob3RfcHJldmlldzEHZmRfc2VlawAIA62AgIAALAMF",
+"BgIBAAUGAgEBAAACAAIAAAAHBAQCAgEDAAIAAQIBAQIAAQMBAQEACggLBIWAgIAAAXABBAQFh4CAgAABAYA",
+"CgIACBsiAgIAACn8BQYCAwAILfwFBAAt/AUEAC38BQQALfwBBnJHBAgt/AEGwkcECC38AQZyRwQILfwBBsJ",
+"HBAgt/AEGwkcECC38AQZKSwQILB/qEgIAAGwZtZW1vcnkCABFfX3dhc21fY2FsbF9jdG9ycwAFJWVtc2Nya",
+"XB0ZW5fYmluZF9Wb2lkUHRyX19fZGVzdHJveV9fXzAACCVlbXNjcmlwdGVuX2JpbmRfQ3JjNjRIYXNoX0Ny",
+"YzY0SGFzaF8wAAkkZW1zY3JpcHRlbl9iaW5kX0NyYzY0SGFzaF9PbkFwcGVuZF8yAAsjZW1zY3JpcHRlbl9",
+"iaW5kX0NyYzY0SGFzaF9PbkZpbmFsXzMADCdlbXNjcmlwdGVuX2JpbmRfQ3JjNjRIYXNoX19fZGVzdHJveV",
+"9fXzAADRtfX2VtX2xpYl9kZXBzX3dlYmlkbF9iaW5kZXIDBCFfX2VtX2pzX19hcnJheV9ib3VuZHNfY2hlY",
+"2tfZXJyb3IDBRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQAQX19lcnJub19sb2NhdGlvbgAPBmZmbHVz",
+"aAAtBm1hbGxvYwARBGZyZWUAEhVlbXNjcmlwdGVuX3N0YWNrX2luaXQAKRllbXNjcmlwdGVuX3N0YWNrX2d",
+"ldF9mcmVlACoZZW1zY3JpcHRlbl9zdGFja19nZXRfYmFzZQArGGVtc2NyaXB0ZW5fc3RhY2tfZ2V0X2VuZA",
+"AsCXN0YWNrU2F2ZQAlDHN0YWNrUmVzdG9yZQAmCnN0YWNrQWxsb2MAJxxlbXNjcmlwdGVuX3N0YWNrX2dld",
+"F9jdXJyZW50ACgTX19zdGFydF9lbV9saWJfZGVwcwMGEl9fc3RvcF9lbV9saWJfZGVwcwMHDV9fc3RhcnRf",
+"ZW1fanMDCAxfX3N0b3BfZW1fanMDCQxkeW5DYWxsX2ppamkALwmJgICAAAEAQQELAxYYGgqtkYGAACwEABA",
+"pC81IAvcCf6EFfiMAIQNBgAEhBCADIARrIQUgBSAANgJ8IAUgATYCeCAFIAI2AnQgBSgCfCEGIAUoAnghBy",
+"AFIAc2AnAgBSgCdCEIIAghCSAJrCH6AiAGKQMIIfsCIPsCIPoCfCH8AiAGIPwCNwMIIAYpAwAh/QJCfyH+A",
+"iD9AiD+AoUh/wIgBSD/AjcDaEIAIYADIAUggAM3A2AgBSgCdCEKIAUoAnQhC0EgIQwgCyAMbyENIAogDWsh",
+"DiAFIA42AlwgBSgCXCEPQcAAIRAgDyERIBAhEiARIBJPIRNBASEUIBMgFHEhFQJAIBVFDQAgBSgCcCEWIAU",
+"gFjYCWEIAIYEDIAUggQM3A1BCACGCAyAFIIIDNwNIQgAhgwMgBSCDAzcDQEIAIYQDIAUghAM3AzggBSkDYC",
+"GFAyAFKAJcIRcgFyEYIBitIYYDIIUDIIYDfCGHA0IgIYgDIIcDIIgDfSGJAyAFIIkDNwMwIAUoAlwhGSAFK",
+"AJ0IRogGiAZayEbIAUgGzYCdCAFKQNoIYoDIAUgigM3A1ACQANAIAUpA2AhiwMgBSkDMCGMAyCLAyGNAyCM",
+"AyGOAyCNAyCOA1QhHEEBIR0gHCAdcSEeIB5FDQEgBSgCWCEfIB8pAwAhjwMgBSkDUCGQAyCPAyCQA4UhkQM",
+"gBSCRAzcDKCAFKAJYISAgICkDCCGSAyAFKQNIIZMDIJIDIJMDhSGUAyAFIJQDNwMgIAUoAlghISAhKQMQIZ",
+"UDIAUpA0AhlgMglQMglgOFIZcDIAUglwM3AxggBSgCWCEiICIpAxghmAMgBSkDOCGZAyCYAyCZA4UhmgMgB",
+"SCaAzcDECAFKQMoIZsDQv8BIZwDIJsDIJwDgyGdA0KADiGeAyCdAyCeA3whnwMgnwOnISNBgIDAAiEkQQMh",
+"JSAjICV0ISYgJCAmaiEnICcpAwAhoAMgBSCgAzcDUCAFKQMoIaEDQgghogMgoQMgogOIIaMDIAUgowM3Ayg",
+"gBSkDICGkA0L/ASGlAyCkAyClA4MhpgNCgA4hpwMgpgMgpwN8IagDIKgDpyEoQYCAwAIhKUEDISogKCAqdC",
+"ErICkgK2ohLCAsKQMAIakDIAUgqQM3A0ggBSkDICGqA0IIIasDIKoDIKsDiCGsAyAFIKwDNwMgIAUpAxghr",
+"QNC/wEhrgMgrQMgrgODIa8DQoAOIbADIK8DILADfCGxAyCxA6chLUGAgMACIS5BAyEvIC0gL3QhMCAuIDBq",
+"ITEgMSkDACGyAyAFILIDNwNAIAUpAxghswNCCCG0AyCzAyC0A4ghtQMgBSC1AzcDGCAFKQMQIbYDQv8BIbc",
+"DILYDILcDgyG4A0KADiG5AyC4AyC5A3whugMgugOnITJBgIDAAiEzQQMhNCAyIDR0ITUgMyA1aiE2IDYpAw",
+"AhuwMgBSC7AzcDOCAFKQMQIbwDQgghvQMgvAMgvQOIIb4DIAUgvgM3AxAgBSkDKCG/A0L/ASHAAyC/AyDAA",
+"4MhwQNCgAwhwgMgwQMgwgN8IcMDIMMDpyE3QYCAwAIhOEEDITkgNyA5dCE6IDggOmohOyA7KQMAIcQDIAUp",
+"A1AhxQMgxQMgxAOFIcYDIAUgxgM3A1AgBSkDKCHHA0IIIcgDIMcDIMgDiCHJAyAFIMkDNwMoIAUpAyAhygN",
+"C/wEhywMgygMgywODIcwDQoAMIc0DIMwDIM0DfCHOAyDOA6chPEGAgMACIT1BAyE+IDwgPnQhPyA9ID9qIU",
+"AgQCkDACHPAyAFKQNIIdADINADIM8DhSHRAyAFINEDNwNIIAUpAyAh0gNCCCHTAyDSAyDTA4gh1AMgBSDUA",
+"zcDICAFKQMYIdUDQv8BIdYDINUDINYDgyHXA0KADCHYAyDXAyDYA3wh2QMg2QOnIUFBgIDAAiFCQQMhQyBB",
+"IEN0IUQgQiBEaiFFIEUpAwAh2gMgBSkDQCHbAyDbAyDaA4Uh3AMgBSDcAzcDQCAFKQMYId0DQggh3gMg3QM",
+"g3gOIId8DIAUg3wM3AxggBSkDECHgA0L/ASHhAyDgAyDhA4Mh4gNCgAwh4wMg4gMg4wN8IeQDIOQDpyFGQY",
+"CAwAIhR0EDIUggRiBIdCFJIEcgSWohSiBKKQMAIeUDIAUpAzgh5gMg5gMg5QOFIecDIAUg5wM3AzggBSkDE",
+"CHoA0IIIekDIOgDIOkDiCHqAyAFIOoDNwMQIAUpAygh6wNC/wEh7AMg6wMg7AODIe0DQoAKIe4DIO0DIO4D",
+"fCHvAyDvA6chS0GAgMACIUxBAyFNIEsgTXQhTiBMIE5qIU8gTykDACHwAyAFKQNQIfEDIPEDIPADhSHyAyA",
+"FIPIDNwNQIAUpAygh8wNCCCH0AyDzAyD0A4gh9QMgBSD1AzcDKCAFKQMgIfYDQv8BIfcDIPYDIPcDgyH4A0",
+"KACiH5AyD4AyD5A3wh+gMg+gOnIVBBgIDAAiFRQQMhUiBQIFJ0IVMgUSBTaiFUIFQpAwAh+wMgBSkDSCH8A",
+"yD8AyD7A4Uh/QMgBSD9AzcDSCAFKQMgIf4DQggh/wMg/gMg/wOIIYAEIAUggAQ3AyAgBSkDGCGBBEL/ASGC",
+"BCCBBCCCBIMhgwRCgAohhAQggwQghAR8IYUEIIUEpyFVQYCAwAIhVkEDIVcgVSBXdCFYIFYgWGohWSBZKQM",
+"AIYYEIAUpA0AhhwQghwQghgSFIYgEIAUgiAQ3A0AgBSkDGCGJBEIIIYoEIIkEIIoEiCGLBCAFIIsENwMYIA",
+"UpAxAhjARC/wEhjQQgjAQgjQSDIY4EQoAKIY8EII4EII8EfCGQBCCQBKchWkGAgMACIVtBAyFcIFogXHQhX",
+"SBbIF1qIV4gXikDACGRBCAFKQM4IZIEIJIEIJEEhSGTBCAFIJMENwM4IAUpAxAhlARCCCGVBCCUBCCVBIgh",
+"lgQgBSCWBDcDECAFKQMoIZcEQv8BIZgEIJcEIJgEgyGZBEKACCGaBCCZBCCaBHwhmwQgmwSnIV9BgIDAAiF",
+"gQQMhYSBfIGF0IWIgYCBiaiFjIGMpAwAhnAQgBSkDUCGdBCCdBCCcBIUhngQgBSCeBDcDUCAFKQMoIZ8EQg",
+"ghoAQgnwQgoASIIaEEIAUgoQQ3AyggBSkDICGiBEL/ASGjBCCiBCCjBIMhpARCgAghpQQgpAQgpQR8IaYEI",
+"KYEpyFkQYCAwAIhZUEDIWYgZCBmdCFnIGUgZ2ohaCBoKQMAIacEIAUpA0ghqAQgqAQgpwSFIakEIAUgqQQ3",
+"A0ggBSkDICGqBEIIIasEIKoEIKsEiCGsBCAFIKwENwMgIAUpAxghrQRC/wEhrgQgrQQgrgSDIa8EQoAIIbA",
+"EIK8EILAEfCGxBCCxBKchaUGAgMACIWpBAyFrIGkga3QhbCBqIGxqIW0gbSkDACGyBCAFKQNAIbMEILMEIL",
+"IEhSG0BCAFILQENwNAIAUpAxghtQRCCCG2BCC1BCC2BIghtwQgBSC3BDcDGCAFKQMQIbgEQv8BIbkEILgEI",
+"LkEgyG6BEKACCG7BCC6BCC7BHwhvAQgvASnIW5BgIDAAiFvQQMhcCBuIHB0IXEgbyBxaiFyIHIpAwAhvQQg",
+"BSkDOCG+BCC+BCC9BIUhvwQgBSC/BDcDOCAFKQMQIcAEQgghwQQgwAQgwQSIIcIEIAUgwgQ3AxAgBSkDKCH",
+"DBEL/ASHEBCDDBCDEBIMhxQRCgAYhxgQgxQQgxgR8IccEIMcEpyFzQYCAwAIhdEEDIXUgcyB1dCF2IHQgdm",
+"ohdyB3KQMAIcgEIAUpA1AhyQQgyQQgyASFIcoEIAUgygQ3A1AgBSkDKCHLBEIIIcwEIMsEIMwEiCHNBCAFI",
+"M0ENwMoIAUpAyAhzgRC/wEhzwQgzgQgzwSDIdAEQoAGIdEEINAEINEEfCHSBCDSBKcheEGAgMACIXlBAyF6",
+"IHggenQheyB5IHtqIXwgfCkDACHTBCAFKQNIIdQEINQEINMEhSHVBCAFINUENwNIIAUpAyAh1gRCCCHXBCD",
+"WBCDXBIgh2AQgBSDYBDcDICAFKQMYIdkEQv8BIdoEINkEINoEgyHbBEKABiHcBCDbBCDcBHwh3QQg3QSnIX",
+"1BgIDAAiF+QQMhfyB9IH90IYABIH4ggAFqIYEBIIEBKQMAId4EIAUpA0Ah3wQg3wQg3gSFIeAEIAUg4AQ3A",
+"0AgBSkDGCHhBEIIIeIEIOEEIOIEiCHjBCAFIOMENwMYIAUpAxAh5ARC/wEh5QQg5AQg5QSDIeYEQoAGIecE",
+"IOYEIOcEfCHoBCDoBKchggFBgIDAAiGDAUEDIYQBIIIBIIQBdCGFASCDASCFAWohhgEghgEpAwAh6QQgBSk",
+"DOCHqBCDqBCDpBIUh6wQgBSDrBDcDOCAFKQMQIewEQggh7QQg7AQg7QSIIe4EIAUg7gQ3AxAgBSkDKCHvBE",
+"L/ASHwBCDvBCDwBIMh8QRCgAQh8gQg8QQg8gR8IfMEIPMEpyGHAUGAgMACIYgBQQMhiQEghwEgiQF0IYoBI",
+"IgBIIoBaiGLASCLASkDACH0BCAFKQNQIfUEIPUEIPQEhSH2BCAFIPYENwNQIAUpAygh9wRCCCH4BCD3BCD4",
+"BIgh+QQgBSD5BDcDKCAFKQMgIfoEQv8BIfsEIPoEIPsEgyH8BEKABCH9BCD8BCD9BHwh/gQg/gSnIYwBQYC",
+"AwAIhjQFBAyGOASCMASCOAXQhjwEgjQEgjwFqIZABIJABKQMAIf8EIAUpA0ghgAUggAUg/wSFIYEFIAUggQ",
+"U3A0ggBSkDICGCBUIIIYMFIIIFIIMFiCGEBSAFIIQFNwMgIAUpAxghhQVC/wEhhgUghQUghgWDIYcFQoAEI",
+"YgFIIcFIIgFfCGJBSCJBachkQFBgIDAAiGSAUEDIZMBIJEBIJMBdCGUASCSASCUAWohlQEglQEpAwAhigUg",
+"BSkDQCGLBSCLBSCKBYUhjAUgBSCMBTcDQCAFKQMYIY0FQgghjgUgjQUgjgWIIY8FIAUgjwU3AxggBSkDECG",
+"QBUL/ASGRBSCQBSCRBYMhkgVCgAQhkwUgkgUgkwV8IZQFIJQFpyGWAUGAgMACIZcBQQMhmAEglgEgmAF0IZ",
+"kBIJcBIJkBaiGaASCaASkDACGVBSAFKQM4IZYFIJYFIJUFhSGXBSAFIJcFNwM4IAUpAxAhmAVCCCGZBSCYB",
+"SCZBYghmgUgBSCaBTcDECAFKQMoIZsFQv8BIZwFIJsFIJwFgyGdBUKAAiGeBSCdBSCeBXwhnwUgnwWnIZsB",
+"QYCAwAIhnAFBAyGdASCbASCdAXQhngEgnAEgngFqIZ8BIJ8BKQMAIaAFIAUpA1AhoQUgoQUgoAWFIaIFIAU",
+"gogU3A1AgBSkDKCGjBUIIIaQFIKMFIKQFiCGlBSAFIKUFNwMoIAUpAyAhpgVC/wEhpwUgpgUgpwWDIagFQo",
+"ACIakFIKgFIKkFfCGqBSCqBachoAFBgIDAAiGhAUEDIaIBIKABIKIBdCGjASChASCjAWohpAEgpAEpAwAhq",
+"wUgBSkDSCGsBSCsBSCrBYUhrQUgBSCtBTcDSCAFKQMgIa4FQgghrwUgrgUgrwWIIbAFIAUgsAU3AyAgBSkD",
+"GCGxBUL/ASGyBSCxBSCyBYMhswVCgAIhtAUgswUgtAV8IbUFILUFpyGlAUGAgMACIaYBQQMhpwEgpQEgpwF",
+"0IagBIKYBIKgBaiGpASCpASkDACG2BSAFKQNAIbcFILcFILYFhSG4BSAFILgFNwNAIAUpAxghuQVCCCG6BS",
+"C5BSC6BYghuwUgBSC7BTcDGCAFKQMQIbwFQv8BIb0FILwFIL0FgyG+BUKAAiG/BSC+BSC/BXwhwAUgwAWnI",
+"aoBQYCAwAIhqwFBAyGsASCqASCsAXQhrQEgqwEgrQFqIa4BIK4BKQMAIcEFIAUpAzghwgUgwgUgwQWFIcMF",
+"IAUgwwU3AzggBSkDECHEBUIIIcUFIMQFIMUFiCHGBSAFIMYFNwMQIAUpAyghxwVC/wEhyAUgxwUgyAWDIck",
+"FQgAhygUgyQUgygV8IcsFIMsFpyGvAUGAgMACIbABQQMhsQEgrwEgsQF0IbIBILABILIBaiGzASCzASkDAC",
+"HMBSAFKQNQIc0FIM0FIMwFhSHOBSAFIM4FNwNQIAUpAyAhzwVC/wEh0AUgzwUg0AWDIdEFQgAh0gUg0QUg0",
+"gV8IdMFINMFpyG0AUGAgMACIbUBQQMhtgEgtAEgtgF0IbcBILUBILcBaiG4ASC4ASkDACHUBSAFKQNIIdUF",
+"INUFINQFhSHWBSAFINYFNwNIIAUpAxgh1wVC/wEh2AUg1wUg2AWDIdkFQgAh2gUg2QUg2gV8IdsFINsFpyG",
+"5AUGAgMACIboBQQMhuwEguQEguwF0IbwBILoBILwBaiG9ASC9ASkDACHcBSAFKQNAId0FIN0FINwFhSHeBS",
+"AFIN4FNwNAIAUpAxAh3wVC/wEh4AUg3wUg4AWDIeEFQgAh4gUg4QUg4gV8IeMFIOMFpyG+AUGAgMACIb8BQ",
+"QMhwAEgvgEgwAF0IcEBIL8BIMEBaiHCASDCASkDACHkBSAFKQM4IeUFIOUFIOQFhSHmBSAFIOYFNwM4IAUp",
+"A2Ah5wVCICHoBSDnBSDoBXwh6QUgBSDpBTcDYCAFKAJYIcMBQSAhxAEgwwEgxAFqIcUBIAUgxQE2AlgMAAs",
+"AC0IAIeoFIAUg6gU3A2ggBSgCWCHGASDGASkDACHrBSAFKQNQIewFIOsFIOwFhSHtBSAFKQNoIe4FIO4FIO",
+"0FhSHvBSAFIO8FNwNoIAUpA2gh8AVCCCHxBSDwBSDxBYgh8gUgBSkDaCHzBUL/ASH0BSDzBSD0BYMh9QUg9",
+"QWnIccBQYCAwQIhyAFBAyHJASDHASDJAXQhygEgyAEgygFqIcsBIMsBKQMAIfYFIPIFIPYFhSH3BSAFIPcF",
+"NwNoIAUpA2gh+AVCCCH5BSD4BSD5BYgh+gUgBSkDaCH7BUL/ASH8BSD7BSD8BYMh/QUg/QWnIcwBQYCAwQI",
+"hzQFBAyHOASDMASDOAXQhzwEgzQEgzwFqIdABINABKQMAIf4FIPoFIP4FhSH/BSAFIP8FNwNoIAUpA2ghgA",
+"ZCCCGBBiCABiCBBoghggYgBSkDaCGDBkL/ASGEBiCDBiCEBoMhhQYghQanIdEBQYCAwQIh0gFBAyHTASDRA",
+"SDTAXQh1AEg0gEg1AFqIdUBINUBKQMAIYYGIIIGIIYGhSGHBiAFIIcGNwNoIAUpA2ghiAZCCCGJBiCIBiCJ",
+"BoghigYgBSkDaCGLBkL/ASGMBiCLBiCMBoMhjQYgjQanIdYBQYCAwQIh1wFBAyHYASDWASDYAXQh2QEg1wE",
+"g2QFqIdoBINoBKQMAIY4GIIoGII4GhSGPBiAFII8GNwNoIAUpA2ghkAZCCCGRBiCQBiCRBoghkgYgBSkDaC",
+"GTBkL/ASGUBiCTBiCUBoMhlQYglQanIdsBQYCAwQIh3AFBAyHdASDbASDdAXQh3gEg3AEg3gFqId8BIN8BK",
+"QMAIZYGIJIGIJYGhSGXBiAFIJcGNwNoIAUpA2ghmAZCCCGZBiCYBiCZBoghmgYgBSkDaCGbBkL/ASGcBiCb",
+"BiCcBoMhnQYgnQanIeABQYCAwQIh4QFBAyHiASDgASDiAXQh4wEg4QEg4wFqIeQBIOQBKQMAIZ4GIJoGIJ4",
+"GhSGfBiAFIJ8GNwNoIAUpA2ghoAZCCCGhBiCgBiChBoghogYgBSkDaCGjBkL/ASGkBiCjBiCkBoMhpQYgpQ",
+"anIeUBQYCAwQIh5gFBAyHnASDlASDnAXQh6AEg5gEg6AFqIekBIOkBKQMAIaYGIKIGIKYGhSGnBiAFIKcGN",
+"wNoIAUpA2ghqAZCCCGpBiCoBiCpBoghqgYgBSkDaCGrBkL/ASGsBiCrBiCsBoMhrQYgrQanIeoBQYCAwQIh",
+"6wFBAyHsASDqASDsAXQh7QEg6wEg7QFqIe4BIO4BKQMAIa4GIKoGIK4GhSGvBiAFIK8GNwNoIAUoAlgh7wE",
+"g7wEpAwghsAYgBSkDSCGxBiCwBiCxBoUhsgYgBSkDaCGzBiCzBiCyBoUhtAYgBSC0BjcDaCAFKQNoIbUGQg",
+"ghtgYgtQYgtgaIIbcGIAUpA2ghuAZC/wEhuQYguAYguQaDIboGILoGpyHwAUGAgMECIfEBQQMh8gEg8AEg8",
+"gF0IfMBIPEBIPMBaiH0ASD0ASkDACG7BiC3BiC7BoUhvAYgBSC8BjcDaCAFKQNoIb0GQgghvgYgvQYgvgaI",
+"Ib8GIAUpA2ghwAZC/wEhwQYgwAYgwQaDIcIGIMIGpyH1AUGAgMECIfYBQQMh9wEg9QEg9wF0IfgBIPYBIPg",
+"BaiH5ASD5ASkDACHDBiC/BiDDBoUhxAYgBSDEBjcDaCAFKQNoIcUGQgghxgYgxQYgxgaIIccGIAUpA2ghyA",
+"ZC/wEhyQYgyAYgyQaDIcoGIMoGpyH6AUGAgMECIfsBQQMh/AEg+gEg/AF0If0BIPsBIP0BaiH+ASD+ASkDA",
+"CHLBiDHBiDLBoUhzAYgBSDMBjcDaCAFKQNoIc0GQgghzgYgzQYgzgaIIc8GIAUpA2gh0AZC/wEh0QYg0AYg",
+"0QaDIdIGINIGpyH/AUGAgMECIYACQQMhgQIg/wEggQJ0IYICIIACIIICaiGDAiCDAikDACHTBiDPBiDTBoU",
+"h1AYgBSDUBjcDaCAFKQNoIdUGQggh1gYg1QYg1gaIIdcGIAUpA2gh2AZC/wEh2QYg2AYg2QaDIdoGINoGpy",
+"GEAkGAgMECIYUCQQMhhgIghAIghgJ0IYcCIIUCIIcCaiGIAiCIAikDACHbBiDXBiDbBoUh3AYgBSDcBjcDa",
+"CAFKQNoId0GQggh3gYg3QYg3gaIId8GIAUpA2gh4AZC/wEh4QYg4AYg4QaDIeIGIOIGpyGJAkGAgMECIYoC",
+"QQMhiwIgiQIgiwJ0IYwCIIoCIIwCaiGNAiCNAikDACHjBiDfBiDjBoUh5AYgBSDkBjcDaCAFKQNoIeUGQgg",
+"h5gYg5QYg5gaIIecGIAUpA2gh6AZC/wEh6QYg6AYg6QaDIeoGIOoGpyGOAkGAgMECIY8CQQMhkAIgjgIgkA",
+"J0IZECII8CIJECaiGSAiCSAikDACHrBiDnBiDrBoUh7AYgBSDsBjcDaCAFKQNoIe0GQggh7gYg7QYg7gaII",
+"e8GIAUpA2gh8AZC/wEh8QYg8AYg8QaDIfIGIPIGpyGTAkGAgMECIZQCQQMhlQIgkwIglQJ0IZYCIJQCIJYC",
+"aiGXAiCXAikDACHzBiDvBiDzBoUh9AYgBSD0BjcDaCAFKAJYIZgCIJgCKQMQIfUGIAUpA0Ah9gYg9QYg9ga",
+"FIfcGIAUpA2gh+AYg+AYg9waFIfkGIAUg+QY3A2ggBSkDaCH6BkIIIfsGIPoGIPsGiCH8BiAFKQNoIf0GQv",
+"8BIf4GIP0GIP4GgyH/BiD/BqchmQJBgIDBAiGaAkEDIZsCIJkCIJsCdCGcAiCaAiCcAmohnQIgnQIpAwAhg",
+"Acg/AYggAeFIYEHIAUggQc3A2ggBSkDaCGCB0IIIYMHIIIHIIMHiCGEByAFKQNoIYUHQv8BIYYHIIUHIIYH",
+"gyGHByCHB6chngJBgIDBAiGfAkEDIaACIJ4CIKACdCGhAiCfAiChAmohogIgogIpAwAhiAcghAcgiAeFIYk",
+"HIAUgiQc3A2ggBSkDaCGKB0IIIYsHIIoHIIsHiCGMByAFKQNoIY0HQv8BIY4HII0HII4HgyGPByCPB6chow",
+"JBgIDBAiGkAkEDIaUCIKMCIKUCdCGmAiCkAiCmAmohpwIgpwIpAwAhkAcgjAcgkAeFIZEHIAUgkQc3A2ggB",
+"SkDaCGSB0IIIZMHIJIHIJMHiCGUByAFKQNoIZUHQv8BIZYHIJUHIJYHgyGXByCXB6chqAJBgIDBAiGpAkED",
+"IaoCIKgCIKoCdCGrAiCpAiCrAmohrAIgrAIpAwAhmAcglAcgmAeFIZkHIAUgmQc3A2ggBSkDaCGaB0IIIZs",
+"HIJoHIJsHiCGcByAFKQNoIZ0HQv8BIZ4HIJ0HIJ4HgyGfByCfB6chrQJBgIDBAiGuAkEDIa8CIK0CIK8CdC",
+"GwAiCuAiCwAmohsQIgsQIpAwAhoAcgnAcgoAeFIaEHIAUgoQc3A2ggBSkDaCGiB0IIIaMHIKIHIKMHiCGkB",
+"yAFKQNoIaUHQv8BIaYHIKUHIKYHgyGnByCnB6chsgJBgIDBAiGzAkEDIbQCILICILQCdCG1AiCzAiC1Amoh",
+"tgIgtgIpAwAhqAcgpAcgqAeFIakHIAUgqQc3A2ggBSkDaCGqB0IIIasHIKoHIKsHiCGsByAFKQNoIa0HQv8",
+"BIa4HIK0HIK4HgyGvByCvB6chtwJBgIDBAiG4AkEDIbkCILcCILkCdCG6AiC4AiC6AmohuwIguwIpAwAhsA",
+"cgrAcgsAeFIbEHIAUgsQc3A2ggBSkDaCGyB0IIIbMHILIHILMHiCG0ByAFKQNoIbUHQv8BIbYHILUHILYHg",
+"yG3ByC3B6chvAJBgIDBAiG9AkEDIb4CILwCIL4CdCG/AiC9AiC/AmohwAIgwAIpAwAhuAcgtAcguAeFIbkH",
+"IAUguQc3A2ggBSgCWCHBAiDBAikDGCG6ByAFKQM4IbsHILoHILsHhSG8ByAFKQNoIb0HIL0HILwHhSG+ByA",
+"FIL4HNwNoIAUpA2ghvwdCCCHAByC/ByDAB4ghwQcgBSkDaCHCB0L/ASHDByDCByDDB4MhxAcgxAenIcICQY",
+"CAwQIhwwJBAyHEAiDCAiDEAnQhxQIgwwIgxQJqIcYCIMYCKQMAIcUHIMEHIMUHhSHGByAFIMYHNwNoIAUpA",
+"2ghxwdCCCHIByDHByDIB4ghyQcgBSkDaCHKB0L/ASHLByDKByDLB4MhzAcgzAenIccCQYCAwQIhyAJBAyHJ",
+"AiDHAiDJAnQhygIgyAIgygJqIcsCIMsCKQMAIc0HIMkHIM0HhSHOByAFIM4HNwNoIAUpA2ghzwdCCCHQByD",
+"PByDQB4gh0QcgBSkDaCHSB0L/ASHTByDSByDTB4Mh1Acg1AenIcwCQYCAwQIhzQJBAyHOAiDMAiDOAnQhzw",
+"IgzQIgzwJqIdACINACKQMAIdUHINEHINUHhSHWByAFINYHNwNoIAUpA2gh1wdCCCHYByDXByDYB4gh2QcgB",
+"SkDaCHaB0L/ASHbByDaByDbB4Mh3Acg3AenIdECQYCAwQIh0gJBAyHTAiDRAiDTAnQh1AIg0gIg1AJqIdUC",
+"INUCKQMAId0HINkHIN0HhSHeByAFIN4HNwNoIAUpA2gh3wdCCCHgByDfByDgB4gh4QcgBSkDaCHiB0L/ASH",
+"jByDiByDjB4Mh5Acg5AenIdYCQYCAwQIh1wJBAyHYAiDWAiDYAnQh2QIg1wIg2QJqIdoCINoCKQMAIeUHIO",
+"EHIOUHhSHmByAFIOYHNwNoIAUpA2gh5wdCCCHoByDnByDoB4gh6QcgBSkDaCHqB0L/ASHrByDqByDrB4Mh7",
+"Acg7AenIdsCQYCAwQIh3AJBAyHdAiDbAiDdAnQh3gIg3AIg3gJqId8CIN8CKQMAIe0HIOkHIO0HhSHuByAF",
+"IO4HNwNoIAUpA2gh7wdCCCHwByDvByDwB4gh8QcgBSkDaCHyB0L/ASHzByDyByDzB4Mh9Acg9AenIeACQYC",
+"AwQIh4QJBAyHiAiDgAiDiAnQh4wIg4QIg4wJqIeQCIOQCKQMAIfUHIPEHIPUHhSH2ByAFIPYHNwNoIAUpA2",
+"gh9wdCCCH4ByD3ByD4B4gh+QcgBSkDaCH6B0L/ASH7ByD6ByD7B4Mh/Acg/AenIeUCQYCAwQIh5gJBAyHnA",
+"iDlAiDnAnQh6AIg5gIg6AJqIekCIOkCKQMAIf0HIPkHIP0HhSH+ByAFIP4HNwNoIAUpA2Ah/wdCICGACCD/",
+"ByCACHwhgQggBSCBCDcDYAtCACGCCCAFIIIINwMIAkADQCAFKQMIIYMIIAUoAnQh6gIg6gIh6wIg6wKsIYQ",
+"IIIMIIYUIIIQIIYYIIIUIIIYIVCHsAkEBIe0CIOwCIO0CcSHuAiDuAkUNASAFKQNoIYcIQgghiAgghwggiA",
+"iIIYkIIAUpA2ghigggBSgCcCHvAiAFKQNgIYsIIIsIpyHwAiDvAiDwAmoh8QIg8QItAAAh8gJB/wEh8wIg8",
+"gIg8wJxIfQCIPQCrSGMCCCKCCCMCIUhjQhC/wEhjgggjQggjgiDIY8III8IpyH1AkGAgMECIfYCQQMh9wIg",
+"9QIg9wJ0IfgCIPYCIPgCaiH5AiD5AikDACGQCCCJCCCQCIUhkQggBSCRCDcDaCAFKQMIIZIIQgEhkwggkgg",
+"gkwh8IZQIIAUglAg3AwggBSkDYCGVCEIBIZYIIJUIIJYIfCGXCCAFIJcINwNgDAALAAsgBSkDaCGYCEJ/IZ",
+"kIIJgIIJkIhSGaCCAGIJoINwMADwudAgIcfwV+IwAhBEEgIQUgBCAFayEGIAYkACAGIAA2AhwgBiABNgIYI",
+"AYgAjYCFCAGIAM2AhAgBigCHCEHIAYoAhghCCAGKAIUIQkgByAIIAkQBiAGKAIQIQogBiAKNgIMQQAhCyAG",
+"IAs2AggCQANAIAYoAgghDEEIIQ0gDCEOIA0hDyAOIA9JIRBBASERIBAgEXEhEiASRQ0BIAcpAwAhICAGKAI",
+"IIRNBAyEUIBMgFHQhFSAVIRYgFq0hISAgICGIISJC/wEhIyAiICODISQgJKchFyAGKAIMIRggBigCCCEZIB",
+"ggGWohGiAaIBc6AAAgBigCCCEbQQEhHCAbIBxqIR0gBiAdNgIIDAALAAtBICEeIAYgHmohHyAfJAAPC14BD",
+"H8jACEBQRAhAiABIAJrIQMgAyQAIAMgADYCDCADKAIMIQRBACEFIAQhBiAFIQcgBiAHRiEIQQEhCSAIIAlx",
+"IQoCQCAKDQAgBBAUC0EQIQsgAyALaiEMIAwkAA8LNQIEfwF+QRAhACAAEBMhAUIAIQQgASAENwMAQQghAiA",
+"BIAJqIQMgAyAENwMAIAEQChogAQ8LPAIEfwJ+IwAhAUEQIQIgASACayEDIAMgADYCDCADKAIMIQRCACEFIA",
+"QgBTcDAEIAIQYgBCAGNwMIIAQPC1kBCH8jACEDQRAhBCADIARrIQUgBSQAIAUgADYCDCAFIAE2AgggBSACN",
+"gIEIAUoAgwhBiAFKAIIIQcgBSgCBCEIIAYgByAIEAZBECEJIAUgCWohCiAKJAAPC2kBCX8jACEEQRAhBSAE",
+"IAVrIQYgBiQAIAYgADYCDCAGIAE2AgggBiACNgIEIAYgAzYCACAGKAIMIQcgBigCCCEIIAYoAgQhCSAGKAI",
+"AIQogByAIIAkgChAHQRAhCyAGIAtqIQwgDCQADwteAQx/IwAhAUEQIQIgASACayEDIAMkACADIAA2AgwgAy",
+"gCDCEEQQAhBSAEIQYgBSEHIAYgB0YhCEEBIQkgCCAJcSEKAkAgCg0AIAQQFAtBECELIAMgC2ohDCAMJAAPC",
+"wcAPwBBEHQLBwBBlJLBAgtUAQJ/QQAoAoCQwQIiASAAQQdqQXhxIgJqIQACQAJAIAJFDQAgACABTQ0BCwJA",
+"IAAQDk0NACAAEAFFDQELQQAgADYCgJDBAiABDwsQD0EwNgIAQX8LviwBC38jAEEQayIBJAACQAJAAkACQAJ",
+"AAkACQAJAAkACQAJAAkACQAJAAkAgAEH0AUsNAAJAQQAoApiSwQIiAkEQIABBC2pBeHEgAEELSRsiA0EDdi",
+"IEdiIAQQNxRQ0AAkACQCAAQX9zQQFxIARqIgVBA3QiBEHAksECaiIAIARByJLBAmooAgAiBCgCCCIDRw0AQ",
+"QAgAkF+IAV3cTYCmJLBAgwBCyADIAA2AgwgACADNgIICyAEQQhqIQAgBCAFQQN0IgVBA3I2AgQgBCAFaiIE",
+"IAQoAgRBAXI2AgQMDwsgA0EAKAKgksECIgZNDQECQCAARQ0AAkACQCAAIAR0QQIgBHQiAEEAIABrcnEiAEE",
+"AIABrcWgiBEEDdCIAQcCSwQJqIgUgAEHIksECaigCACIAKAIIIgdHDQBBACACQX4gBHdxIgI2ApiSwQIMAQ",
+"sgByAFNgIMIAUgBzYCCAsgACADQQNyNgIEIAAgA2oiByAEQQN0IgQgA2siBUEBcjYCBCAAIARqIAU2AgACQ",
+"CAGRQ0AIAZBeHFBwJLBAmohA0EAKAKsksECIQQCQAJAIAJBASAGQQN2dCIIcQ0AQQAgAiAIcjYCmJLBAiAD",
+"IQgMAQsgAygCCCEICyADIAQ2AgggCCAENgIMIAQgAzYCDCAEIAg2AggLIABBCGohAEEAIAc2AqySwQJBACA",
+"FNgKgksECDA8LQQAoApySwQIiCUUNASAJQQAgCWtxaEECdEHIlMECaigCACIHKAIEQXhxIANrIQQgByEFAk",
+"ADQAJAIAUoAhAiAA0AIAVBFGooAgAiAEUNAgsgACgCBEF4cSADayIFIAQgBSAESSIFGyEEIAAgByAFGyEHI",
+"AAhBQwACwALIAcoAhghCgJAIAcoAgwiCCAHRg0AIAcoAggiAEEAKAKoksECSRogACAINgIMIAggADYCCAwO",
+"CwJAIAdBFGoiBSgCACIADQAgBygCECIARQ0DIAdBEGohBQsDQCAFIQsgACIIQRRqIgUoAgAiAA0AIAhBEGo",
+"hBSAIKAIQIgANAAsgC0EANgIADA0LQX8hAyAAQb9/Sw0AIABBC2oiAEF4cSEDQQAoApySwQIiBkUNAEEAIQ",
+"sCQCADQYACSQ0AQR8hCyADQf///wdLDQAgA0EmIABBCHZnIgBrdkEBcSAAQQF0a0E+aiELC0EAIANrIQQCQ",
+"AJAAkACQCALQQJ0QciUwQJqKAIAIgUNAEEAIQBBACEIDAELQQAhACADQQBBGSALQQF2ayALQR9GG3QhB0EA",
+"IQgDQAJAIAUoAgRBeHEgA2siAiAETw0AIAIhBCAFIQggAg0AQQAhBCAFIQggBSEADAMLIAAgBUEUaigCACI",
+"CIAIgBSAHQR12QQRxakEQaigCACIFRhsgACACGyEAIAdBAXQhByAFDQALCwJAIAAgCHINAEEAIQhBAiALdC",
+"IAQQAgAGtyIAZxIgBFDQMgAEEAIABrcWhBAnRByJTBAmooAgAhAAsgAEUNAQsDQCAAKAIEQXhxIANrIgIgB",
+"EkhBwJAIAAoAhAiBQ0AIABBFGooAgAhBQsgAiAEIAcbIQQgACAIIAcbIQggBSEAIAUNAAsLIAhFDQAgBEEA",
+"KAKgksECIANrTw0AIAgoAhghCwJAIAgoAgwiByAIRg0AIAgoAggiAEEAKAKoksECSRogACAHNgIMIAcgADY",
+"CCAwMCwJAIAhBFGoiBSgCACIADQAgCCgCECIARQ0DIAhBEGohBQsDQCAFIQIgACIHQRRqIgUoAgAiAA0AIA",
+"dBEGohBSAHKAIQIgANAAsgAkEANgIADAsLAkBBACgCoJLBAiIAIANJDQBBACgCrJLBAiEEAkACQCAAIANrI",
+"gVBEEkNAEEAIAU2AqCSwQJBACAEIANqIgc2AqySwQIgByAFQQFyNgIEIAQgAGogBTYCACAEIANBA3I2AgQM",
+"AQtBAEEANgKsksECQQBBADYCoJLBAiAEIABBA3I2AgQgBCAAaiIAIAAoAgRBAXI2AgQLIARBCGohAAwNCwJ",
+"AQQAoAqSSwQIiByADTQ0AQQAgByADayIENgKkksECQQBBACgCsJLBAiIAIANqIgU2ArCSwQIgBSAEQQFyNg",
+"IEIAAgA0EDcjYCBCAAQQhqIQAMDQsCQAJAQQAoAvCVwQJFDQBBACgC+JXBAiEEDAELQQBCfzcC/JXBAkEAQ",
+"oCggICAgAQ3AvSVwQJBACABQQxqQXBxQdiq1aoFczYC8JXBAkEAQQA2AoSWwQJBAEEANgLUlcECQYAgIQQL",
+"QQAhACAEIANBL2oiBmoiAkEAIARrIgtxIgggA00NDEEAIQACQEEAKALQlcECIgRFDQBBACgCyJXBAiIFIAh",
+"qIgkgBU0NDSAJIARLDQ0LAkACQEEALQDUlcECQQRxDQACQAJAAkACQAJAQQAoArCSwQIiBEUNAEHYlcECIQ",
+"ADQAJAIAAoAgAiBSAESw0AIAUgACgCBGogBEsNAwsgACgCCCIADQALC0EAEBAiB0F/Rg0DIAghAgJAQQAoA",
+"vSVwQIiAEF/aiIEIAdxRQ0AIAggB2sgBCAHakEAIABrcWohAgsgAiADTQ0DAkBBACgC0JXBAiIARQ0AQQAo",
+"AsiVwQIiBCACaiIFIARNDQQgBSAASw0ECyACEBAiACAHRw0BDAULIAIgB2sgC3EiAhAQIgcgACgCACAAKAI",
+"EakYNASAHIQALIABBf0YNAQJAIANBMGogAksNACAAIQcMBAsgBiACa0EAKAL4lcECIgRqQQAgBGtxIgQQEE",
+"F/Rg0BIAQgAmohAiAAIQcMAwsgB0F/Rw0CC0EAQQAoAtSVwQJBBHI2AtSVwQILIAgQECEHQQAQECEAIAdBf",
+"0YNBSAAQX9GDQUgByAATw0FIAAgB2siAiADQShqTQ0FC0EAQQAoAsiVwQIgAmoiADYCyJXBAgJAIABBACgC",
+"zJXBAk0NAEEAIAA2AsyVwQILAkACQEEAKAKwksECIgRFDQBB2JXBAiEAA0AgByAAKAIAIgUgACgCBCIIakY",
+"NAiAAKAIIIgANAAwFCwALAkACQEEAKAKoksECIgBFDQAgByAATw0BC0EAIAc2AqiSwQILQQAhAEEAIAI2At",
+"yVwQJBACAHNgLYlcECQQBBfzYCuJLBAkEAQQAoAvCVwQI2ArySwQJBAEEANgLklcECA0AgAEEDdCIEQciSw",
+"QJqIARBwJLBAmoiBTYCACAEQcySwQJqIAU2AgAgAEEBaiIAQSBHDQALQQAgAkFYaiIAQXggB2tBB3FBACAH",
+"QQhqQQdxGyIEayIFNgKkksECQQAgByAEaiIENgKwksECIAQgBUEBcjYCBCAHIABqQSg2AgRBAEEAKAKAlsE",
+"CNgK0ksECDAQLIAAtAAxBCHENAiAEIAVJDQIgBCAHTw0CIAAgCCACajYCBEEAIARBeCAEa0EHcUEAIARBCG",
+"pBB3EbIgBqIgU2ArCSwQJBAEEAKAKkksECIAJqIgcgAGsiADYCpJLBAiAFIABBAXI2AgQgBCAHakEoNgIEQ",
+"QBBACgCgJbBAjYCtJLBAgwDC0EAIQgMCgtBACEHDAgLAkAgB0EAKAKoksECIghPDQBBACAHNgKoksECIAch",
+"CAsgByACaiEFQdiVwQIhAAJAAkACQAJAA0AgACgCACAFRg0BIAAoAggiAA0ADAILAAsgAC0ADEEIcUUNAQt",
+"B2JXBAiEAA0ACQCAAKAIAIgUgBEsNACAFIAAoAgRqIgUgBEsNAwsgACgCCCEADAALAAsgACAHNgIAIAAgAC",
+"gCBCACajYCBCAHQXggB2tBB3FBACAHQQhqQQdxG2oiCyADQQNyNgIEIAVBeCAFa0EHcUEAIAVBCGpBB3Eba",
+"iICIAsgA2oiA2shAAJAIAIgBEcNAEEAIAM2ArCSwQJBAEEAKAKkksECIABqIgA2AqSSwQIgAyAAQQFyNgIE",
+"DAgLAkAgAkEAKAKsksECRw0AQQAgAzYCrJLBAkEAQQAoAqCSwQIgAGoiADYCoJLBAiADIABBAXI2AgQgAyA",
+"AaiAANgIADAgLIAIoAgQiBEEDcUEBRw0GIARBeHEhBgJAIARB/wFLDQAgAigCCCIFIARBA3YiCEEDdEHAks",
+"ECaiIHRhoCQCACKAIMIgQgBUcNAEEAQQAoApiSwQJBfiAId3E2ApiSwQIMBwsgBCAHRhogBSAENgIMIAQgB",
+"TYCCAwGCyACKAIYIQkCQCACKAIMIgcgAkYNACACKAIIIgQgCEkaIAQgBzYCDCAHIAQ2AggMBQsCQCACQRRq",
+"IgUoAgAiBA0AIAIoAhAiBEUNBCACQRBqIQULA0AgBSEIIAQiB0EUaiIFKAIAIgQNACAHQRBqIQUgBygCECI",
+"EDQALIAhBADYCAAwEC0EAIAJBWGoiAEF4IAdrQQdxQQAgB0EIakEHcRsiCGsiCzYCpJLBAkEAIAcgCGoiCD",
+"YCsJLBAiAIIAtBAXI2AgQgByAAakEoNgIEQQBBACgCgJbBAjYCtJLBAiAEIAVBJyAFa0EHcUEAIAVBWWpBB",
+"3EbakFRaiIAIAAgBEEQakkbIghBGzYCBCAIQRBqQQApAuCVwQI3AgAgCEEAKQLYlcECNwIIQQAgCEEIajYC",
+"4JXBAkEAIAI2AtyVwQJBACAHNgLYlcECQQBBADYC5JXBAiAIQRhqIQADQCAAQQc2AgQgAEEIaiEHIABBBGo",
+"hACAHIAVJDQALIAggBEYNACAIIAgoAgRBfnE2AgQgBCAIIARrIgdBAXI2AgQgCCAHNgIAAkAgB0H/AUsNAC",
+"AHQXhxQcCSwQJqIQACQAJAQQAoApiSwQIiBUEBIAdBA3Z0IgdxDQBBACAFIAdyNgKYksECIAAhBQwBCyAAK",
+"AIIIQULIAAgBDYCCCAFIAQ2AgwgBCAANgIMIAQgBTYCCAwBC0EfIQACQCAHQf///wdLDQAgB0EmIAdBCHZn",
+"IgBrdkEBcSAAQQF0a0E+aiEACyAEIAA2AhwgBEIANwIQIABBAnRByJTBAmohBQJAAkACQEEAKAKcksECIgh",
+"BASAAdCICcQ0AQQAgCCACcjYCnJLBAiAFIAQ2AgAgBCAFNgIYDAELIAdBAEEZIABBAXZrIABBH0YbdCEAIA",
+"UoAgAhCANAIAgiBSgCBEF4cSAHRg0CIABBHXYhCCAAQQF0IQAgBSAIQQRxaiICQRBqKAIAIggNAAsgAkEQa",
+"iAENgIAIAQgBTYCGAsgBCAENgIMIAQgBDYCCAwBCyAFKAIIIgAgBDYCDCAFIAQ2AgggBEEANgIYIAQgBTYC",
+"DCAEIAA2AggLQQAoAqSSwQIiACADTQ0AQQAgACADayIENgKkksECQQBBACgCsJLBAiIAIANqIgU2ArCSwQI",
+"gBSAEQQFyNgIEIAAgA0EDcjYCBCAAQQhqIQAMCAsQD0EwNgIAQQAhAAwHC0EAIQcLIAlFDQACQAJAIAIgAi",
+"gCHCIFQQJ0QciUwQJqIgQoAgBHDQAgBCAHNgIAIAcNAUEAQQAoApySwQJBfiAFd3E2ApySwQIMAgsgCUEQQ",
+"RQgCSgCECACRhtqIAc2AgAgB0UNAQsgByAJNgIYAkAgAigCECIERQ0AIAcgBDYCECAEIAc2AhgLIAJBFGoo",
+"AgAiBEUNACAHQRRqIAQ2AgAgBCAHNgIYCyAGIABqIQAgAiAGaiICKAIEIQQLIAIgBEF+cTYCBCADIABBAXI",
+"2AgQgAyAAaiAANgIAAkAgAEH/AUsNACAAQXhxQcCSwQJqIQQCQAJAQQAoApiSwQIiBUEBIABBA3Z0IgBxDQ",
+"BBACAFIAByNgKYksECIAQhAAwBCyAEKAIIIQALIAQgAzYCCCAAIAM2AgwgAyAENgIMIAMgADYCCAwBC0EfI",
+"QQCQCAAQf///wdLDQAgAEEmIABBCHZnIgRrdkEBcSAEQQF0a0E+aiEECyADIAQ2AhwgA0IANwIQIARBAnRB",
+"yJTBAmohBQJAAkACQEEAKAKcksECIgdBASAEdCIIcQ0AQQAgByAIcjYCnJLBAiAFIAM2AgAgAyAFNgIYDAE",
+"LIABBAEEZIARBAXZrIARBH0YbdCEEIAUoAgAhBwNAIAciBSgCBEF4cSAARg0CIARBHXYhByAEQQF0IQQgBS",
+"AHQQRxaiIIQRBqKAIAIgcNAAsgCEEQaiADNgIAIAMgBTYCGAsgAyADNgIMIAMgAzYCCAwBCyAFKAIIIgAgA",
+"zYCDCAFIAM2AgggA0EANgIYIAMgBTYCDCADIAA2AggLIAtBCGohAAwCCwJAIAtFDQACQAJAIAggCCgCHCIF",
+"QQJ0QciUwQJqIgAoAgBHDQAgACAHNgIAIAcNAUEAIAZBfiAFd3EiBjYCnJLBAgwCCyALQRBBFCALKAIQIAh",
+"GG2ogBzYCACAHRQ0BCyAHIAs2AhgCQCAIKAIQIgBFDQAgByAANgIQIAAgBzYCGAsgCEEUaigCACIARQ0AIA",
+"dBFGogADYCACAAIAc2AhgLAkACQCAEQQ9LDQAgCCAEIANqIgBBA3I2AgQgCCAAaiIAIAAoAgRBAXI2AgQMA",
+"QsgCCADQQNyNgIEIAggA2oiByAEQQFyNgIEIAcgBGogBDYCAAJAIARB/wFLDQAgBEF4cUHAksECaiEAAkAC",
+"QEEAKAKYksECIgVBASAEQQN2dCIEcQ0AQQAgBSAEcjYCmJLBAiAAIQQMAQsgACgCCCEECyAAIAc2AgggBCA",
+"HNgIMIAcgADYCDCAHIAQ2AggMAQtBHyEAAkAgBEH///8HSw0AIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPm",
+"ohAAsgByAANgIcIAdCADcCECAAQQJ0QciUwQJqIQUCQAJAAkAgBkEBIAB0IgNxDQBBACAGIANyNgKcksECI",
+"AUgBzYCACAHIAU2AhgMAQsgBEEAQRkgAEEBdmsgAEEfRht0IQAgBSgCACEDA0AgAyIFKAIEQXhxIARGDQIg",
+"AEEddiEDIABBAXQhACAFIANBBHFqIgJBEGooAgAiAw0ACyACQRBqIAc2AgAgByAFNgIYCyAHIAc2AgwgByA",
+"HNgIIDAELIAUoAggiACAHNgIMIAUgBzYCCCAHQQA2AhggByAFNgIMIAcgADYCCAsgCEEIaiEADAELAkAgCk",
+"UNAAJAAkAgByAHKAIcIgVBAnRByJTBAmoiACgCAEcNACAAIAg2AgAgCA0BQQAgCUF+IAV3cTYCnJLBAgwCC",
+"yAKQRBBFCAKKAIQIAdGG2ogCDYCACAIRQ0BCyAIIAo2AhgCQCAHKAIQIgBFDQAgCCAANgIQIAAgCDYCGAsg",
+"B0EUaigCACIARQ0AIAhBFGogADYCACAAIAg2AhgLAkACQCAEQQ9LDQAgByAEIANqIgBBA3I2AgQgByAAaiI",
+"AIAAoAgRBAXI2AgQMAQsgByADQQNyNgIEIAcgA2oiBSAEQQFyNgIEIAUgBGogBDYCAAJAIAZFDQAgBkF4cU",
+"HAksECaiEDQQAoAqySwQIhAAJAAkBBASAGQQN2dCIIIAJxDQBBACAIIAJyNgKYksECIAMhCAwBCyADKAIII",
+"QgLIAMgADYCCCAIIAA2AgwgACADNgIMIAAgCDYCCAtBACAFNgKsksECQQAgBDYCoJLBAgsgB0EIaiEACyAB",
+"QRBqJAAgAAuDDQEHfwJAIABFDQAgAEF4aiIBIABBfGooAgAiAkF4cSIAaiEDAkAgAkEBcQ0AIAJBA3FFDQE",
+"gASABKAIAIgJrIgFBACgCqJLBAiIESQ0BIAIgAGohAAJAAkACQCABQQAoAqySwQJGDQACQCACQf8BSw0AIA",
+"EoAggiBCACQQN2IgVBA3RBwJLBAmoiBkYaAkAgASgCDCICIARHDQBBAEEAKAKYksECQX4gBXdxNgKYksECD",
+"AULIAIgBkYaIAQgAjYCDCACIAQ2AggMBAsgASgCGCEHAkAgASgCDCIGIAFGDQAgASgCCCICIARJGiACIAY2",
+"AgwgBiACNgIIDAMLAkAgAUEUaiIEKAIAIgINACABKAIQIgJFDQIgAUEQaiEECwNAIAQhBSACIgZBFGoiBCg",
+"CACICDQAgBkEQaiEEIAYoAhAiAg0ACyAFQQA2AgAMAgsgAygCBCICQQNxQQNHDQJBACAANgKgksECIAMgAk",
+"F+cTYCBCABIABBAXI2AgQgAyAANgIADwtBACEGCyAHRQ0AAkACQCABIAEoAhwiBEECdEHIlMECaiICKAIAR",
+"w0AIAIgBjYCACAGDQFBAEEAKAKcksECQX4gBHdxNgKcksECDAILIAdBEEEUIAcoAhAgAUYbaiAGNgIAIAZF",
+"DQELIAYgBzYCGAJAIAEoAhAiAkUNACAGIAI2AhAgAiAGNgIYCyABQRRqKAIAIgJFDQAgBkEUaiACNgIAIAI",
+"gBjYCGAsgASADTw0AIAMoAgQiAkEBcUUNAAJAAkACQAJAAkAgAkECcQ0AAkAgA0EAKAKwksECRw0AQQAgAT",
+"YCsJLBAkEAQQAoAqSSwQIgAGoiADYCpJLBAiABIABBAXI2AgQgAUEAKAKsksECRw0GQQBBADYCoJLBAkEAQ",
+"QA2AqySwQIPCwJAIANBACgCrJLBAkcNAEEAIAE2AqySwQJBAEEAKAKgksECIABqIgA2AqCSwQIgASAAQQFy",
+"NgIEIAEgAGogADYCAA8LIAJBeHEgAGohAAJAIAJB/wFLDQAgAygCCCIEIAJBA3YiBUEDdEHAksECaiIGRho",
+"CQCADKAIMIgIgBEcNAEEAQQAoApiSwQJBfiAFd3E2ApiSwQIMBQsgAiAGRhogBCACNgIMIAIgBDYCCAwECy",
+"ADKAIYIQcCQCADKAIMIgYgA0YNACADKAIIIgJBACgCqJLBAkkaIAIgBjYCDCAGIAI2AggMAwsCQCADQRRqI",
+"gQoAgAiAg0AIAMoAhAiAkUNAiADQRBqIQQLA0AgBCEFIAIiBkEUaiIEKAIAIgINACAGQRBqIQQgBigCECIC",
+"DQALIAVBADYCAAwCCyADIAJBfnE2AgQgASAAQQFyNgIEIAEgAGogADYCAAwDC0EAIQYLIAdFDQACQAJAIAM",
+"gAygCHCIEQQJ0QciUwQJqIgIoAgBHDQAgAiAGNgIAIAYNAUEAQQAoApySwQJBfiAEd3E2ApySwQIMAgsgB0",
+"EQQRQgBygCECADRhtqIAY2AgAgBkUNAQsgBiAHNgIYAkAgAygCECICRQ0AIAYgAjYCECACIAY2AhgLIANBF",
+"GooAgAiAkUNACAGQRRqIAI2AgAgAiAGNgIYCyABIABBAXI2AgQgASAAaiAANgIAIAFBACgCrJLBAkcNAEEA",
+"IAA2AqCSwQIPCwJAIABB/wFLDQAgAEF4cUHAksECaiECAkACQEEAKAKYksECIgRBASAAQQN2dCIAcQ0AQQA",
+"gBCAAcjYCmJLBAiACIQAMAQsgAigCCCEACyACIAE2AgggACABNgIMIAEgAjYCDCABIAA2AggPC0EfIQICQC",
+"AAQf///wdLDQAgAEEmIABBCHZnIgJrdkEBcSACQQF0a0E+aiECCyABIAI2AhwgAUIANwIQIAJBAnRByJTBA",
+"mohBAJAAkACQAJAQQAoApySwQIiBkEBIAJ0IgNxDQBBACAGIANyNgKcksECIAQgATYCACABIAQ2AhgMAQsg",
+"AEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGA0AgBiIEKAIEQXhxIABGDQIgAkEddiEGIAJBAXQhAiAEIAZ",
+"BBHFqIgNBEGooAgAiBg0ACyADQRBqIAE2AgAgASAENgIYCyABIAE2AgwgASABNgIIDAELIAQoAggiACABNg",
+"IMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAK4ksECQX9qIgFBfyABGzYCuJLBAgsLMQEBf",
+"yAAQQEgABshAQJAA0AgARARIgANAQJAECIiAEUNACAAEQMADAELCxAAAAsgAAsGACAAEBILBAAgAAsLACAA",
+"KAI8EBUQAgsVAAJAIAANAEEADwsQDyAANgIAQX8L4wIBB38jAEEgayIDJAAgAyAAKAIcIgQ2AhAgACgCFCE",
+"FIAMgAjYCHCADIAE2AhggAyAFIARrIgE2AhQgASACaiEGIANBEGohBEECIQcCQAJAAkACQAJAIAAoAjwgA0",
+"EQakECIANBDGoQAxAXRQ0AIAQhBQwBCwNAIAYgAygCDCIBRg0CAkAgAUF/Sg0AIAQhBQwECyAEIAEgBCgCB",
+"CIISyIJQQN0aiIFIAUoAgAgASAIQQAgCRtrIghqNgIAIARBDEEEIAkbaiIEIAQoAgAgCGs2AgAgBiABayEG",
+"IAUhBCAAKAI8IAUgByAJayIHIANBDGoQAxAXRQ0ACwsgBkF/Rw0BCyAAIAAoAiwiATYCHCAAIAE2AhQgACA",
+"BIAAoAjBqNgIQIAIhAQwBC0EAIQEgAEEANgIcIABCADcDECAAIAAoAgBBIHI2AgAgB0ECRg0AIAIgBSgCBG",
+"shAQsgA0EgaiQAIAELNwEBfyMAQRBrIgMkACAAIAEgAkH/AXEgA0EIahAwEBchAiADKQMIIQEgA0EQaiQAQ",
+"n8gASACGwsNACAAKAI8IAEgAhAZCwIACwIACw4AQZCWwQIQG0GUlsECCwkAQZCWwQIQHAsEAEEBCwIACwcA",
+"IAAoAgALCQBBnJbBAhAhCwYAIAAkAQsEACMBCwQAIwALBgAgACQACxIBAn8jACAAa0FwcSIBJAAgAQsEACM",
+"ACxMAQYCAwAIkA0EAQQ9qQXBxJAILBwAjACMCawsEACMDCwQAIwILuAIBA38CQCAADQBBACEBAkBBACgCmJ",
+"bBAkUNAEEAKAKYlsECEC0hAQsCQEEAKAKYkcECRQ0AQQAoApiRwQIQLSABciEBCwJAEB0oAgAiAEUNAANAQ",
+"QAhAgJAIAAoAkxBAEgNACAAEB8hAgsCQCAAKAIUIAAoAhxGDQAgABAtIAFyIQELAkAgAkUNACAAECALIAAo",
+"AjgiAA0ACwsQHiABDwtBACECAkAgACgCTEEASA0AIAAQHyECCwJAAkACQCAAKAIUIAAoAhxGDQAgAEEAQQA",
+"gACgCJBEHABogACgCFA0AQX8hASACDQEMAgsCQCAAKAIEIgEgACgCCCIDRg0AIAAgASADa6xBASAAKAIoEQ",
+"QAGgtBACEBIABBADYCHCAAQgA3AxAgAEIANwIEIAJFDQELIAAQIAsgAQsNACABIAIgAyAAEQQACyMBAX4gA",
+"CABIAKtIAOtQiCGhCAEEC4hBSAFQiCIpxAjIAWnCxMAIAAgAacgAUIgiKcgAiADEAQLC7aSgYAABABBgIDA",
+"AguAkAEAAAAAAAAAADGyfhfBM8W4CfdqdtFBU0U4RRRhEHKW/RLu1eyig6aKI1yr+2OwYzIbGb+ac8L1zyq",
+"rwY2y8TB3T088gRYhlCF+/UKW1xJRmUa4VvfHYMdkdwoo4AZTAtxdoelttKIyq2wTl3p1kfcTVFaDG2XjYe",
+"5l5P0MpNCkVp6eeAItQihDrywGFexx7fuXaRJ0/AN7BqbbbGM9ML6+jHCt7o/Bjsm9wtP5TvJLcYWHx5heg",
+"N2MtDW5j5+zGDTR0USDO2O8YuBjOpT6UHna2CYu9eoi7yfplFDiKxEqn8M/kW+Z4Bro8o3veFjT31DKyPsZ",
+"SKFJrft6hQ6JkowVPD3xBFqEUIYNj48Tm7eVPjXKm3KLxQPDBHjlZUr2xnsu0yTo+Af2DB9hWv85NDO0JyR",
+"OnilGpUkWljCJ6HVg8XNyzYVMpcSnQsCzko2WAR96hafzneSX4ks32eRc11JaYZwYae4mYi1QLmZ+LxWnlW",
+"hrch8/ZzFoWdkMCP5U9NCio4kGd8Z4xZMR9xG29b19q1TjcKaHK4Ca5p1nZ7TuOLBNXOrVRd5Pgf8i/RR2G",
+"/e5ujacBASNCogISIvFN0iy7ey1h2Hn7OTcXsuQoNQpXOQb3/Gwpr+h1amh5nGVehn/AmBrw2RKbs6wHnwC",
+"V4/W9vUKHRIlGSvHR3QK0xbckxPpdVHnLng4IlsLRiYdvYAaHh8nNm8rfSusYTD3XO7FAQegvUWt3rIwtd6",
+"qhJ4bCgjwysuU7I33OUK03FXfSE9cpknQ8Q/sGW0UN8cwPCmhVVEjpiBOv1xk412x4X165E5InDxTjEqTf/",
+"riK5K/jytHv/ZKgs0Z1nYNiF1D/txujXcNU8psUHu8xXNEC1+Vw4SAZyUbLQM+tTIZMtoexoafmdi/aO/28",
+"a4rpqip3DNJlm6yybmupbSn3MzeeJ1gDMI4MdLcTcRa84pPxR1+AeLLz1ukDQyXH/p9JbPMP1Kn0NbkPn7O",
+"YtDhZJopv/2naNkhjkivjzGV6JPwX2689C0v1IRVvaoovh5m+kJ8me0GJiPuI2zre/sXkZA0rdi+Qz06Ubk",
+"fKY40DIgvrt4aS4w0zTvPzmjdcQV/RdgPWxjJYJu41KuLvJ9RKcbDarh5J2ls0qJ6yu/aWN6stbv5KmJydW",
+"04CQgaFUPHEy/IO9+te4IHTthJSVBKMHlZGXqM6LFK/FeQ6AD9gPiCQFHbxUW4vZYhQalTuIkP6DaAmpYAo",
+"6QpuzJrpneSFles81hjz6pTQ83jKvUym+E92iIZMIr+BcDWhsmU3M+3vsFH+lFk9/KqoFeIx5nGQNS3lrsC",
+"IezrFTokSjJW3VlrLeV59+7lHH9M9QthE9SuAVs0OKSrJtLros5d8HAXYJW1D241yC8lgdQfHKM1Hpf/w94",
+"vZo00PD5ObN5W+gWOQFmt7ZNCPctUOL2fBb8MeSovfKzAB2md1yPYfGRRWC+pNBlPoelgar1VCT03FFHYw0",
+"LIDvKse3MCz3r/wttKwXzYu8wHY3KEaLmrvpGeQzYWrmqNVCa4TJOg4x/YM4n+7bciLB2Lsbv51jJei3aAC",
+"YfB821OzqqiRkxBnH65mxA4W4CvuwGjVSw6kN0t/JLnUi1R7uhE9wOvIfU+TBLGsdE2NA2Jqv70xVckfx9X",
+"z0a7QOVM2u/l7XrNV73qmNRfBNqWji8g7BoQu4b8ud3dqG6sR898ZRrvGqaU2aD2K11ksVXqZU4TGHDQRZj",
+"zsyKqDseEqzYLCAHPSjZaBnw5s7Fd92nDxAH2pTznG1U5METbKyYokIFVoCYngvg012QSWDBDy/FvXFdMUV",
+"O5Z5Jt5TJGkoqiKkdO88sge5JddvyN3OFIV+VOuZm98TrBGH8L56owCQSghHFipLmbiLW1wxyzeKhNDY2GC",
+"NJo2tvwvDR2xanpHkiWn7dIGxguP6ctyV/aK+uHn2jdPspZfXqu2qMpC2q4wss+XiWvuhyU+owgMm6J2SzC",
+"yTRTfvtP0fN7SkS/yIpp2dCLyQ05uh7oYvXezAp/ptAn4b/ceOlb4ZWfqB1LLOM1O57zKXOISASJ4OToQE3",
+"wPMz0hfgy2w0NfoqSOQEetSfVSx+L8C7CFmc1CErD63ouIiFpWrF9hx+QX36bgrg/enSicj9SHGlLxtxl/m",
+"HZ0XODyATuE08sQjG2Ey8gipRomneendG641koCYlc4n9bYW0d6EyQ6aZQ32P/jaMsHqul5vEEMaALmheY5",
+"sUCZbOiUoyH1XDzTpPg8pAUQzb2uUszHaayBoGI+U0KZ4HDObC8WWt381XEgQ4nfLbAkHzk6tpwEhA0KtVY",
+"pGfTI/GS7R2wBsNRZ2/cr84RAmKi1/YED5ywk5Kgx7Zxi3GgVxj/82XqYdLB5c5BG/2g4QRdCQZv93P32M4",
+"4tBHgssQddgDxBYGitouLMUN7lmOFTjMb6Lob0XR+RCpaxAwQR7v8Eh/QbQA1LQEjra56wQbouUZJU3Zl1k",
+"zvd/stYaTliVdPvjkAtJcfqn4MRxd1pNoSVKeGmsdV6mVlFfiNBmYv3V1Q7OwWFLkgbOKS+9cnfJiXmBf1X",
+"rXwjaYqaeKfhjU1nm99g4/0o8iv3QOUTsdmcIV2whn8NlYHtMS8Dj0Fk7+MgahvLXcFQr0z1njsRMD62Ncr",
+"dEiUZKzpZVVjiaehFNEgQQKZ1Tfp4JI/FVjm8lHKOf6Y6hfCJvuLgI8rJAeew86U7jtWkWPyfOr5+mVU2wA",
+"AAAAAAAAASEfgaLc09/b7HVeJPU832bNat+GKe8Avnag5Sii4t4bV79kin4xAcGa1bsMV94BfLvKOq6LDd6",
+"lRwuTMA1a2ORmFBKS0YkHPqt+zRT4ZgeDimFMtiS12Fsxq3YYr7gG/hC097pza9kk3d4oPFqE2Zn8wamehl",
+"cGQooTJmQesbHPqwynxsJibhVmZnhA641uqEd5+eI3XrFw/LPDTLxTb9XdrELuYICwDxDGnWhJb7CyMdkcy",
+"pW8b2vNGLVUE+tpKuwHNPbPOLbwIW3rcObXtk0AcmrSOgRplbu4UHyxCbcwmqfR3m3aaOpXzQ5YRDVoV3bS",
+"j/qY5reNECZMzD1jZ5gxOc1u4bC4QvxTEujIX7j/3UyTShSMZydmhqnkn4G5gkeZKEZDUmZYivP3wGq9ZuW",
+"r7HZitm65PFct3/wwOb99djJeXuzqYKe7WIHYxQVgGppHAHoZ1r/CIY061JLbYWcAkrt2Tgi+vc34ZPBn57",
+"4A7OflUrs0YduaNWqoI9LWVrsq6wr/AQmMdkA0jNbuCTFXX7UuCj3W6eyVj4CBMAhMzYoOIl3j15YA4NGkd",
+"AzXKyH/UAao3wjy3T75mC6IDrP8IXg68lvRaTFLp7zbtNHUEFQmHgdnDgyrnhywjGrQqYqBnRJQuQ9zR+tC",
+"lHlWD85m9MM2pYXQF44GxP02Wa/mrxlFX+qKcDxic5rZw2VwgUNsG3sftq9Z+KYh1ZS7cfzZuaB3SGiuJhT",
+"Tf/Fhh66bNcz+U71UcULJDVfNOwN3A+gS1m/n0KjZJXgJ6c4/qGQEZ4hLEux3vL+tsuWZ4akZnrIzR0Uyds",
+"NT2OzBbN12fnLHbWOwDqmlBBXimSjoHiglCmM79DvB8uhgvL3d1MFPyX89HwEHHpdytQexigrAMlOqhhNW2",
+"R/onsBZlX82H1W/39g3o+XAjEMecaklssbNYgHwC/lhGRevay+N0I4Zqo50ri8MXcZyNb6UgYdQGNcUoRUj",
+"W4PHDdnLyqVybMew+NRLB66/GGqeIIgxCzrIf78/CZPX6RelclXWFf4GFxhTSle3ItXIwOiAbRmp2BZlyZ/",
+"su3ULyb8E9TM9XOTJAiXqsp+ANxbb2SsbAQZgEJr4NJqj2rPPQDVeRSXzXM/9FEHEhy+PECWvi/4ppILOgI",
+"6Uf4t4URFaQ/6gDVG+Eedi4SGvjW3OPBQzrlUVi3mxNSwv98lYpmv4RvBx4Lem1tlZcdM8ZHkOYpNLfbdpp",
+"6tDjMrfa7p4cY7mFVlCVXjMr/mU+56GpxVTOD1lGNGhVHInvMfEAn6Ov01jQe3tfjOeUuLjMT6h6yWY2E26",
+"M39OBIdZ72bgoJTJ7YZpTw+gKejyB8uT3H/ytkPQnyQoOxuXXFE9+PvkwVo2jrvRFOR8eykPGQ3HO6TA4zW",
+"3hsrlAeH8tBVaGTrbLJZrk3P2OmYNieoxryXlv/FIQ68pcuP+0FfCDfWhPCQdPR2L3E48mTwinCkAneNBh+",
+"imh4uQPeSm9yclV0PiPmud+KN+rOKDSoJ5AaJ/PVg8UPb7OpmK1R1Pd1nmSlUP0CWo38+lVbLxOil9E3aKa",
+"krwE9OYe1TPa++ScUSoixWmhU33bUeLqIeazFWxlFRxe1tlyzfDUjBaRORp6xCN6pcuO+/C/41XtjG6TR4s",
+"Uo8N+4DjlSGMKizkAUFJ8lPw4Y7ex2AdU03AkV9lvM6Ml6ZlnFMZS1yCh3od8cWYg1hKEMJ37HeD5WsPQ9U",
+"wpFw90MV5e7upgpjx2vjZZ3pdQjywJ19OlV3/Ha+m/ZJGgibhbg9jFBGEZ8BxjsHIwlu9DRtRR+EtWwAsBN",
+"DlPf6E2JfO6ku281p9ttFr6Woghad7u7RvQ8+FGlqkNc2fHFrBLHa6Nwf67UwNaTuV2ykylsAD5BPyxjIr4",
+"RxlsS4V7fNa1l8fpRgzVnvJ3r15y+yMtqMBO1Ak7DGXvICZjPcz6Gt9KQcKoDWpSmKopdZz6nOHCHcj/5zq",
+"zqYX9oEjTzUWHd3ML6hC67M8wk2NdJE0afGokgtdfjTU0LcTqYGt6w04RRRiEnGU/BlalcDOoksm1DBKRud",
+"NS5v1L8vkO56UQ07l8Uqwk0rmb/pw6GxAlTyikK9uRa+VgYOPLsyZfEpYf06HUh8rTBleUQbww/iTw5M72X",
+"bqF5N+siRY1DbETKYJ7mJ6vcmSAyjx49hhGk3Z5Zs8Xkj1TWTEhL38lCaSv7JWMgYMwCUyk0mzpNAT+uheI",
+"2wi+fz6VX887YAlLyWNxPbXLq4i+yjl6VaMcvEk8iiDiQpbHiRPCZwIqIfN+5b1XaE2AZr919RCIJTdSSIN",
+"GSj/EvSmIrA4N36wKHX9aIP9RB6jeCPNouLFvH+r/BdviBo6VkT8qk6Xm5iKlyNwKGNYri8S82UJfNkM88E",
+"sv8QWBoraLiwC5QmHKAb989pew72GjfAtf3/cPCRRI/KlsrbjonjM8hiTqWIApB8twW9oy54iSCuATndKPP",
+"6b9FqDHZW613T056ICFBgLpys/GcgutoCq9Zo4168UXHkqQPW9cJJ1lir91KLxMKlF9SaicH7KMaNCq4Nv/",
+"2jtcJ1xTgUg7sSfncxvGqFMGExCFNTQm+KTQZyx9c8aQE+SQ2s4pcXGZn1D1hm6RGS6rpwP5Xvt+jz5mk7E",
+"ZGxY4CpFlAkOs97JxUUpKBEyfBUWmvGT2wjSnhtEVLLEiXBCyJuOf65W9msnmzNesddUt/RE6AAAAAAAAAA",
+"BdMxKlPcGwcbpmJEp7gmHj51U270ZD0ZIfXt/MpSIa8kJtzWmY46qDpTj7ht6gexH4C+kj42HLYFUvKcEYY",
+"+3QCBw7ZCWiXaHvSQ2LY+GMM7J6Hy5eIDxCSnH2Db1B9yIXQuSogIBHU/AX0kfGw5bBrSTA4vsCJrDBzcXa",
+"YuADlZz+139fIbPke6vhkBliYnYmmPM1JKPSB96TGhbHwhlng6AIs/oDqRZk9T5cvEB4hDnGLPmBgcj1lOL",
+"sG3qD7kXJ0f6+R0JeNC6EyFEBAY+mc7fa9DzAP9eLvDPX36H0t9aPIXLiYETGMdoXnaQjlVRs6QU4meIlJe",
+"kIHO2W5t4etDsOSKsnbm9Tbjin7WS//Q5dKgLQpQ+M9lbDITPExOyrZdGEDgV0nUww52tIRqUPEQP1znWHF",
+"X68JzUsjoUzzuEUJ4mzRIO/BkERZvUHUi1bcgPDyMbiXKN56uArpyk8/kr4RRZmmU0ZH86qUCVI30Qs3A9t",
+"5PiuKMXZN/QG3Yt19suSycdt+pKj/X2PhLxoz5Dv2LJFDBk3mwb7USTHeWqoFF5s5XcIjf0isSqmpprQzjA",
+"UF2cW633q8PbsZTBbINniU9GkgCrHjNS8l+dRuJq/xhmqJuHJYrQvOklHKqk/hz2fdIaa2NjSC3AyxUtKhe",
+"EZ1Q8E+zvSETjaLc29PY8iKn8QDA1MaHcckFZP3N41RA41a45sr81P5xaI76fPkHz1s7UuF753KcNc823GL",
+"Coa0fnOrHZdhz4RGzWuUO3aDQO+CG/gnD1YNVFOLDEOYGsn9HPtgX+YYM7XkIxKH8VT3HKtTfpuIgbqnesO",
+"K/x/Nfg41s+bjRPc/QBPLb6oTu/vpXLsDtmputlKNK/fS/SJy+8Jbm86DIIizOoPpFpRsTBp184UK7bkBoa",
+"RjcW569cUI6xMdchG89TBV05TeBvAxmRqj+MJ/JXwiyzMMpuhpuIuEQ2C6lmtCw3ybEmKBJ4ZqM+t+fvjyy",
+"9Hie4oab74PeK0L5gYOxkkN7srYyNmKjaShurTUoF/AH3AqQLA3EwS2P1osrEkR/v7Hgl50Xl06V4jyMmgn",
+"iHfsWWLGDLDEs0UWEqoQ242DfajSI7zMwUfU56JPoLUUCm82MrvEIljOxnlC19hcWjSOgZqlAEsW8CfO6sk",
+"cMsO9nB96PXilj3k1UApRZP61OHt2ctgtqfn80jkCtDHQLLFp6JJAVUdgdcCn4ixJOWKPiF86XpEuLkshEE",
+"oyjVf7BprB2sbpwLfCM46qqvWr/vILMGojWbyyNqJ/Gk9FxWd7Ga6KuyFSK7+w4frXPSwpRfgZIqXlO2WBU",
+"VZSyflCsMzqh8I9ndX8CEPIslGBqQjcLRbmnt7+RBiEWZbywoeRVT+IBgamEN2Rlsd2arpu32veP64YYnmT",
+"r3dw3nR+AEbizKFOgBqXCiZl7j7sBvxDFl1Q/mWq6w/S9B+OCbaS2p9Pzh790gWWW+aBbpHOe5Shrnm24xZ",
+"s2GUHNsaPChUNKLznVntugkHsFagmF3LZe61bjl6eO443afLBLvIn9+IkSRC+BkNgruDgX85qXx6sGqinFh",
+"iHCeDeAehmdJtwNZO6OfaA/+d5VxN2huzjjDBnK8hGZU+bfKOChzYJU+Kp7jlWpv03deUqkBnWkSsL59DY4",
+"Q7j8xyrFHGufo/vZX5Zyn/ue4vyMp1jMJ4Xl5NK2xZzXylZRAYfvzwvRUU901IE7b+xIaqflq2iz9091J1s",
+"5VoXr+XD0ahMFWfD+boE5ffE9zedLUghXouHW4FGARFmNUfSLVFN1c96N74xKJiYdKunSlW/1Fzd5NcmScH",
+"WppUcD1SR1ppiPFN/OI2vTy+Hgu/M6TgD6y7Nn6D1YzmqYOvnKbw0dW7JpJdFoE2gI3J1B7HE2uzn2zp33d",
+"ik7h2Twq+vALOi2TqN38McyneUgVxPN3hdO1AoEz9bZDZyYBCt/9LIIT6kueKPvtRY6+kCMx9KsM+nLat8b",
+"yassaXX44S3VHSm6RNKy8c4aN88XvEaV8wMSHCaWFUnoBAdjJIbnZXxkYrAVrLS5Z2N8xUbCQN1aelkWd+g",
+"TAUF9RpbJei03XctDRfhQfutGzF0wqz6Kj3vVeOOaFNlTYNJiMdYa9uNCuWfi5zClP1m+eZe0XlFbZKdcRI",
+"V0Aod/oEPEO+Y8sWMWRhcKzG9teBFYYlmimwlFCH2xaIjI1V4Pa3/420FLfF0+rMnxEpdnWiDZmp/m81pDB",
+"QqrtbUvQUQaihUnixld8h9ZJA3YxUb1ASx3Yyyhe+wk/0ZJf31g6z4tCkdQzUKAO/47bQMRWYcli2gD93Vk",
+"ngBYWSmkqX+ZH9jnu5qfYy8aC9aRyUN4KAR+hf89J0UxIa201W77XjY586VIPgsRhYwglGJt1wqCklXHDJm",
+"zN5u3hvYmym8snKgGSLT0WTAqrdV5nqeFKy2zoCrwU+EWNJZzG9oAPQ0zjKFX1C+NL1iJcmb+fFE0X5cHNZ",
+"CINQlGstQEutvpEkGtVLoo5d8O96iHiwK2AxXwtvLYbEJnKOmTIelGEbsz7oXveRWYJRG80DxIP8v5CrvOS",
+"RtRP503ouuaKntsQSyl9BqU6VJ3MBPxyaXDAasrFO+89q31zxYNym/Hh6YTDQrQvYuJiaMvYdVuuqPafzRm",
+"yxvpzS4bCX/uyNjnfccSePFIZnVD8Q7O9JtXXxAtFcnq7gQx5Eko0M89NRu3lTPX0AAAAAAAAAAF6RFQ9Ib",
+"Nu/17G8RsP+b0uJIKlJi5K09K5jeY2G/d+W8PJsgs6RBCl50sXLRQOw3SdD0MQNb2tiN1RlQl7dZhlpxXBN",
+"FrG9puDl2QSdIwlSvnTMC9VP0u2ZNxzP2CC5j8emCcCQTGIwToagiRve1sQQF7WGU7INe26oyoS8us0yMDn",
+"fi/TWFo25GXbCf0SieeeIY803KHnGwMuzCTpHEqSeWqYGcivJGxd6D0/5uX3vSesaQLHVplBZ/K/G4merKw",
+"dtusmqC3CUjk0TgCGZxGDQ3AaPafUf3/ef1ktkmnS9qQ7DRCz2rwIgLmoNp2Qb9n6/fwLvCMBJ3FCVCXl1m",
+"2WCwYAGMRlA2gvhKU+6i/QuVXA8QPLnL5FyM+yE/4hE8yyi+Yu35J9MpYJQwjx2K7j7E0XNdBrwB+sE8Esn",
+"qP18tZXlRG/EJsM8tUwN5FaSN2IkWQKsOkmIRWeJxqFVIuob9pzJ6Tn5VZLWNYBiq02hzEcgjyrHlh6y+F+",
+"Nxc9WV+xpSoKNo43oZUnjywYxORw72PbETl3ioxybJgBDMonBQgozDwteUn7LKppGgMzmipW7j0nIoD01ha",
+"w6z5sSME7bPS/A037r8VIdholY7F8FDIyThhCAhLorz0NCHe/v2HVeVk1VgzRn/H7/BN4RgJOi7+oLln1bL",
+"LihKhPy6jbL5jA/HLqG7XRvEJZVMRRZgDGBg1p5eII/FsJTnnQX6V1IU0aRPHsy4sFz79i36YYWn+L61/+F",
+"XamP9U9RrDdQ0tFkWl7kW4ttWETzF2/JP5kG1eYYJ6XkJiGWNtwqyo9Efwcj02KmVPv2J4qa6TTgD6i2n5W",
+"hWDuw1gngl05Q+/mImPWYBjwgRgG4XNGNrpSyXylJ3sXCTw14apkayK0kbyb7jBWAwf/Qr9slXAtTSyTxSj",
+"BTQz+Qm+FdhdUQjZ3gv8yQ2ljhRl827DmT03Pyq2h9LJybHykUTz78WJZwQnYRr+lX3hyZyZiPQB5Vji09x",
+"h5VER3i9oJk8b8ai5+trjpgqhXD83YRs0ADXEhhwuXt0RZTAA0ZWsqSxpcNYnI4lAPTmEUOqYcdI3rRzpwd",
+"c0Oyb96G8MbMU6XaWNVCy7cNNM9XnS4QCIQUZh4WvKT82oVzEV7Qf0P9xqPVU78UIaNXttob08+eKncfk5B",
+"Be2p05gqc2C2g1QpZdZ43JWCcVMhgkX9JuyPd6MnY9NsP14N53Ne8t9RopDoME7HYvwr6qxkc+bRktXOLsF",
+"VyJtBBLRqlWjpKC/49DRDcafgGhWOcBdMhlN066rysmqoGac60LbmV4mqycZNuaVHvBdkTzf98XqdpAqxE3",
+"9UXLPu2WBpOwBhkl23nG9DCfrfztKJFQddx/59vHcxhfjh0DdvpkvBrNzxhAFa1s7vzMQ5rNOsirvx5YrCL",
+"YgIHtfLwBH88kxK6upzfwCyEpzzpLtK7chWyM6FCCQT7NRt6KtC98KWkDnVivGZPgufesW/TDS3cdsu+J7/",
+"WklVWYvesLWJmC8d3+ORBudl1eAj6C0l5kCvpHfVDJaIvosm0vMi3Ftv8WKGzgNvNZNsbcXeNtKYGhYpkeM",
+"XYfbkMqs0xTkrJTVI72D4GJhLyQixtuFWUH4kcvXi3HfjENpWd0f6WanDCywzE8d4Gq33sTxQ102nAH7LeA",
+"TqbBRugO/6ocxCXr1Rlb718WPt068eAV3fOhi/HmRFCeIbq9HgQMesxDXhAjE6g/j5FFJszaeMu+kh78FE3",
+"cjv1ABcr7r5SkryLhZ8a4MOHs8PpRKXw1DI1kFtJ3q5FJzrYN5JhJ2WOc1OlJpV59Jt8G8n9Kl63S7gWppZ",
+"IACZet17KTfeJBvf+1Vj5A9eX4vGdNCK8qSid83I84vX3uYj8OlA5Sn6ZIbWxwo2+IAg0uvmuVgEHS+R+9M",
+"E9Y1na8XG8rebc0PpYODc/UiiOa003f1OJl558+LEs4YTswO3tvmSNX1NJzUT37x/rpxdcUfinczAYMB+BP",
+"KocW3pujpQz4nCAxeeuPXpp4jQxuT8odSGO746jcehtRRmCaf3g/WINdVnWdMBUK4bn7SIqUUEkzos2nQ0S",
+"keDD5F3/U4OE74uIhkDaoy2mABoytIQyOKlIdukLlCWNLxvE5HDKtJggU6g/z0OUMWnYOos7HQUkZpBWUIQ",
+"6RvSinTk75mTX4a3VVeBZ7fdI5F7HVK2zZl3rFquPEs3ZIun5o09bk0g35rHPlOQaaJ6vOl0gEET5i6ByMf",
+"uvY7pbZH9ekM09K05rNzJLcrQL5yK8oP+G6pryLfTMJDn6jUerp34pQqQcUqTvEvL9LTz77WSARglzre7iL",
+"OydtlTuPiYhg/bUCn8rKWnvLWuDX4Jg4n2Zn93Ol2+qEUIgfyF9ZDxsGQwhsGhrdADCs6iQwSL/knZH9gHU",
+"Lbf+rfjRQgTpupHGmo/TEeby/R0lBvO4r3lvqdFYYq2gMQNybkh1GCZisX8VFuQNKSrdpKqfxKRgoU8QXsF",
+"VsW/pI8vh5hZhq+RMoIO4h3SkrCB7PDGn3e0nss/IbzbI4m/eFHcRibfggNbUPk8You/Iug+BxjgLpkMou3",
+"WYqR6pC0Rgyr/qzm0GKwuo4XvbYk5H0BdoW3IrxdVk4zbKZySNub9cJt3Sot4Lsid4TMetlmdpmPFsbuQd9",
+"d1sr/1761WZBtOIvqsvWPZtsdYvviAQmrYOXw8XaZsIAvoBngJm02TZRQAAAAAAAAAAdw3hKr0Wpj7uGsJV",
+"ei1MfZkXI3/HO+pD3DWEq/RamPqrOGWBSUw+xDIvRv6Od9SHRSKn1DNhcrnT+J8PupPpwaT1fiUHhU//PeJ",
+"dWsC+pbxK77xwfagDgg/NG6ROyXE7eMD6jvPf1wXh19nxNOQ9RpbaONuJ8pt4zWKoRycBCre6b0ltmhesiS",
+"N4ahJdLEbKVHWLOOA64PQRVyzs01uSTWZazcZuTTRz/03uual23jCIQA+TFGB4Dh6aN0idkuN2aZfWYiCER",
+"UjwgPUd57+vC4eNFDdaqQk1wq+z42nIe4y1olLJ1N7dsiy1cbYT5TfxW7iQnK7zkc/xVsfXHSTNWoZbJv2g",
+"MmtkH0wFgmcJgSdoQeSo2h8nGS1jQ3zpflWgWm6iVlRo857DeYEpk1MZ3bR0YAMuRb/jIq5Y2Ke3JJtVo7n",
+"yGqGCpcy0mo3dmmjmu7l7p2CMztj+m9xzU+28YYmWPVnu+xpfEIEeJinA8BxnjP8MlNZWIjw0b5A6JcftSz",
+"mOuoczYdPSLq3FQAiLkKUjTO/9Hi2u4AHrO85/XxeXDAoRc2n5KQ4bKW60UhNqeRbIRAlEtVTvzPCfgLYuL",
+"JjBEbU9oIgSAdYyyvqbYlF229PgR43EbzP5dDR07LbWRPSVHsn6EOjd47ZhDsH6q6ruV0uz11yV4q2OrztI",
+"mrWVoG+Fhl48iwy3TPpBZdbIe7qt0PxzcPY+mAoEzxICT0mV6y5yBKRx0ILIUbU/TjKnjyl7CCnoDDFVEaC",
+"B23N0RljwijzN1UrfT9P1+/Y/CahCMt9G4Jk37WCVC3WB646abXQhyJdNsAN6V14PrKfzdHe2dLK6Ac0vzy",
+"boHEmQAljCx8KhXzY8wdXkvWZk3H+22AWX23J6QfP6okPoEwj4hPdDaVUFrsYd4GAWkj5EhWrtgTwvKOK7/",
+"De556baecOLOljNG8zf/RIte7Lc9zW+ZSCamGHhk4AgAj1MUoDhOVcP3GbvlkcHzhj/GSitrUS5FR4zlbsL",
+"ehP7SXgmbFfvZPaoUpt68dH94YstXEEbkorsagfhV72sz87N09I2zxW4wyz5byBpKyHUD4aoG4NoVtnurBU",
+"NJVbAA9Z3nP++LrcON10h6RgQLhkUIubS8lNZFPUIW8RUbRw2UtxopSbUazuz9tWzgOryLJCJEohqqYUhca",
+"OvnsyX3pnhPwFtXViplAAVvHv7ZjCDI2p7QBElR47CQMZWtxsCrGWU9TfFonWhhL5IIWOc7LanwY8aid+bu",
+"0brMgwv4Q1hfjC7/rSZemyfGgboEqfje7xlwdP45JR2XU98xV7a0VT6m0+kLGOmWRux8rKKXT9OOM41iWAe",
+"SEPZ5IifxiCvyIoHJLbtX9jFay2ZoEthQdJIUl6boSI236l4440HHHP9DqzQ7HWlBPDvhm3605ud58z5qsE",
+"52OrqLdMX15/mfDAVCJ4lBJ4LPfQiIzOioJIq113kCEjj5Sc2d1ke7t2gBZGjan+cZNcIcInXaTpaTh9T9h",
+"BS0Bk5ErLcrUR2J2KqIkADt+foFafDar6hQdaMsOAVeZqrlfu9AT/EjA2rvp+m6/ftfxLJkkfBSvvZLFCFZ",
+"L6NwDNvJ4iFlDDWlVGxUr1PuSQOKcZfXGUEMqgXX0h/GsMJQlQoRZ4wfh/kam1nOeRNfpbTGmrYzvBoMO2D",
+"ffuxN1ParvRwGpuKRXyQXp5N0DmSIAUpk6z6hISGO7CEj4VDv2x4x4lur/6pykaCq8l7zci4//WmKFFw3h7",
+"BbLELLrfl9IIbvOoECvNSvI1m0t+DAcnE+msz9T4Xb/pjfBCK+SyFuRRx8aBEOiOHUVNWdHdbUT4mXrdeyk",
+"33AL9JlCENdh1DyER1C7Bgu32T/OWXHpMqsuTxBL2jhYyMfeYnwmS+Zs8K68bo2ajA8U/JYTzqybJIOMSAF",
+"lffFHah06NpkOT+NdbeQkMt8lgLQAR6mKQAw3M3CZuyGRZlTa4euM3eLY8O2RNZ52M7KTCcMf4zUFpbies8",
+"HxntTP23cis8Zip3F/QFJt1Ml2Gxyk1lBKgf/nfqOmjlgqLo0dSjf8b9ZdM7l9RyJ9fYxZ2pkVCAA+uk7xD",
+"mXWEpVrJJLn9KQlaRiaNtCEejfCyfBVOenZunpW2eK+mQeo0YezgVcIdZ8t9A0lYHirjYYlZ0aEKoHwxRNw",
+"bRNaX+JuwhoO+sst1ZKxpKrNu/PHOWDOySgAes7zj/fV33Ck3FhenbY24dbrpC0jEgGRCPkP/Elx5cMihEz",
+"KXlpys/yW5xs0OZsijqEbaIqdrFJQs7C54P5FP/M+CCbJScJPLSyj96MqK95fG1+EHY4croEJ9FV37fj8q3",
+"S3Y2DGb4x1ZhyyCqWGHQdR4MG0AbFt2UNLEN5iW8M8N/Atq6sMs+IlW/zByOUikBKnj39s0lJOAAxeFQ82A",
+"GR9T2gCJKFwum/kuWhHSOHIWBjK1uN/kRZKsxu8gJb8tccLhJU3EYxr1aBV/1T4HRniXCZB8M9tx/D39yuT",
+"Kz/tjbTBPLi8TzOfHxBW21XeQajjY+h/Yq6fukiyghyHFRazgl27AHBlyKEpjNFjmfS6ltX/b8euhGSEfi4",
+"FpErWTvk9GBKP3aaQ65bJeOw0N+LcarrGSANHPM7Ba6wr6iqfQ3n0hZxtWkFR0iXv/4TLM2YuVlFbs7vtdI",
+"WHOzhX6ccJxrEsE8CZGRttYEZwKQhrLJET+NQeeLU+OsKSt/AAAAAAAAAADlUZmWzImUFsqjMi2ZEyktL/K",
+"ru1WavTuUR2VaMidSWnEW/Mz+rsZMXuRXd6s0e3e7tc7hZ73vYSiPyrRkTqS0zd5TIqjHMKLiLPiZ/V2NmQ",
+"d9YQ8x1BmPvMiv7lZp9u5ZmTZ4muBi+HZrncPPet/DkzoEVQPzS9U7jQIxmrqRXd7cm6dWMwVL8S4wHAOpu",
+"HAUf6mKzyAsZq/KZ2uoncMHSpv+/WQUVxFlaVVGMY7qKoA4zND9B348EwLIhf70Nen2U1ETMn2h/9mh+qhn",
+"5xzEPPBjPqtuiNKHRa3fzNNns2IUNEkAWvOlTeaf8lXATp6otwZkmUnaiHYaBWI0dSO7k0uc9Pj8t628uTd",
+"PrWYKllnortlh756A4l1gOAZSceEHDPmuytvl9yj+UhWfQVjMza/Lg1PIzNpelc/WUDuHD7vEVkCcshMZlD",
+"b9+8koriJxZ2RtBaE6NMrSqoxiHNVVL4MzGq6VQUMAcZih+w/8eOUgATc3hmhuTZcHU67Psuaoxp7FYkYm8",
+"Ic0NX433JvLYmWs6PtVD93Z0GIJnOjgvDyB+59QYXSqE3NQJAX7yZH2IsmyyXJdh2UYzefKgRZSgElUcQYI",
+"gkSvu//KU5I/f0rqZlyfG6tp8V+ovfimRAgUDjErNC/QHjv8mpBhtW0l3q0DBq08+TOHp52cO8yfQmL2BAr",
+"3RQtUTQSvsaLftm+oVTYnblYieRPg+MYJ680Y9rFhUMViWQ7ZQ8rrkPjkNTwSU31ccXAjryhXKF+CO/ZKec",
+"6+kwuv4GWLZQXGkRLbgNr8kwoYhs07bzJybaVprN4+q+ShLP268cwAX/S2QIEUnZnJOD/Ul7wqn62hdg4fW",
+"XsGO23/mgl2ia2AOGUnMpPYNBb07LMkKG3695NRXEXNPGNhX9jIU+LOyNoKQnVoB59RTMbL4X6UpVUZxTiq",
+"q3H0zI8JsT69XgZnNFwrg4a7V/6ikKIXkADiMEP3H/jx5bOp1TuWbOfKQQJubgzR3C8Qm/iihUXK8b2Y/g+",
+"5vPkU7AFowzAo7zseqtOWqpXU3k8zRVojAcJl+v2kPZ7uo4CrZDLxF3q1r1nPiaSNx45KCFYfaARTmNkyUk",
+"pr9xhNPGPL3Kd+jFsTkWBn8uQxYPbA+fE+baV2TXU3EFnQSheoJK6GlVneAYfWBT3Aw2M6YoecqwxK9yzKM",
+"JrPlQMtpC9hA1lZirmyAJOo4gwQBInlwjF0wJmQn153/5WnJH/+uyZmA2ut6+iU1M24PjdW03GFVC7yvsLF",
+"4r9Qe/FNiRAH7sntPcQdBigcYlZoXqA9zU37wKTXNCt2+DUhw2rbSpOprLcP409cvFsHDFp58mdZCp6alvB",
+"mcQ5POzl3mD+F6x6ir7sRq5PE7AkU7osWqCG9kIIiAoK+mgheY0W/bd9/Wcf1iTb5yVCrbE7crETytfr12B",
+"Al0OQmwPGNE9abMcORaBvfXw8n7GPDoIrFshwJMlo2RkwmCrKHlNch8clrV9YNQe14XX14JKb6uOLgRp11P",
+"2x0a3RQNcI5CO0irtjQk6CeIas6zv9hCyV0MYf1GjCSs7i4E+OhhVxS3wX8gkTUxcQTjGiUayZuf0YW1a+O",
+"d/fpip9BuR1N87yJbAps+BxqKkXlnnrX7sGREH8jQTK/WAfc9rdXiQqW5rtLWDZsWw9wd8LMIEOppMsiWHE",
+"bpvg9Xe7R5Q14VT5bQ+0cPp0Ep82PZIgosvYMdtr+NRNXp5XgFnehBewSWwFxyk5kCUPCl71D2nImsWks6N",
+"lnScPg8LokUPNfUNr07yejuIq1i2156yosnJp5xsK+sJGnfyhfVHI5BbHEnZG1FYTq0CHMCCPZDX7GDj6jm",
+"IyXw/3rbzoOQB5X60PYPGrZV41jpoml/BXeGXWJew5HQESkTmwql9GMzTBY159ZMOtw3zkyzsCmJ/lLLx08",
+"ax1yY/YU+G3yi77qYgJrV/bevRkp144Gb0hxkL3BofTE8yQKAPpEpV1l6IOU7P8Qk4SPPnuNGkEKEkO375s",
+"1s6GpFi1SoNDiOD/apMa2ieimpUxUoMdsuT8zgN000UNLlIjVR4nqphoNHhnOHfwdr8P/fnPynfj+Wmmy+m",
+"aL1wzx0udg27AyXWhEK+lPpqFnbBEoGgRzRDb1h+STkGVrxF48sQktXo6Vx6p9gLlINSAJSxo9VinQcZDd1",
+"rTCP/+DO2aDLn8EGtKi8E+n6xKyZaSU1u4xmlc0PQIaZ6WMeMaWuU/9GLedlw8vg3SMoSYiwc7kyWPAw3NY",
+"WChA99bsgfPjfdpK7QnQanWxU977mupuILKglS5/u/e2fikBOFBJXA0rs7wDtRjFm+c6KBUOrQt6gIfHdOv",
+"8kuxMDlNixA45VxmU7lkhX6DB1R16T//yo8d4IYN8GqM6UbSoF2o1UZHq4TKqUdAACHwtuz5Ha7XGnUoG0S",
+"aO5F8Lho9FMKEW9LDTFfgLREdtJh+cbB3XfWlzHG8nyDIs8OXQ5rPeHd5bXoV8DuX4j8LISfWa80M6DCkuS",
+"HWSpmuVv+LB4YSJmT4Et1tcv2zIp5J70sipxH+h9uKbEiEhLjhgLhKGNw7ck9t7iDsM640KTbcBrxpQOMSs",
+"0LxAe7VpXTocNdRtmpv2gUmvaVZ/ym8XhSb9QOzwa0KG1baVCaHy1EpcIoMmU1lvH8afuMMCwPnTTwuueLc",
+"OGLTy5M+d5peOeHtw2bIUPDUt4c3iV0Wlo+FoWfQAAAAAAAAAAH+du6PRNu0K/jp3R6Nt2hWBp8zkcls3H/",
+"x17o5G27Qrg+hVLZftWSECT5nJ5bZuPn3SImo0gIM0+OvcHY22aVeHdme+XICEXQbRq1ou27NCeUwQ+f/tX",
+"kgEnjKTy23dfHsDiTAaWzB2+qRF1GgAB2mFOf53uTbqY/DXuTsabdOuj0oCmMtbPqQO7c58uQAJu3Fwdd9o",
+"NuSxDKJXtVy2Z4VzP+wWjYCKj/KYIPL/272QjQWbUS7tUJoIPGUml9u6+Xeh3oVG7Vfz9gYSYTS2YOyJm6n",
+"C5YCN5vRJi6jRAA7Si9QwCwA249gKc/zvcm3Ux3XuR0yjWznNizzkL2f8f2n0oV+MtsqSY3UGk2jEkaV8Cp",
+"soyxWnSHZ3SQqhISfLQgjUsQLwESZIiXN95oJKEVf27sZFU3z8XXPXODLqShY+DEqDkTt8+zSN7U91SSfMK",
+"/Jw9NaYESEhj6LWvKyRohXwP20ffadPH3GYofsP/HgADgUaWN7KlQp7610UfZGsxwR25resp0HNhdEqU978",
+"dtL6TJHwD8qb2Iees5o7Shjs+AMIOep89eZ5pMTdmCfC+QY5f35JES/zgwCBCfAnxZD8nTqqIREomn069k5",
+"TSh+FAqdN7YJ88o9/dW+HtvxxuwDo1CRnypyxgU8YwBWRq67+0qNjxKdGpBZ5yF/O+P/SaeRz/B/OEtjoQ7",
+"8YbZUlx5feBLu8o8jN6gwm0YgjS/mVkZ1yWRWm8xQ2UZYrTpHsa6vqNfp4fObukhRCQ06WhZEPr+GSeHuPE",
+"KhjBeAjTJBvNdimMRWhmhLn+swFlSKubXpBb9Sjz6Ts3Y2Lpvj4u5NANih3zhWx5q5xZNSVLHyZM8rHBaPB",
+"dhiUBiN3+PZpZwm9gKbOG2Ma25/qkk6YV2VGJElDeHVd5OHorTEjQkKbfFMO4BWvSB5FrXlZI0UrYdgW2og",
+"VqCHgf9o++k6fPp/iYZ0reHI04jBD9x/48QCdrfhUzs4cChwKNLC8lSsVY5ePE22jxh+dRSxwqQSAu+LYl9",
+"N4Mm2xY39bNwppWq4c4uCU21+3pGEwwv7v3zSQHq15XT7p2ZqfCrW5TLLuheCXDhqdhAOPZa7wbSSy6ewaM",
+"0vO9YQE5puUhyqH3zP55Ak8iVbp3vOZ2x7jYmldx+ZGpUCzX7DNZ+FppMEEh9IYfNIHEDJq2G2SlUuzaVMV",
+"Eg8u6GJfvh+TqOIMEASJAOw1Wa/BMmQKked7xfWy5z7uesBmJIQKNG/dDIJW3z0rEEC3IYfp0CGVeUlWPt8",
+"6Qurk8vXv6ddIa0M+EZ2y4FcU3oWyTIQNXWkMp9h4BI5pFpEce6kyY2OXNtCf22lUfOirazwKX7l2R2EH58",
+"/XJpE4/LxEHuHLm7lbcKBsuvyExsbLA72MEY67FOlpiQySusSJUspYOn+wRS6eLiphSK86syWN+1elpb+K2",
+"/pCYU/GwBdgWZNXosxBsKy94QyV0z4tFx4wOnjZQ/81dAS6++08Yo7X1YwW573FQjOn1yH4wlj5kHbhzPK3",
+"tr7c1br1P8grBX8EjBg1SYzJm3bXLyo2EXI4p+HCIEvDUFKTYUEUNF7r8UJXrB61+ScVMAybAcpknLbhOnY",
+"LT11iwVgMnGgwwNliiTpxYrFnFYb7YUZ9zvquJSpXq3ezKIxPHtcoQ8y1N+zP4cVJTRL7CL268lYyj0CrbI",
+"wfXMxd48ioK1n4s8BYa3kdtPIyZ5SPC0aD7U36LyzacG7nMCgNRu7w7dNPtbblP8YA2c4SegFNnTfGsY/Bo",
+"pyr2sw0tj/VJZ0wr0srhHb0q92lyoxIkobw6rq1EfMxV8YHsMjD0VtjRoSEt15q+LJwaY42+aYcwCtekUlk",
+"Hb8RHbObPIpa87JGilZDF+FQY3BnXMKwLbQRK1BDvS2WF8AdvUnA/7R99J0+fb9iD94lq9N3PsXDOlfw5Gh",
+"BWHiZhsYJYsRhhu4/8OMBu/w9Te7GDgs6W/GpnJ05FEXGSgpNq9QeOBRoYHkrVypHidPDqB26IMYuHyfaRo",
+"0/ubOkhAtwYDVRGM+4AS/ZQy6FdBvQGTRJryK4/6JCA1bQvwNcc3TuXK1tITZH9G1o0vCalZbCgGJTV1Zx5",
+"Jm3fSzK7dI1r1p3qfMTpYyZsBTWbqgGXa9dHlfJZOIv9GoBKFTfQf7ChwtVhv0rykIEPyobRogbdOk1q7yK",
+"bGkv3irUITHPuBkzIKHPdoMbQgrt3lLNIMp05+df9QHEuC/Q+CBoumdpGT3yXbqYDV2ZvsYiJyOujK9TzKO",
+"A70r+9GTT3B1U6S/CidlZJKqelvRjuia5ET1Hwo6wpx7d2TWZua/Yg2Z65K9UpaVRRBDQL9eR2sz/swEZOp",
+"tbazNXc0INhCT2iPSidOCO2iQrl2bTpiqluZA0t+VLICQeXNDFvnw/W4PncxSIkTUmUcUZIAgSAVnMfrrxP",
+"v8L2GuyXoNlyBSn9gn9UlMlHiLP94rrZc99XVJMKTpTInfc9YDNSAgVaKNoO26ZPvhi3roZBK2+e1ahJ6Kn",
+"fIiWXCCAbkMO06FDXx3V4N/lTEkq85KsfL51hFVuKQ+tiJiO1Mnl69/Tr5GrVF5IDuVCm9aGfCI6ZcGvqRv",
+"HgetTLKUovAtlmQgbulchsMZIPvaw0hhOsfEIHNOthfUSID7x2SwiOfZSZcbGU7+CVYNTK8wubaA/t9Oo+F",
+"HwG5xm5UXy0FfXeBS+cu2vymzbxYif5wAAAAAAAAAAAPUEklguvLBreZ584nqhVWuMmu66VB3l1vI8+cT1Q",
+"qvWBzhrnNv+G72LooUmj+P+vX6mF36hX07Hdu6q2s1cYseD6jiC4+DSrA9w1ji3/Tes+nREYJlBhxGE0lMe",
+"OB7JEXHWwUYWonl6/Uwv/EK/nHoISL2kbAMsju3cVbWbucSOGNjH7bUFdOWUQilX4RiR5WFGuw/PpCFYH+C",
+"scW77b1jq5D4pQEffM2Z+0JMUWjozk3pCyzrmikmbMv9vVuWmSW42bTd4WRYi4qyDjSxE8yIXqBHVAvhDn2",
+"kOBqujpw2fnAqU840bvfQQkHpJ2QZY9OWU6BH3uuh3SC7zORGqvXe9KmFhPxYNHDGwj9trC+gcxLQdg0W3W",
+"KG6Egr95OgWoU8WmKXKVKbKw4x2H55JQ8o2iORHsPXzsD7AWePc9t+wy8TLu/JKb9tHXiUBpleK27Jat1mI",
+"6zpmzPygJym0dGY5+DJ/BwjEDbVi3MVTFSENQGZOnX2pkfml8qaMihN5+VD2NNSkr8mS3GzabvCyLJIpaEg",
+"23g6cL1fOX0h/UdIvosrNEFHtYkQuUCOqBfCHRNtUsfIrTDc+0xwMVkdPGz4mGJ4OafOrVaqCcLQ97k5VX4",
+"bi7BNS/ughIPWSsg2w6NQkZ8qcsQCDWL6JcMis5YOtuhso5hBVhQPLviAEjU+F9s8seCox/+56VcLCfiwa7",
+"o9RUJpQkKpT8fdH5PHP5FME89W833NUOIhpOwaLbrE4fW2pXqXSAUJ1JRT6ydEtQoAhhqLnbZ0pDLtoGLNw",
+"eCn5v/pAnczIlIcZ7T48k4aUch1/ZhIvNv/+h5HcRjLT/wuDA4RojmML7hfrlZ80iwsbE3nNsYg7YJeJl3f",
+"lld5gYo0FL8spbt0cKxJRanYg3ekvgAlEypC2ZbVusxDXdbaQsfzrPmvFzJj5QU9SaOnMbf3TF3zUWafhZz",
+"2tKMm8pxRjr/UGdQwaasW4i6cqQhqfwSrTiZbycRNbxGndixdx5l9WMfM3p/JL5U0ZFSfy8r7h30E7m0KZM",
+"nsx+2+Gp5nHf6OjQToXJLnZtN3gZVkkTN0mhc7Z6U/AR8g/msQMTzVDWme0eLw1PQvnw9h7kDXID3Wb9scg",
+"XkSVmyGi2sVesZEJeYxmdePPNx4HLTk74zozjF8DhYuItqli5VeYbohDrfC9eSTefKY5GKyOnjZ8Uz2K9KA",
+"ihhffp2RO9D9jFyqj9hbag9OqVAXhaHvcnaqhAXMwVWAtwS2bnYoBfcjB2J8P0i/BeLvQ17J2Q8JUuyXTIC",
+"5tfuTQqUnOlDljAdBcTVzMF9+xbSLrS7K2gP9t1+/Z6pg8TwZbdTdQzCGqBq5xpQjinRoKB5Z9QQganwryk",
+"u8ZJqYvYX4IAaNyu8phiwyT+1wHetz1qoSF/Vg03ACuFt3T5IS3jDT4Z4f5Ybd5MGo/qUXRzXF415vFRv3N",
+"hHxFw+v6TaYI5qt5v+eopv3iOSGRWxgbg0QuXzAEVht2QLwHHrjmcPraUr1KpQNwD97A5WQZs4TqSij0k6N",
+"bhB9Ouqy9H+vvk9RUFukCDu9m0MZOx76+Uhh20TBm4fBS7XJDaEhdQDlh6K3SHEClOZTsP4oy/BVDnKSCLl",
+"7/OUNpoBB2cEOJKOU6/swkXmwoED5slAri3JVumHvqq72SlZuc6bKFASL+FwYHCNEcx/7iApVQ/6B3fU+4j",
+"ngZsCJ9urwcIDcMkhY2JvKaYxF3FsMiYMJNrcervYR3vOzyiatIgOXkwk45wMQaC16WU9zAMR6ZBrjvbLo5",
+"ViSi1OxAusxStvr6UPDRQMhYQK5NFdG1zMoYgPGlbMtq3WYhrutsPm5PPg8SWwey9KGEWw++B0fwM9x1sw7",
+"zomTbzYIJ5vNXYEmVrLVWmNv6py/4qLOYLv41d9YUAyVQWCIJd0tNJaVcsFFZ9/1OKcZe6w3qGE7cwsyzI1",
+"aoNNSKcRdPVYQ0IY7jT2HpNF+tFA31NfTRX1gQn60bSGHiJraI07oXL+LTshqLlKufiV8o9DHAtnqJqixma",
+"e4Kyo8EXcNhDJfQj/FZUTkiK2DkfcO/g3Y2heSIxy3bWIo1WfZhOqX51XtZA2Wo/ddpyzKP/0ZHg3QuMnr7",
+"1B+tyJ5IcrNpu8HLskiHt/vj73cCIwstFVm7aucj/imHAZXWV56Aj5B/NIkZnnWLAicaNan1+RHsnU4oTPU",
+"MFX7FYJT8AemBltSXLhQBHIUEjLmSpGqQH+o27Y9BamUbeG7DM/HXG71vEGJsv9fuuf1ITNAPvGIjE/IYze",
+"q8lyeBqjZxWsafbzwOWnJ2xmprrlZ0zsat5vFA7CDTI60T9dK0Dm+TEG1TxcqvMN0QmFdXkoGMbXsUzbko1",
+"ZGIe+HJK3D7LTj4THMwWB09bfi5d6IAM4HdkzXtTLpnnDiTwOne4kkgiC6+T8mc6H/GLktLW8TGw3ZFx9G1",
+"fpLek0Uy1ScmvGIjPzqdmoLQYQ8/z5kI2v7dv1RDA+ZgqsBaVLYHdDiEfOrpyKFjRiUjpOk9pfEeC58UgrE",
+"/H6RfgvGCRDuN/HE+QXahr2XthoSpdlSr97WoOBkd2DEZD/wl/B0tNYtX0plMoFOTnClzxgKgppcOcV16ss",
+"sqDeDLCWdXy98JcpMn2+ex10HPN0vYy7EiRV1vZWR72q7fs9UxeZ7aW9shjR/FLmclfTbzvppgZ9B5pKuQJ",
+"tAMXONKEcQ7NQyp59hJ6oeFAAAAAAAAAAB5iTUwyPBuf/ISa2CQ4d3+i5teUFgRs4GPtkGYc+ViyfY/dKi7",
+"FQy2faQq+OMEvzcELR/IK/TRSHX+FGi07BymDHchWHwcctmH7H8IJA3BWP5lSjjs/a8n+khV8McJfm+DwWD",
+"AD/kQEAhaPpBX6KORcdMLoJ8Yze6Bb76IO//gePjmi7jzD44Hc33V6KsePYYK9ODYY+5T+Q7Z/xBIGoKxd1",
+"DKIIDq7M78y5Rw2PtfT4VCoUAQCzEw9JGq4I8T/N6NGJ/QR+OSoQaDwYAf8iEgfwr0sNcCT197J+t4/PaeF",
+"wKu3kg0BvBoiTWAGGwXQ+nwvLUopOctlgLffBF3/sHxe1ZJIb8Or47wzRdx5x8cD4lEIkEv73JwjWk9iQQb",
+"ozj04Ai5zOvNR397VumU+n7GBvJj2VwKELl3IWh5wxLdVw6oXUkL4rMohTMDGVPzAKn8ujYpmwNu1viXKeG",
+"w97+egR4c0XgH0eEKhUKBIBZiYHMMd7Ho5gwfg7DCmUwBIYn6OfephPFP9nGiqfnc4Px3CCucyRQQkggMBo",
+"MBP+RDQHWPtjH3FC0//hToYa8Fnr6Hnd1RZ/XwwfZO1vH47T0vj8fjwTAdU1AEXL2RaAzg0X3ViKGg/I6ue",
+"fiXaYsIX+YAcaJZQ/gxmYvq/Akb6YIY8mPJOdMZ7GdvLW56vdpa1xakW0p1KjSonT8FGi07hynktjAq5cvp",
+"VuCbL+LOPzgemRIa0gbPVmESiUSCXt7l4GsAcbKWLoufGtN6Egk2RnFjWk8iwcYoDujBEXKZ15uPkUgkQlE",
+"n9fCVZTuKetMkuOzsDrqyI0rHZ3dQ6uoy+UYe/mXaIsKXOe5C0PKGJbqvl8vlwk7V1NAcULuSFsRnUWXZjq",
+"LeNAkuYfSRavXA2GYYfaRaPTC2GZPm+gplIQWY6m/POq3Ra+ebvMSaMsmmCeI18ar6Och2aa6v+qIoe/cQJ",
+"5rKatgViBQKhQJBLMTAbYOwMoncqr/mGO5i0c0ZPp+R21IZPXdBbfISa8okmyYUeydbAtT1WZ/geQtaxUbY",
+"5mlMO5I1KKfiRFPzucH575vNZsNxMZeQEFY4kykgJBFp3w2j4dBKbhgMBgN+yIeAYYUzM7Y46f/qHm1j7il",
+"afpOXWFMm2TQBl7pHmw0t5UnuM3Krxd2LNmWoLPudzDi3HCEZy1U8Vsjsnazj8dt7XpUUmdM5KxUhHo/Hg2",
+"E6pqBnBvKzqcrI32Mr7XuCPhmXGqLYS0rOd+iROYYbEt/EaeiwsyvaL6oWmWO4i0U3Z/jg6o27jccJh2tx0",
+"+vV1roGEvjm2x0m1HkW1fkTNtIFMW9czCP+ImtO5MeSc6Yz2M+dTqdDbsO2sLXJS6wpk2yazEB+nOFjAuVH",
+"2yDMuXKxZD5SFfxxgt8bOn8KNFp2DlND9j8EkoZgLMhtYVTKl9OtseRUZAJnvdLAN1/EnX9wPLm+avRVjx5",
+"DMiU0pA2ercJLrAGUxW7DvU+BHlzumhL1NggrbCZqfIq9k3U8fnvPC8QaQAy2i6F0NKb1JBJsjOJNL8AU2p",
+"zinca0nkSCjVEcvz2rdEp9P2O7ELS8YYnuK8KZgYypeYBUSQLf3PFoM9Uwi+rsOZhdqkFY4UymgJBEONHUf",
+"G5w/juzSoosNmFNusrDvxz+kSPFzu6g1NVl8o23Z5XkHZWc8jz8y7RFhC9zRXX+hI10QQy3Fje9Xm2ta86f",
+"Ao2WncMURQRc3c6McJU8jWntBnwe6jigdiUtiM+iQSlDFeV4od3Ksh1FvWkSXLM7KHV1mXwjwugj1eqBsc2",
+"7YRblInHfsjD6SLV6YGwzSXN9hbKQAkxNXmJNmWTTBDTXV31RlL17v0wJLQmFDvrGxTwdwXVghTZ5iTVlkk",
+"0TT/C8Ba1iI2zEa+JV9XOQ7b3i12U9g/6Suc/IrRZ3L9rARv2d3odBpUvdo82GlvIkMlSW/U5mnFtDh51d0",
+"X5RtToOqG0Zjj/KsZX2PUGfjEvIHMMNiW/iNMwx3MWimzN8tbjp9WprXQM+I7elMnrugkeqgpX6ioD92uQl",
+"1pRJNk2jbRDmXLlYMij2TrYEqOuzUX97hsxYhcxVUmRO56xUhCzbUX4vXDr7p0APLndNiXreyToev73nBa8",
+"aMb4gpSrr1pMEjuhVRJRdCFresET3FSSBb+54tJlqIKxwJlNASCJZJUUWm7AmXdK+G0bDoZXcqzcudgtR+6",
+"Nbi5ter7bWNSICrm5nRrhKqZnwPj9XC8vQEMUO96dltNQ92sbcU7T8rbTv9hSj2oMmL7GmTLJpAl+mhJaEQ",
+"gd9LnWPNhtaypNX/LoG06qk7Nxn5FaLuxdtpe7RZkNLeRKhw86uaL+oWthK+56gT8YlU9GlzvhedaQqWJD+",
+"MK4b29g7Wcfjt/e8obJs9ytHmcMqKTKnc1YqQlOgB5e7pkQ9V40YX5BSlXUuBC1vWKL7CqWfcz8As0iL3BZ",
+"GD8hDJvStxU2vV1vrGtRMeJ+fq4VlX9cmz8e6NuQmXhP/D0pYmyJzDDckvonTW/o5B+xO56zQYWdXtF9ULa",
+"noUmd8rzpSWVTnT9hIF8Qg3dJ/ELh5u6tGjC9Iqco60s+5H4BZpEXW4qbXq611Da9rk+djXRtyJPDNtztMq",
+"PNdefiH87zGjCyq8ydspAtiVSPGF6RUZR3euJhH/EXWnKcxrXc0tbjjoxyyvx9BaavalYeP17EH1FEO2d+P",
+"oLRVKIfs70dQ2ioAQYCQwQILnAEgS1AAAAAAAAUAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+"AAAIAAAADAAAAEEtQAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAD//////////wAAAAAAAAAAAAAAAA",
+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhIUAAAQZyRwQILFCRpb",
+"nRBcnJheUZyb21TdHJpbmcAAEGwkcECC2Ioc2l6ZV90IGlkeCwgc2l6ZV90IHNpemUpPDo6PnsgdGhyb3cg",
+"J0FycmF5IGluZGV4ICcgKyBpZHggKyAnIG91dCBvZiBib3VuZHM6IFswLCcgKyBzaXplICsgJyknOyB9AA=="
+].join("");
+
+function _base64ToArrayBuffer(base64) {
+  var binary_string = window.atob(base64);
+  var len = binary_string.length;
+  var bytes = new Uint8Array(len);
+  for (var i = 0; i < len; i++) {
+      bytes[i] = binary_string.charCodeAt(i);
+  }
+  return bytes;
+}
+
+function getBinary(file) {
+  if (typeof Buffer == "function"){
+    return Buffer.from(binaryInString, "base64");
+  }
+  else {
+    return _base64ToArrayBuffer(binaryInString);
+  }
+}
+
+function getBinaryPromise() {
+  // If we don't have the binary yet, try to to load it asynchronously.
+  // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.
+  // See https://github.com/github/fetch/pull/92#issuecomment-140665932
+  // Cordova or Electron apps are typically loaded from a file:// url.
+  // So use fetch if it is available and the url is not a file, otherwise fall back to XHR.
+  // if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
+  //   if (typeof fetch == 'function'
+  //     && !isFileURI(wasmBinaryFile)
+  //   ) {
+  //     return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function(response) {
+  //       if (!response['ok']) {
+  //         throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
+  //       }
+  //       return response['arrayBuffer']();
+  //     }).catch(function () {
+  //         return getBinary(wasmBinaryFile);
+  //     });
+  //   }
+  //   else {
+  //     if (readAsync) {
+  //       // fetch is not available or url is file => try XHR (readAsync uses XHR internally)
+  //       return new Promise(function(resolve, reject) {
+  //         readAsync(wasmBinaryFile, function(response) { resolve(new Uint8Array(/** @type{!ArrayBuffer} */(response))) }, reject)
+  //       });
+  //     }
+  //   }
+  // }
+
+  // Otherwise, getBinary should be able to get it synchronously
+  return Promise.resolve().then(function() { return getBinary(wasmBinaryFile); });
+}
+
+// Create the wasm instance.
+// Receives the wasm imports, returns the exports.
+function createWasm() {
+  // prepare imports
+  var info = {
+    'env': asmLibraryArg,
+    'wasi_snapshot_preview1': asmLibraryArg,
+  };
+  // Load the wasm module and create an instance of using native support in the JS engine.
+  // handle a generated wasm instance, receiving its exports and
+  // performing other necessary setup
+  /** @param {WebAssembly.Module=} module*/
+  function receiveInstance(instance, module) {
+    var exports = instance.exports;
+
+    Module['asm'] = exports;
+
+    wasmMemory = Module['asm']['memory'];
+    assert(wasmMemory, "memory not found in wasm exports");
+    // This assertion doesn't hold when emscripten is run in --post-link
+    // mode.
+    // TODO(sbc): Read INITIAL_MEMORY out of the wasm file in post-link mode.
+    //assert(wasmMemory.buffer.byteLength === 16777216);
+    updateGlobalBufferAndViews(wasmMemory.buffer);
+
+    wasmTable = Module['asm']['__indirect_function_table'];
+    assert(wasmTable, "table not found in wasm exports");
+
+    addOnInit(Module['asm']['__wasm_call_ctors']);
+
+    removeRunDependency('wasm-instantiate');
+
+  }
+  // we can't run yet (except in a pthread, where we have a custom sync instantiator)
+  addRunDependency('wasm-instantiate');
+
+  // Prefer streaming instantiation if available.
+  // Async compilation can be confusing when an error on the page overwrites Module
+  // (for example, if the order of elements is wrong, and the one defining Module is
+  // later), so we save Module and check it later.
+  var trueModule = Module;
+  function receiveInstantiationResult(result) {
+    // 'result' is a ResultObject object which has both the module and instance.
+    // receiveInstance() will swap in the exports (to Module.asm) so they can be called
+    assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');
+    trueModule = null;
+    // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
+    // When the regression is fixed, can restore the above USE_PTHREADS-enabled path.
+    receiveInstance(result['instance']);
+  }
+
+  function instantiateArrayBuffer(receiver) {
+    return getBinaryPromise().then(function(binary) {
+      return WebAssembly.instantiate(binary, info);
+    }).then(function (instance) {
+      return instance;
+    }).then(receiver, function(reason) {
+      err('failed to asynchronously prepare wasm: ' + reason);
+
+      // Warn on some common problems.
+      if (isFileURI(wasmBinaryFile)) {
+        err('warning: Loading from a file URI (' + wasmBinaryFile + ') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing');
+      }
+      abort(reason);
+    });
+  }
+
+  function instantiateAsync() {
+    // if (!wasmBinary &&
+    //     typeof WebAssembly.instantiateStreaming == 'function' &&
+    //     !isDataURI(wasmBinaryFile) &&
+    //     // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously.
+    //     !isFileURI(wasmBinaryFile) &&
+    //     // Avoid instantiateStreaming() on Node.js environment for now, as while
+    //     // Node.js v18.1.0 implements it, it does not have a full fetch()
+    //     // implementation yet.
+    //     //
+    //     // Reference:
+    //     //   https://github.com/emscripten-core/emscripten/pull/16917
+    //     !ENVIRONMENT_IS_NODE &&
+    //     typeof fetch == 'function') {
+    //   return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function(response) {
+    //     // Suppress closure warning here since the upstream definition for
+    //     // instantiateStreaming only allows Promise rather than
+    //     // an actual Response.
+    //     // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure is fixed.
+    //     /** @suppress {checkTypes} */
+    //     var result = WebAssembly.instantiateStreaming(response, info);
+
+    //     return result.then(
+    //       receiveInstantiationResult,
+    //       function(reason) {
+    //         // We expect the most common failure cause to be a bad MIME type for the binary,
+    //         // in which case falling back to ArrayBuffer instantiation should work.
+    //         err('wasm streaming compile failed: ' + reason);
+    //         err('falling back to ArrayBuffer instantiation');
+    //         return instantiateArrayBuffer(receiveInstantiationResult);
+    //       });
+    //   });
+    // } else {
+      return instantiateArrayBuffer(receiveInstantiationResult);
+    //}
+  }
+
+  // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
+  // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel
+  // to any other async startup actions they are performing.
+  // Also pthreads and wasm workers initialize the wasm instance through this path.
+  if (Module['instantiateWasm']) {
+    try {
+      var exports = Module['instantiateWasm'](info, receiveInstance);
+      return exports;
+    } catch(e) {
+      err('Module.instantiateWasm callback failed with error: ' + e);
+        // If instantiation fails, reject the module ready promise.
+        readyPromiseReject(e);
     }
-    [EMITEND]() {
-        if (this[EMITTED_END])
-            return false;
-        this[EMITTED_END] = true;
-        this.readable = false;
-        return this[ASYNC]
-            ? (defer(() => this[EMITEND2]()), true)
-            : this[EMITEND2]();
+  }
+
+  // If instantiation fails, reject the module ready promise.
+  instantiateAsync().catch(readyPromiseReject);
+  return {}; // no exports yet; we'll fill them in later
+}
+
+// Globals used by JS i64 conversions (see makeSetValue)
+var tempDouble;
+var tempI64;
+
+// === Body ===
+
+var ASM_CONSTS = {
+  
+};
+function array_bounds_check_error(idx,size) { throw 'Array index ' + idx + ' out of bounds: [0,' + size + ')'; }
+
+
+
+
+  /** @constructor */
+  function ExitStatus(status) {
+      this.name = 'ExitStatus';
+      this.message = 'Program terminated with exit(' + status + ')';
+      this.status = status;
     }
-    [EMITEND2]() {
-        if (this[DECODER]) {
-            const data = this[DECODER].end();
-            if (data) {
-                for (const p of this[PIPES]) {
-                    p.dest.write(data);
-                }
-                if (!this[DISCARDED])
-                    super.emit('data', data);
-            }
-        }
-        for (const p of this[PIPES]) {
-            p.end();
-        }
-        const ret = super.emit('end');
-        this.removeAllListeners('end');
-        return ret;
+
+  function callRuntimeCallbacks(callbacks) {
+      while (callbacks.length > 0) {
+        // Pass the module as the first argument.
+        callbacks.shift()(Module);
+      }
     }
+
+  
     /**
-     * Return a Promise that resolves to an array of all emitted data once
-     * the stream ends.
+     * @param {number} ptr
+     * @param {string} type
      */
-    async collect() {
-        const buf = Object.assign([], {
-            dataLength: 0,
-        });
-        if (!this[OBJECTMODE])
-            buf.dataLength = 0;
-        // set the promise first, in case an error is raised
-        // by triggering the flow here.
-        const p = this.promise();
-        this.on('data', c => {
-            buf.push(c);
-            if (!this[OBJECTMODE])
-                buf.dataLength += c.length;
-        });
-        await p;
-        return buf;
+  function getValue(ptr, type = 'i8') {
+      if (type.endsWith('*')) type = '*';
+      switch (type) {
+        case 'i1': return HEAP8[((ptr)>>0)];
+        case 'i8': return HEAP8[((ptr)>>0)];
+        case 'i16': return HEAP16[((ptr)>>1)];
+        case 'i32': return HEAP32[((ptr)>>2)];
+        case 'i64': return HEAP32[((ptr)>>2)];
+        case 'float': return HEAPF32[((ptr)>>2)];
+        case 'double': return HEAPF64[((ptr)>>3)];
+        case '*': return HEAPU32[((ptr)>>2)];
+        default: abort('invalid type for getValue: ' + type);
+      }
+      return null;
     }
-    /**
-     * Return a Promise that resolves to the concatenation of all emitted data
-     * once the stream ends.
-     *
-     * Not allowed on objectMode streams.
-     */
-    async concat() {
-        if (this[OBJECTMODE]) {
-            throw new Error('cannot concat in objectMode');
-        }
-        const buf = await this.collect();
-        return (this[ENCODING]
-            ? buf.join('')
-            : Buffer.concat(buf, buf.dataLength));
+
+  function ptrToString(ptr) {
+      return '0x' + ptr.toString(16).padStart(8, '0');
     }
+
+  
     /**
-     * Return a void Promise that resolves once the stream ends.
+     * @param {number} ptr
+     * @param {number} value
+     * @param {string} type
      */
-    async promise() {
-        return new Promise((resolve, reject) => {
-            this.on(DESTROYED, () => reject(new Error('stream destroyed')));
-            this.on('error', er => reject(er));
-            this.on('end', () => resolve());
-        });
+  function setValue(ptr, value, type = 'i8') {
+      if (type.endsWith('*')) type = '*';
+      switch (type) {
+        case 'i1': HEAP8[((ptr)>>0)] = value; break;
+        case 'i8': HEAP8[((ptr)>>0)] = value; break;
+        case 'i16': HEAP16[((ptr)>>1)] = value; break;
+        case 'i32': HEAP32[((ptr)>>2)] = value; break;
+        case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math.min((+(Math.floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)] = tempI64[0],HEAP32[(((ptr)+(4))>>2)] = tempI64[1]); break;
+        case 'float': HEAPF32[((ptr)>>2)] = value; break;
+        case 'double': HEAPF64[((ptr)>>3)] = value; break;
+        case '*': HEAPU32[((ptr)>>2)] = value; break;
+        default: abort('invalid type for setValue: ' + type);
+      }
     }
-    /**
-     * Asynchronous `for await of` iteration.
-     *
-     * This will continue emitting all chunks until the stream terminates.
-     */
-    [Symbol.asyncIterator]() {
-        // set this up front, in case the consumer doesn't call next()
-        // right away.
-        this[DISCARDED] = false;
-        let stopped = false;
-        const stop = async () => {
-            this.pause();
-            stopped = true;
-            return { value: undefined, done: true };
-        };
-        const next = () => {
-            if (stopped)
-                return stop();
-            const res = this.read();
-            if (res !== null)
-                return Promise.resolve({ done: false, value: res });
-            if (this[EOF])
-                return stop();
-            let resolve;
-            let reject;
-            const onerr = (er) => {
-                this.off('data', ondata);
-                this.off('end', onend);
-                this.off(DESTROYED, ondestroy);
-                stop();
-                reject(er);
-            };
-            const ondata = (value) => {
-                this.off('error', onerr);
-                this.off('end', onend);
-                this.off(DESTROYED, ondestroy);
-                this.pause();
-                resolve({ value, done: !!this[EOF] });
-            };
-            const onend = () => {
-                this.off('error', onerr);
-                this.off('data', ondata);
-                this.off(DESTROYED, ondestroy);
-                stop();
-                resolve({ done: true, value: undefined });
-            };
-            const ondestroy = () => onerr(new Error('stream destroyed'));
-            return new Promise((res, rej) => {
-                reject = rej;
-                resolve = res;
-                this.once(DESTROYED, ondestroy);
-                this.once('error', onerr);
-                this.once('end', onend);
-                this.once('data', ondata);
-            });
-        };
-        return {
-            next,
-            throw: stop,
-            return: stop,
-            [Symbol.asyncIterator]() {
-                return this;
-            },
-            [Symbol.asyncDispose]: async () => { },
-        };
+
+  function warnOnce(text) {
+      if (!warnOnce.shown) warnOnce.shown = {};
+      if (!warnOnce.shown[text]) {
+        warnOnce.shown[text] = 1;
+        if (ENVIRONMENT_IS_NODE) text = 'warning: ' + text;
+        err(text);
+      }
     }
-    /**
-     * Synchronous `for of` iteration.
-     *
-     * The iteration will terminate when the internal buffer runs out, even
-     * if the stream has not yet terminated.
-     */
-    [Symbol.iterator]() {
-        // set this up front, in case the consumer doesn't call next()
-        // right away.
-        this[DISCARDED] = false;
-        let stopped = false;
-        const stop = () => {
-            this.pause();
-            this.off(ERROR, stop);
-            this.off(DESTROYED, stop);
-            this.off('end', stop);
-            stopped = true;
-            return { done: true, value: undefined };
-        };
-        const next = () => {
-            if (stopped)
-                return stop();
-            const value = this.read();
-            return value === null ? stop() : { done: false, value };
-        };
-        this.once('end', stop);
-        this.once(ERROR, stop);
-        this.once(DESTROYED, stop);
-        return {
-            next,
-            throw: stop,
-            return: stop,
-            [Symbol.iterator]() {
-                return this;
-            },
-            [Symbol.dispose]: () => { },
-        };
+
+  function _abort() {
+      abort('native code called abort()');
     }
-    /**
-     * Destroy a stream, preventing it from being used for any further purpose.
-     *
-     * If the stream has a `close()` method, then it will be called on
-     * destruction.
-     *
-     * After destruction, any attempt to write data, read data, or emit most
-     * events will be ignored.
-     *
-     * If an error argument is provided, then it will be emitted in an
-     * 'error' event.
-     */
-    destroy(er) {
-        if (this[DESTROYED]) {
-            if (er)
-                this.emit('error', er);
-            else
-                this.emit(DESTROYED);
-            return this;
+
+  function getHeapMax() {
+      // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
+      // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
+      // for any code that deals with heap sizes, which would require special
+      // casing all heap size related code to treat 0 specially.
+      return 2147483648;
+    }
+  
+  function emscripten_realloc_buffer(size) {
+      try {
+        // round size grow request up to wasm page size (fixed 64KB per spec)
+        wasmMemory.grow((size - buffer.byteLength + 65535) >>> 16); // .grow() takes a delta compared to the previous size
+        updateGlobalBufferAndViews(wasmMemory.buffer);
+        return 1 /*success*/;
+      } catch(e) {
+        err('emscripten_realloc_buffer: Attempted to grow heap from ' + buffer.byteLength  + ' bytes to ' + size + ' bytes, but got error: ' + e);
+      }
+      // implicit 0 return to save code size (caller will cast "undefined" into 0
+      // anyhow)
+    }
+  function _emscripten_resize_heap(requestedSize) {
+      var oldSize = HEAPU8.length;
+      requestedSize = requestedSize >>> 0;
+      // With multithreaded builds, races can happen (another thread might increase the size
+      // in between), so return a failure, and let the caller retry.
+      assert(requestedSize > oldSize);
+  
+      // Memory resize rules:
+      // 1.  Always increase heap size to at least the requested size, rounded up
+      //     to next page multiple.
+      // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap
+      //     geometrically: increase the heap size according to
+      //     MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most
+      //     overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).
+      // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap
+      //     linearly: increase the heap size by at least
+      //     MEMORY_GROWTH_LINEAR_STEP bytes.
+      // 3.  Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by
+      //     MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest
+      // 4.  If we were unable to allocate as much memory, it may be due to
+      //     over-eager decision to excessively reserve due to (3) above.
+      //     Hence if an allocation fails, cut down on the amount of excess
+      //     growth, in an attempt to succeed to perform a smaller allocation.
+  
+      // A limit is set for how much we can grow. We should not exceed that
+      // (the wasm binary specifies it, so if we tried, we'd fail anyhow).
+      var maxHeapSize = getHeapMax();
+      if (requestedSize > maxHeapSize) {
+        err('Cannot enlarge memory, asked to go up to ' + requestedSize + ' bytes, but the limit is ' + maxHeapSize + ' bytes!');
+        return false;
+      }
+  
+      let alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple;
+  
+      // Loop through potential heap size increases. If we attempt a too eager
+      // reservation that fails, cut down on the attempted size and reserve a
+      // smaller bump instead. (max 3 times, chosen somewhat arbitrarily)
+      for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
+        var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth
+        // but limit overreserving (default to capping at +96MB overgrowth at most)
+        overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296 );
+  
+        var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
+  
+        var replacement = emscripten_realloc_buffer(newSize);
+        if (replacement) {
+  
+          return true;
         }
-        this[DESTROYED] = true;
-        this[DISCARDED] = true;
-        // throw away all buffered data, it's never coming out
-        this[BUFFER].length = 0;
-        this[BUFFERLENGTH] = 0;
-        const wc = this;
-        if (typeof wc.close === 'function' && !this[CLOSED])
-            wc.close();
-        if (er)
-            this.emit('error', er);
-        // if no error to emit, still reject pending promises
-        else
-            this.emit(DESTROYED);
-        return this;
+      }
+      err('Failed to grow the heap from ' + oldSize + ' bytes to ' + newSize + ' bytes, not enough memory!');
+      return false;
     }
-    /**
-     * Alias for {@link isStream}
-     *
-     * Former export location, maintained for backwards compatibility.
-     *
-     * @deprecated
-     */
-    static get isStream() {
-        return exports.isStream;
+
+  var SYSCALLS = {varargs:undefined,get:function() {
+        assert(SYSCALLS.varargs != undefined);
+        SYSCALLS.varargs += 4;
+        var ret = HEAP32[(((SYSCALLS.varargs)-(4))>>2)];
+        return ret;
+      },getStr:function(ptr) {
+        var ret = UTF8ToString(ptr);
+        return ret;
+      }};
+  function _fd_close(fd) {
+      abort('fd_close called without SYSCALLS_REQUIRE_FILESYSTEM');
+    }
+
+  function convertI32PairToI53Checked(lo, hi) {
+      assert(lo == (lo >>> 0) || lo == (lo|0)); // lo should either be a i32 or a u32
+      assert(hi === (hi|0));                    // hi should be a i32
+      return ((hi + 0x200000) >>> 0 < 0x400001 - !!lo) ? (lo >>> 0) + hi * 4294967296 : NaN;
+    }
+  function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
+      return 70;
+    }
+
+  var printCharBuffers = [null,[],[]];
+  function printChar(stream, curr) {
+      var buffer = printCharBuffers[stream];
+      assert(buffer);
+      if (curr === 0 || curr === 10) {
+        (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
+        buffer.length = 0;
+      } else {
+        buffer.push(curr);
+      }
+    }
+  function flush_NO_FILESYSTEM() {
+      // flush anything remaining in the buffers during shutdown
+      _fflush(0);
+      if (printCharBuffers[1].length) printChar(1, 10);
+      if (printCharBuffers[2].length) printChar(2, 10);
+    }
+  function _fd_write(fd, iov, iovcnt, pnum) {
+      // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0
+      var num = 0;
+      for (var i = 0; i < iovcnt; i++) {
+        var ptr = HEAPU32[((iov)>>2)];
+        var len = HEAPU32[(((iov)+(4))>>2)];
+        iov += 8;
+        for (var j = 0; j < len; j++) {
+          printChar(fd, HEAPU8[ptr+j]);
+        }
+        num += len;
+      }
+      HEAPU32[((pnum)>>2)] = num;
+      return 0;
     }
+
+  /** @type {function(string, boolean=, number=)} */
+  function intArrayFromString(stringy, dontAddNull, length) {
+    var len = length > 0 ? length : lengthBytesUTF8(stringy)+1;
+    var u8array = new Array(len);
+    var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
+    if (dontAddNull) u8array.length = numBytesWritten;
+    return u8array;
+  }
+var ASSERTIONS = true;
+
+function checkIncomingModuleAPI() {
+  ignoredModuleProp('fetchSettings');
+}
+var asmLibraryArg = {
+  "abort": _abort,
+  "array_bounds_check_error": array_bounds_check_error,
+  "emscripten_resize_heap": _emscripten_resize_heap,
+  "fd_close": _fd_close,
+  "fd_seek": _fd_seek,
+  "fd_write": _fd_write
+};
+var asm = createWasm();
+/** @type {function(...*):?} */
+var ___wasm_call_ctors = Module["___wasm_call_ctors"] = createExportWrapper("__wasm_call_ctors");
+
+/** @type {function(...*):?} */
+var _emscripten_bind_VoidPtr___destroy___0 = Module["_emscripten_bind_VoidPtr___destroy___0"] = createExportWrapper("emscripten_bind_VoidPtr___destroy___0");
+
+/** @type {function(...*):?} */
+var _emscripten_bind_Crc64Hash_Crc64Hash_0 = Module["_emscripten_bind_Crc64Hash_Crc64Hash_0"] = createExportWrapper("emscripten_bind_Crc64Hash_Crc64Hash_0");
+
+/** @type {function(...*):?} */
+var _emscripten_bind_Crc64Hash_OnAppend_2 = Module["_emscripten_bind_Crc64Hash_OnAppend_2"] = createExportWrapper("emscripten_bind_Crc64Hash_OnAppend_2");
+
+/** @type {function(...*):?} */
+var _emscripten_bind_Crc64Hash_OnFinal_3 = Module["_emscripten_bind_Crc64Hash_OnFinal_3"] = createExportWrapper("emscripten_bind_Crc64Hash_OnFinal_3");
+
+/** @type {function(...*):?} */
+var _emscripten_bind_Crc64Hash___destroy___0 = Module["_emscripten_bind_Crc64Hash___destroy___0"] = createExportWrapper("emscripten_bind_Crc64Hash___destroy___0");
+
+/** @type {function(...*):?} */
+var ___errno_location = Module["___errno_location"] = createExportWrapper("__errno_location");
+
+/** @type {function(...*):?} */
+var _fflush = Module["_fflush"] = createExportWrapper("fflush");
+
+/** @type {function(...*):?} */
+var _malloc = Module["_malloc"] = createExportWrapper("malloc");
+
+/** @type {function(...*):?} */
+var _free = Module["_free"] = createExportWrapper("free");
+
+/** @type {function(...*):?} */
+var _emscripten_stack_init = Module["_emscripten_stack_init"] = function() {
+  return (_emscripten_stack_init = Module["_emscripten_stack_init"] = Module["asm"]["emscripten_stack_init"]).apply(null, arguments);
+};
+
+/** @type {function(...*):?} */
+var _emscripten_stack_get_free = Module["_emscripten_stack_get_free"] = function() {
+  return (_emscripten_stack_get_free = Module["_emscripten_stack_get_free"] = Module["asm"]["emscripten_stack_get_free"]).apply(null, arguments);
+};
+
+/** @type {function(...*):?} */
+var _emscripten_stack_get_base = Module["_emscripten_stack_get_base"] = function() {
+  return (_emscripten_stack_get_base = Module["_emscripten_stack_get_base"] = Module["asm"]["emscripten_stack_get_base"]).apply(null, arguments);
+};
+
+/** @type {function(...*):?} */
+var _emscripten_stack_get_end = Module["_emscripten_stack_get_end"] = function() {
+  return (_emscripten_stack_get_end = Module["_emscripten_stack_get_end"] = Module["asm"]["emscripten_stack_get_end"]).apply(null, arguments);
+};
+
+/** @type {function(...*):?} */
+var stackSave = Module["stackSave"] = createExportWrapper("stackSave");
+
+/** @type {function(...*):?} */
+var stackRestore = Module["stackRestore"] = createExportWrapper("stackRestore");
+
+/** @type {function(...*):?} */
+var stackAlloc = Module["stackAlloc"] = createExportWrapper("stackAlloc");
+
+/** @type {function(...*):?} */
+var _emscripten_stack_get_current = Module["_emscripten_stack_get_current"] = function() {
+  return (_emscripten_stack_get_current = Module["_emscripten_stack_get_current"] = Module["asm"]["emscripten_stack_get_current"]).apply(null, arguments);
+};
+
+/** @type {function(...*):?} */
+var dynCall_jiji = Module["dynCall_jiji"] = createExportWrapper("dynCall_jiji");
+
+var ___start_em_js = Module['___start_em_js'] = 5261488;
+var ___stop_em_js = Module['___stop_em_js'] = 5261586;
+
+
+
+// === Auto-generated postamble setup entry stuff ===
+
+
+var unexportedRuntimeSymbols = [
+  'run',
+  'UTF8ArrayToString',
+  'UTF8ToString',
+  'stringToUTF8Array',
+  'stringToUTF8',
+  'lengthBytesUTF8',
+  'addOnPreRun',
+  'addOnInit',
+  'addOnPreMain',
+  'addOnExit',
+  'addOnPostRun',
+  'addRunDependency',
+  'removeRunDependency',
+  'FS_createFolder',
+  'FS_createPath',
+  'FS_createDataFile',
+  'FS_createPreloadedFile',
+  'FS_createLazyFile',
+  'FS_createLink',
+  'FS_createDevice',
+  'FS_unlink',
+  'getLEB',
+  'getFunctionTables',
+  'alignFunctionTables',
+  'registerFunctions',
+  'prettyPrint',
+  'getCompilerSetting',
+  'out',
+  'err',
+  'callMain',
+  'abort',
+  'keepRuntimeAlive',
+  'wasmMemory',
+  'stackAlloc',
+  'stackSave',
+  'stackRestore',
+  'getTempRet0',
+  'setTempRet0',
+  'writeStackCookie',
+  'checkStackCookie',
+  'ptrToString',
+  'zeroMemory',
+  'stringToNewUTF8',
+  'exitJS',
+  'getHeapMax',
+  'emscripten_realloc_buffer',
+  'ENV',
+  'ERRNO_CODES',
+  'ERRNO_MESSAGES',
+  'setErrNo',
+  'inetPton4',
+  'inetNtop4',
+  'inetPton6',
+  'inetNtop6',
+  'readSockaddr',
+  'writeSockaddr',
+  'DNS',
+  'getHostByName',
+  'Protocols',
+  'Sockets',
+  'getRandomDevice',
+  'warnOnce',
+  'traverseStack',
+  'UNWIND_CACHE',
+  'convertPCtoSourceLocation',
+  'readEmAsmArgsArray',
+  'readEmAsmArgs',
+  'runEmAsmFunction',
+  'runMainThreadEmAsm',
+  'jstoi_q',
+  'jstoi_s',
+  'getExecutableName',
+  'listenOnce',
+  'autoResumeAudioContext',
+  'dynCallLegacy',
+  'getDynCaller',
+  'dynCall',
+  'handleException',
+  'runtimeKeepalivePush',
+  'runtimeKeepalivePop',
+  'callUserCallback',
+  'maybeExit',
+  'safeSetTimeout',
+  'asmjsMangle',
+  'asyncLoad',
+  'alignMemory',
+  'mmapAlloc',
+  'writeI53ToI64',
+  'writeI53ToI64Clamped',
+  'writeI53ToI64Signaling',
+  'writeI53ToU64Clamped',
+  'writeI53ToU64Signaling',
+  'readI53FromI64',
+  'readI53FromU64',
+  'convertI32PairToI53',
+  'convertI32PairToI53Checked',
+  'convertU32PairToI53',
+  'getCFunc',
+  'ccall',
+  'cwrap',
+  'uleb128Encode',
+  'sigToWasmTypes',
+  'generateFuncType',
+  'convertJsFunctionToWasm',
+  'freeTableIndexes',
+  'functionsInTableMap',
+  'getEmptyTableSlot',
+  'updateTableMap',
+  'addFunction',
+  'removeFunction',
+  'reallyNegative',
+  'unSign',
+  'strLen',
+  'reSign',
+  'formatString',
+  'setValue',
+  'getValue',
+  'PATH',
+  'PATH_FS',
+  'intArrayFromString',
+  'intArrayToString',
+  'AsciiToString',
+  'stringToAscii',
+  'UTF16Decoder',
+  'UTF16ToString',
+  'stringToUTF16',
+  'lengthBytesUTF16',
+  'UTF32ToString',
+  'stringToUTF32',
+  'lengthBytesUTF32',
+  'allocateUTF8',
+  'allocateUTF8OnStack',
+  'writeStringToMemory',
+  'writeArrayToMemory',
+  'writeAsciiToMemory',
+  'SYSCALLS',
+  'getSocketFromFD',
+  'getSocketAddress',
+  'JSEvents',
+  'registerKeyEventCallback',
+  'specialHTMLTargets',
+  'maybeCStringToJsString',
+  'findEventTarget',
+  'findCanvasEventTarget',
+  'getBoundingClientRect',
+  'fillMouseEventData',
+  'registerMouseEventCallback',
+  'registerWheelEventCallback',
+  'registerUiEventCallback',
+  'registerFocusEventCallback',
+  'fillDeviceOrientationEventData',
+  'registerDeviceOrientationEventCallback',
+  'fillDeviceMotionEventData',
+  'registerDeviceMotionEventCallback',
+  'screenOrientation',
+  'fillOrientationChangeEventData',
+  'registerOrientationChangeEventCallback',
+  'fillFullscreenChangeEventData',
+  'registerFullscreenChangeEventCallback',
+  'JSEvents_requestFullscreen',
+  'JSEvents_resizeCanvasForFullscreen',
+  'registerRestoreOldStyle',
+  'hideEverythingExceptGivenElement',
+  'restoreHiddenElements',
+  'setLetterbox',
+  'currentFullscreenStrategy',
+  'restoreOldWindowedStyle',
+  'softFullscreenResizeWebGLRenderTarget',
+  'doRequestFullscreen',
+  'fillPointerlockChangeEventData',
+  'registerPointerlockChangeEventCallback',
+  'registerPointerlockErrorEventCallback',
+  'requestPointerLock',
+  'fillVisibilityChangeEventData',
+  'registerVisibilityChangeEventCallback',
+  'registerTouchEventCallback',
+  'fillGamepadEventData',
+  'registerGamepadEventCallback',
+  'registerBeforeUnloadEventCallback',
+  'fillBatteryEventData',
+  'battery',
+  'registerBatteryEventCallback',
+  'setCanvasElementSize',
+  'getCanvasElementSize',
+  'demangle',
+  'demangleAll',
+  'jsStackTrace',
+  'stackTrace',
+  'ExitStatus',
+  'getEnvStrings',
+  'checkWasiClock',
+  'flush_NO_FILESYSTEM',
+  'dlopenMissingError',
+  'createDyncallWrapper',
+  'setImmediateWrapped',
+  'clearImmediateWrapped',
+  'polyfillSetImmediate',
+  'uncaughtExceptionCount',
+  'exceptionLast',
+  'exceptionCaught',
+  'ExceptionInfo',
+  'exception_addRef',
+  'exception_decRef',
+  'Browser',
+  'setMainLoop',
+  'wget',
+  'FS',
+  'MEMFS',
+  'TTY',
+  'PIPEFS',
+  'SOCKFS',
+  '_setNetworkCallback',
+  'tempFixedLengthArray',
+  'miniTempWebGLFloatBuffers',
+  'heapObjectForWebGLType',
+  'heapAccessShiftForWebGLHeap',
+  'GL',
+  'emscriptenWebGLGet',
+  'computeUnpackAlignedImageSize',
+  'emscriptenWebGLGetTexPixelData',
+  'emscriptenWebGLGetUniform',
+  'webglGetUniformLocation',
+  'webglPrepareUniformLocationsBeforeFirstUse',
+  'webglGetLeftBracePos',
+  'emscriptenWebGLGetVertexAttrib',
+  'writeGLArray',
+  'AL',
+  'SDL_unicode',
+  'SDL_ttfContext',
+  'SDL_audio',
+  'SDL',
+  'SDL_gfx',
+  'GLUT',
+  'EGL',
+  'GLFW_Window',
+  'GLFW',
+  'GLEW',
+  'IDBStore',
+  'runAndAbortIfError',
+  'ALLOC_NORMAL',
+  'ALLOC_STACK',
+  'allocate',
+];
+unexportedRuntimeSymbols.forEach(unexportedRuntimeSymbol);
+var missingLibrarySymbols = [
+  'zeroMemory',
+  'stringToNewUTF8',
+  'exitJS',
+  'setErrNo',
+  'inetPton4',
+  'inetNtop4',
+  'inetPton6',
+  'inetNtop6',
+  'readSockaddr',
+  'writeSockaddr',
+  'getHostByName',
+  'getRandomDevice',
+  'traverseStack',
+  'convertPCtoSourceLocation',
+  'readEmAsmArgs',
+  'runEmAsmFunction',
+  'runMainThreadEmAsm',
+  'jstoi_q',
+  'jstoi_s',
+  'getExecutableName',
+  'listenOnce',
+  'autoResumeAudioContext',
+  'dynCallLegacy',
+  'getDynCaller',
+  'dynCall',
+  'handleException',
+  'runtimeKeepalivePush',
+  'runtimeKeepalivePop',
+  'callUserCallback',
+  'maybeExit',
+  'safeSetTimeout',
+  'asmjsMangle',
+  'asyncLoad',
+  'alignMemory',
+  'mmapAlloc',
+  'writeI53ToI64',
+  'writeI53ToI64Clamped',
+  'writeI53ToI64Signaling',
+  'writeI53ToU64Clamped',
+  'writeI53ToU64Signaling',
+  'readI53FromI64',
+  'readI53FromU64',
+  'convertI32PairToI53',
+  'convertU32PairToI53',
+  'getCFunc',
+  'ccall',
+  'cwrap',
+  'uleb128Encode',
+  'sigToWasmTypes',
+  'generateFuncType',
+  'convertJsFunctionToWasm',
+  'getEmptyTableSlot',
+  'updateTableMap',
+  'addFunction',
+  'removeFunction',
+  'reallyNegative',
+  'unSign',
+  'strLen',
+  'reSign',
+  'formatString',
+  'intArrayToString',
+  'AsciiToString',
+  'stringToAscii',
+  'UTF16ToString',
+  'stringToUTF16',
+  'lengthBytesUTF16',
+  'UTF32ToString',
+  'stringToUTF32',
+  'lengthBytesUTF32',
+  'allocateUTF8',
+  'allocateUTF8OnStack',
+  'writeStringToMemory',
+  'writeArrayToMemory',
+  'writeAsciiToMemory',
+  'getSocketFromFD',
+  'getSocketAddress',
+  'registerKeyEventCallback',
+  'maybeCStringToJsString',
+  'findEventTarget',
+  'findCanvasEventTarget',
+  'getBoundingClientRect',
+  'fillMouseEventData',
+  'registerMouseEventCallback',
+  'registerWheelEventCallback',
+  'registerUiEventCallback',
+  'registerFocusEventCallback',
+  'fillDeviceOrientationEventData',
+  'registerDeviceOrientationEventCallback',
+  'fillDeviceMotionEventData',
+  'registerDeviceMotionEventCallback',
+  'screenOrientation',
+  'fillOrientationChangeEventData',
+  'registerOrientationChangeEventCallback',
+  'fillFullscreenChangeEventData',
+  'registerFullscreenChangeEventCallback',
+  'JSEvents_requestFullscreen',
+  'JSEvents_resizeCanvasForFullscreen',
+  'registerRestoreOldStyle',
+  'hideEverythingExceptGivenElement',
+  'restoreHiddenElements',
+  'setLetterbox',
+  'softFullscreenResizeWebGLRenderTarget',
+  'doRequestFullscreen',
+  'fillPointerlockChangeEventData',
+  'registerPointerlockChangeEventCallback',
+  'registerPointerlockErrorEventCallback',
+  'requestPointerLock',
+  'fillVisibilityChangeEventData',
+  'registerVisibilityChangeEventCallback',
+  'registerTouchEventCallback',
+  'fillGamepadEventData',
+  'registerGamepadEventCallback',
+  'registerBeforeUnloadEventCallback',
+  'fillBatteryEventData',
+  'battery',
+  'registerBatteryEventCallback',
+  'setCanvasElementSize',
+  'getCanvasElementSize',
+  'demangle',
+  'demangleAll',
+  'jsStackTrace',
+  'stackTrace',
+  'getEnvStrings',
+  'checkWasiClock',
+  'createDyncallWrapper',
+  'setImmediateWrapped',
+  'clearImmediateWrapped',
+  'polyfillSetImmediate',
+  'ExceptionInfo',
+  'exception_addRef',
+  'exception_decRef',
+  'setMainLoop',
+  '_setNetworkCallback',
+  'heapObjectForWebGLType',
+  'heapAccessShiftForWebGLHeap',
+  'emscriptenWebGLGet',
+  'computeUnpackAlignedImageSize',
+  'emscriptenWebGLGetTexPixelData',
+  'emscriptenWebGLGetUniform',
+  'webglGetUniformLocation',
+  'webglPrepareUniformLocationsBeforeFirstUse',
+  'webglGetLeftBracePos',
+  'emscriptenWebGLGetVertexAttrib',
+  'writeGLArray',
+  'SDL_unicode',
+  'SDL_ttfContext',
+  'SDL_audio',
+  'GLFW_Window',
+  'runAndAbortIfError',
+  'ALLOC_NORMAL',
+  'ALLOC_STACK',
+  'allocate',
+];
+missingLibrarySymbols.forEach(missingLibrarySymbol)
+
+
+var calledRun;
+
+dependenciesFulfilled = function runCaller() {
+  // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
+  if (!calledRun) run();
+  if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
+};
+
+function stackCheckInit() {
+  // This is normally called automatically during __wasm_call_ctors but need to
+  // get these values before even running any of the ctors so we call it redundantly
+  // here.
+  _emscripten_stack_init();
+  // TODO(sbc): Move writeStackCookie to native to to avoid this.
+  writeStackCookie();
+}
+
+/** @type {function(Array=)} */
+function run(args) {
+  args = args || arguments_;
+
+  if (runDependencies > 0) {
+    return;
+  }
+
+    stackCheckInit();
+
+  preRun();
+
+  // a preRun added a dependency, run will be called later
+  if (runDependencies > 0) {
+    return;
+  }
+
+  function doRun() {
+    // run may have just been called through dependencies being fulfilled just in this very frame,
+    // or while the async setStatus time below was happening
+    if (calledRun) return;
+    calledRun = true;
+    Module['calledRun'] = true;
+
+    if (ABORT) return;
+
+    initRuntime();
+
+    readyPromiseResolve(Module);
+    if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();
+
+    assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');
+
+    postRun();
+  }
+
+  if (Module['setStatus']) {
+    Module['setStatus']('Running...');
+    setTimeout(function() {
+      setTimeout(function() {
+        Module['setStatus']('');
+      }, 1);
+      doRun();
+    }, 1);
+  } else
+  {
+    doRun();
+  }
+  checkStackCookie();
+}
+
+function checkUnflushedContent() {
+  // Compiler settings do not allow exiting the runtime, so flushing
+  // the streams is not possible. but in ASSERTIONS mode we check
+  // if there was something to flush, and if so tell the user they
+  // should request that the runtime be exitable.
+  // Normally we would not even include flush() at all, but in ASSERTIONS
+  // builds we do so just for this check, and here we see if there is any
+  // content to flush, that is, we check if there would have been
+  // something a non-ASSERTIONS build would have not seen.
+  // How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0
+  // mode (which has its own special function for this; otherwise, all
+  // the code is inside libc)
+  var oldOut = out;
+  var oldErr = err;
+  var has = false;
+  out = err = (x) => {
+    has = true;
+  }
+  try { // it doesn't matter if it fails
+    flush_NO_FILESYSTEM();
+  } catch(e) {}
+  out = oldOut;
+  err = oldErr;
+  if (has) {
+    warnOnce('stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.');
+    warnOnce('(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)');
+  }
+}
+
+if (Module['preInit']) {
+  if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
+  while (Module['preInit'].length > 0) {
+    Module['preInit'].pop()();
+  }
+}
+
+run();
+
+
+
+
+
+
+// Bindings utilities
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function WrapperObject() {
+}
+WrapperObject.prototype = Object.create(WrapperObject.prototype);
+WrapperObject.prototype.constructor = WrapperObject;
+WrapperObject.prototype.__class__ = WrapperObject;
+WrapperObject.__cache__ = {};
+Module['WrapperObject'] = WrapperObject;
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant)
+    @param {*=} __class__ */
+function getCache(__class__) {
+  return (__class__ || WrapperObject).__cache__;
+}
+Module['getCache'] = getCache;
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant)
+    @param {*=} __class__ */
+function wrapPointer(ptr, __class__) {
+  var cache = getCache(__class__);
+  var ret = cache[ptr];
+  if (ret) return ret;
+  ret = Object.create((__class__ || WrapperObject).prototype);
+  ret.ptr = ptr;
+  return cache[ptr] = ret;
+}
+Module['wrapPointer'] = wrapPointer;
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function castObject(obj, __class__) {
+  return wrapPointer(obj.ptr, __class__);
+}
+Module['castObject'] = castObject;
+
+Module['NULL'] = wrapPointer(0);
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function destroy(obj) {
+  if (!obj['__destroy__']) throw 'Error: Cannot destroy object. (Did you create it yourself?)';
+  obj['__destroy__']();
+  // Remove from cache, so the object can be GC'd and refs added onto it released
+  delete getCache(obj.__class__)[obj.ptr];
+}
+Module['destroy'] = destroy;
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function compare(obj1, obj2) {
+  return obj1.ptr === obj2.ptr;
+}
+Module['compare'] = compare;
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function getPointer(obj) {
+  return obj.ptr;
 }
-exports.Minipass = Minipass;
-//# sourceMappingURL=index.js.map
+Module['getPointer'] = getPointer;
 
-/***/ }),
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function getClass(obj) {
+  return obj.__class__;
+}
+Module['getClass'] = getClass;
 
-/***/ 38958:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+// Converts big (string or array) values into a C-style storage, in temporary space
 
-"use strict";
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+var ensureCache = {
+  buffer: 0,  // the main buffer of temporary storage
+  size: 0,   // the size of buffer
+  pos: 0,    // the next free offset in buffer
+  temps: [], // extra allocations
+  needed: 0, // the total size we need next time
 
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
-    if (k2 === undefined) k2 = k;
-    var desc = Object.getOwnPropertyDescriptor(m, k);
-    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
-      desc = { enumerable: true, get: function() { return m[k]; } };
-    }
-    Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
-    if (k2 === undefined) k2 = k;
-    o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
-    Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
-    o["default"] = v;
-});
-var __importStar = (this && this.__importStar) || function (mod) {
-    if (mod && mod.__esModule) return mod;
-    var result = {};
-    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
-    __setModuleDefault(result, mod);
-    return result;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0;
-const lru_cache_1 = __nccwpck_require__(32477);
-const node_path_1 = __nccwpck_require__(76760);
-const node_url_1 = __nccwpck_require__(73136);
-const fs_1 = __nccwpck_require__(79896);
-const actualFS = __importStar(__nccwpck_require__(73024));
-const realpathSync = fs_1.realpathSync.native;
-// TODO: test perf of fs/promises realpath vs realpathCB,
-// since the promises one uses realpath.native
-const promises_1 = __nccwpck_require__(51455);
-const minipass_1 = __nccwpck_require__(78275);
-const defaultFS = {
-    lstatSync: fs_1.lstatSync,
-    readdir: fs_1.readdir,
-    readdirSync: fs_1.readdirSync,
-    readlinkSync: fs_1.readlinkSync,
-    realpathSync,
-    promises: {
-        lstat: promises_1.lstat,
-        readdir: promises_1.readdir,
-        readlink: promises_1.readlink,
-        realpath: promises_1.realpath,
-    },
-};
-// if they just gave us require('fs') then use our default
-const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ?
-    defaultFS
-    : {
-        ...defaultFS,
-        ...fsOption,
-        promises: {
-            ...defaultFS.promises,
-            ...(fsOption.promises || {}),
-        },
-    };
-// turn something like //?/c:/ into c:\
-const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
-const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
-// windows paths are separated by either / or \
-const eitherSep = /[\\\/]/;
-const UNKNOWN = 0; // may not even exist, for all we know
-const IFIFO = 0b0001;
-const IFCHR = 0b0010;
-const IFDIR = 0b0100;
-const IFBLK = 0b0110;
-const IFREG = 0b1000;
-const IFLNK = 0b1010;
-const IFSOCK = 0b1100;
-const IFMT = 0b1111;
-// mask to unset low 4 bits
-const IFMT_UNKNOWN = ~IFMT;
-// set after successfully calling readdir() and getting entries.
-const READDIR_CALLED = 0b0000_0001_0000;
-// set after a successful lstat()
-const LSTAT_CALLED = 0b0000_0010_0000;
-// set if an entry (or one of its parents) is definitely not a dir
-const ENOTDIR = 0b0000_0100_0000;
-// set if an entry (or one of its parents) does not exist
-// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
-const ENOENT = 0b0000_1000_0000;
-// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
-// set if we fail to readlink
-const ENOREADLINK = 0b0001_0000_0000;
-// set if we know realpath() will fail
-const ENOREALPATH = 0b0010_0000_0000;
-const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
-const TYPEMASK = 0b0011_1111_1111;
-const entToType = (s) => s.isFile() ? IFREG
-    : s.isDirectory() ? IFDIR
-        : s.isSymbolicLink() ? IFLNK
-            : s.isCharacterDevice() ? IFCHR
-                : s.isBlockDevice() ? IFBLK
-                    : s.isSocket() ? IFSOCK
-                        : s.isFIFO() ? IFIFO
-                            : UNKNOWN;
-// normalize unicode path names
-const normalizeCache = new Map();
-const normalize = (s) => {
-    const c = normalizeCache.get(s);
-    if (c)
-        return c;
-    const n = s.normalize('NFKD');
-    normalizeCache.set(s, n);
-    return n;
-};
-const normalizeNocaseCache = new Map();
-const normalizeNocase = (s) => {
-    const c = normalizeNocaseCache.get(s);
-    if (c)
-        return c;
-    const n = normalize(s.toLowerCase());
-    normalizeNocaseCache.set(s, n);
-    return n;
-};
-/**
- * An LRUCache for storing resolved path strings or Path objects.
- * @internal
- */
-class ResolveCache extends lru_cache_1.LRUCache {
-    constructor() {
-        super({ max: 256 });
-    }
-}
-exports.ResolveCache = ResolveCache;
-// In order to prevent blowing out the js heap by allocating hundreds of
-// thousands of Path entries when walking extremely large trees, the "children"
-// in this tree are represented by storing an array of Path entries in an
-// LRUCache, indexed by the parent.  At any time, Path.children() may return an
-// empty array, indicating that it doesn't know about any of its children, and
-// thus has to rebuild that cache.  This is fine, it just means that we don't
-// benefit as much from having the cached entries, but huge directory walks
-// don't blow out the stack, and smaller ones are still as fast as possible.
-//
-//It does impose some complexity when building up the readdir data, because we
-//need to pass a reference to the children array that we started with.
-/**
- * an LRUCache for storing child entries.
- * @internal
- */
-class ChildrenCache extends lru_cache_1.LRUCache {
-    constructor(maxSize = 16 * 1024) {
-        super({
-            maxSize,
-            // parent + children
-            sizeCalculation: a => a.length + 1,
-        });
-    }
-}
-exports.ChildrenCache = ChildrenCache;
-const setAsCwd = Symbol('PathScurry setAsCwd');
-/**
- * Path objects are sort of like a super-powered
- * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
- *
- * Each one represents a single filesystem entry on disk, which may or may not
- * exist. It includes methods for reading various types of information via
- * lstat, readlink, and readdir, and caches all information to the greatest
- * degree possible.
- *
- * Note that fs operations that would normally throw will instead return an
- * "empty" value. This is in order to prevent excessive overhead from error
- * stack traces.
- */
-class PathBase {
-    /**
-     * the basename of this path
-     *
-     * **Important**: *always* test the path name against any test string
-     * usingthe {@link isNamed} method, and not by directly comparing this
-     * string. Otherwise, unicode path strings that the system sees as identical
-     * will not be properly treated as the same path, leading to incorrect
-     * behavior and possible security issues.
-     */
-    name;
-    /**
-     * the Path entry corresponding to the path root.
-     *
-     * @internal
-     */
-    root;
-    /**
-     * All roots found within the current PathScurry family
-     *
-     * @internal
-     */
-    roots;
-    /**
-     * a reference to the parent path, or undefined in the case of root entries
-     *
-     * @internal
-     */
-    parent;
-    /**
-     * boolean indicating whether paths are compared case-insensitively
-     * @internal
-     */
-    nocase;
-    /**
-     * boolean indicating that this path is the current working directory
-     * of the PathScurry collection that contains it.
-     */
-    isCWD = false;
-    // potential default fs override
-    #fs;
-    // Stats fields
-    #dev;
-    get dev() {
-        return this.#dev;
-    }
-    #mode;
-    get mode() {
-        return this.#mode;
-    }
-    #nlink;
-    get nlink() {
-        return this.#nlink;
-    }
-    #uid;
-    get uid() {
-        return this.#uid;
-    }
-    #gid;
-    get gid() {
-        return this.#gid;
-    }
-    #rdev;
-    get rdev() {
-        return this.#rdev;
-    }
-    #blksize;
-    get blksize() {
-        return this.#blksize;
-    }
-    #ino;
-    get ino() {
-        return this.#ino;
-    }
-    #size;
-    get size() {
-        return this.#size;
-    }
-    #blocks;
-    get blocks() {
-        return this.#blocks;
-    }
-    #atimeMs;
-    get atimeMs() {
-        return this.#atimeMs;
-    }
-    #mtimeMs;
-    get mtimeMs() {
-        return this.#mtimeMs;
-    }
-    #ctimeMs;
-    get ctimeMs() {
-        return this.#ctimeMs;
-    }
-    #birthtimeMs;
-    get birthtimeMs() {
-        return this.#birthtimeMs;
-    }
-    #atime;
-    get atime() {
-        return this.#atime;
-    }
-    #mtime;
-    get mtime() {
-        return this.#mtime;
-    }
-    #ctime;
-    get ctime() {
-        return this.#ctime;
-    }
-    #birthtime;
-    get birthtime() {
-        return this.#birthtime;
+  prepare: function() {
+    if (ensureCache.needed) {
+      // clear the temps
+      for (var i = 0; i < ensureCache.temps.length; i++) {
+        Module['_free'](ensureCache.temps[i]);
+      }
+      ensureCache.temps.length = 0;
+      // prepare to allocate a bigger buffer
+      Module['_free'](ensureCache.buffer);
+      ensureCache.buffer = 0;
+      ensureCache.size += ensureCache.needed;
+      // clean up
+      ensureCache.needed = 0;
     }
-    #matchName;
-    #depth;
-    #fullpath;
-    #fullpathPosix;
-    #relative;
-    #relativePosix;
-    #type;
-    #children;
-    #linkTarget;
-    #realpath;
-    /**
-     * This property is for compatibility with the Dirent class as of
-     * Node v20, where Dirent['parentPath'] refers to the path of the
-     * directory that was passed to readdir. For root entries, it's the path
-     * to the entry itself.
-     */
-    get parentPath() {
-        return (this.parent || this).fullpath();
+    if (!ensureCache.buffer) { // happens first time, or when we need to grow
+      ensureCache.size += 128; // heuristic, avoid many small grow events
+      ensureCache.buffer = Module['_malloc'](ensureCache.size);
+      assert(ensureCache.buffer);
     }
-    /**
-     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
-     * this property refers to the *parent* path, not the path object itself.
-     */
-    get path() {
-        return this.parentPath;
+    ensureCache.pos = 0;
+  },
+  alloc: function(array, view) {
+    assert(ensureCache.buffer);
+    var bytes = view.BYTES_PER_ELEMENT;
+    var len = array.length * bytes;
+    len = (len + 7) & -8; // keep things aligned to 8 byte boundaries
+    var ret;
+    if (ensureCache.pos + len >= ensureCache.size) {
+      // we failed to allocate in the buffer, ensureCache time around :(
+      assert(len > 0); // null terminator, at least
+      ensureCache.needed += len;
+      ret = Module['_malloc'](len);
+      ensureCache.temps.push(ret);
+    } else {
+      // we can allocate in the buffer
+      ret = ensureCache.buffer + ensureCache.pos;
+      ensureCache.pos += len;
     }
-    /**
-     * Do not create new Path objects directly.  They should always be accessed
-     * via the PathScurry class or other methods on the Path class.
-     *
-     * @internal
-     */
-    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
-        this.name = name;
-        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
-        this.#type = type & TYPEMASK;
-        this.nocase = nocase;
-        this.roots = roots;
-        this.root = root || this;
-        this.#children = children;
-        this.#fullpath = opts.fullpath;
-        this.#relative = opts.relative;
-        this.#relativePosix = opts.relativePosix;
-        this.parent = opts.parent;
-        if (this.parent) {
-            this.#fs = this.parent.#fs;
-        }
-        else {
-            this.#fs = fsFromOption(opts.fs);
-        }
+    return ret;
+  },
+  copy: function(array, view, offset) {
+    offset >>>= 0;
+    var bytes = view.BYTES_PER_ELEMENT;
+    switch (bytes) {
+      case 2: offset >>>= 1; break;
+      case 4: offset >>>= 2; break;
+      case 8: offset >>>= 3; break;
     }
-    /**
-     * Returns the depth of the Path object from its root.
-     *
-     * For example, a path at `/foo/bar` would have a depth of 2.
-     */
-    depth() {
-        if (this.#depth !== undefined)
-            return this.#depth;
-        if (!this.parent)
-            return (this.#depth = 0);
-        return (this.#depth = this.parent.depth() + 1);
+    for (var i = 0; i < array.length; i++) {
+      view[offset + i] = array[i];
     }
-    /**
-     * @internal
-     */
-    childrenCache() {
-        return this.#children;
+  },
+};
+
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function ensureString(value) {
+  if (typeof value === 'string') {
+    var intArray = intArrayFromString(value);
+    var offset = ensureCache.alloc(intArray, HEAP8);
+    ensureCache.copy(intArray, HEAP8, offset);
+    return offset;
+  }
+  return value;
+}
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function ensureInt8(value) {
+  if (typeof value === 'object') {
+    var offset = ensureCache.alloc(value, HEAP8);
+    ensureCache.copy(value, HEAP8, offset);
+    return offset;
+  }
+  return value;
+}
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function ensureInt16(value) {
+  if (typeof value === 'object') {
+    var offset = ensureCache.alloc(value, HEAP16);
+    ensureCache.copy(value, HEAP16, offset);
+    return offset;
+  }
+  return value;
+}
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function ensureInt32(value) {
+  if (typeof value === 'object') {
+    var offset = ensureCache.alloc(value, HEAP32);
+    ensureCache.copy(value, HEAP32, offset);
+    return offset;
+  }
+  return value;
+}
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function ensureFloat32(value) {
+  if (typeof value === 'object') {
+    var offset = ensureCache.alloc(value, HEAPF32);
+    ensureCache.copy(value, HEAPF32, offset);
+    return offset;
+  }
+  return value;
+}
+/** @suppress {duplicate} (TODO: avoid emitting this multiple times, it is redundant) */
+function ensureFloat64(value) {
+  if (typeof value === 'object') {
+    var offset = ensureCache.alloc(value, HEAPF64);
+    ensureCache.copy(value, HEAPF64, offset);
+    return offset;
+  }
+  return value;
+}
+
+
+// VoidPtr
+/** @suppress {undefinedVars, duplicate} @this{Object} */function VoidPtr() { throw "cannot construct a VoidPtr, no constructor in IDL" }
+VoidPtr.prototype = Object.create(WrapperObject.prototype);
+VoidPtr.prototype.constructor = VoidPtr;
+VoidPtr.prototype.__class__ = VoidPtr;
+VoidPtr.__cache__ = {};
+Module['VoidPtr'] = VoidPtr;
+
+  VoidPtr.prototype['__destroy__'] = VoidPtr.prototype.__destroy__ = /** @suppress {undefinedVars, duplicate} @this{Object} */function() {
+  var self = this.ptr;
+  _emscripten_bind_VoidPtr___destroy___0(self);
+};
+// Crc64Hash
+/** @suppress {undefinedVars, duplicate} @this{Object} */function Crc64Hash() {
+  this.ptr = _emscripten_bind_Crc64Hash_Crc64Hash_0();
+  getCache(Crc64Hash)[this.ptr] = this;
+};;
+Crc64Hash.prototype = Object.create(WrapperObject.prototype);
+Crc64Hash.prototype.constructor = Crc64Hash;
+Crc64Hash.prototype.__class__ = Crc64Hash;
+Crc64Hash.__cache__ = {};
+Module['Crc64Hash'] = Crc64Hash;
+
+Crc64Hash.prototype['OnAppend'] = Crc64Hash.prototype.OnAppend = /** @suppress {undefinedVars, duplicate} @this{Object} */function(data, length) {
+  var self = this.ptr;
+  if (data && typeof data === 'object') data = data.ptr;
+  if (length && typeof length === 'object') length = length.ptr;
+  _emscripten_bind_Crc64Hash_OnAppend_2(self, data, length);
+};;
+
+Crc64Hash.prototype['OnFinal'] = Crc64Hash.prototype.OnFinal = /** @suppress {undefinedVars, duplicate} @this{Object} */function(data, length, result) {
+  var self = this.ptr;
+  if (data && typeof data === 'object') data = data.ptr;
+  if (length && typeof length === 'object') length = length.ptr;
+  if (result && typeof result === 'object') result = result.ptr;
+  _emscripten_bind_Crc64Hash_OnFinal_3(self, data, length, result);
+};;
+
+  Crc64Hash.prototype['__destroy__'] = Crc64Hash.prototype.__destroy__ = /** @suppress {undefinedVars, duplicate} @this{Object} */function() {
+  var self = this.ptr;
+  _emscripten_bind_Crc64Hash___destroy___0(self);
+};
+
+  return NativeCRC64.ready
+}
+);
+})();
+// if (typeof exports === 'object' && typeof module === 'object')
+//   module.exports = NativeCRC64;
+// else if (typeof define === 'function' && define['amd'])
+//   define([], function() { return NativeCRC64; });
+// else if (typeof exports === 'object')
+//   exports["NativeCRC64"] = NativeCRC64;
+
+// ESM-EXPORT-START (rewritten to `module.exports = NativeCRC64;` in dist/commonjs by copyJSFiles.cjs)
+/* harmony default export */ const crc64 = (NativeCRC64);
+// ESM-EXPORT-END
+
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/StorageCRC64Calculator.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+// @ts-expect-error the crc64 js file is auto generated
+
+/**
+ * Class used to calculator CRC64 checksum
+ */
+class StorageCRC64Calculator {
+    nativeCrc64Hash;
+    static nativeInstance;
+    constructor() {
+        this.nativeCrc64Hash = new StorageCRC64Calculator.nativeInstance.Crc64Hash();
     }
+    static initPromise;
     /**
-     * Get the Path object referenced by the string path, resolved from this Path
+     * Initialize environment for CRC64 checksum calculator
      */
-    resolve(path) {
-        if (!path) {
-            return this;
-        }
-        const rootPath = this.getRootString(path);
-        const dir = path.substring(rootPath.length);
-        const dirParts = dir.split(this.splitSep);
-        const result = rootPath ?
-            this.getRoot(rootPath).#resolveParts(dirParts)
-            : this.#resolveParts(dirParts);
-        return result;
-    }
-    #resolveParts(dirParts) {
-        let p = this;
-        for (const part of dirParts) {
-            p = p.child(part);
+    static async init() {
+        if (!this.initPromise) {
+            this.initPromise = crc64().then((instance) => {
+                this.nativeInstance = instance;
+                return;
+            });
         }
-        return p;
+        return this.initPromise;
     }
     /**
-     * Returns the cached children Path objects, if still available.  If they
-     * have fallen out of the cache, then returns an empty array, and resets the
-     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
-     * lookup.
-     *
-     * @internal
+     * Append data for CRC64 checksum calculator
+     * @param body - content to be append
+     * @param length - length of the content
      */
-    children() {
-        const cached = this.#children.get(this);
-        if (cached) {
-            return cached;
-        }
-        const children = Object.assign([], { provisional: 0 });
-        this.#children.set(this, children);
-        this.#type &= ~READDIR_CALLED;
-        return children;
+    append(body, length) {
+        const ptr = StorageCRC64Calculator.nativeInstance._malloc(length);
+        StorageCRC64Calculator.nativeInstance.HEAPU8.set(body, ptr);
+        this.nativeCrc64Hash.OnAppend(ptr, length);
+        StorageCRC64Calculator.nativeInstance._free(ptr);
     }
     /**
-     * Resolves a path portion and returns or creates the child Path.
-     *
-     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
-     * `'..'`.
-     *
-     * This should not be called directly.  If `pathPart` contains any path
-     * separators, it will lead to unsafe undefined behavior.
-     *
-     * Use `Path.resolve()` instead.
-     *
-     * @internal
+     * Complete CRC64 checksum calculating and get the final result.
+     * @param body -
+     * @param length -
+     * @returns
      */
-    child(pathPart, opts) {
-        if (pathPart === '' || pathPart === '.') {
-            return this;
-        }
-        if (pathPart === '..') {
-            return this.parent || this;
-        }
-        // find the child
-        const children = this.children();
-        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
-        for (const p of children) {
-            if (p.#matchName === name) {
-                return p;
+    final(body, length) {
+        const ptr = StorageCRC64Calculator.nativeInstance._malloc(length);
+        StorageCRC64Calculator.nativeInstance.HEAPU8.set(body, ptr);
+        const result = StorageCRC64Calculator.nativeInstance._malloc(8);
+        this.nativeCrc64Hash.OnFinal(ptr, length, result);
+        StorageCRC64Calculator.nativeInstance._free(ptr);
+        const resultArray = new Uint8Array(8);
+        resultArray.set(StorageCRC64Calculator.nativeInstance.HEAPU8.subarray(result, result + 8));
+        StorageCRC64Calculator.nativeInstance._free(result);
+        return resultArray;
+    }
+}
+//# sourceMappingURL=StorageCRC64Calculator.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/streamHelpers.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * Signals the end of a stream by pushing null.
+ * In Node.js, this is required to signal the end of a Readable stream.
+ * @internal
+ */
+function signalStreamEnd(pushData) {
+    pushData(null);
+}
+//# sourceMappingURL=streamHelpers.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/StructuredMessageEncoding.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+const MESSAGE_VERSION = 1;
+const MESSAGE_HEADER_LENGTH = 13;
+const SEGMENT_HEADER_LENGTH = 10;
+const FOOTER_LENGTH = 8;
+const MAX_SEGMENT_CONTENT_LENGTH = 4 * 1024 * 1024;
+var SMRegion;
+(function (SMRegion) {
+    SMRegion[SMRegion["StreamHeader"] = 0] = "StreamHeader";
+    SMRegion[SMRegion["StreamFooter"] = 1] = "StreamFooter";
+    SMRegion[SMRegion["SegmentHeader"] = 2] = "SegmentHeader";
+    SMRegion[SMRegion["SegmentFooter"] = 3] = "SegmentFooter";
+    SMRegion[SMRegion["SegmentContent"] = 4] = "SegmentContent";
+    SMRegion[SMRegion["Completed"] = 5] = "Completed";
+})(SMRegion || (SMRegion = {}));
+class StructuredMessageEncoding {
+    pushData;
+    contentLength;
+    messageLength;
+    constructor(pushData, contentLength) {
+        this.pushData = pushData;
+        this.contentLength = contentLength;
+        this.contentOffset = 0;
+        this.currentDataOffset = 0;
+        this.segmentsCount = Math.ceil(this.contentLength / MAX_SEGMENT_CONTENT_LENGTH);
+        this.messageLength =
+            this.contentLength +
+                MESSAGE_HEADER_LENGTH +
+                (SEGMENT_HEADER_LENGTH + FOOTER_LENGTH) * this.segmentsCount +
+                FOOTER_LENGTH;
+        this.messageHeaderBuffer = new Uint8Array(MESSAGE_HEADER_LENGTH);
+        this.segmentNumber = 0;
+        this.segmentContentLength = 0;
+        this.segmentContentOffset = 0;
+        this.state = SMRegion.StreamHeader;
+        this.segmentCrc64 = new StorageCRC64Calculator();
+        this.messageCrc64 = new StorageCRC64Calculator();
+    }
+    currentDataOffset;
+    contentOffset;
+    segmentsCount;
+    messageHeaderBuffer;
+    segmentNumber;
+    segmentContentLength;
+    segmentContentOffset;
+    segmentCrc64;
+    messageCrc64;
+    state;
+    sourceDataHandler = (data) => {
+        this.currentDataOffset = 0;
+        if (this.state === SMRegion.StreamHeader) {
+            this.handlingMessageHeader();
+        }
+        while (this.segmentNumber < this.segmentsCount) {
+            this.segmentContentLength = Math.min(MAX_SEGMENT_CONTENT_LENGTH, this.contentLength - this.contentOffset);
+            if (this.state === SMRegion.SegmentHeader) {
+                this.handlingSegmentHeader();
+            }
+            if (this.state === SMRegion.SegmentContent) {
+                this.handlingSegmentContent(data);
+            }
+            if (this.state === SMRegion.SegmentFooter) {
+                this.handlingSegmentFooter();
+                this.contentOffset += this.segmentContentLength;
+            }
+            if (this.currentDataOffset === data.length) {
+                break;
             }
         }
-        // didn't find it, create provisional child, since it might not
-        // actually exist.  If we know the parent isn't a dir, then
-        // in fact it CAN'T exist.
-        const s = this.parent ? this.sep : '';
-        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
-        const pchild = this.newChild(pathPart, UNKNOWN, {
-            ...opts,
-            parent: this,
-            fullpath,
-        });
-        if (!this.canReaddir()) {
-            pchild.#type |= ENOENT;
+        if (this.state === SMRegion.StreamFooter) {
+            this.handlingMessageFooter();
         }
-        // don't have to update provisional, because if we have real children,
-        // then provisional is set to children.length, otherwise a lower number
-        children.push(pchild);
-        return pchild;
-    }
-    /**
-     * The relative path from the cwd. If it does not share an ancestor with
-     * the cwd, then this ends up being equivalent to the fullpath()
-     */
-    relative() {
-        if (this.isCWD)
-            return '';
-        if (this.#relative !== undefined) {
-            return this.#relative;
+    };
+    handlingMessageHeader() {
+        this.messageHeaderBuffer[0] = MESSAGE_VERSION;
+        this.fillInt64(this.messageHeaderBuffer, 1, this.messageLength); // content length
+        this.fillInt16(this.messageHeaderBuffer, 9, 1);
+        this.fillInt16(this.messageHeaderBuffer, 11, this.segmentsCount);
+        this.pushData(this.messageHeaderBuffer);
+        this.state = SMRegion.SegmentHeader;
+    }
+    handlingSegmentHeader() {
+        const segmentHeaderBuffer = new Uint8Array(SEGMENT_HEADER_LENGTH);
+        this.fillInt16(segmentHeaderBuffer, 0, this.segmentNumber + 1);
+        this.fillInt64(segmentHeaderBuffer, 2, this.segmentContentLength);
+        this.segmentContentOffset = 0;
+        this.pushData(segmentHeaderBuffer);
+        this.state = SMRegion.SegmentContent;
+    }
+    handlingSegmentContent(data) {
+        const length = Math.min(this.segmentContentLength - this.segmentContentOffset, data.length - this.currentDataOffset);
+        if (length !== 0) {
+            const current_content = Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length);
+            this.messageCrc64.append(current_content, length);
+            this.segmentCrc64.append(current_content, length);
+            this.pushData(current_content);
+        }
+        this.segmentContentOffset += length;
+        this.currentDataOffset += length;
+        if (this.segmentContentOffset === this.segmentContentLength) {
+            this.state = SMRegion.SegmentFooter;
+        }
+    }
+    handlingSegmentFooter() {
+        const crc64Result = this.segmentCrc64.final(new Uint8Array([]), 0);
+        this.pushData(crc64Result);
+        this.segmentCrc64 = new StorageCRC64Calculator();
+        ++this.segmentNumber;
+        if (this.segmentNumber === this.segmentsCount) {
+            this.state = SMRegion.StreamFooter;
         }
-        const name = this.name;
-        const p = this.parent;
-        if (!p) {
-            return (this.#relative = this.name);
+        else {
+            this.state = SMRegion.SegmentHeader;
         }
-        const pv = p.relative();
-        return pv + (!pv || !p.parent ? '' : this.sep) + name;
     }
-    /**
-     * The relative path from the cwd, using / as the path separator.
-     * If it does not share an ancestor with
-     * the cwd, then this ends up being equivalent to the fullpathPosix()
-     * On posix systems, this is identical to relative().
-     */
-    relativePosix() {
-        if (this.sep === '/')
-            return this.relative();
-        if (this.isCWD)
-            return '';
-        if (this.#relativePosix !== undefined)
-            return this.#relativePosix;
-        const name = this.name;
-        const p = this.parent;
-        if (!p) {
-            return (this.#relativePosix = this.fullpathPosix());
-        }
-        const pv = p.relativePosix();
-        return pv + (!pv || !p.parent ? '' : '/') + name;
+    handlingMessageFooter() {
+        const crc64Result = this.messageCrc64.final(new Uint8Array([]), 0);
+        this.pushData(crc64Result);
+        signalStreamEnd(this.pushData);
+        this.state = SMRegion.Completed;
     }
-    /**
-     * The fully resolved path string for this Path entry
-     */
-    fullpath() {
-        if (this.#fullpath !== undefined) {
-            return this.#fullpath;
-        }
-        const name = this.name;
-        const p = this.parent;
-        if (!p) {
-            return (this.#fullpath = this.name);
+    fillInt64(buffer, offset, input) {
+        if (buffer.length < offset + 8) {
+            throw new Error("Uint8Array length is not expected.");
         }
-        const pv = p.fullpath();
-        const fp = pv + (!p.parent ? '' : this.sep) + name;
-        return (this.#fullpath = fp);
+        const view = new DataView(buffer.buffer, buffer.byteOffset + offset, 8);
+        view.setBigUint64(0, BigInt(input), true);
     }
-    /**
-     * On platforms other than windows, this is identical to fullpath.
-     *
-     * On windows, this is overridden to return the forward-slash form of the
-     * full UNC path.
-     */
-    fullpathPosix() {
-        if (this.#fullpathPosix !== undefined)
-            return this.#fullpathPosix;
-        if (this.sep === '/')
-            return (this.#fullpathPosix = this.fullpath());
-        if (!this.parent) {
-            const p = this.fullpath().replace(/\\/g, '/');
-            if (/^[a-z]:\//i.test(p)) {
-                return (this.#fullpathPosix = `//?/${p}`);
-            }
-            else {
-                return (this.#fullpathPosix = p);
-            }
+    fillInt16(buffer, offset, input) {
+        if (buffer.length < offset + 2) {
+            throw new Error("Uint8Array length is not expected.");
         }
-        const p = this.parent;
-        const pfpp = p.fullpathPosix();
-        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
-        return (this.#fullpathPosix = fpp);
-    }
-    /**
-     * Is the Path of an unknown type?
-     *
-     * Note that we might know *something* about it if there has been a previous
-     * filesystem operation, for example that it does not exist, or is not a
-     * link, or whether it has child entries.
-     */
-    isUnknown() {
-        return (this.#type & IFMT) === UNKNOWN;
-    }
-    isType(type) {
-        return this[`is${type}`]();
-    }
-    getType() {
-        return (this.isUnknown() ? 'Unknown'
-            : this.isDirectory() ? 'Directory'
-                : this.isFile() ? 'File'
-                    : this.isSymbolicLink() ? 'SymbolicLink'
-                        : this.isFIFO() ? 'FIFO'
-                            : this.isCharacterDevice() ? 'CharacterDevice'
-                                : this.isBlockDevice() ? 'BlockDevice'
-                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
-                                        : 'Unknown');
-        /* c8 ignore stop */
-    }
-    /**
-     * Is the Path a regular file?
-     */
-    isFile() {
-        return (this.#type & IFMT) === IFREG;
-    }
-    /**
-     * Is the Path a directory?
-     */
-    isDirectory() {
-        return (this.#type & IFMT) === IFDIR;
-    }
-    /**
-     * Is the path a character device?
-     */
-    isCharacterDevice() {
-        return (this.#type & IFMT) === IFCHR;
-    }
-    /**
-     * Is the path a block device?
-     */
-    isBlockDevice() {
-        return (this.#type & IFMT) === IFBLK;
-    }
-    /**
-     * Is the path a FIFO pipe?
-     */
-    isFIFO() {
-        return (this.#type & IFMT) === IFIFO;
-    }
-    /**
-     * Is the path a socket?
-     */
-    isSocket() {
-        return (this.#type & IFMT) === IFSOCK;
+        const view = new DataView(buffer.buffer, buffer.byteOffset + offset, 2);
+        view.setUint16(0, input, true);
     }
-    /**
-     * Is the path a symbolic link?
-     */
-    isSymbolicLink() {
-        return (this.#type & IFLNK) === IFLNK;
-    }
-    /**
-     * Return the entry if it has been subject of a successful lstat, or
-     * undefined otherwise.
-     *
-     * Does not read the filesystem, so an undefined result *could* simply
-     * mean that we haven't called lstat on it.
-     */
-    lstatCached() {
-        return this.#type & LSTAT_CALLED ? this : undefined;
-    }
-    /**
-     * Return the cached link target if the entry has been the subject of a
-     * successful readlink, or undefined otherwise.
-     *
-     * Does not read the filesystem, so an undefined result *could* just mean we
-     * don't have any cached data. Only use it if you are very sure that a
-     * readlink() has been called at some point.
-     */
-    readlinkCached() {
-        return this.#linkTarget;
-    }
-    /**
-     * Returns the cached realpath target if the entry has been the subject
-     * of a successful realpath, or undefined otherwise.
-     *
-     * Does not read the filesystem, so an undefined result *could* just mean we
-     * don't have any cached data. Only use it if you are very sure that a
-     * realpath() has been called at some point.
-     */
-    realpathCached() {
-        return this.#realpath;
+}
+//# sourceMappingURL=StructuredMessageEncoding.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/StructuredMessageEncodingStream.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+function StructuredMessageEncodingStream_isNodeReadableStream(source) {
+    return (source !== null &&
+        source instanceof external_node_stream_ &&
+        typeof source._read === "function" &&
+        typeof source._readableState === "object" &&
+        typeof source.pipe === "function");
+}
+/**
+ *
+ * To encode structured body for CRC64 content validtion in storage uploading.
+ * @param source -
+ * @param contentLength -
+ * @returns
+ */
+async function structuredMessageEncoding(source, contentLength) {
+    if (source === null) {
+        return {
+            body: source,
+            encodedContentLength: contentLength,
+        };
     }
-    /**
-     * Returns the cached child Path entries array if the entry has been the
-     * subject of a successful readdir(), or [] otherwise.
-     *
-     * Does not read the filesystem, so an empty array *could* just mean we
-     * don't have any cached data. Only use it if you are very sure that a
-     * readdir() has been called recently enough to still be valid.
-     */
-    readdirCached() {
-        const children = this.children();
-        return children.slice(0, children.provisional);
+    if (StructuredMessageEncodingStream_isNodeReadableStream(source)) {
+        const encodingMessage = new StructuredMessageEncodingStream(source, contentLength, {});
+        return {
+            body: encodingMessage,
+            encodedContentLength: encodingMessage.messageLength(),
+        };
     }
-    /**
-     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
-     * any indication that readlink will definitely fail.
-     *
-     * Returns false if the path is known to not be a symlink, if a previous
-     * readlink failed, or if the entry does not exist.
-     */
-    canReadlink() {
-        if (this.#linkTarget)
-            return true;
-        if (!this.parent)
-            return false;
-        // cases where it cannot possibly succeed
-        const ifmt = this.#type & IFMT;
-        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
-            this.#type & ENOREADLINK ||
-            this.#type & ENOENT);
+    if (typeof source === "function") {
+        const encodingMessage = new StructuredMessageEncodingStream(source(), contentLength, {});
+        return {
+            body: encodingMessage,
+            encodedContentLength: encodingMessage.messageLength(),
+        };
     }
-    /**
-     * Return true if readdir has previously been successfully called on this
-     * path, indicating that cachedReaddir() is likely valid.
-     */
-    calledReaddir() {
-        return !!(this.#type & READDIR_CALLED);
+    if (source instanceof Blob) {
+        const encoding = await BrowserStream(source, contentLength);
+        return {
+            body: encoding.content,
+            encodedContentLength: encoding.encodedContentLength,
+        };
     }
-    /**
-     * Returns true if the path is known to not exist. That is, a previous lstat
-     * or readdir failed to verify its existence when that would have been
-     * expected, or a parent entry was marked either enoent or enotdir.
-     */
-    isENOENT() {
-        return !!(this.#type & ENOENT);
+    if (typeof source === "string") {
+        const s = new external_node_stream_.Readable();
+        s._read = () => { };
+        s.push(source);
+        s.push(null);
+        const stringContentLength = Buffer.byteLength(source);
+        const encodingMessage = await new StructuredMessageEncodingStream(s, stringContentLength, {});
+        return {
+            body: encodingMessage,
+            encodedContentLength: encodingMessage.messageLength(),
+        };
     }
-    /**
-     * Return true if the path is a match for the given path name.  This handles
-     * case sensitivity and unicode normalization.
-     *
-     * Note: even on case-sensitive systems, it is **not** safe to test the
-     * equality of the `.name` property to determine whether a given pathname
-     * matches, due to unicode normalization mismatches.
-     *
-     * Always use this method instead of testing the `path.name` property
-     * directly.
-     */
-    isNamed(n) {
-        return !this.nocase ?
-            this.#matchName === normalize(n)
-            : this.#matchName === normalizeNocase(n);
+    if (source instanceof ArrayBuffer) {
+        const stream = external_node_stream_.Readable.from(Buffer.from(source));
+        const encodingMessage = await new StructuredMessageEncodingStream(stream, contentLength, {});
+        return {
+            body: encodingMessage,
+            encodedContentLength: encodingMessage.messageLength(),
+        };
     }
-    /**
-     * Return the Path object corresponding to the target of a symbolic link.
-     *
-     * If the Path is not a symbolic link, or if the readlink call fails for any
-     * reason, `undefined` is returned.
-     *
-     * Result is cached, and thus may be outdated if the filesystem is mutated.
-     */
-    async readlink() {
-        const target = this.#linkTarget;
-        if (target) {
-            return target;
-        }
-        if (!this.canReadlink()) {
-            return undefined;
-        }
-        /* c8 ignore start */
-        // already covered by the canReadlink test, here for ts grumples
-        if (!this.parent) {
-            return undefined;
-        }
-        /* c8 ignore stop */
-        try {
-            const read = await this.#fs.promises.readlink(this.fullpath());
-            const linkTarget = (await this.parent.realpath())?.resolve(read);
-            if (linkTarget) {
-                return (this.#linkTarget = linkTarget);
-            }
-        }
-        catch (er) {
-            this.#readlinkFail(er.code);
-            return undefined;
-        }
+    if (source instanceof Buffer) {
+        const stream = external_node_stream_.Readable.from(source);
+        const encodingMessage = await new StructuredMessageEncodingStream(stream, contentLength, {});
+        return {
+            body: encodingMessage,
+            encodedContentLength: encodingMessage.messageLength(),
+        };
     }
-    /**
-     * Synchronous {@link PathBase.readlink}
-     */
-    readlinkSync() {
-        const target = this.#linkTarget;
-        if (target) {
-            return target;
-        }
-        if (!this.canReadlink()) {
-            return undefined;
-        }
-        /* c8 ignore start */
-        // already covered by the canReadlink test, here for ts grumples
-        if (!this.parent) {
-            return undefined;
-        }
-        /* c8 ignore stop */
-        try {
-            const read = this.#fs.readlinkSync(this.fullpath());
-            const linkTarget = this.parent.realpathSync()?.resolve(read);
-            if (linkTarget) {
-                return (this.#linkTarget = linkTarget);
-            }
-        }
-        catch (er) {
-            this.#readlinkFail(er.code);
-            return undefined;
-        }
+    if (ArrayBuffer.isView(source)) {
+        const stream = external_node_stream_.Readable.from(Buffer.from(source.buffer, source.byteOffset, source.byteLength));
+        const encodingMessage = await new StructuredMessageEncodingStream(stream, contentLength, {});
+        return {
+            body: encodingMessage,
+            encodedContentLength: encodingMessage.messageLength(),
+        };
     }
-    #readdirSuccess(children) {
-        // succeeded, mark readdir called bit
-        this.#type |= READDIR_CALLED;
-        // mark all remaining provisional children as ENOENT
-        for (let p = children.provisional; p < children.length; p++) {
-            const c = children[p];
-            if (c)
-                c.#markENOENT();
-        }
+    throw new Error("The specified request body type is not supported for CRC64 checksum");
+}
+async function pump(reader, controller, encodingStream) {
+    const { done, value } = await reader.read();
+    // When no more data needs to be consumed, close the stream
+    if (done) {
+        controller.close();
+        return;
     }
-    #markENOENT() {
-        // mark as UNKNOWN and ENOENT
-        if (this.#type & ENOENT)
+    // Enqueue the next data chunk into our target stream
+    encodingStream.sourceDataHandler(Buffer.from(value));
+}
+async function BrowserStream(source, contentLength) {
+    const sourceStream = source instanceof Blob ? source.stream() : source;
+    const reader = sourceStream.getReader();
+    let encodingStream = undefined;
+    const stream = new ReadableStream({
+        start(controller) {
+            encodingStream = new StructuredMessageEncoding((data) => {
+                controller.enqueue(data);
+            }, contentLength);
+        },
+        pull(controller) {
+            pump(reader, controller, encodingStream)
+                .then(() => {
+                return;
+            })
+                .catch(function (error) {
+                controller.error(error);
+            });
+        },
+    });
+    const response = new Response(stream);
+    return {
+        content: await response.blob(),
+        encodedContentLength: encodingStream.messageLength,
+    };
+}
+class StructuredMessageEncodingStream extends external_node_stream_.Readable {
+    source;
+    encodingMethods;
+    constructor(source, contentLength, options) {
+        super({ highWaterMark: options.highWaterMark });
+        this.source = source;
+        this.encodingMethods = new StructuredMessageEncoding((dataToHandle) => {
+            if (!this.push(dataToHandle)) {
+                source.pause();
+            }
+        }, contentLength);
+        this.setSourceEventHandlers();
+    }
+    messageLength() {
+        return this.encodingMethods.messageLength;
+    }
+    setSourceEventHandlers() {
+        this.source.on("data", this.sourceDataHandler);
+        this.source.on("end", this.sourceErrorOrEndHandler);
+        this.source.on("error", this.sourceErrorOrEndHandler);
+        // needed for Node14
+        this.source.on("aborted", this.sourceAbortedHandler);
+    }
+    removeSourceEventHandlers() {
+        this.source.removeListener("data", this.sourceDataHandler);
+        this.source.removeListener("end", this.sourceErrorOrEndHandler);
+        this.source.removeListener("error", this.sourceErrorOrEndHandler);
+        this.source.removeListener("aborted", this.sourceAbortedHandler);
+    }
+    sourceDataHandler = (data) => {
+        this.encodingMethods.sourceDataHandler(data);
+    };
+    sourceAbortedHandler = () => {
+        const abortError = new esm_AbortError_AbortError("The operation was aborted.");
+        this.destroy(abortError);
+    };
+    sourceErrorOrEndHandler = (err) => {
+        if (err && err.name === "AbortError") {
+            this.destroy(err);
             return;
-        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
-        this.#markChildrenENOENT();
-    }
-    #markChildrenENOENT() {
-        // all children are provisional and do not exist
-        const children = this.children();
-        children.provisional = 0;
-        for (const p of children) {
-            p.#markENOENT();
         }
+        // console.log(
+        //   `Source stream emits end or error, offset: ${
+        //     this.offset
+        //   }, dest end : ${this.end}`
+        // );
+        this.removeSourceEventHandlers();
+    };
+    _read() {
+        this.source.resume();
     }
-    #markENOREALPATH() {
-        this.#type |= ENOREALPATH;
-        this.#markENOTDIR();
-    }
-    // save the information when we know the entry is not a dir
-    #markENOTDIR() {
-        // entry is not a directory, so any children can't exist.
-        // this *should* be impossible, since any children created
-        // after it's been marked ENOTDIR should be marked ENOENT,
-        // so it won't even get to this point.
-        /* c8 ignore start */
-        if (this.#type & ENOTDIR)
-            return;
-        /* c8 ignore stop */
-        let t = this.#type;
-        // this could happen if we stat a dir, then delete it,
-        // then try to read it or one of its children.
-        if ((t & IFMT) === IFDIR)
-            t &= IFMT_UNKNOWN;
-        this.#type = t | ENOTDIR;
-        this.#markChildrenENOENT();
+    _destroy(error, callback) {
+        // remove listener from source and release source
+        this.removeSourceEventHandlers();
+        this.source.destroy();
+        callback(error === null ? undefined : error);
     }
-    #readdirFail(code = '') {
-        // markENOTDIR and markENOENT also set provisional=0
-        if (code === 'ENOTDIR' || code === 'EPERM') {
-            this.#markENOTDIR();
-        }
-        else if (code === 'ENOENT') {
-            this.#markENOENT();
+}
+//# sourceMappingURL=StructuredMessageEncodingStream.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/StructuredMessageDecoding.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+const StructuredMessageDecoding_MESSAGE_VERSION = 1;
+const StructuredMessageDecoding_MESSAGE_HEADER_LENGTH = 13;
+const StructuredMessageDecoding_SEGMENT_HEADER_LENGTH = 10;
+const StructuredMessageDecoding_FOOTER_LENGTH = 8;
+var StructuredMessageDecoding_SMRegion;
+(function (SMRegion) {
+    SMRegion[SMRegion["StreamHeader"] = 0] = "StreamHeader";
+    SMRegion[SMRegion["StreamFooter"] = 1] = "StreamFooter";
+    SMRegion[SMRegion["SegmentHeader"] = 2] = "SegmentHeader";
+    SMRegion[SMRegion["SegmentFooter"] = 3] = "SegmentFooter";
+    SMRegion[SMRegion["SegmentContent"] = 4] = "SegmentContent";
+})(StructuredMessageDecoding_SMRegion || (StructuredMessageDecoding_SMRegion = {}));
+class StructuredMessageDecoding {
+    pushData;
+    segmentsCount;
+    //   private currentState: SMRegion;
+    currentOffset;
+    currentDataOffset;
+    messageHeaderBuffer;
+    messageHeaderOffset;
+    segmentNumber;
+    segmentHeaderOffset;
+    segmentHeaderBuffer;
+    segmentContentOffset;
+    segmentContentLength;
+    segmentFooterOffset;
+    segmentFooterBuffer;
+    messageFooterOffset;
+    messageFooterBuffer;
+    segmentCrc64;
+    messageCrc64;
+    state;
+    constructor(pushData) {
+        this.pushData = pushData;
+        this.currentOffset = 0;
+        this.segmentsCount = 0;
+        this.messageHeaderOffset = 0;
+        this.messageHeaderBuffer = new Uint8Array(StructuredMessageDecoding_MESSAGE_HEADER_LENGTH);
+        this.currentDataOffset = 0;
+        this.segmentNumber = 0;
+        this.segmentHeaderOffset = 0;
+        this.segmentHeaderBuffer = new Uint8Array(StructuredMessageDecoding_SEGMENT_HEADER_LENGTH);
+        this.segmentContentOffset = 0;
+        this.segmentContentLength = 0;
+        this.state = StructuredMessageDecoding_SMRegion.StreamHeader;
+        this.segmentFooterOffset = 0;
+        this.segmentFooterBuffer = new Uint8Array(StructuredMessageDecoding_FOOTER_LENGTH);
+        this.messageFooterOffset = 0;
+        this.messageFooterBuffer = new Uint8Array(StructuredMessageDecoding_FOOTER_LENGTH);
+        this.segmentCrc64 = new StorageCRC64Calculator();
+        this.messageCrc64 = new StorageCRC64Calculator();
+    }
+    sourceDataHandler = (data) => {
+        this.currentDataOffset = 0;
+        if (this.state === StructuredMessageDecoding_SMRegion.StreamHeader) {
+            this.parseMessageHeader(data);
         }
-        else {
-            this.children().provisional = 0;
+        while (this.segmentNumber < this.segmentsCount && this.currentDataOffset < data.length) {
+            if (this.state === StructuredMessageDecoding_SMRegion.SegmentHeader) {
+                this.parseSegmentHeader(data);
+            }
+            if (this.state === StructuredMessageDecoding_SMRegion.SegmentContent) {
+                this.parseSegmentContent(data);
+            }
+            if (this.state === StructuredMessageDecoding_SMRegion.SegmentFooter) {
+                this.parseSegmentFooter(data);
+            }
         }
-    }
-    #lstatFail(code = '') {
-        // Windows just raises ENOENT in this case, disable for win CI
-        /* c8 ignore start */
-        if (code === 'ENOTDIR') {
-            // already know it has a parent by this point
-            const p = this.parent;
-            p.#markENOTDIR();
+        if (this.state === StructuredMessageDecoding_SMRegion.StreamFooter) {
+            this.parseMessageFooter(data);
         }
-        else if (code === 'ENOENT') {
-            /* c8 ignore stop */
-            this.#markENOENT();
+    };
+    parseMessageHeader(data) {
+        const length = Math.min(StructuredMessageDecoding_MESSAGE_HEADER_LENGTH - this.messageHeaderOffset, data.length - this.currentDataOffset);
+        this.messageHeaderBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.messageHeaderOffset);
+        this.currentDataOffset += length;
+        this.messageHeaderOffset += length;
+        this.currentOffset += length;
+        if (this.messageHeaderOffset === StructuredMessageDecoding_MESSAGE_HEADER_LENGTH) {
+            const currentVersion = this.messageHeaderBuffer[0];
+            if (currentVersion !== StructuredMessageDecoding_MESSAGE_VERSION) {
+                throw new Error("Unexpected message version");
+            }
+            this.segmentsCount = this.toInt16(Uint8Array.prototype.slice.call(this.messageHeaderBuffer, 11, 13));
+            this.state = StructuredMessageDecoding_SMRegion.SegmentHeader;
+        }
+    }
+    parseSegmentHeader(data) {
+        const length = Math.min(StructuredMessageDecoding_SEGMENT_HEADER_LENGTH - this.segmentHeaderOffset, data.length - this.currentDataOffset);
+        this.segmentHeaderBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.segmentHeaderOffset);
+        this.currentDataOffset += length;
+        this.segmentHeaderOffset += length;
+        this.currentOffset += length;
+        if (this.segmentHeaderOffset === StructuredMessageDecoding_SEGMENT_HEADER_LENGTH) {
+            const currentSegmentNumber = this.toInt16(Uint8Array.prototype.slice.call(this.segmentHeaderBuffer, 0, 2));
+            if (currentSegmentNumber !== this.segmentNumber + 1) {
+                throw new Error("Segment number is unexpected.");
+            }
+            this.segmentContentLength = this.toInt64(this.segmentHeaderBuffer, 2);
+            this.segmentContentOffset = 0;
+            this.state = StructuredMessageDecoding_SMRegion.SegmentContent;
+        }
+    }
+    parseSegmentContent(data) {
+        const length = Math.min(this.segmentContentLength - this.segmentContentOffset, data.length - this.currentDataOffset);
+        const dataToHandle = Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length);
+        this.segmentCrc64.append(dataToHandle, length);
+        this.messageCrc64.append(dataToHandle, length);
+        this.pushData(dataToHandle);
+        this.currentDataOffset += length;
+        this.segmentContentOffset += length;
+        this.currentOffset += length;
+        if (this.segmentContentOffset === this.segmentContentLength) {
+            this.state = StructuredMessageDecoding_SMRegion.SegmentFooter;
+        }
+    }
+    parseSegmentFooter(data) {
+        const length = Math.min(StructuredMessageDecoding_FOOTER_LENGTH - this.segmentFooterOffset, data.length - this.currentDataOffset);
+        this.segmentFooterBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.segmentFooterOffset);
+        this.currentDataOffset += length;
+        this.segmentFooterOffset += length;
+        this.currentOffset += length;
+        if (this.segmentFooterOffset === StructuredMessageDecoding_FOOTER_LENGTH) {
+            const crc64Result = this.segmentCrc64.final(new Uint8Array([]), 0);
+            if (!this.checkCrc64CheckSum(crc64Result, this.segmentFooterBuffer)) {
+                throw new Error(`Segment check sum mismatch, segmentNumber: ${this.segmentNumber}`);
+            }
+            ++this.segmentNumber;
+            if (this.segmentNumber === this.segmentsCount) {
+                this.state = StructuredMessageDecoding_SMRegion.StreamFooter;
+            }
+            else {
+                this.segmentHeaderOffset = 0;
+                this.segmentFooterOffset = 0;
+                this.segmentCrc64 = new StorageCRC64Calculator();
+                this.state = StructuredMessageDecoding_SMRegion.SegmentHeader;
+            }
         }
     }
-    #readlinkFail(code = '') {
-        let ter = this.#type;
-        ter |= ENOREADLINK;
-        if (code === 'ENOENT')
-            ter |= ENOENT;
-        // windows gets a weird error when you try to readlink a file
-        if (code === 'EINVAL' || code === 'UNKNOWN') {
-            // exists, but not a symlink, we don't know WHAT it is, so remove
-            // all IFMT bits.
-            ter &= IFMT_UNKNOWN;
-        }
-        this.#type = ter;
-        // windows just gets ENOENT in this case.  We do cover the case,
-        // just disabled because it's impossible on Windows CI
-        /* c8 ignore start */
-        if (code === 'ENOTDIR' && this.parent) {
-            this.parent.#markENOTDIR();
+    parseMessageFooter(data) {
+        const length = Math.min(StructuredMessageDecoding_FOOTER_LENGTH - this.messageFooterOffset, data.length - this.currentDataOffset);
+        this.messageFooterBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.messageFooterOffset);
+        this.currentDataOffset += length;
+        this.messageFooterOffset += length;
+        this.currentOffset += length;
+        if (this.messageFooterOffset === StructuredMessageDecoding_FOOTER_LENGTH) {
+            const crc64Result = this.messageCrc64.final(new Uint8Array([]), 0);
+            if (!this.checkCrc64CheckSum(crc64Result, this.messageFooterBuffer)) {
+                throw new Error("Check sum mismatch");
+            }
+            this.pushData(null);
         }
-        /* c8 ignore stop */
     }
-    #readdirAddChild(e, c) {
-        return (this.#readdirMaybePromoteChild(e, c) ||
-            this.#readdirAddNewChild(e, c));
+    toInt64(input, offset) {
+        if (input.length < offset + 8) {
+            throw new Error("CRC64 buffer error, something wrong with crc64 calculator");
+        }
+        const view = new DataView(input.buffer, input.byteOffset + offset, 8);
+        return Number(view.getBigUint64(0, true));
     }
-    #readdirAddNewChild(e, c) {
-        // alloc new entry at head, so it's never provisional
-        const type = entToType(e);
-        const child = this.newChild(e.name, type, { parent: this });
-        const ifmt = child.#type & IFMT;
-        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
-            child.#type |= ENOTDIR;
+    toInt16(input) {
+        if (input.length !== 2) {
+            throw new Error("CRC64 buffer error, something wrong with crc64 calculator");
         }
-        c.unshift(child);
-        c.provisional++;
-        return child;
+        return input[0] + input[1] * 256;
     }
-    #readdirMaybePromoteChild(e, c) {
-        for (let p = c.provisional; p < c.length; p++) {
-            const pchild = c[p];
-            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
-            if (name !== pchild.#matchName) {
-                continue;
+    checkCrc64CheckSum(first, second) {
+        if (first.length !== 8 || second.length !== 8) {
+            throw new Error("CRC64 buffer error, something wrong with crc64 calculator");
+        }
+        for (let index = 0; index < 8; ++index) {
+            if (first[index] !== second[index]) {
+                return false;
             }
-            return this.#readdirPromoteChild(e, pchild, p, c);
         }
+        return true;
     }
-    #readdirPromoteChild(e, p, index, c) {
-        const v = p.name;
-        // retain any other flags, but set ifmt from dirent
-        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
-        // case sensitivity fixing when we learn the true name.
-        if (v !== e.name)
-            p.name = e.name;
-        // just advance provisional index (potentially off the list),
-        // otherwise we have to splice/pop it out and re-insert at head
-        if (index !== c.provisional) {
-            if (index === c.length - 1)
-                c.pop();
-            else
-                c.splice(index, 1);
-            c.unshift(p);
+}
+//# sourceMappingURL=StructuredMessageDecoding.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/StructuredMessageDecodingStream.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+/**
+ * To decode structured body for CRC64 content validtion in storage downloading.
+ * @param source -
+ */
+async function structuredMessageDecodingBrowser(source) {
+    /* eslint-disable no-unused-expressions */
+    source;
+    throw new Error("structuredMessageDecodingBrowser is only for Browser");
+}
+/**
+ * To decode structured body for CRC64 content validtion in storage downloading.
+ * @param source -
+ * @param options -
+ * @returns
+ */
+function structuredMessageDecodingStream(source, options) {
+    return new StructuredMessageDecodingStream(source, options);
+}
+class StructuredMessageDecodingStream extends external_node_stream_.Readable {
+    source;
+    decodingMethods;
+    constructor(source, options) {
+        super({ highWaterMark: options.highWaterMark });
+        this.source = source;
+        this.decodingMethods = new StructuredMessageDecoding((dataToHandle) => {
+            if (!this.push(dataToHandle)) {
+                source.pause();
+            }
+        });
+        this.setSourceEventHandlers();
+    }
+    _read() {
+        this.source.resume();
+    }
+    setSourceEventHandlers() {
+        this.source.on("data", this.sourceDataHandler);
+        this.source.on("end", this.sourceErrorOrEndHandler);
+        this.source.on("error", this.sourceErrorOrEndHandler);
+        // needed for Node14
+        this.source.on("aborted", this.sourceAbortedHandler);
+    }
+    removeSourceEventHandlers() {
+        this.source.removeListener("data", this.sourceDataHandler);
+        this.source.removeListener("end", this.sourceErrorOrEndHandler);
+        this.source.removeListener("error", this.sourceErrorOrEndHandler);
+        this.source.removeListener("aborted", this.sourceAbortedHandler);
+    }
+    sourceDataHandler = (data) => {
+        try {
+            this.decodingMethods.sourceDataHandler(data);
         }
-        c.provisional++;
-        return p;
+        catch (err) {
+            this.destroy(err);
+        }
+    };
+    sourceAbortedHandler = () => {
+        const abortError = new esm_AbortError_AbortError("The operation was aborted.");
+        this.destroy(abortError);
+    };
+    sourceErrorOrEndHandler = (err) => {
+        if (err) {
+            this.destroy(err);
+            return;
+        }
+        this.removeSourceEventHandlers();
+    };
+    _destroy(error, callback) {
+        // remove listener from source and release source
+        this.removeSourceEventHandlers();
+        this.source.destroy();
+        callback(error === null ? undefined : error);
+    }
+}
+//# sourceMappingURL=StructuredMessageDecodingStream.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/cache.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+let _defaultHttpClient;
+function cache_getCachedDefaultHttpClient() {
+    if (!_defaultHttpClient) {
+        _defaultHttpClient = esm_defaultHttpClient_createDefaultHttpClient();
     }
+    return _defaultHttpClient;
+}
+//# sourceMappingURL=cache.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/RequestPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * The base class from which all request policies derive.
+ */
+class BaseRequestPolicy {
+    _nextPolicy;
+    _options;
     /**
-     * Call lstat() on this Path, and update all known information that can be
-     * determined.
-     *
-     * Note that unlike `fs.lstat()`, the returned value does not contain some
-     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
-     * information is required, you will need to call `fs.lstat` yourself.
-     *
-     * If the Path refers to a nonexistent file, or if the lstat call fails for
-     * any reason, `undefined` is returned.  Otherwise the updated Path object is
-     * returned.
-     *
-     * Results are cached, and thus may be out of date if the filesystem is
-     * mutated.
+     * The main method to implement that manipulates a request/response.
      */
-    async lstat() {
-        if ((this.#type & ENOENT) === 0) {
-            try {
-                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
-                return this;
-            }
-            catch (er) {
-                this.#lstatFail(er.code);
-            }
-        }
+    constructor(
+    /**
+     * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
+     */
+    _nextPolicy, 
+    /**
+     * The options that can be passed to a given request policy.
+     */
+    _options) {
+        this._nextPolicy = _nextPolicy;
+        this._options = _options;
     }
     /**
-     * synchronous {@link PathBase.lstat}
+     * Get whether or not a log with the provided log level should be logged.
+     * @param logLevel - The log level of the log that will be logged.
+     * @returns Whether or not a log with the provided log level should be logged.
      */
-    lstatSync() {
-        if ((this.#type & ENOENT) === 0) {
-            try {
-                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
-                return this;
-            }
-            catch (er) {
-                this.#lstatFail(er.code);
-            }
-        }
+    shouldLog(logLevel) {
+        return this._options.shouldLog(logLevel);
     }
-    #applyStat(st) {
-        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
-        this.#atime = atime;
-        this.#atimeMs = atimeMs;
-        this.#birthtime = birthtime;
-        this.#birthtimeMs = birthtimeMs;
-        this.#blksize = blksize;
-        this.#blocks = blocks;
-        this.#ctime = ctime;
-        this.#ctimeMs = ctimeMs;
-        this.#dev = dev;
-        this.#gid = gid;
-        this.#ino = ino;
-        this.#mode = mode;
-        this.#mtime = mtime;
-        this.#mtimeMs = mtimeMs;
-        this.#nlink = nlink;
-        this.#rdev = rdev;
-        this.#size = size;
-        this.#uid = uid;
-        const ifmt = entToType(st);
-        // retain any other flags, but set the ifmt
-        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
-        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
-            this.#type |= ENOTDIR;
-        }
+    /**
+     * Attempt to log the provided message to the provided logger. If no logger was provided or if
+     * the log level does not meat the logger's threshold, then nothing will be logged.
+     * @param logLevel - The log level of this log.
+     * @param message - The message of this log.
+     */
+    log(logLevel, message) {
+        this._options.log(logLevel, message);
     }
-    #onReaddirCB = [];
-    #readdirCBInFlight = false;
-    #callOnReaddirCB(children) {
-        this.#readdirCBInFlight = false;
-        const cbs = this.#onReaddirCB.slice();
-        this.#onReaddirCB.length = 0;
-        cbs.forEach(cb => cb(null, children));
+}
+//# sourceMappingURL=RequestPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageBrowserPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:
+ *
+ * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.
+ * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL
+ * thus avoid the browser cache.
+ *
+ * 2. Remove cookie header for security
+ *
+ * 3. Remove content-length header to avoid browsers warning
+ *
+ * In Node.js, this policy is a no-op pass-through.
+ */
+class StorageBrowserPolicy extends BaseRequestPolicy {
+    /**
+     * Creates an instance of StorageBrowserPolicy.
+     * @param nextPolicy -
+     * @param options -
+     */
+    // The base class has a protected constructor. Adding a public one to enable constructing of this class.
+    /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
+    constructor(nextPolicy, options) {
+        super(nextPolicy, options);
     }
     /**
-     * Standard node-style callback interface to get list of directory entries.
+     * Sends out request.
      *
-     * If the Path cannot or does not contain any children, then an empty array
-     * is returned.
+     * @param request -
+     */
+    async sendRequest(request) {
+        return this._nextPolicy.sendRequest(request);
+    }
+}
+//# sourceMappingURL=StorageBrowserPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/StorageBrowserPolicyFactory.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+/**
+ * StorageBrowserPolicyFactory is a factory class helping generating StorageBrowserPolicy objects.
+ */
+class StorageBrowserPolicyFactory {
+    /**
+     * Creates a StorageBrowserPolicyFactory object.
      *
-     * Results are cached, and thus may be out of date if the filesystem is
-     * mutated.
+     * @param nextPolicy -
+     * @param options -
+     */
+    create(nextPolicy, options) {
+        return new StorageBrowserPolicy(nextPolicy, options);
+    }
+}
+//# sourceMappingURL=StorageBrowserPolicyFactory.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/CredentialPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Credential policy used to sign HTTP(S) requests before sending. This is an
+ * abstract class.
+ */
+class CredentialPolicy extends BaseRequestPolicy {
+    /**
+     * Sends out request.
      *
-     * @param cb The callback called with (er, entries).  Note that the `er`
-     * param is somewhat extraneous, as all readdir() errors are handled and
-     * simply result in an empty set of entries being returned.
-     * @param allowZalgo Boolean indicating that immediately known results should
-     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
-     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     * @param request -
      */
-    readdirCB(cb, allowZalgo = false) {
-        if (!this.canReaddir()) {
-            if (allowZalgo)
-                cb(null, []);
-            else
-                queueMicrotask(() => cb(null, []));
-            return;
-        }
-        const children = this.children();
-        if (this.calledReaddir()) {
-            const c = children.slice(0, children.provisional);
-            if (allowZalgo)
-                cb(null, c);
-            else
-                queueMicrotask(() => cb(null, c));
-            return;
-        }
-        // don't have to worry about zalgo at this point.
-        this.#onReaddirCB.push(cb);
-        if (this.#readdirCBInFlight) {
-            return;
-        }
-        this.#readdirCBInFlight = true;
-        // else read the directory, fill up children
-        // de-provisionalize any provisional children.
-        const fullpath = this.fullpath();
-        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
-            if (er) {
-                this.#readdirFail(er.code);
-                children.provisional = 0;
-            }
-            else {
-                // if we didn't get an error, we always get entries.
-                //@ts-ignore
-                for (const e of entries) {
-                    this.#readdirAddChild(e, children);
-                }
-                this.#readdirSuccess(children);
-            }
-            this.#callOnReaddirCB(children.slice(0, children.provisional));
-            return;
-        });
+    sendRequest(request) {
+        return this._nextPolicy.sendRequest(this.signRequest(request));
     }
-    #asyncReaddirInFlight;
     /**
-     * Return an array of known child entries.
+     * Child classes must implement this method with request signing. This method
+     * will be executed in {@link sendRequest}.
      *
-     * If the Path cannot or does not contain any children, then an empty array
-     * is returned.
+     * @param request -
+     */
+    signRequest(request) {
+        // Child classes must override this method with request signing. This method
+        // will be executed in sendRequest().
+        return request;
+    }
+}
+//# sourceMappingURL=CredentialPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/AnonymousCredentialPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources
+ * or for use with Shared Access Signatures (SAS).
+ */
+class AnonymousCredentialPolicy extends CredentialPolicy {
+    /**
+     * Creates an instance of AnonymousCredentialPolicy.
+     * @param nextPolicy -
+     * @param options -
+     */
+    // The base class has a protected constructor. Adding a public one to enable constructing of this class.
+    /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
+    constructor(nextPolicy, options) {
+        super(nextPolicy, options);
+    }
+}
+//# sourceMappingURL=AnonymousCredentialPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/credentials/Credential.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * Credential is an abstract class for Azure Storage HTTP requests signing. This
+ * class will host an credentialPolicyCreator factory which generates CredentialPolicy.
+ */
+class Credential {
+    /**
+     * Creates a RequestPolicy object.
      *
-     * Results are cached, and thus may be out of date if the filesystem is
-     * mutated.
+     * @param _nextPolicy -
+     * @param _options -
      */
-    async readdir() {
-        if (!this.canReaddir()) {
-            return [];
-        }
-        const children = this.children();
-        if (this.calledReaddir()) {
-            return children.slice(0, children.provisional);
+    create(_nextPolicy, _options) {
+        throw new Error("Method should be implemented in children classes.");
+    }
+}
+//# sourceMappingURL=Credential.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/credentials/AnonymousCredential.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+/**
+ * AnonymousCredential provides a credentialPolicyCreator member used to create
+ * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with
+ * HTTP(S) requests that read public resources or for use with Shared Access
+ * Signatures (SAS).
+ */
+class AnonymousCredential extends Credential {
+    /**
+     * Creates an {@link AnonymousCredentialPolicy} object.
+     *
+     * @param nextPolicy -
+     * @param options -
+     */
+    create(nextPolicy, options) {
+        return new AnonymousCredentialPolicy(nextPolicy, options);
+    }
+}
+//# sourceMappingURL=AnonymousCredential.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/utils/constants.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+const utils_constants_SDK_VERSION = "12.4.0";
+const constants_URLConstants = {
+    Parameters: {
+        FORCE_BROWSER_NO_CACHE: "_",
+        SIGNATURE: "sig",
+        SNAPSHOT: "snapshot",
+        VERSIONID: "versionid",
+        TIMEOUT: "timeout",
+    },
+};
+const constants_HeaderConstants = {
+    AUTHORIZATION: "Authorization",
+    AUTHORIZATION_SCHEME: "Bearer",
+    CONTENT_ENCODING: "Content-Encoding",
+    CONTENT_ID: "Content-ID",
+    CONTENT_LANGUAGE: "Content-Language",
+    CONTENT_LENGTH: "Content-Length",
+    CONTENT_MD5: "Content-Md5",
+    CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding",
+    CONTENT_TYPE: "Content-Type",
+    COOKIE: "Cookie",
+    DATE: "date",
+    IF_MATCH: "if-match",
+    IF_MODIFIED_SINCE: "if-modified-since",
+    IF_NONE_MATCH: "if-none-match",
+    IF_UNMODIFIED_SINCE: "if-unmodified-since",
+    PREFIX_FOR_STORAGE: "x-ms-",
+    RANGE: "Range",
+    USER_AGENT: "User-Agent",
+    X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id",
+    X_MS_COPY_SOURCE: "x-ms-copy-source",
+    X_MS_DATE: "x-ms-date",
+    X_MS_ERROR_CODE: "x-ms-error-code",
+    X_MS_VERSION: "x-ms-version",
+    X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code",
+};
+const constants_DevelopmentConnectionString = (/* unused pure expression or super */ null && (`DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`));
+/// List of ports used for path style addressing.
+/// Path style addressing means that storage account is put in URI's Path segment in instead of in host.
+const constants_PathStylePorts = (/* unused pure expression or super */ null && ([
+    "10000",
+    "10001",
+    "10002",
+    "10003",
+    "10004",
+    "10100",
+    "10101",
+    "10102",
+    "10103",
+    "10104",
+    "11000",
+    "11001",
+    "11002",
+    "11003",
+    "11004",
+    "11100",
+    "11101",
+    "11102",
+    "11103",
+    "11104",
+]));
+//# sourceMappingURL=constants.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/utils/utils.common.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+/**
+ * Reserved URL characters must be properly escaped for Storage services like Blob or File.
+ *
+ * ## URL encode and escape strategy for JS SDKs
+ *
+ * When customers pass a URL string into XxxClient classes constructor, the URL string may already be URL encoded or not.
+ * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL
+ * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors.
+ *
+ * ### Strategy One: Assume the customer URL string is not encoded, and always encode URL string in SDK.
+ *
+ * This is what legacy V2 SDK does, simple and works for most of the cases.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b:",
+ *   SDK will encode it to "http://account.blob.core.windows.net/con/b%3A" and send to server. A blob named "b:" will be created.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b%3A",
+ *   SDK will encode it to "http://account.blob.core.windows.net/con/b%253A" and send to server. A blob named "b%3A" will be created.
+ *
+ * But this strategy will make it not possible to create a blob with "?" in it's name. Because when customer URL string is
+ * "http://account.blob.core.windows.net/con/blob?name", the "?name" will be treated as URL paramter instead of blob name.
+ * If customer URL string is "http://account.blob.core.windows.net/con/blob%3Fname", a blob named "blob%3Fname" will be created.
+ * V2 SDK doesn't have this issue because it doesn't allow customer pass in a full URL, it accepts a separate blob name and encodeURIComponent for it.
+ * We cannot accept a SDK cannot create a blob name with "?". So we implement strategy two:
+ *
+ * ### Strategy Two: SDK doesn't assume the URL has been encoded or not. It will just escape the special characters.
+ *
+ * This is what V10 Blob Go SDK does. It accepts a URL type in Go, and call url.EscapedPath() to escape the special chars unescaped.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b:",
+ *   SDK will escape ":" like "http://account.blob.core.windows.net/con/b%3A" and send to server. A blob named "b:" will be created.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b%3A",
+ *   There is no special characters, so send "http://account.blob.core.windows.net/con/b%3A" to server. A blob named "b:" will be created.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b%253A",
+ *   There is no special characters, so send "http://account.blob.core.windows.net/con/b%253A" to server. A blob named "b%3A" will be created.
+ *
+ * This strategy gives us flexibility to create with any special characters. But "%" will be treated as a special characters, if the URL string
+ * is not encoded, there shouldn't a "%" in the URL string, otherwise the URL is not a valid URL.
+ * If customer needs to create a blob with "%" in it's blob name, use "%25" instead of "%". Just like above 3rd sample.
+ * And following URL strings are invalid:
+ * - "http://account.blob.core.windows.net/con/b%"
+ * - "http://account.blob.core.windows.net/con/b%2"
+ * - "http://account.blob.core.windows.net/con/b%G"
+ *
+ * Another special character is "?", use "%2F" to represent a blob name with "?" in a URL string.
+ *
+ * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `containerClient.getBlobClient(blobName)`
+ *
+ * We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.
+ *
+ * @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
+ * @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata
+ *
+ * @param url -
+ */
+function escapeURLPath(url) {
+    const urlParsed = new URL(url);
+    let path = urlParsed.pathname;
+    path = path || "/";
+    path = utils_common_escape(path);
+    urlParsed.pathname = path;
+    return urlParsed.toString();
+}
+function getProxyUriFromDevConnString(connectionString) {
+    // Development Connection String
+    // https://learn.microsoft.com/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key
+    let proxyUri = "";
+    if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) {
+        // CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri
+        const matchCredentials = connectionString.split(";");
+        for (const element of matchCredentials) {
+            if (element.trim().startsWith("DevelopmentStorageProxyUri=")) {
+                proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1];
+            }
         }
-        // else read the directory, fill up children
-        // de-provisionalize any provisional children.
-        const fullpath = this.fullpath();
-        if (this.#asyncReaddirInFlight) {
-            await this.#asyncReaddirInFlight;
+    }
+    return proxyUri;
+}
+function getValueInConnString(connectionString, argument) {
+    const elements = connectionString.split(";");
+    for (const element of elements) {
+        if (element.trim().startsWith(argument)) {
+            return element.trim().match(argument + "=(.*)")[1];
         }
-        else {
-            /* c8 ignore start */
-            let resolve = () => { };
-            /* c8 ignore stop */
-            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
-            try {
-                for (const e of await this.#fs.promises.readdir(fullpath, {
-                    withFileTypes: true,
-                })) {
-                    this.#readdirAddChild(e, children);
-                }
-                this.#readdirSuccess(children);
-            }
-            catch (er) {
-                this.#readdirFail(er.code);
-                children.provisional = 0;
-            }
-            this.#asyncReaddirInFlight = undefined;
-            resolve();
+    }
+    return "";
+}
+/**
+ * Extracts the parts of an Azure Storage account connection string.
+ *
+ * @param connectionString - Connection string.
+ * @returns String key value pairs of the storage account's url and credentials.
+ */
+function extractConnectionStringParts(connectionString) {
+    let proxyUri = "";
+    if (connectionString.startsWith("UseDevelopmentStorage=true")) {
+        // Development connection string
+        proxyUri = getProxyUriFromDevConnString(connectionString);
+        connectionString = DevelopmentConnectionString;
+    }
+    // Matching BlobEndpoint in the Account connection string
+    let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint");
+    // Slicing off '/' at the end if exists
+    // (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end)
+    blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint;
+    if (connectionString.search("DefaultEndpointsProtocol=") !== -1 &&
+        connectionString.search("AccountKey=") !== -1) {
+        // Account connection string
+        let defaultEndpointsProtocol = "";
+        let accountName = "";
+        let accountKey = stringToUint8Array("accountKey", "base64");
+        let endpointSuffix = "";
+        // Get account name and key
+        accountName = getValueInConnString(connectionString, "AccountName");
+        accountKey = stringToUint8Array(getValueInConnString(connectionString, "AccountKey"), "base64");
+        if (!blobEndpoint) {
+            // BlobEndpoint is not present in the Account connection string
+            // Can be obtained from `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`
+            defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol");
+            const protocol = defaultEndpointsProtocol.toLowerCase();
+            if (protocol !== "https" && protocol !== "http") {
+                throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
+            }
+            endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix");
+            if (!endpointSuffix) {
+                throw new Error("Invalid EndpointSuffix in the provided Connection String");
+            }
+            blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;
+        }
+        if (!accountName) {
+            throw new Error("Invalid AccountName in the provided Connection String");
+        }
+        else if (accountKey.length === 0) {
+            throw new Error("Invalid AccountKey in the provided Connection String");
         }
-        return children.slice(0, children.provisional);
+        return {
+            kind: "AccountConnString",
+            url: blobEndpoint,
+            accountName,
+            accountKey,
+            proxyUri,
+        };
     }
-    /**
-     * synchronous {@link PathBase.readdir}
-     */
-    readdirSync() {
-        if (!this.canReaddir()) {
-            return [];
+    else {
+        // SAS connection string
+        let accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
+        let accountName = getValueInConnString(connectionString, "AccountName");
+        // if accountName is empty, try to read it from BlobEndpoint
+        if (!accountName) {
+            accountName = getAccountNameFromUrl(blobEndpoint);
         }
-        const children = this.children();
-        if (this.calledReaddir()) {
-            return children.slice(0, children.provisional);
+        if (!blobEndpoint) {
+            throw new Error("Invalid BlobEndpoint in the provided SAS Connection String");
         }
-        // else read the directory, fill up children
-        // de-provisionalize any provisional children.
-        const fullpath = this.fullpath();
-        try {
-            for (const e of this.#fs.readdirSync(fullpath, {
-                withFileTypes: true,
-            })) {
-                this.#readdirAddChild(e, children);
-            }
-            this.#readdirSuccess(children);
+        else if (!accountSas) {
+            throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
         }
-        catch (er) {
-            this.#readdirFail(er.code);
-            children.provisional = 0;
+        // client constructors assume accountSas does *not* start with ?
+        if (accountSas.startsWith("?")) {
+            accountSas = accountSas.substring(1);
         }
-        return children.slice(0, children.provisional);
+        return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas };
+    }
+}
+/**
+ * Internal escape method implemented Strategy Two mentioned in escapeURL() description.
+ *
+ * @param text -
+ */
+function utils_common_escape(text) {
+    return encodeURIComponent(text)
+        .replace(/%2F/g, "/") // Don't escape for "/"
+        .replace(/'/g, "%27") // Escape for "'"
+        .replace(/\+/g, "%20")
+        .replace(/%25/g, "%"); // Revert encoded "%"
+}
+/**
+ * Append a string to URL path. Will remove duplicated "/" in front of the string
+ * when URL path ends with a "/".
+ *
+ * @param url - Source URL string
+ * @param name - String to be appended to URL
+ * @returns An updated URL string
+ */
+function appendToURLPath(url, name) {
+    const urlParsed = new URL(url);
+    let path = urlParsed.pathname;
+    path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name;
+    urlParsed.pathname = path;
+    return urlParsed.toString();
+}
+/**
+ * Set URL parameter name and value. If name exists in URL parameters, old value
+ * will be replaced by name key. If not provide value, the parameter will be deleted.
+ *
+ * @param url - Source URL string
+ * @param name - Parameter name
+ * @param value - Parameter value
+ * @returns An updated URL string
+ */
+function setURLParameter(url, name, value) {
+    const urlParsed = new URL(url);
+    const encodedName = encodeURIComponent(name);
+    const encodedValue = value ? encodeURIComponent(value) : undefined;
+    // mutating searchParams will change the encoding, so we have to do this ourselves
+    const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
+    const searchPieces = [];
+    for (const pair of searchString.slice(1).split("&")) {
+        if (pair) {
+            const [key] = pair.split("=", 2);
+            if (key !== encodedName) {
+                searchPieces.push(pair);
+            }
+        }
+    }
+    if (encodedValue) {
+        searchPieces.push(`${encodedName}=${encodedValue}`);
+    }
+    urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
+    return urlParsed.toString();
+}
+/**
+ * Get URL parameter by name.
+ *
+ * @param url -
+ * @param name -
+ */
+function getURLParameter(url, name) {
+    const urlParsed = new URL(url);
+    return urlParsed.searchParams.get(name) ?? undefined;
+}
+/**
+ * Set URL host.
+ *
+ * @param url - Source URL string
+ * @param host - New host string
+ * @returns An updated URL string
+ */
+function setURLHost(url, host) {
+    const urlParsed = new URL(url);
+    urlParsed.hostname = host;
+    return urlParsed.toString();
+}
+/**
+ * Get URL path from an URL string.
+ *
+ * @param url - Source URL string
+ */
+function getURLPath(url) {
+    try {
+        const urlParsed = new URL(url);
+        return urlParsed.pathname;
+    }
+    catch (e) {
+        return undefined;
+    }
+}
+/**
+ * Get URL scheme from an URL string.
+ *
+ * @param url - Source URL string
+ */
+function getURLScheme(url) {
+    try {
+        const urlParsed = new URL(url);
+        return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol;
+    }
+    catch (e) {
+        return undefined;
+    }
+}
+/**
+ * Get URL path and query from an URL string.
+ *
+ * @param url - Source URL string
+ */
+function getURLPathAndQuery(url) {
+    const urlParsed = new URL(url);
+    const pathString = urlParsed.pathname;
+    if (!pathString) {
+        throw new RangeError("Invalid url without valid path.");
+    }
+    let queryString = urlParsed.search || "";
+    queryString = queryString.trim();
+    if (queryString !== "") {
+        queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; // Ensure query string start with '?'
+    }
+    return `${pathString}${queryString}`;
+}
+/**
+ * Get URL query key value pairs from an URL string.
+ *
+ * @param url -
+ */
+function getURLQueries(url) {
+    let queryString = new URL(url).search;
+    if (!queryString) {
+        return {};
+    }
+    queryString = queryString.trim();
+    queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString;
+    let querySubStrings = queryString.split("&");
+    querySubStrings = querySubStrings.filter((value) => {
+        const indexOfEqual = value.indexOf("=");
+        const lastIndexOfEqual = value.lastIndexOf("=");
+        return (indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1);
+    });
+    const queries = {};
+    for (const querySubString of querySubStrings) {
+        const splitResults = querySubString.split("=");
+        const key = splitResults[0];
+        const value = splitResults[1];
+        queries[key] = value;
+    }
+    return queries;
+}
+/**
+ * Append a string to URL query.
+ *
+ * @param url - Source URL string.
+ * @param queryParts - String to be appended to the URL query.
+ * @returns An updated URL string.
+ */
+function appendToURLQuery(url, queryParts) {
+    const urlParsed = new URL(url);
+    let query = urlParsed.search;
+    if (query) {
+        query += "&" + queryParts;
+    }
+    else {
+        query = queryParts;
+    }
+    urlParsed.search = query;
+    return urlParsed.toString();
+}
+/**
+ * Rounds a date off to seconds.
+ *
+ * @param date -
+ * @param withMilliseconds - If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned;
+ *                                          If false, YYYY-MM-DDThh:mm:ssZ will be returned.
+ * @returns Date string in ISO8061 format, with or without 7 milliseconds component
+ */
+function truncatedISO8061Date(date, withMilliseconds = true) {
+    // Date.toISOString() will return like "2018-10-29T06:34:36.139Z"
+    const dateString = date.toISOString();
+    return withMilliseconds
+        ? dateString.substring(0, dateString.length - 1) + "0000" + "Z"
+        : dateString.substring(0, dateString.length - 5) + "Z";
+}
+/**
+ * Generate a 64 bytes base64 block ID string.
+ *
+ * @param blockIndex -
+ */
+function generateBlockID(blockIDPrefix, blockIndex) {
+    // To generate a 64 bytes base64 string, source string should be 48
+    const maxSourceStringLength = 48;
+    // A blob can have a maximum of 100,000 uncommitted blocks at any given time
+    const maxBlockIndexLength = 6;
+    const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength;
+    if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) {
+        blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength);
     }
-    canReaddir() {
-        if (this.#type & ENOCHILD)
-            return false;
-        const ifmt = IFMT & this.#type;
-        // we always set ENOTDIR when setting IFMT, so should be impossible
-        /* c8 ignore start */
-        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
-            return false;
+    const res = blockIDPrefix +
+        padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0");
+    return uint8ArrayToString(stringToUint8Array(res, "utf-8"), "base64");
+}
+/**
+ * Delay specified time interval.
+ *
+ * @param timeInMs -
+ * @param aborter -
+ * @param abortError -
+ */
+async function utils_common_delay(timeInMs, aborter, abortError) {
+    return new Promise((resolve, reject) => {
+        /* eslint-disable-next-line prefer-const */
+        let timeout;
+        const abortHandler = () => {
+            if (timeout !== undefined) {
+                clearTimeout(timeout);
+            }
+            reject(abortError);
+        };
+        const resolveHandler = () => {
+            if (aborter !== undefined) {
+                aborter.removeEventListener("abort", abortHandler);
+            }
+            resolve();
+        };
+        timeout = setTimeout(resolveHandler, timeInMs);
+        if (aborter !== undefined) {
+            aborter.addEventListener("abort", abortHandler);
         }
-        /* c8 ignore stop */
-        return true;
+    });
+}
+/**
+ * String.prototype.padStart()
+ *
+ * @param currentString -
+ * @param targetLength -
+ * @param padString -
+ */
+function padStart(currentString, targetLength, padString = " ") {
+    // @ts-expect-error: TS doesn't know this code needs to run downlevel sometimes
+    if (String.prototype.padStart) {
+        return currentString.padStart(targetLength, padString);
     }
-    shouldWalk(dirs, walkFilter) {
-        return ((this.#type & IFDIR) === IFDIR &&
-            !(this.#type & ENOCHILD) &&
-            !dirs.has(this) &&
-            (!walkFilter || walkFilter(this)));
+    padString = padString || " ";
+    if (currentString.length > targetLength) {
+        return currentString;
     }
-    /**
-     * Return the Path object corresponding to path as resolved
-     * by realpath(3).
-     *
-     * If the realpath call fails for any reason, `undefined` is returned.
-     *
-     * Result is cached, and thus may be outdated if the filesystem is mutated.
-     * On success, returns a Path object.
-     */
-    async realpath() {
-        if (this.#realpath)
-            return this.#realpath;
-        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
-            return undefined;
-        try {
-            const rp = await this.#fs.promises.realpath(this.fullpath());
-            return (this.#realpath = this.resolve(rp));
-        }
-        catch (_) {
-            this.#markENOREALPATH();
+    else {
+        targetLength = targetLength - currentString.length;
+        if (targetLength > padString.length) {
+            padString += padString.repeat(targetLength / padString.length);
         }
+        return padString.slice(0, targetLength) + currentString;
     }
-    /**
-     * Synchronous {@link realpath}
-     */
-    realpathSync() {
-        if (this.#realpath)
-            return this.#realpath;
-        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
-            return undefined;
-        try {
-            const rp = this.#fs.realpathSync(this.fullpath());
-            return (this.#realpath = this.resolve(rp));
-        }
-        catch (_) {
-            this.#markENOREALPATH();
-        }
+}
+function sanitizeURL(url) {
+    let safeURL = url;
+    if (getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) {
+        safeURL = setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****");
     }
-    /**
-     * Internal method to mark this Path object as the scurry cwd,
-     * called by {@link PathScurry#chdir}
-     *
-     * @internal
-     */
-    [setAsCwd](oldCwd) {
-        if (oldCwd === this)
-            return;
-        oldCwd.isCWD = false;
-        this.isCWD = true;
-        const changed = new Set([]);
-        let rp = [];
-        let p = this;
-        while (p && p.parent) {
-            changed.add(p);
-            p.#relative = rp.join(this.sep);
-            p.#relativePosix = rp.join('/');
-            p = p.parent;
-            rp.push('..');
+    return safeURL;
+}
+function sanitizeHeaders(originalHeader) {
+    const headers = createHttpHeaders();
+    for (const [name, value] of originalHeader) {
+        if (name.toLowerCase() === HeaderConstants.AUTHORIZATION.toLowerCase()) {
+            headers.set(name, "*****");
         }
-        // now un-memoize parents of old cwd
-        p = oldCwd;
-        while (p && p.parent && !changed.has(p)) {
-            p.#relative = undefined;
-            p.#relativePosix = undefined;
-            p = p.parent;
+        else if (name.toLowerCase() === HeaderConstants.X_MS_COPY_SOURCE) {
+            headers.set(name, sanitizeURL(value));
+        }
+        else {
+            headers.set(name, value);
         }
     }
+    return headers;
 }
-exports.PathBase = PathBase;
 /**
- * Path class used on win32 systems
+ * If two strings are equal when compared case insensitive.
  *
- * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
- * as the path separator for parsing paths.
+ * @param str1 -
+ * @param str2 -
  */
-class PathWin32 extends PathBase {
-    /**
-     * Separator for generating path strings.
-     */
-    sep = '\\';
-    /**
-     * Separator for parsing path strings.
-     */
-    splitSep = eitherSep;
-    /**
-     * Do not create new Path objects directly.  They should always be accessed
-     * via the PathScurry class or other methods on the Path class.
-     *
-     * @internal
-     */
-    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
-        super(name, type, root, roots, nocase, children, opts);
-    }
-    /**
-     * @internal
-     */
-    newChild(name, type = UNKNOWN, opts = {}) {
-        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
-    }
-    /**
-     * @internal
-     */
-    getRootString(path) {
-        return node_path_1.win32.parse(path).root;
-    }
-    /**
-     * @internal
-     */
-    getRoot(rootPath) {
-        rootPath = uncToDrive(rootPath.toUpperCase());
-        if (rootPath === this.root.name) {
-            return this.root;
+function iEqual(str1, str2) {
+    return str1.toLocaleLowerCase() === str2.toLocaleLowerCase();
+}
+/**
+ * Extracts account name from the url
+ * @param url - url to extract the account name from
+ * @returns with the account name
+ */
+function getAccountNameFromUrl(url) {
+    const parsedUrl = new URL(url);
+    let accountName;
+    try {
+        if (parsedUrl.hostname.split(".")[1] === "blob") {
+            // `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;
+            accountName = parsedUrl.hostname.split(".")[0];
         }
-        // ok, not that one, check if it matches another we know about
-        for (const [compare, root] of Object.entries(this.roots)) {
-            if (this.sameRoot(rootPath, compare)) {
-                return (this.roots[rootPath] = root);
-            }
+        else if (isIpEndpointStyle(parsedUrl)) {
+            // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/
+            // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/
+            // .getPath() -> /devstoreaccount1/
+            accountName = parsedUrl.pathname.split("/")[1];
         }
-        // otherwise, have to create a new one.
-        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
+        else {
+            // Custom domain case: "https://customdomain.com/containername/blob".
+            accountName = "";
+        }
+        return accountName;
     }
-    /**
-     * @internal
-     */
-    sameRoot(rootPath, compare = this.root.name) {
-        // windows can (rarely) have case-sensitive filesystem, but
-        // UNC and drive letters are always case-insensitive, and canonically
-        // represented uppercase.
-        rootPath = rootPath
-            .toUpperCase()
-            .replace(/\//g, '\\')
-            .replace(uncDriveRegexp, '$1\\');
-        return rootPath === compare;
+    catch (error) {
+        throw new Error("Unable to extract accountName with provided information.");
     }
 }
-exports.PathWin32 = PathWin32;
+function isIpEndpointStyle(parsedUrl) {
+    const host = parsedUrl.host;
+    // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.
+    // Case 2: localhost(:port) or host.docker.internal, use broad regex to match port part.
+    // Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
+    // For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
+    return (/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
+        (Boolean(parsedUrl.port) && PathStylePorts.includes(parsedUrl.port)));
+}
 /**
- * Path class used on all posix systems.
+ * Attach a TokenCredential to an object.
  *
- * Uses `'/'` as the path separator.
+ * @param thing -
+ * @param credential -
  */
-class PathPosix extends PathBase {
-    /**
-     * separator for parsing path strings
-     */
-    splitSep = '/';
-    /**
-     * separator for generating path strings
-     */
-    sep = '/';
-    /**
-     * Do not create new Path objects directly.  They should always be accessed
-     * via the PathScurry class or other methods on the Path class.
-     *
-     * @internal
-     */
-    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
-        super(name, type, root, roots, nocase, children, opts);
-    }
-    /**
-     * @internal
-     */
-    getRootString(path) {
-        return path.startsWith('/') ? '/' : '';
-    }
-    /**
-     * @internal
-     */
-    getRoot(_rootPath) {
-        return this.root;
-    }
-    /**
-     * @internal
-     */
-    newChild(name, type = UNKNOWN, opts = {}) {
-        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+function attachCredential(thing, credential) {
+    thing.credential = credential;
+    return thing;
+}
+function httpAuthorizationToString(httpAuthorization) {
+    return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
+}
+/**
+ * Escape the blobName but keep path separator ('/').
+ */
+function EscapePath(blobName) {
+    const split = blobName.split("/");
+    for (let i = 0; i < split.length; i++) {
+        split[i] = encodeURIComponent(split[i]);
     }
+    return split.join("/");
 }
-exports.PathPosix = PathPosix;
 /**
- * The base class for all PathScurry classes, providing the interface for path
- * resolution and filesystem operations.
- *
- * Typically, you should *not* instantiate this class directly, but rather one
- * of the platform-specific classes, or the exported {@link PathScurry} which
- * defaults to the current platform.
+ * A typesafe helper for ensuring that a given response object has
+ * the original _response attached.
+ * @param response - A response object from calling a client operation
+ * @returns The same object, but with known _response property
  */
-class PathScurryBase {
-    /**
-     * The root Path entry for the current working directory of this Scurry
-     */
-    root;
-    /**
-     * The string path for the root of this Scurry's current working directory
-     */
-    rootPath;
-    /**
-     * A collection of all roots encountered, referenced by rootPath
-     */
-    roots;
-    /**
-     * The Path entry corresponding to this PathScurry's current working directory.
-     */
-    cwd;
-    #resolveCache;
-    #resolvePosixCache;
-    #children;
-    /**
-     * Perform path comparisons case-insensitively.
-     *
-     * Defaults true on Darwin and Windows systems, false elsewhere.
-     */
-    nocase;
-    #fs;
-    /**
-     * This class should not be instantiated directly.
-     *
-     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
-     *
-     * @internal
-     */
-    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
-        this.#fs = fsFromOption(fs);
-        if (cwd instanceof URL || cwd.startsWith('file://')) {
-            cwd = (0, node_url_1.fileURLToPath)(cwd);
+function assertResponse(response) {
+    if (`_response` in response) {
+        return response;
+    }
+    throw new TypeError(`Unexpected response object ${response}`);
+}
+//# sourceMappingURL=utils.common.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/utils/SharedKeyComparator.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/*
+ * We need to imitate .Net culture-aware sorting, which is used in storage service.
+ * Below tables contain sort-keys for en-US culture.
+ */
+const table_lv0 = new Uint32Array([
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71c, 0x0, 0x71f, 0x721,
+    0x723, 0x725, 0x0, 0x0, 0x0, 0x72d, 0x803, 0x0, 0x0, 0x733, 0x0, 0xd03, 0xd1a, 0xd1c, 0xd1e,
+    0xd20, 0xd22, 0xd24, 0xd26, 0xd28, 0xd2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe02, 0xe09, 0xe0a,
+    0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70, 0xe7c, 0xe7e, 0xe89,
+    0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x0, 0x0, 0x743, 0x744, 0x748,
+    0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70,
+    0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x74c,
+    0x0, 0x750, 0x0,
+]);
+const table_lv2 = new Uint32Array([
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
+    0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
+    0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+]);
+const table_lv4 = new Uint32Array([
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x8012, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8212, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+]);
+function compareHeader(lhs, rhs) {
+    if (isLessThan(lhs, rhs))
+        return -1;
+    return 1;
+}
+function isLessThan(lhs, rhs) {
+    const tables = [table_lv0, table_lv2, table_lv4];
+    let curr_level = 0;
+    let i = 0;
+    let j = 0;
+    while (curr_level < tables.length) {
+        if (curr_level === tables.length - 1 && i !== j) {
+            return i > j;
+        }
+        const weight1 = i < lhs.length ? tables[curr_level][lhs[i].charCodeAt(0)] : 0x1;
+        const weight2 = j < rhs.length ? tables[curr_level][rhs[j].charCodeAt(0)] : 0x1;
+        if (weight1 === 0x1 && weight2 === 0x1) {
+            i = 0;
+            j = 0;
+            ++curr_level;
         }
-        // resolve and split root, and then add to the store.
-        // this is the only time we call path.resolve()
-        const cwdPath = pathImpl.resolve(cwd);
-        this.roots = Object.create(null);
-        this.rootPath = this.parseRootPath(cwdPath);
-        this.#resolveCache = new ResolveCache();
-        this.#resolvePosixCache = new ResolveCache();
-        this.#children = new ChildrenCache(childrenCacheSize);
-        const split = cwdPath.substring(this.rootPath.length).split(sep);
-        // resolve('/') leaves '', splits to [''], we don't want that.
-        if (split.length === 1 && !split[0]) {
-            split.pop();
+        else if (weight1 === weight2) {
+            ++i;
+            ++j;
         }
-        /* c8 ignore start */
-        if (nocase === undefined) {
-            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
+        else if (weight1 === 0) {
+            ++i;
         }
-        /* c8 ignore stop */
-        this.nocase = nocase;
-        this.root = this.newRoot(this.#fs);
-        this.roots[this.rootPath] = this.root;
-        let prev = this.root;
-        let len = split.length - 1;
-        const joinSep = pathImpl.sep;
-        let abs = this.rootPath;
-        let sawFirst = false;
-        for (const part of split) {
-            const l = len--;
-            prev = prev.child(part, {
-                relative: new Array(l).fill('..').join(joinSep),
-                relativePosix: new Array(l).fill('..').join('/'),
-                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
-            });
-            sawFirst = true;
+        else if (weight2 === 0) {
+            ++j;
+        }
+        else {
+            return weight1 < weight2;
         }
-        this.cwd = prev;
     }
+    return false;
+}
+//# sourceMappingURL=SharedKeyComparator.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageSharedKeyCredentialPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+/**
+ * StorageSharedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key.
+ */
+class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
     /**
-     * Get the depth of a provided path, string, or the cwd
+     * Reference to StorageSharedKeyCredential which generates StorageSharedKeyCredentialPolicy
      */
-    depth(path = this.cwd) {
-        if (typeof path === 'string') {
-            path = this.cwd.resolve(path);
-        }
-        return path.depth();
+    factory;
+    /**
+     * Creates an instance of StorageSharedKeyCredentialPolicy.
+     * @param nextPolicy -
+     * @param options -
+     * @param factory -
+     */
+    constructor(nextPolicy, options, factory) {
+        super(nextPolicy, options);
+        this.factory = factory;
     }
     /**
-     * Return the cache of child entries.  Exposed so subclasses can create
-     * child Path objects in a platform-specific way.
+     * Signs request.
      *
-     * @internal
+     * @param request -
      */
-    childrenCache() {
-        return this.#children;
+    signRequest(request) {
+        request.headers.set(constants_HeaderConstants.X_MS_DATE, new Date().toUTCString());
+        if (request.body &&
+            (typeof request.body === "string" || request.body !== undefined) &&
+            request.body.length > 0) {
+            request.headers.set(constants_HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
+        }
+        const stringToSign = [
+            request.method.toUpperCase(),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_LANGUAGE),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_ENCODING),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_LENGTH),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_MD5),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_TYPE),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.DATE),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.IF_MODIFIED_SINCE),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.IF_MATCH),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.IF_NONE_MATCH),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.IF_UNMODIFIED_SINCE),
+            this.getHeaderValueToSign(request, constants_HeaderConstants.RANGE),
+        ].join("\n") +
+            "\n" +
+            this.getCanonicalizedHeadersString(request) +
+            this.getCanonicalizedResourceString(request);
+        const signature = this.factory.computeHMACSHA256(stringToSign);
+        request.headers.set(constants_HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`);
+        // console.log(`[URL]:${request.url}`);
+        // console.log(`[HEADERS]:${request.headers.toString()}`);
+        // console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`);
+        // console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`);
+        return request;
     }
     /**
-     * Resolve one or more path strings to a resolved string
-     *
-     * Same interface as require('path').resolve.
+     * Retrieve header value according to shared key sign rules.
+     * @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
      *
-     * Much faster than path.resolve() when called multiple times for the same
-     * path, because the resolved Path objects are cached.  Much slower
-     * otherwise.
+     * @param request -
+     * @param headerName -
      */
-    resolve(...paths) {
-        // first figure out the minimum number of paths we have to test
-        // we always start at cwd, but any absolutes will bump the start
-        let r = '';
-        for (let i = paths.length - 1; i >= 0; i--) {
-            const p = paths[i];
-            if (!p || p === '.')
-                continue;
-            r = r ? `${p}/${r}` : p;
-            if (this.isAbsolute(p)) {
-                break;
-            }
+    getHeaderValueToSign(request, headerName) {
+        const value = request.headers.get(headerName);
+        if (!value) {
+            return "";
         }
-        const cached = this.#resolveCache.get(r);
-        if (cached !== undefined) {
-            return cached;
+        // When using version 2015-02-21 or later, if Content-Length is zero, then
+        // set the Content-Length part of the StringToSign to an empty string.
+        // https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
+        if (headerName === constants_HeaderConstants.CONTENT_LENGTH && value === "0") {
+            return "";
         }
-        const result = this.cwd.resolve(r).fullpath();
-        this.#resolveCache.set(r, result);
-        return result;
+        return value;
     }
     /**
-     * Resolve one or more path strings to a resolved string, returning
-     * the posix path.  Identical to .resolve() on posix systems, but on
-     * windows will return a forward-slash separated UNC path.
-     *
-     * Same interface as require('path').resolve.
+     * To construct the CanonicalizedHeaders portion of the signature string, follow these steps:
+     * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.
+     * 2. Convert each HTTP header name to lowercase.
+     * 3. Sort the headers lexicographically by header name, in ascending order.
+     *    Each header may appear only once in the string.
+     * 4. Replace any linear whitespace in the header value with a single space.
+     * 5. Trim any whitespace around the colon in the header.
+     * 6. Finally, append a new-line character to each canonicalized header in the resulting list.
+     *    Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.
      *
-     * Much faster than path.resolve() when called multiple times for the same
-     * path, because the resolved Path objects are cached.  Much slower
-     * otherwise.
+     * @param request -
      */
-    resolvePosix(...paths) {
-        // first figure out the minimum number of paths we have to test
-        // we always start at cwd, but any absolutes will bump the start
-        let r = '';
-        for (let i = paths.length - 1; i >= 0; i--) {
-            const p = paths[i];
-            if (!p || p === '.')
-                continue;
-            r = r ? `${p}/${r}` : p;
-            if (this.isAbsolute(p)) {
-                break;
+    getCanonicalizedHeadersString(request) {
+        let headersArray = request.headers.headersArray().filter((value) => {
+            return value.name.toLowerCase().startsWith(constants_HeaderConstants.PREFIX_FOR_STORAGE);
+        });
+        headersArray.sort((a, b) => {
+            return compareHeader(a.name.toLowerCase(), b.name.toLowerCase());
+        });
+        // Remove duplicate headers
+        headersArray = headersArray.filter((value, index, array) => {
+            if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) {
+                return false;
+            }
+            return true;
+        });
+        let canonicalizedHeadersStringToSign = "";
+        headersArray.forEach((header) => {
+            canonicalizedHeadersStringToSign += `${header.name
+                .toLowerCase()
+                .trimRight()}:${header.value.trimLeft()}\n`;
+        });
+        return canonicalizedHeadersStringToSign;
+    }
+    /**
+     * Retrieves the webResource canonicalized resource string.
+     *
+     * @param request -
+     */
+    getCanonicalizedResourceString(request) {
+        const path = getURLPath(request.url) || "/";
+        let canonicalizedResourceString = "";
+        canonicalizedResourceString += `/${this.factory.accountName}${path}`;
+        const queries = getURLQueries(request.url);
+        const lowercaseQueries = {};
+        if (queries) {
+            const queryKeys = [];
+            for (const key in queries) {
+                if (Object.prototype.hasOwnProperty.call(queries, key)) {
+                    const lowercaseKey = key.toLowerCase();
+                    lowercaseQueries[lowercaseKey] = queries[key];
+                    queryKeys.push(lowercaseKey);
+                }
+            }
+            queryKeys.sort();
+            for (const key of queryKeys) {
+                canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`;
             }
         }
-        const cached = this.#resolvePosixCache.get(r);
-        if (cached !== undefined) {
-            return cached;
-        }
-        const result = this.cwd.resolve(r).fullpathPosix();
-        this.#resolvePosixCache.set(r, result);
-        return result;
+        return canonicalizedResourceString;
     }
+}
+//# sourceMappingURL=StorageSharedKeyCredentialPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/credentials/StorageSharedKeyCredential.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * StorageSharedKeyCredential for account key authorization of Azure Storage service.
+ */
+class StorageSharedKeyCredential extends Credential {
     /**
-     * find the relative path from the cwd to the supplied path string or entry
+     * Azure Storage account name; readonly.
      */
-    relative(entry = this.cwd) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        return entry.relative();
-    }
+    accountName;
     /**
-     * find the relative path from the cwd to the supplied path string or
-     * entry, using / as the path delimiter, even on Windows.
+     * Azure Storage account key; readonly.
      */
-    relativePosix(entry = this.cwd) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        return entry.relativePosix();
-    }
+    accountKey;
     /**
-     * Return the basename for the provided string or Path object
+     * Creates an instance of StorageSharedKeyCredential.
+     * @param accountName -
+     * @param accountKey -
      */
-    basename(entry = this.cwd) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        return entry.name;
+    constructor(accountName, accountKey) {
+        super();
+        this.accountName = accountName;
+        this.accountKey = Buffer.from(accountKey, "base64");
     }
     /**
-     * Return the dirname for the provided string or Path object
+     * Creates a StorageSharedKeyCredentialPolicy object.
+     *
+     * @param nextPolicy -
+     * @param options -
      */
-    dirname(entry = this.cwd) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        return (entry.parent || entry).fullpath();
+    create(nextPolicy, options) {
+        return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this);
     }
-    async readdir(entry = this.cwd, opts = {
-        withFileTypes: true,
-    }) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            opts = entry;
-            entry = this.cwd;
-        }
-        const { withFileTypes } = opts;
-        if (!entry.canReaddir()) {
-            return [];
-        }
-        else {
-            const p = await entry.readdir();
-            return withFileTypes ? p : p.map(e => e.name);
-        }
+    /**
+     * Generates a hash signature for an HTTP request or for a SAS.
+     *
+     * @param stringToSign -
+     */
+    computeHMACSHA256(stringToSign) {
+        return (0,external_node_crypto_.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64");
     }
-    readdirSync(entry = this.cwd, opts = {
-        withFileTypes: true,
-    }) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            opts = entry;
-            entry = this.cwd;
-        }
-        const { withFileTypes = true } = opts;
-        if (!entry.canReaddir()) {
-            return [];
-        }
-        else if (withFileTypes) {
-            return entry.readdirSync();
-        }
-        else {
-            return entry.readdirSync().map(e => e.name);
-        }
+}
+//# sourceMappingURL=StorageSharedKeyCredential.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/log.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * The `@azure/logger` configuration for this package.
+ */
+const storage_common_dist_esm_log_logger = esm_createClientLogger("storage-common");
+//# sourceMappingURL=log.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageRetryPolicyType.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * RetryPolicy types.
+ */
+var StorageRetryPolicyType;
+(function (StorageRetryPolicyType) {
+    /**
+     * Exponential retry. Retry time delay grows exponentially.
+     */
+    StorageRetryPolicyType[StorageRetryPolicyType["EXPONENTIAL"] = 0] = "EXPONENTIAL";
+    /**
+     * Linear retry. Retry time delay grows linearly.
+     */
+    StorageRetryPolicyType[StorageRetryPolicyType["FIXED"] = 1] = "FIXED";
+})(StorageRetryPolicyType || (StorageRetryPolicyType = {}));
+//# sourceMappingURL=StorageRetryPolicyType.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageRetryPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+/**
+ * A factory method used to generated a RetryPolicy factory.
+ *
+ * @param retryOptions -
+ */
+function NewRetryPolicyFactory(retryOptions) {
+    return {
+        create: (nextPolicy, options) => {
+            return new StorageRetryPolicy(nextPolicy, options, retryOptions);
+        },
+    };
+}
+// Default values of StorageRetryOptions
+const DEFAULT_RETRY_OPTIONS = {
+    maxRetryDelayInMs: 120 * 1000,
+    maxTries: 4,
+    retryDelayInMs: 4 * 1000,
+    retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,
+    secondaryHost: "",
+    tryTimeoutInMs: undefined, // Use server side default timeout strategy
+};
+const RETRY_ABORT_ERROR = new esm_AbortError_AbortError("The operation was aborted.");
+/**
+ * Retry policy with exponential retry and linear retry implemented.
+ */
+class StorageRetryPolicy extends BaseRequestPolicy {
+    /**
+     * RetryOptions.
+     */
+    retryOptions;
+    /**
+     * Creates an instance of RetryPolicy.
+     *
+     * @param nextPolicy -
+     * @param options -
+     * @param retryOptions -
+     */
+    constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) {
+        super(nextPolicy, options);
+        // Initialize retry options
+        this.retryOptions = {
+            retryPolicyType: retryOptions.retryPolicyType
+                ? retryOptions.retryPolicyType
+                : DEFAULT_RETRY_OPTIONS.retryPolicyType,
+            maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1
+                ? Math.floor(retryOptions.maxTries)
+                : DEFAULT_RETRY_OPTIONS.maxTries,
+            tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0
+                ? retryOptions.tryTimeoutInMs
+                : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,
+            retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0
+                ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs
+                    ? retryOptions.maxRetryDelayInMs
+                    : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs)
+                : DEFAULT_RETRY_OPTIONS.retryDelayInMs,
+            maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0
+                ? retryOptions.maxRetryDelayInMs
+                : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,
+            secondaryHost: retryOptions.secondaryHost
+                ? retryOptions.secondaryHost
+                : DEFAULT_RETRY_OPTIONS.secondaryHost,
+        };
     }
     /**
-     * Call lstat() on the string or Path object, and update all known
-     * information that can be determined.
-     *
-     * Note that unlike `fs.lstat()`, the returned value does not contain some
-     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
-     * information is required, you will need to call `fs.lstat` yourself.
-     *
-     * If the Path refers to a nonexistent file, or if the lstat call fails for
-     * any reason, `undefined` is returned.  Otherwise the updated Path object is
-     * returned.
+     * Sends request.
      *
-     * Results are cached, and thus may be out of date if the filesystem is
-     * mutated.
+     * @param request -
      */
-    async lstat(entry = this.cwd) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        return entry.lstat();
+    async sendRequest(request) {
+        return this.attemptSendRequest(request, false, 1);
     }
     /**
-     * synchronous {@link PathScurryBase.lstat}
+     * Decide and perform next retry. Won't mutate request parameter.
+     *
+     * @param request -
+     * @param secondaryHas404 -  If attempt was against the secondary & it returned a StatusNotFound (404), then
+     *                                   the resource was not found. This may be due to replication delay. So, in this
+     *                                   case, we'll never try the secondary again for this operation.
+     * @param attempt -           How many retries has been attempted to performed, starting from 1, which includes
+     *                                   the attempt will be performed by this method call.
      */
-    lstatSync(entry = this.cwd) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        return entry.lstatSync();
-    }
-    async readlink(entry = this.cwd, { withFileTypes } = {
-        withFileTypes: false,
-    }) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            withFileTypes = entry.withFileTypes;
-            entry = this.cwd;
-        }
-        const e = await entry.readlink();
-        return withFileTypes ? e : e?.fullpath();
-    }
-    readlinkSync(entry = this.cwd, { withFileTypes } = {
-        withFileTypes: false,
-    }) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            withFileTypes = entry.withFileTypes;
-            entry = this.cwd;
-        }
-        const e = entry.readlinkSync();
-        return withFileTypes ? e : e?.fullpath();
-    }
-    async realpath(entry = this.cwd, { withFileTypes } = {
-        withFileTypes: false,
-    }) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
+    async attemptSendRequest(request, secondaryHas404, attempt) {
+        const newRequest = request.clone();
+        const isPrimaryRetry = secondaryHas404 ||
+            !this.retryOptions.secondaryHost ||
+            !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") ||
+            attempt % 2 === 1;
+        if (!isPrimaryRetry) {
+            newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost);
         }
-        else if (!(entry instanceof PathBase)) {
-            withFileTypes = entry.withFileTypes;
-            entry = this.cwd;
+        // Set the server-side timeout query parameter "timeout=[seconds]"
+        if (this.retryOptions.tryTimeoutInMs) {
+            newRequest.url = setURLParameter(newRequest.url, constants_URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString());
         }
-        const e = await entry.realpath();
-        return withFileTypes ? e : e?.fullpath();
-    }
-    realpathSync(entry = this.cwd, { withFileTypes } = {
-        withFileTypes: false,
-    }) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
+        let response;
+        try {
+            storage_common_dist_esm_log_logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
+            response = await this._nextPolicy.sendRequest(newRequest);
+            if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {
+                return response;
+            }
+            secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
         }
-        else if (!(entry instanceof PathBase)) {
-            withFileTypes = entry.withFileTypes;
-            entry = this.cwd;
+        catch (err) {
+            storage_common_dist_esm_log_logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);
+            if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {
+                throw err;
+            }
         }
-        const e = entry.realpathSync();
-        return withFileTypes ? e : e?.fullpath();
+        await this.delay(isPrimaryRetry, attempt, request.abortSignal);
+        return this.attemptSendRequest(request, secondaryHas404, ++attempt);
     }
-    async walk(entry = this.cwd, opts = {}) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            opts = entry;
-            entry = this.cwd;
-        }
-        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
-        const results = [];
-        if (!filter || filter(entry)) {
-            results.push(withFileTypes ? entry : entry.fullpath());
+    /**
+     * Decide whether to retry according to last HTTP response and retry counters.
+     *
+     * @param isPrimaryRetry -
+     * @param attempt -
+     * @param response -
+     * @param err -
+     */
+    shouldRetry(isPrimaryRetry, attempt, response, err) {
+        if (attempt >= this.retryOptions.maxTries) {
+            storage_common_dist_esm_log_logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions
+                .maxTries}, no further try.`);
+            return false;
         }
-        const dirs = new Set();
-        const walk = (dir, cb) => {
-            dirs.add(dir);
-            dir.readdirCB((er, entries) => {
-                /* c8 ignore start */
-                if (er) {
-                    return cb(er);
-                }
-                /* c8 ignore stop */
-                let len = entries.length;
-                if (!len)
-                    return cb();
-                const next = () => {
-                    if (--len === 0) {
-                        cb();
-                    }
-                };
-                for (const e of entries) {
-                    if (!filter || filter(e)) {
-                        results.push(withFileTypes ? e : e.fullpath());
-                    }
-                    if (follow && e.isSymbolicLink()) {
-                        e.realpath()
-                            .then(r => (r?.isUnknown() ? r.lstat() : r))
-                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
-                    }
-                    else {
-                        if (e.shouldWalk(dirs, walkFilter)) {
-                            walk(e, next);
-                        }
-                        else {
-                            next();
-                        }
-                    }
+        // Handle network failures, you may need to customize the list when you implement
+        // your own http client
+        const retriableErrors = [
+            "ETIMEDOUT",
+            "ESOCKETTIMEDOUT",
+            "ECONNREFUSED",
+            "ECONNRESET",
+            "ENOENT",
+            "ENOTFOUND",
+            "TIMEOUT",
+            "EPIPE",
+            "REQUEST_SEND_ERROR", // For default xhr based http client provided in ms-rest-js
+        ];
+        if (err) {
+            for (const retriableError of retriableErrors) {
+                if (err.name.toUpperCase().includes(retriableError) ||
+                    err.message.toUpperCase().includes(retriableError) ||
+                    (err.code && err.code.toString().toUpperCase() === retriableError)) {
+                    storage_common_dist_esm_log_logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
+                    return true;
                 }
-            }, true); // zalgooooooo
-        };
-        const start = entry;
-        return new Promise((res, rej) => {
-            walk(start, er => {
-                /* c8 ignore start */
-                if (er)
-                    return rej(er);
-                /* c8 ignore stop */
-                res(results);
-            });
-        });
-    }
-    walkSync(entry = this.cwd, opts = {}) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            opts = entry;
-            entry = this.cwd;
+            }
         }
-        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
-        const results = [];
-        if (!filter || filter(entry)) {
-            results.push(withFileTypes ? entry : entry.fullpath());
+        // If attempt was against the secondary & it returned a StatusNotFound (404), then
+        // the resource was not found. This may be due to replication delay. So, in this
+        // case, we'll never try the secondary again for this operation.
+        if (response || err) {
+            const statusCode = response ? response.status : err ? err.statusCode : 0;
+            if (!isPrimaryRetry && statusCode === 404) {
+                storage_common_dist_esm_log_logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
+                return true;
+            }
+            // Server internal error or server timeout
+            if (statusCode === 503 || statusCode === 500) {
+                storage_common_dist_esm_log_logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
+                return true;
+            }
         }
-        const dirs = new Set([entry]);
-        for (const dir of dirs) {
-            const entries = dir.readdirSync();
-            for (const e of entries) {
-                if (!filter || filter(e)) {
-                    results.push(withFileTypes ? e : e.fullpath());
-                }
-                let r = e;
-                if (e.isSymbolicLink()) {
-                    if (!(follow && (r = e.realpathSync())))
-                        continue;
-                    if (r.isUnknown())
-                        r.lstatSync();
-                }
-                if (r.shouldWalk(dirs, walkFilter)) {
-                    dirs.add(r);
+        if (response) {
+            // Retry select Copy Source Error Codes.
+            if (response?.status >= 400) {
+                const copySourceError = response.headers.get(constants_HeaderConstants.X_MS_CopySourceErrorCode);
+                if (copySourceError !== undefined) {
+                    switch (copySourceError) {
+                        case "InternalError":
+                        case "OperationTimedOut":
+                        case "ServerBusy":
+                            return true;
+                    }
                 }
             }
         }
-        return results;
+        if (err?.code === "PARSE_ERROR" && err?.message.startsWith(`Error "Error: Unclosed root tag`)) {
+            storage_common_dist_esm_log_logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
+            return true;
+        }
+        return false;
     }
     /**
-     * Support for `for await`
-     *
-     * Alias for {@link PathScurryBase.iterate}
+     * Delay a calculated time between retries.
      *
-     * Note: As of Node 19, this is very slow, compared to other methods of
-     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
-     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     * @param isPrimaryRetry -
+     * @param attempt -
+     * @param abortSignal -
      */
-    [Symbol.asyncIterator]() {
-        return this.iterate();
-    }
-    iterate(entry = this.cwd, options = {}) {
-        // iterating async over the stream is significantly more performant,
-        // especially in the warm-cache scenario, because it buffers up directory
-        // entries in the background instead of waiting for a yield for each one.
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
+    async delay(isPrimaryRetry, attempt, abortSignal) {
+        let delayTimeInMs = 0;
+        if (isPrimaryRetry) {
+            switch (this.retryOptions.retryPolicyType) {
+                case StorageRetryPolicyType.EXPONENTIAL:
+                    delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs);
+                    break;
+                case StorageRetryPolicyType.FIXED:
+                    delayTimeInMs = this.retryOptions.retryDelayInMs;
+                    break;
+            }
         }
-        else if (!(entry instanceof PathBase)) {
-            options = entry;
-            entry = this.cwd;
+        else {
+            delayTimeInMs = Math.random() * 1000;
         }
-        return this.stream(entry, options)[Symbol.asyncIterator]();
+        storage_common_dist_esm_log_logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
+        return utils_common_delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);
     }
+}
+//# sourceMappingURL=StorageRetryPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/StorageRetryPolicyFactory.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+/**
+ * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.
+ */
+class StorageRetryPolicyFactory {
+    retryOptions;
     /**
-     * Iterating over a PathScurry performs a synchronous walk.
+     * Creates an instance of StorageRetryPolicyFactory.
+     * @param retryOptions -
+     */
+    constructor(retryOptions) {
+        this.retryOptions = retryOptions;
+    }
+    /**
+     * Creates a StorageRetryPolicy object.
      *
-     * Alias for {@link PathScurryBase.iterateSync}
+     * @param nextPolicy -
+     * @param options -
      */
-    [Symbol.iterator]() {
-        return this.iterateSync();
+    create(nextPolicy, options) {
+        return new StorageRetryPolicy(nextPolicy, options, this.retryOptions);
     }
-    *iterateSync(entry = this.cwd, opts = {}) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            opts = entry;
-            entry = this.cwd;
+}
+//# sourceMappingURL=StorageRetryPolicyFactory.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageBrowserPolicyV2.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * The programmatic identifier of the StorageBrowserPolicy.
+ */
+const storageBrowserPolicyName = "storageBrowserPolicy";
+/**
+ * storageBrowserPolicy is a policy used to prevent browsers from caching requests
+ * and to remove cookies and explicit content-length headers.
+ *
+ * In Node.js, this policy is a no-op pass-through.
+ */
+function storageBrowserPolicy() {
+    return {
+        name: storageBrowserPolicyName,
+        async sendRequest(request, next) {
+            return next(request);
+        },
+    };
+}
+//# sourceMappingURL=StorageBrowserPolicyV2.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageCorrectContentLengthPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * The programmatic identifier of the storageCorrectContentLengthPolicy.
+ */
+const storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy";
+/**
+ * storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.
+ */
+function storageCorrectContentLengthPolicy() {
+    function correctContentLength(request) {
+        if (request.body &&
+            (typeof request.body === "string" || Buffer.isBuffer(request.body)) &&
+            request.body.length > 0) {
+            request.headers.set(constants_HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
         }
-        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
-        if (!filter || filter(entry)) {
-            yield withFileTypes ? entry : entry.fullpath();
+    }
+    return {
+        name: storageCorrectContentLengthPolicyName,
+        async sendRequest(request, next) {
+            correctContentLength(request);
+            return next(request);
+        },
+    };
+}
+//# sourceMappingURL=StorageCorrectContentLengthPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageRetryPolicyV2.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+
+/**
+ * Name of the {@link storageRetryPolicy}
+ */
+const storageRetryPolicyName = "storageRetryPolicy";
+// Default values of StorageRetryOptions
+const StorageRetryPolicyV2_DEFAULT_RETRY_OPTIONS = {
+    maxRetryDelayInMs: 120 * 1000,
+    maxTries: 4,
+    retryDelayInMs: 4 * 1000,
+    retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,
+    secondaryHost: "",
+    tryTimeoutInMs: undefined, // Use server side default timeout strategy
+};
+const retriableErrors = [
+    "ETIMEDOUT",
+    "ESOCKETTIMEDOUT",
+    "ECONNREFUSED",
+    "ECONNRESET",
+    "ENOENT",
+    "ENOTFOUND",
+    "TIMEOUT",
+    "EPIPE",
+    "REQUEST_SEND_ERROR",
+];
+const StorageRetryPolicyV2_RETRY_ABORT_ERROR = new esm_AbortError_AbortError("The operation was aborted.");
+/**
+ * Retry policy with exponential retry and linear retry implemented.
+ */
+function storageRetryPolicy(options = {}) {
+    const retryPolicyType = options.retryPolicyType ?? StorageRetryPolicyV2_DEFAULT_RETRY_OPTIONS.retryPolicyType;
+    const maxTries = options.maxTries ?? StorageRetryPolicyV2_DEFAULT_RETRY_OPTIONS.maxTries;
+    const retryDelayInMs = options.retryDelayInMs ?? StorageRetryPolicyV2_DEFAULT_RETRY_OPTIONS.retryDelayInMs;
+    const maxRetryDelayInMs = options.maxRetryDelayInMs ?? StorageRetryPolicyV2_DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs;
+    const secondaryHost = options.secondaryHost ?? StorageRetryPolicyV2_DEFAULT_RETRY_OPTIONS.secondaryHost;
+    const tryTimeoutInMs = options.tryTimeoutInMs ?? StorageRetryPolicyV2_DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;
+    function shouldRetry({ isPrimaryRetry, attempt, response, error, }) {
+        if (attempt >= maxTries) {
+            storage_common_dist_esm_log_logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`);
+            return false;
         }
-        const dirs = new Set([entry]);
-        for (const dir of dirs) {
-            const entries = dir.readdirSync();
-            for (const e of entries) {
-                if (!filter || filter(e)) {
-                    yield withFileTypes ? e : e.fullpath();
-                }
-                let r = e;
-                if (e.isSymbolicLink()) {
-                    if (!(follow && (r = e.realpathSync())))
-                        continue;
-                    if (r.isUnknown())
-                        r.lstatSync();
+        if (error) {
+            for (const retriableError of retriableErrors) {
+                if (error.name.toUpperCase().includes(retriableError) ||
+                    error.message.toUpperCase().includes(retriableError) ||
+                    (error.code && error.code.toString().toUpperCase() === retriableError)) {
+                    storage_common_dist_esm_log_logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
+                    return true;
                 }
-                if (r.shouldWalk(dirs, walkFilter)) {
-                    dirs.add(r);
+            }
+            if (error?.code === "PARSE_ERROR" &&
+                error?.message.startsWith(`Error "Error: Unclosed root tag`)) {
+                storage_common_dist_esm_log_logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
+                return true;
+            }
+        }
+        // If attempt was against the secondary & it returned a StatusNotFound (404), then
+        // the resource was not found. This may be due to replication delay. So, in this
+        // case, we'll never try the secondary again for this operation.
+        if (response || error) {
+            const statusCode = response?.status ?? error?.statusCode ?? 0;
+            if (!isPrimaryRetry && statusCode === 404) {
+                storage_common_dist_esm_log_logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
+                return true;
+            }
+            // Server internal error or server timeout
+            if (statusCode === 503 || statusCode === 500) {
+                storage_common_dist_esm_log_logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
+                return true;
+            }
+        }
+        if (response) {
+            // Retry select Copy Source Error Codes.
+            if (response?.status >= 400) {
+                const copySourceError = response.headers.get(constants_HeaderConstants.X_MS_CopySourceErrorCode);
+                if (copySourceError !== undefined) {
+                    switch (copySourceError) {
+                        case "InternalError":
+                        case "OperationTimedOut":
+                        case "ServerBusy":
+                            return true;
+                    }
                 }
             }
         }
+        return false;
     }
-    stream(entry = this.cwd, opts = {}) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
-        }
-        else if (!(entry instanceof PathBase)) {
-            opts = entry;
-            entry = this.cwd;
+    function calculateDelay(isPrimaryRetry, attempt) {
+        let delayTimeInMs = 0;
+        if (isPrimaryRetry) {
+            switch (retryPolicyType) {
+                case StorageRetryPolicyType.EXPONENTIAL:
+                    delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs);
+                    break;
+                case StorageRetryPolicyType.FIXED:
+                    delayTimeInMs = retryDelayInMs;
+                    break;
+            }
         }
-        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
-        const results = new minipass_1.Minipass({ objectMode: true });
-        if (!filter || filter(entry)) {
-            results.write(withFileTypes ? entry : entry.fullpath());
+        else {
+            delayTimeInMs = Math.random() * 1000;
         }
-        const dirs = new Set();
-        const queue = [entry];
-        let processing = 0;
-        const process = () => {
-            let paused = false;
-            while (!paused) {
-                const dir = queue.shift();
-                if (!dir) {
-                    if (processing === 0)
-                        results.end();
-                    return;
+        storage_common_dist_esm_log_logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
+        return delayTimeInMs;
+    }
+    return {
+        name: storageRetryPolicyName,
+        async sendRequest(request, next) {
+            // Set the server-side timeout query parameter "timeout=[seconds]"
+            if (tryTimeoutInMs) {
+                request.url = setURLParameter(request.url, constants_URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1000)));
+            }
+            const primaryUrl = request.url;
+            const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : undefined;
+            let secondaryHas404 = false;
+            let attempt = 1;
+            let retryAgain = true;
+            let response;
+            let error;
+            while (retryAgain) {
+                const isPrimaryRetry = secondaryHas404 ||
+                    !secondaryUrl ||
+                    !["GET", "HEAD", "OPTIONS"].includes(request.method) ||
+                    attempt % 2 === 1;
+                request.url = isPrimaryRetry ? primaryUrl : secondaryUrl;
+                response = undefined;
+                error = undefined;
+                try {
+                    storage_common_dist_esm_log_logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
+                    response = await next(request);
+                    secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
                 }
-                processing++;
-                dirs.add(dir);
-                const onReaddir = (er, entries, didRealpaths = false) => {
-                    /* c8 ignore start */
-                    if (er)
-                        return results.emit('error', er);
-                    /* c8 ignore stop */
-                    if (follow && !didRealpaths) {
-                        const promises = [];
-                        for (const e of entries) {
-                            if (e.isSymbolicLink()) {
-                                promises.push(e
-                                    .realpath()
-                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
-                            }
-                        }
-                        if (promises.length) {
-                            Promise.all(promises).then(() => onReaddir(null, entries, true));
-                            return;
-                        }
-                    }
-                    for (const e of entries) {
-                        if (e && (!filter || filter(e))) {
-                            if (!results.write(withFileTypes ? e : e.fullpath())) {
-                                paused = true;
-                            }
-                        }
-                    }
-                    processing--;
-                    for (const e of entries) {
-                        const r = e.realpathCached() || e;
-                        if (r.shouldWalk(dirs, walkFilter)) {
-                            queue.push(r);
-                        }
-                    }
-                    if (paused && !results.flowing) {
-                        results.once('drain', process);
+                catch (e) {
+                    if (esm_restError_isRestError(e)) {
+                        storage_common_dist_esm_log_logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`);
+                        error = e;
                     }
-                    else if (!sync) {
-                        process();
+                    else {
+                        storage_common_dist_esm_log_logger.error(`RetryPolicy: Caught error, message: ${getErrorMessage(e)}`);
+                        throw e;
                     }
-                };
-                // zalgo containment
-                let sync = true;
-                dir.readdirCB(onReaddir, true);
-                sync = false;
+                }
+                retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error });
+                if (retryAgain) {
+                    await utils_common_delay(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, StorageRetryPolicyV2_RETRY_ABORT_ERROR);
+                }
+                attempt++;
             }
-        };
-        process();
-        return results;
-    }
-    streamSync(entry = this.cwd, opts = {}) {
-        if (typeof entry === 'string') {
-            entry = this.cwd.resolve(entry);
+            if (response) {
+                return response;
+            }
+            throw error ?? new esm_restError_RestError("RetryPolicy failed without known error.");
+        },
+    };
+}
+//# sourceMappingURL=StorageRetryPolicyV2.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+/**
+ * The programmatic identifier of the storageSharedKeyCredentialPolicy.
+ */
+const storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy";
+/**
+ * storageSharedKeyCredentialPolicy handles signing requests using storage account keys.
+ */
+function storageSharedKeyCredentialPolicy(options) {
+    function signRequest(request) {
+        request.headers.set(constants_HeaderConstants.X_MS_DATE, new Date().toUTCString());
+        if (request.body &&
+            (typeof request.body === "string" || Buffer.isBuffer(request.body)) &&
+            request.body.length > 0) {
+            request.headers.set(constants_HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
+        }
+        const stringToSign = [
+            request.method.toUpperCase(),
+            getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_LANGUAGE),
+            getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_ENCODING),
+            getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_LENGTH),
+            getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_MD5),
+            getHeaderValueToSign(request, constants_HeaderConstants.CONTENT_TYPE),
+            getHeaderValueToSign(request, constants_HeaderConstants.DATE),
+            getHeaderValueToSign(request, constants_HeaderConstants.IF_MODIFIED_SINCE),
+            getHeaderValueToSign(request, constants_HeaderConstants.IF_MATCH),
+            getHeaderValueToSign(request, constants_HeaderConstants.IF_NONE_MATCH),
+            getHeaderValueToSign(request, constants_HeaderConstants.IF_UNMODIFIED_SINCE),
+            getHeaderValueToSign(request, constants_HeaderConstants.RANGE),
+        ].join("\n") +
+            "\n" +
+            getCanonicalizedHeadersString(request) +
+            getCanonicalizedResourceString(request);
+        const signature = (0,external_node_crypto_.createHmac)("sha256", options.accountKey)
+            .update(stringToSign, "utf8")
+            .digest("base64");
+        request.headers.set(constants_HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`);
+        // console.log(`[URL]:${request.url}`);
+        // console.log(`[HEADERS]:${request.headers.toString()}`);
+        // console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`);
+        // console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`);
+    }
+    /**
+     * Retrieve header value according to shared key sign rules.
+     * @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
+     */
+    function getHeaderValueToSign(request, headerName) {
+        const value = request.headers.get(headerName);
+        if (!value) {
+            return "";
         }
-        else if (!(entry instanceof PathBase)) {
-            opts = entry;
-            entry = this.cwd;
+        // When using version 2015-02-21 or later, if Content-Length is zero, then
+        // set the Content-Length part of the StringToSign to an empty string.
+        // https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
+        if (headerName === constants_HeaderConstants.CONTENT_LENGTH && value === "0") {
+            return "";
         }
-        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
-        const results = new minipass_1.Minipass({ objectMode: true });
-        const dirs = new Set();
-        if (!filter || filter(entry)) {
-            results.write(withFileTypes ? entry : entry.fullpath());
+        return value;
+    }
+    /**
+     * To construct the CanonicalizedHeaders portion of the signature string, follow these steps:
+     * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.
+     * 2. Convert each HTTP header name to lowercase.
+     * 3. Sort the headers lexicographically by header name, in ascending order.
+     *    Each header may appear only once in the string.
+     * 4. Replace any linear whitespace in the header value with a single space.
+     * 5. Trim any whitespace around the colon in the header.
+     * 6. Finally, append a new-line character to each canonicalized header in the resulting list.
+     *    Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.
+     *
+     */
+    function getCanonicalizedHeadersString(request) {
+        let headersArray = [];
+        for (const [name, value] of request.headers) {
+            if (name.toLowerCase().startsWith(constants_HeaderConstants.PREFIX_FOR_STORAGE)) {
+                headersArray.push({ name, value });
+            }
         }
-        const queue = [entry];
-        let processing = 0;
-        const process = () => {
-            let paused = false;
-            while (!paused) {
-                const dir = queue.shift();
-                if (!dir) {
-                    if (processing === 0)
-                        results.end();
-                    return;
-                }
-                processing++;
-                dirs.add(dir);
-                const entries = dir.readdirSync();
-                for (const e of entries) {
-                    if (!filter || filter(e)) {
-                        if (!results.write(withFileTypes ? e : e.fullpath())) {
-                            paused = true;
-                        }
-                    }
+        headersArray.sort((a, b) => {
+            return compareHeader(a.name.toLowerCase(), b.name.toLowerCase());
+        });
+        // Remove duplicate headers
+        headersArray = headersArray.filter((value, index, array) => {
+            if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) {
+                return false;
+            }
+            return true;
+        });
+        let canonicalizedHeadersStringToSign = "";
+        headersArray.forEach((header) => {
+            canonicalizedHeadersStringToSign += `${header.name
+                .toLowerCase()
+                .trimRight()}:${header.value.trimLeft()}\n`;
+        });
+        return canonicalizedHeadersStringToSign;
+    }
+    function getCanonicalizedResourceString(request) {
+        const path = getURLPath(request.url) || "/";
+        let canonicalizedResourceString = "";
+        canonicalizedResourceString += `/${options.accountName}${path}`;
+        const queries = getURLQueries(request.url);
+        const lowercaseQueries = {};
+        if (queries) {
+            const queryKeys = [];
+            for (const key in queries) {
+                if (Object.prototype.hasOwnProperty.call(queries, key)) {
+                    const lowercaseKey = key.toLowerCase();
+                    lowercaseQueries[lowercaseKey] = queries[key];
+                    queryKeys.push(lowercaseKey);
                 }
-                processing--;
-                for (const e of entries) {
-                    let r = e;
-                    if (e.isSymbolicLink()) {
-                        if (!(follow && (r = e.realpathSync())))
-                            continue;
-                        if (r.isUnknown())
-                            r.lstatSync();
-                    }
-                    if (r.shouldWalk(dirs, walkFilter)) {
-                        queue.push(r);
+            }
+            queryKeys.sort();
+            for (const key of queryKeys) {
+                canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`;
+            }
+        }
+        return canonicalizedResourceString;
+    }
+    return {
+        name: storageSharedKeyCredentialPolicyName,
+        async sendRequest(request, next) {
+            signRequest(request);
+            return next(request);
+        },
+    };
+}
+//# sourceMappingURL=StorageSharedKeyCredentialPolicyV2.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/policies/StorageRequestFailureDetailsParserPolicy.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * The programmatic identifier of the StorageRequestFailureDetailsParserPolicy.
+ */
+const storageRequestFailureDetailsParserPolicyName = "storageRequestFailureDetailsParserPolicy";
+/**
+ * StorageRequestFailureDetailsParserPolicy
+ */
+function storageRequestFailureDetailsParserPolicy() {
+    return {
+        name: storageRequestFailureDetailsParserPolicyName,
+        async sendRequest(request, next) {
+            try {
+                const response = await next(request);
+                return response;
+            }
+            catch (err) {
+                if (typeof err === "object" &&
+                    err !== null &&
+                    err.response &&
+                    err.response.parsedBody) {
+                    if (err.response.parsedBody.code === "InvalidHeaderValue" &&
+                        err.response.parsedBody.HeaderName === "x-ms-version") {
+                        err.message =
+                            "The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.\n";
                     }
                 }
+                throw err;
             }
-            if (paused && !results.flowing)
-                results.once('drain', process);
-        };
-        process();
-        return results;
-    }
-    chdir(path = this.cwd) {
-        const oldCwd = this.cwd;
-        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
-        this.cwd[setAsCwd](oldCwd);
-    }
+        },
+    };
 }
-exports.PathScurryBase = PathScurryBase;
+//# sourceMappingURL=StorageRequestFailureDetailsParserPolicy.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/credentials/UserDelegationKeyCredential.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
 /**
- * Windows implementation of {@link PathScurryBase}
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
  *
- * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
- * {@link PathWin32} for Path objects.
+ * UserDelegationKeyCredential is only used for generation of user delegation SAS.
+ * @see https://learn.microsoft.com/rest/api/storageservices/create-user-delegation-sas
  */
-class PathScurryWin32 extends PathScurryBase {
+class UserDelegationKeyCredential {
     /**
-     * separator for generating path strings
+     * Azure Storage account name; readonly.
      */
-    sep = '\\';
-    constructor(cwd = process.cwd(), opts = {}) {
-        const { nocase = true } = opts;
-        super(cwd, node_path_1.win32, '\\', { ...opts, nocase });
-        this.nocase = nocase;
-        for (let p = this.cwd; p; p = p.parent) {
-            p.nocase = this.nocase;
-        }
-    }
+    accountName;
     /**
-     * @internal
+     * Azure Storage user delegation key; readonly.
      */
-    parseRootPath(dir) {
-        // if the path starts with a single separator, it's not a UNC, and we'll
-        // just get separator as the root, and driveFromUNC will return \
-        // In that case, mount \ on the root from the cwd.
-        return node_path_1.win32.parse(dir).root.toUpperCase();
-    }
+    userDelegationKey;
     /**
-     * @internal
+     * Key value in Buffer type.
      */
-    newRoot(fs) {
-        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    key;
+    /**
+     * Creates an instance of UserDelegationKeyCredential.
+     * @param accountName -
+     * @param userDelegationKey -
+     */
+    constructor(accountName, userDelegationKey) {
+        this.accountName = accountName;
+        this.userDelegationKey = userDelegationKey;
+        this.key = Buffer.from(userDelegationKey.value, "base64");
     }
     /**
-     * Return true if the provided path string is an absolute path
+     * Generates a hash signature for an HTTP request or for a SAS.
+     *
+     * @param stringToSign -
      */
-    isAbsolute(p) {
-        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
+    computeHMACSHA256(stringToSign) {
+        return (0,external_node_crypto_.createHmac)("sha256", this.key).update(stringToSign, "utf8").digest("base64");
     }
 }
-exports.PathScurryWin32 = PathScurryWin32;
+//# sourceMappingURL=UserDelegationKeyCredential.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/indexPlatform.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# sourceMappingURL=indexPlatform.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-common/dist/esm/index.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/utils/constants.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+const esm_utils_constants_SDK_VERSION = "12.32.0";
+const SERVICE_VERSION = "2026-04-06";
+const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
+const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
+const BLOCK_BLOB_MAX_BLOCKS = 50000;
+const DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; // 8MB
+const DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB
+const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
+const REQUEST_TIMEOUT = 100 * 1000; // In ms
 /**
- * {@link PathScurryBase} implementation for all posix systems other than Darwin.
- *
- * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ * The OAuth scope to use with Azure Storage.
+ */
+const StorageOAuthScopes = "https://storage.azure.com/.default";
+const utils_constants_URLConstants = {
+    Parameters: {
+        FORCE_BROWSER_NO_CACHE: "_",
+        SIGNATURE: "sig",
+        SNAPSHOT: "snapshot",
+        VERSIONID: "versionid",
+        TIMEOUT: "timeout",
+    },
+};
+const HTTPURLConnection = {
+    HTTP_ACCEPTED: 202,
+    HTTP_CONFLICT: 409,
+    HTTP_NOT_FOUND: 404,
+    HTTP_PRECON_FAILED: 412,
+    HTTP_RANGE_NOT_SATISFIABLE: 416,
+};
+const utils_constants_HeaderConstants = {
+    AUTHORIZATION: "Authorization",
+    AUTHORIZATION_SCHEME: "Bearer",
+    CONTENT_ENCODING: "Content-Encoding",
+    CONTENT_ID: "Content-ID",
+    CONTENT_LANGUAGE: "Content-Language",
+    CONTENT_LENGTH: "Content-Length",
+    CONTENT_MD5: "Content-Md5",
+    CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding",
+    CONTENT_TYPE: "Content-Type",
+    COOKIE: "Cookie",
+    DATE: "date",
+    IF_MATCH: "if-match",
+    IF_MODIFIED_SINCE: "if-modified-since",
+    IF_NONE_MATCH: "if-none-match",
+    IF_UNMODIFIED_SINCE: "if-unmodified-since",
+    PREFIX_FOR_STORAGE: "x-ms-",
+    RANGE: "Range",
+    USER_AGENT: "User-Agent",
+    X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id",
+    X_MS_COPY_SOURCE: "x-ms-copy-source",
+    X_MS_DATE: "x-ms-date",
+    X_MS_ERROR_CODE: "x-ms-error-code",
+    X_MS_VERSION: "x-ms-version",
+    X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code",
+};
+const ETagNone = "";
+const ETagAny = "*";
+const SIZE_1_MB = 1 * 1024 * 1024;
+const BATCH_MAX_REQUEST = 256;
+const BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB;
+const HTTP_LINE_ENDING = "\r\n";
+const HTTP_VERSION_1_1 = "HTTP/1.1";
+const EncryptionAlgorithmAES25 = "AES256";
+const utils_constants_DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`;
+const StorageBlobLoggingAllowedHeaderNames = [
+    "Access-Control-Allow-Origin",
+    "Cache-Control",
+    "Content-Length",
+    "Content-Type",
+    "Date",
+    "Request-Id",
+    "traceparent",
+    "Transfer-Encoding",
+    "User-Agent",
+    "x-ms-client-request-id",
+    "x-ms-date",
+    "x-ms-error-code",
+    "x-ms-request-id",
+    "x-ms-return-client-request-id",
+    "x-ms-version",
+    "Accept-Ranges",
+    "Content-Disposition",
+    "Content-Encoding",
+    "Content-Language",
+    "Content-MD5",
+    "Content-Range",
+    "ETag",
+    "Last-Modified",
+    "Server",
+    "Vary",
+    "x-ms-content-crc64",
+    "x-ms-copy-action",
+    "x-ms-copy-completion-time",
+    "x-ms-copy-id",
+    "x-ms-copy-progress",
+    "x-ms-copy-status",
+    "x-ms-has-immutability-policy",
+    "x-ms-has-legal-hold",
+    "x-ms-lease-state",
+    "x-ms-lease-status",
+    "x-ms-range",
+    "x-ms-request-server-encrypted",
+    "x-ms-server-encrypted",
+    "x-ms-snapshot",
+    "x-ms-source-range",
+    "If-Match",
+    "If-Modified-Since",
+    "If-None-Match",
+    "If-Unmodified-Since",
+    "x-ms-access-tier",
+    "x-ms-access-tier-change-time",
+    "x-ms-access-tier-inferred",
+    "x-ms-account-kind",
+    "x-ms-archive-status",
+    "x-ms-blob-append-offset",
+    "x-ms-blob-cache-control",
+    "x-ms-blob-committed-block-count",
+    "x-ms-blob-condition-appendpos",
+    "x-ms-blob-condition-maxsize",
+    "x-ms-blob-content-disposition",
+    "x-ms-blob-content-encoding",
+    "x-ms-blob-content-language",
+    "x-ms-blob-content-length",
+    "x-ms-blob-content-md5",
+    "x-ms-blob-content-type",
+    "x-ms-blob-public-access",
+    "x-ms-blob-sequence-number",
+    "x-ms-blob-type",
+    "x-ms-copy-destination-snapshot",
+    "x-ms-creation-time",
+    "x-ms-default-encryption-scope",
+    "x-ms-delete-snapshots",
+    "x-ms-delete-type-permanent",
+    "x-ms-deny-encryption-scope-override",
+    "x-ms-encryption-algorithm",
+    "x-ms-if-sequence-number-eq",
+    "x-ms-if-sequence-number-le",
+    "x-ms-if-sequence-number-lt",
+    "x-ms-incremental-copy",
+    "x-ms-lease-action",
+    "x-ms-lease-break-period",
+    "x-ms-lease-duration",
+    "x-ms-lease-id",
+    "x-ms-lease-time",
+    "x-ms-page-write",
+    "x-ms-proposed-lease-id",
+    "x-ms-range-get-content-md5",
+    "x-ms-rehydrate-priority",
+    "x-ms-sequence-number-action",
+    "x-ms-sku-name",
+    "x-ms-source-content-md5",
+    "x-ms-source-if-match",
+    "x-ms-source-if-modified-since",
+    "x-ms-source-if-none-match",
+    "x-ms-source-if-unmodified-since",
+    "x-ms-tag-count",
+    "x-ms-encryption-key-sha256",
+    "x-ms-copy-source-error-code",
+    "x-ms-copy-source-status-code",
+    "x-ms-if-tags",
+    "x-ms-source-if-tags",
+];
+const StorageBlobLoggingAllowedQueryParameters = [
+    "comp",
+    "maxresults",
+    "rscc",
+    "rscd",
+    "rsce",
+    "rscl",
+    "rsct",
+    "se",
+    "si",
+    "sip",
+    "sp",
+    "spr",
+    "sr",
+    "srt",
+    "ss",
+    "st",
+    "sv",
+    "include",
+    "marker",
+    "prefix",
+    "copyid",
+    "restype",
+    "blockid",
+    "blocklisttype",
+    "delimiter",
+    "prevsnapshot",
+    "ske",
+    "skoid",
+    "sks",
+    "skt",
+    "sktid",
+    "skv",
+    "snapshot",
+];
+const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption";
+const BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption";
+/// List of ports used for path style addressing.
+/// Path style addressing means that storage account is put in URI's Path segment in instead of in host.
+const utils_constants_PathStylePorts = [
+    "10000",
+    "10001",
+    "10002",
+    "10003",
+    "10004",
+    "10100",
+    "10101",
+    "10102",
+    "10103",
+    "10104",
+    "11000",
+    "11001",
+    "11002",
+    "11003",
+    "11004",
+    "11100",
+    "11101",
+    "11102",
+    "11103",
+    "11104",
+];
+//# sourceMappingURL=constants.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/Pipeline.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+
+
+// Export following interfaces and types for customers who want to implement their
+// own RequestPolicy or HTTPClient
+
+/**
+ * A helper to decide if a given argument satisfies the Pipeline contract
+ * @param pipeline - An argument that may be a Pipeline
+ * @returns true when the argument satisfies the Pipeline contract
+ */
+function isPipelineLike(pipeline) {
+    if (!pipeline || typeof pipeline !== "object") {
+        return false;
+    }
+    const castPipeline = pipeline;
+    return (Array.isArray(castPipeline.factories) &&
+        typeof castPipeline.options === "object" &&
+        typeof castPipeline.toServiceClientOptions === "function");
+}
+/**
+ * A Pipeline class containing HTTP request policies.
+ * You can create a default Pipeline by calling {@link newPipeline}.
+ * Or you can create a Pipeline with your own policies by the constructor of Pipeline.
  *
- * Uses {@link PathPosix} for Path objects.
+ * Refer to {@link newPipeline} and provided policies before implementing your
+ * customized Pipeline.
  */
-class PathScurryPosix extends PathScurryBase {
+class Pipeline {
     /**
-     * separator for generating path strings
+     * A list of chained request policy factories.
      */
-    sep = '/';
-    constructor(cwd = process.cwd(), opts = {}) {
-        const { nocase = false } = opts;
-        super(cwd, node_path_1.posix, '/', { ...opts, nocase });
-        this.nocase = nocase;
-    }
+    factories;
     /**
-     * @internal
+     * Configures pipeline logger and HTTP client.
      */
-    parseRootPath(_dir) {
-        return '/';
-    }
+    options;
     /**
-     * @internal
+     * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.
+     *
+     * @param factories -
+     * @param options -
      */
-    newRoot(fs) {
-        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    constructor(factories, options = {}) {
+        this.factories = factories;
+        this.options = options;
     }
     /**
-     * Return true if the provided path string is an absolute path
+     * Transfer Pipeline object to ServiceClientOptions object which is required by
+     * ServiceClient constructor.
+     *
+     * @returns The ServiceClientOptions object from this Pipeline.
      */
-    isAbsolute(p) {
-        return p.startsWith('/');
+    toServiceClientOptions() {
+        return {
+            httpClient: this.options.httpClient,
+            requestPolicyFactories: this.factories,
+        };
     }
 }
-exports.PathScurryPosix = PathScurryPosix;
 /**
- * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ * Creates a new Pipeline object with Credential provided.
  *
- * Defaults to case-insensitive matching, uses `'/'` for generating path
- * strings.
- *
- * Uses {@link PathPosix} for Path objects.
+ * @param credential -  Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
+ * @param pipelineOptions - Optional. Options.
+ * @returns A new Pipeline object.
  */
-class PathScurryDarwin extends PathScurryPosix {
-    constructor(cwd = process.cwd(), opts = {}) {
-        const { nocase = true } = opts;
-        super(cwd, { ...opts, nocase });
+function newPipeline(credential, pipelineOptions = {}) {
+    if (!credential) {
+        credential = new AnonymousCredential();
     }
+    const pipeline = new Pipeline([], pipelineOptions);
+    pipeline._credential = credential;
+    return pipeline;
 }
-exports.PathScurryDarwin = PathScurryDarwin;
-/**
- * Default {@link PathBase} implementation for the current platform.
- *
- * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
- */
-exports.Path = process.platform === 'win32' ? PathWin32 : PathPosix;
-/**
- * Default {@link PathScurryBase} implementation for the current platform.
- *
- * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
- * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
- */
-exports.PathScurry = process.platform === 'win32' ? PathScurryWin32
-    : process.platform === 'darwin' ? PathScurryDarwin
-        : PathScurryPosix;
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 57349:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var identity = __nccwpck_require__(41127);
-var Scalar = __nccwpck_require__(63301);
-var YAMLMap = __nccwpck_require__(84454);
-var YAMLSeq = __nccwpck_require__(92223);
-var resolveBlockMap = __nccwpck_require__(87103);
-var resolveBlockSeq = __nccwpck_require__(90334);
-var resolveFlowCollection = __nccwpck_require__(13142);
-
-function resolveCollection(CN, ctx, token, onError, tagName, tag) {
-    const coll = token.type === 'block-map'
-        ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag)
-        : token.type === 'block-seq'
-            ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag)
-            : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);
-    const Coll = coll.constructor;
-    // If we got a tagName matching the class, or the tag name is '!',
-    // then use the tagName from the node class used to create it.
-    if (tagName === '!' || tagName === Coll.tagName) {
-        coll.tag = Coll.tagName;
-        return coll;
+function processDownlevelPipeline(pipeline) {
+    const knownFactoryFunctions = [
+        isAnonymousCredential,
+        isStorageSharedKeyCredential,
+        isCoreHttpBearerTokenFactory,
+        isStorageBrowserPolicyFactory,
+        isStorageRetryPolicyFactory,
+        isStorageTelemetryPolicyFactory,
+        isCoreHttpPolicyFactory,
+    ];
+    if (pipeline.factories.length) {
+        const novelFactories = pipeline.factories.filter((factory) => {
+            return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));
+        });
+        if (novelFactories.length) {
+            const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));
+            // if there are any left over, wrap in a requestPolicyFactoryPolicy
+            return {
+                wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),
+                afterRetry: hasInjector,
+            };
+        }
     }
-    if (tagName)
-        coll.tag = tagName;
-    return coll;
+    return undefined;
 }
-function composeCollection(CN, ctx, token, props, onError) {
-    const tagToken = props.tag;
-    const tagName = !tagToken
-        ? null
-        : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
-    if (token.type === 'block-seq') {
-        const { anchor, newlineAfterProp: nl } = props;
-        const lastProp = anchor && tagToken
-            ? anchor.offset > tagToken.offset
-                ? anchor
-                : tagToken
-            : (anchor ?? tagToken);
-        if (lastProp && (!nl || nl.offset < lastProp.offset)) {
-            const message = 'Missing newline after block sequence props';
-            onError(lastProp, 'MISSING_CHAR', message);
-        }
+function getCoreClientOptions(pipeline) {
+    const { httpClient: v1Client, ...restOptions } = pipeline.options;
+    let httpClient = pipeline._coreHttpClient;
+    if (!httpClient) {
+        httpClient = v1Client ? convertHttpClient(v1Client) : cache_getCachedDefaultHttpClient();
+        pipeline._coreHttpClient = httpClient;
+    }
+    let corePipeline = pipeline._corePipeline;
+    if (!corePipeline) {
+        const packageDetails = `azsdk-js-azure-storage-blob/${esm_utils_constants_SDK_VERSION}`;
+        const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix
+            ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
+            : `${packageDetails}`;
+        corePipeline = createClientPipeline({
+            ...restOptions,
+            loggingOptions: {
+                additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,
+                additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,
+                logger: storage_blob_dist_esm_log_logger.info,
+            },
+            userAgentOptions: {
+                userAgentPrefix,
+            },
+            serializationOptions: {
+                stringifyXML: stringifyXML,
+                serializerOptions: {
+                    xml: {
+                        // Use customized XML char key of "#" so we can deserialize metadata
+                        // with "_" key
+                        xmlCharKey: "#",
+                    },
+                },
+            },
+            deserializationOptions: {
+                parseXML: parseXML,
+                serializerOptions: {
+                    xml: {
+                        // Use customized XML char key of "#" so we can deserialize metadata
+                        // with "_" key
+                        xmlCharKey: "#",
+                    },
+                },
+            },
+        });
+        corePipeline.removePolicy({ phase: "Retry" });
+        corePipeline.removePolicy({ name: decompressResponsePolicy_decompressResponsePolicyName });
+        corePipeline.addPolicy(storageCorrectContentLengthPolicy());
+        corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" });
+        corePipeline.addPolicy(storageRequestFailureDetailsParserPolicy());
+        corePipeline.addPolicy(storageBrowserPolicy());
+        const downlevelResults = processDownlevelPipeline(pipeline);
+        if (downlevelResults) {
+            corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : undefined);
+        }
+        const credential = getCredentialFromPipeline(pipeline);
+        if (isTokenCredential(credential)) {
+            corePipeline.addPolicy(bearerTokenAuthenticationPolicy({
+                credential,
+                scopes: restOptions.audience ?? StorageOAuthScopes,
+                challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },
+            }), { phase: "Sign" });
+        }
+        else if (credential instanceof StorageSharedKeyCredential) {
+            corePipeline.addPolicy(storageSharedKeyCredentialPolicy({
+                accountName: credential.accountName,
+                accountKey: credential.accountKey,
+            }), { phase: "Sign" });
+        }
+        pipeline._corePipeline = corePipeline;
     }
-    const expType = token.type === 'block-map'
-        ? 'map'
-        : token.type === 'block-seq'
-            ? 'seq'
-            : token.start.source === '{'
-                ? 'map'
-                : 'seq';
-    // shortcut: check if it's a generic YAMLMap or YAMLSeq
-    // before jumping into the custom tag logic.
-    if (!tagToken ||
-        !tagName ||
-        tagName === '!' ||
-        (tagName === YAMLMap.YAMLMap.tagName && expType === 'map') ||
-        (tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) {
-        return resolveCollection(CN, ctx, token, onError, tagName);
+    return {
+        ...restOptions,
+        allowInsecureConnection: true,
+        httpClient,
+        pipeline: corePipeline,
+    };
+}
+function getCredentialFromPipeline(pipeline) {
+    // see if we squirreled one away on the type itself
+    if (pipeline._credential) {
+        return pipeline._credential;
     }
-    let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
-    if (!tag) {
-        const kt = ctx.schema.knownTags[tagName];
-        if (kt?.collection === expType) {
-            ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
-            tag = kt;
+    // if it came from another package, loop over the factories and look for one like before
+    let credential = new AnonymousCredential();
+    for (const factory of pipeline.factories) {
+        if (isTokenCredential(factory.credential)) {
+            // Only works if the factory has been attached a "credential" property.
+            // We do that in newPipeline() when using TokenCredential.
+            credential = factory.credential;
         }
-        else {
-            if (kt) {
-                onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
-            }
-            else {
-                onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
-            }
-            return resolveCollection(CN, ctx, token, onError, tagName);
+        else if (isStorageSharedKeyCredential(factory)) {
+            return factory;
         }
     }
-    const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
-    const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;
-    const node = identity.isNode(res)
-        ? res
-        : new Scalar.Scalar(res);
-    node.range = coll.range;
-    node.tag = tagName;
-    if (tag?.format)
-        node.format = tag.format;
-    return node;
+    return credential;
 }
-
-exports.composeCollection = composeCollection;
-
-
-/***/ }),
-
-/***/ 23683:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var Document = __nccwpck_require__(3021);
-var composeNode = __nccwpck_require__(45937);
-var resolveEnd = __nccwpck_require__(17788);
-var resolveProps = __nccwpck_require__(34631);
-
-function composeDoc(options, directives, { offset, start, value, end }, onError) {
-    const opts = Object.assign({ _directives: directives }, options);
-    const doc = new Document.Document(undefined, opts);
-    const ctx = {
-        atKey: false,
-        atRoot: true,
-        directives: doc.directives,
-        options: doc.options,
-        schema: doc.schema
+function isStorageSharedKeyCredential(factory) {
+    if (factory instanceof StorageSharedKeyCredential) {
+        return true;
+    }
+    return factory.constructor.name === "StorageSharedKeyCredential";
+}
+function isAnonymousCredential(factory) {
+    if (factory instanceof AnonymousCredential) {
+        return true;
+    }
+    return factory.constructor.name === "AnonymousCredential";
+}
+function isCoreHttpBearerTokenFactory(factory) {
+    return isTokenCredential(factory.credential);
+}
+function isStorageBrowserPolicyFactory(factory) {
+    if (factory instanceof StorageBrowserPolicyFactory) {
+        return true;
+    }
+    return factory.constructor.name === "StorageBrowserPolicyFactory";
+}
+function isStorageRetryPolicyFactory(factory) {
+    if (factory instanceof StorageRetryPolicyFactory) {
+        return true;
+    }
+    return factory.constructor.name === "StorageRetryPolicyFactory";
+}
+function isStorageTelemetryPolicyFactory(factory) {
+    return factory.constructor.name === "TelemetryPolicyFactory";
+}
+function isInjectorPolicyFactory(factory) {
+    return factory.constructor.name === "InjectorPolicyFactory";
+}
+function isCoreHttpPolicyFactory(factory) {
+    const knownPolicies = [
+        "GenerateClientRequestIdPolicy",
+        "TracingPolicy",
+        "LogPolicy",
+        "ProxyPolicy",
+        "DisableResponseDecompressionPolicy",
+        "KeepAlivePolicy",
+        "DeserializationPolicy",
+    ];
+    const mockHttpClient = {
+        sendRequest: async (request) => {
+            return {
+                request,
+                headers: request.headers.clone(),
+                status: 500,
+            };
+        },
     };
-    const props = resolveProps.resolveProps(start, {
-        indicator: 'doc-start',
-        next: value ?? end?.[0],
-        offset,
-        onError,
-        parentIndent: 0,
-        startOnNewline: true
+    const mockRequestPolicyOptions = {
+        log(_logLevel, _message) {
+            /* do nothing */
+        },
+        shouldLog(_logLevel) {
+            return false;
+        },
+    };
+    const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);
+    const policyName = policyInstance.constructor.name;
+    // bundlers sometimes add a custom suffix to the class name to make it unique
+    return knownPolicies.some((knownPolicyName) => {
+        return policyName.startsWith(knownPolicyName);
     });
-    if (props.found) {
-        doc.directives.docStart = true;
-        if (value &&
-            (value.type === 'block-map' || value.type === 'block-seq') &&
-            !props.hasNewline)
-            onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');
-    }
-    // @ts-expect-error If Contents is set, let's trust the user
-    doc.contents = value
-        ? composeNode.composeNode(ctx, value, props, onError)
-        : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
-    const contentEnd = doc.contents.range[2];
-    const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);
-    if (re.comment)
-        doc.comment = re.comment;
-    doc.range = [offset, contentEnd, re.offset];
-    return doc;
 }
+//# sourceMappingURL=Pipeline.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/models/index.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
+/** Known values of {@link EncryptionAlgorithmType} that the service accepts. */
+var KnownEncryptionAlgorithmType;
+(function (KnownEncryptionAlgorithmType) {
+    /** AES256 */
+    KnownEncryptionAlgorithmType["AES256"] = "AES256";
+})(KnownEncryptionAlgorithmType || (KnownEncryptionAlgorithmType = {}));
+/** Known values of {@link FileShareTokenIntent} that the service accepts. */
+var KnownFileShareTokenIntent;
+(function (KnownFileShareTokenIntent) {
+    /** Backup */
+    KnownFileShareTokenIntent["Backup"] = "backup";
+})(KnownFileShareTokenIntent || (KnownFileShareTokenIntent = {}));
+/** Known values of {@link BlobExpiryOptions} that the service accepts. */
+var KnownBlobExpiryOptions;
+(function (KnownBlobExpiryOptions) {
+    /** NeverExpire */
+    KnownBlobExpiryOptions["NeverExpire"] = "NeverExpire";
+    /** RelativeToCreation */
+    KnownBlobExpiryOptions["RelativeToCreation"] = "RelativeToCreation";
+    /** RelativeToNow */
+    KnownBlobExpiryOptions["RelativeToNow"] = "RelativeToNow";
+    /** Absolute */
+    KnownBlobExpiryOptions["Absolute"] = "Absolute";
+})(KnownBlobExpiryOptions || (KnownBlobExpiryOptions = {}));
+/** Known values of {@link StorageErrorCode} that the service accepts. */
+var KnownStorageErrorCode;
+(function (KnownStorageErrorCode) {
+    /** AccountAlreadyExists */
+    KnownStorageErrorCode["AccountAlreadyExists"] = "AccountAlreadyExists";
+    /** AccountBeingCreated */
+    KnownStorageErrorCode["AccountBeingCreated"] = "AccountBeingCreated";
+    /** AccountIsDisabled */
+    KnownStorageErrorCode["AccountIsDisabled"] = "AccountIsDisabled";
+    /** AuthenticationFailed */
+    KnownStorageErrorCode["AuthenticationFailed"] = "AuthenticationFailed";
+    /** AuthorizationFailure */
+    KnownStorageErrorCode["AuthorizationFailure"] = "AuthorizationFailure";
+    /** ConditionHeadersNotSupported */
+    KnownStorageErrorCode["ConditionHeadersNotSupported"] = "ConditionHeadersNotSupported";
+    /** ConditionNotMet */
+    KnownStorageErrorCode["ConditionNotMet"] = "ConditionNotMet";
+    /** EmptyMetadataKey */
+    KnownStorageErrorCode["EmptyMetadataKey"] = "EmptyMetadataKey";
+    /** InsufficientAccountPermissions */
+    KnownStorageErrorCode["InsufficientAccountPermissions"] = "InsufficientAccountPermissions";
+    /** InternalError */
+    KnownStorageErrorCode["InternalError"] = "InternalError";
+    /** InvalidAuthenticationInfo */
+    KnownStorageErrorCode["InvalidAuthenticationInfo"] = "InvalidAuthenticationInfo";
+    /** InvalidHeaderValue */
+    KnownStorageErrorCode["InvalidHeaderValue"] = "InvalidHeaderValue";
+    /** InvalidHttpVerb */
+    KnownStorageErrorCode["InvalidHttpVerb"] = "InvalidHttpVerb";
+    /** InvalidInput */
+    KnownStorageErrorCode["InvalidInput"] = "InvalidInput";
+    /** InvalidMd5 */
+    KnownStorageErrorCode["InvalidMd5"] = "InvalidMd5";
+    /** InvalidMetadata */
+    KnownStorageErrorCode["InvalidMetadata"] = "InvalidMetadata";
+    /** InvalidQueryParameterValue */
+    KnownStorageErrorCode["InvalidQueryParameterValue"] = "InvalidQueryParameterValue";
+    /** InvalidRange */
+    KnownStorageErrorCode["InvalidRange"] = "InvalidRange";
+    /** InvalidResourceName */
+    KnownStorageErrorCode["InvalidResourceName"] = "InvalidResourceName";
+    /** InvalidUri */
+    KnownStorageErrorCode["InvalidUri"] = "InvalidUri";
+    /** InvalidXmlDocument */
+    KnownStorageErrorCode["InvalidXmlDocument"] = "InvalidXmlDocument";
+    /** InvalidXmlNodeValue */
+    KnownStorageErrorCode["InvalidXmlNodeValue"] = "InvalidXmlNodeValue";
+    /** Md5Mismatch */
+    KnownStorageErrorCode["Md5Mismatch"] = "Md5Mismatch";
+    /** MetadataTooLarge */
+    KnownStorageErrorCode["MetadataTooLarge"] = "MetadataTooLarge";
+    /** MissingContentLengthHeader */
+    KnownStorageErrorCode["MissingContentLengthHeader"] = "MissingContentLengthHeader";
+    /** MissingRequiredQueryParameter */
+    KnownStorageErrorCode["MissingRequiredQueryParameter"] = "MissingRequiredQueryParameter";
+    /** MissingRequiredHeader */
+    KnownStorageErrorCode["MissingRequiredHeader"] = "MissingRequiredHeader";
+    /** MissingRequiredXmlNode */
+    KnownStorageErrorCode["MissingRequiredXmlNode"] = "MissingRequiredXmlNode";
+    /** MultipleConditionHeadersNotSupported */
+    KnownStorageErrorCode["MultipleConditionHeadersNotSupported"] = "MultipleConditionHeadersNotSupported";
+    /** OperationTimedOut */
+    KnownStorageErrorCode["OperationTimedOut"] = "OperationTimedOut";
+    /** OutOfRangeInput */
+    KnownStorageErrorCode["OutOfRangeInput"] = "OutOfRangeInput";
+    /** OutOfRangeQueryParameterValue */
+    KnownStorageErrorCode["OutOfRangeQueryParameterValue"] = "OutOfRangeQueryParameterValue";
+    /** RequestBodyTooLarge */
+    KnownStorageErrorCode["RequestBodyTooLarge"] = "RequestBodyTooLarge";
+    /** ResourceTypeMismatch */
+    KnownStorageErrorCode["ResourceTypeMismatch"] = "ResourceTypeMismatch";
+    /** RequestUrlFailedToParse */
+    KnownStorageErrorCode["RequestUrlFailedToParse"] = "RequestUrlFailedToParse";
+    /** ResourceAlreadyExists */
+    KnownStorageErrorCode["ResourceAlreadyExists"] = "ResourceAlreadyExists";
+    /** ResourceNotFound */
+    KnownStorageErrorCode["ResourceNotFound"] = "ResourceNotFound";
+    /** ServerBusy */
+    KnownStorageErrorCode["ServerBusy"] = "ServerBusy";
+    /** UnsupportedHeader */
+    KnownStorageErrorCode["UnsupportedHeader"] = "UnsupportedHeader";
+    /** UnsupportedXmlNode */
+    KnownStorageErrorCode["UnsupportedXmlNode"] = "UnsupportedXmlNode";
+    /** UnsupportedQueryParameter */
+    KnownStorageErrorCode["UnsupportedQueryParameter"] = "UnsupportedQueryParameter";
+    /** UnsupportedHttpVerb */
+    KnownStorageErrorCode["UnsupportedHttpVerb"] = "UnsupportedHttpVerb";
+    /** AppendPositionConditionNotMet */
+    KnownStorageErrorCode["AppendPositionConditionNotMet"] = "AppendPositionConditionNotMet";
+    /** BlobAlreadyExists */
+    KnownStorageErrorCode["BlobAlreadyExists"] = "BlobAlreadyExists";
+    /** BlobImmutableDueToPolicy */
+    KnownStorageErrorCode["BlobImmutableDueToPolicy"] = "BlobImmutableDueToPolicy";
+    /** BlobNotFound */
+    KnownStorageErrorCode["BlobNotFound"] = "BlobNotFound";
+    /** BlobOverwritten */
+    KnownStorageErrorCode["BlobOverwritten"] = "BlobOverwritten";
+    /** BlobTierInadequateForContentLength */
+    KnownStorageErrorCode["BlobTierInadequateForContentLength"] = "BlobTierInadequateForContentLength";
+    /** BlobUsesCustomerSpecifiedEncryption */
+    KnownStorageErrorCode["BlobUsesCustomerSpecifiedEncryption"] = "BlobUsesCustomerSpecifiedEncryption";
+    /** BlockCountExceedsLimit */
+    KnownStorageErrorCode["BlockCountExceedsLimit"] = "BlockCountExceedsLimit";
+    /** BlockListTooLong */
+    KnownStorageErrorCode["BlockListTooLong"] = "BlockListTooLong";
+    /** CannotChangeToLowerTier */
+    KnownStorageErrorCode["CannotChangeToLowerTier"] = "CannotChangeToLowerTier";
+    /** CannotVerifyCopySource */
+    KnownStorageErrorCode["CannotVerifyCopySource"] = "CannotVerifyCopySource";
+    /** ContainerAlreadyExists */
+    KnownStorageErrorCode["ContainerAlreadyExists"] = "ContainerAlreadyExists";
+    /** ContainerBeingDeleted */
+    KnownStorageErrorCode["ContainerBeingDeleted"] = "ContainerBeingDeleted";
+    /** ContainerDisabled */
+    KnownStorageErrorCode["ContainerDisabled"] = "ContainerDisabled";
+    /** ContainerNotFound */
+    KnownStorageErrorCode["ContainerNotFound"] = "ContainerNotFound";
+    /** ContentLengthLargerThanTierLimit */
+    KnownStorageErrorCode["ContentLengthLargerThanTierLimit"] = "ContentLengthLargerThanTierLimit";
+    /** CopyAcrossAccountsNotSupported */
+    KnownStorageErrorCode["CopyAcrossAccountsNotSupported"] = "CopyAcrossAccountsNotSupported";
+    /** CopyIdMismatch */
+    KnownStorageErrorCode["CopyIdMismatch"] = "CopyIdMismatch";
+    /** FeatureVersionMismatch */
+    KnownStorageErrorCode["FeatureVersionMismatch"] = "FeatureVersionMismatch";
+    /** IncrementalCopyBlobMismatch */
+    KnownStorageErrorCode["IncrementalCopyBlobMismatch"] = "IncrementalCopyBlobMismatch";
+    /** IncrementalCopyOfEarlierSnapshotNotAllowed */
+    KnownStorageErrorCode["IncrementalCopyOfEarlierSnapshotNotAllowed"] = "IncrementalCopyOfEarlierSnapshotNotAllowed";
+    /** IncrementalCopySourceMustBeSnapshot */
+    KnownStorageErrorCode["IncrementalCopySourceMustBeSnapshot"] = "IncrementalCopySourceMustBeSnapshot";
+    /** InfiniteLeaseDurationRequired */
+    KnownStorageErrorCode["InfiniteLeaseDurationRequired"] = "InfiniteLeaseDurationRequired";
+    /** InvalidBlobOrBlock */
+    KnownStorageErrorCode["InvalidBlobOrBlock"] = "InvalidBlobOrBlock";
+    /** InvalidBlobTier */
+    KnownStorageErrorCode["InvalidBlobTier"] = "InvalidBlobTier";
+    /** InvalidBlobType */
+    KnownStorageErrorCode["InvalidBlobType"] = "InvalidBlobType";
+    /** InvalidBlockId */
+    KnownStorageErrorCode["InvalidBlockId"] = "InvalidBlockId";
+    /** InvalidBlockList */
+    KnownStorageErrorCode["InvalidBlockList"] = "InvalidBlockList";
+    /** InvalidOperation */
+    KnownStorageErrorCode["InvalidOperation"] = "InvalidOperation";
+    /** InvalidPageRange */
+    KnownStorageErrorCode["InvalidPageRange"] = "InvalidPageRange";
+    /** InvalidSourceBlobType */
+    KnownStorageErrorCode["InvalidSourceBlobType"] = "InvalidSourceBlobType";
+    /** InvalidSourceBlobUrl */
+    KnownStorageErrorCode["InvalidSourceBlobUrl"] = "InvalidSourceBlobUrl";
+    /** InvalidVersionForPageBlobOperation */
+    KnownStorageErrorCode["InvalidVersionForPageBlobOperation"] = "InvalidVersionForPageBlobOperation";
+    /** LeaseAlreadyPresent */
+    KnownStorageErrorCode["LeaseAlreadyPresent"] = "LeaseAlreadyPresent";
+    /** LeaseAlreadyBroken */
+    KnownStorageErrorCode["LeaseAlreadyBroken"] = "LeaseAlreadyBroken";
+    /** LeaseIdMismatchWithBlobOperation */
+    KnownStorageErrorCode["LeaseIdMismatchWithBlobOperation"] = "LeaseIdMismatchWithBlobOperation";
+    /** LeaseIdMismatchWithContainerOperation */
+    KnownStorageErrorCode["LeaseIdMismatchWithContainerOperation"] = "LeaseIdMismatchWithContainerOperation";
+    /** LeaseIdMismatchWithLeaseOperation */
+    KnownStorageErrorCode["LeaseIdMismatchWithLeaseOperation"] = "LeaseIdMismatchWithLeaseOperation";
+    /** LeaseIdMissing */
+    KnownStorageErrorCode["LeaseIdMissing"] = "LeaseIdMissing";
+    /** LeaseIsBreakingAndCannotBeAcquired */
+    KnownStorageErrorCode["LeaseIsBreakingAndCannotBeAcquired"] = "LeaseIsBreakingAndCannotBeAcquired";
+    /** LeaseIsBreakingAndCannotBeChanged */
+    KnownStorageErrorCode["LeaseIsBreakingAndCannotBeChanged"] = "LeaseIsBreakingAndCannotBeChanged";
+    /** LeaseIsBrokenAndCannotBeRenewed */
+    KnownStorageErrorCode["LeaseIsBrokenAndCannotBeRenewed"] = "LeaseIsBrokenAndCannotBeRenewed";
+    /** LeaseLost */
+    KnownStorageErrorCode["LeaseLost"] = "LeaseLost";
+    /** LeaseNotPresentWithBlobOperation */
+    KnownStorageErrorCode["LeaseNotPresentWithBlobOperation"] = "LeaseNotPresentWithBlobOperation";
+    /** LeaseNotPresentWithContainerOperation */
+    KnownStorageErrorCode["LeaseNotPresentWithContainerOperation"] = "LeaseNotPresentWithContainerOperation";
+    /** LeaseNotPresentWithLeaseOperation */
+    KnownStorageErrorCode["LeaseNotPresentWithLeaseOperation"] = "LeaseNotPresentWithLeaseOperation";
+    /** MaxBlobSizeConditionNotMet */
+    KnownStorageErrorCode["MaxBlobSizeConditionNotMet"] = "MaxBlobSizeConditionNotMet";
+    /** NoAuthenticationInformation */
+    KnownStorageErrorCode["NoAuthenticationInformation"] = "NoAuthenticationInformation";
+    /** NoPendingCopyOperation */
+    KnownStorageErrorCode["NoPendingCopyOperation"] = "NoPendingCopyOperation";
+    /** OperationNotAllowedOnIncrementalCopyBlob */
+    KnownStorageErrorCode["OperationNotAllowedOnIncrementalCopyBlob"] = "OperationNotAllowedOnIncrementalCopyBlob";
+    /** PendingCopyOperation */
+    KnownStorageErrorCode["PendingCopyOperation"] = "PendingCopyOperation";
+    /** PreviousSnapshotCannotBeNewer */
+    KnownStorageErrorCode["PreviousSnapshotCannotBeNewer"] = "PreviousSnapshotCannotBeNewer";
+    /** PreviousSnapshotNotFound */
+    KnownStorageErrorCode["PreviousSnapshotNotFound"] = "PreviousSnapshotNotFound";
+    /** PreviousSnapshotOperationNotSupported */
+    KnownStorageErrorCode["PreviousSnapshotOperationNotSupported"] = "PreviousSnapshotOperationNotSupported";
+    /** SequenceNumberConditionNotMet */
+    KnownStorageErrorCode["SequenceNumberConditionNotMet"] = "SequenceNumberConditionNotMet";
+    /** SequenceNumberIncrementTooLarge */
+    KnownStorageErrorCode["SequenceNumberIncrementTooLarge"] = "SequenceNumberIncrementTooLarge";
+    /** SnapshotCountExceeded */
+    KnownStorageErrorCode["SnapshotCountExceeded"] = "SnapshotCountExceeded";
+    /** SnapshotOperationRateExceeded */
+    KnownStorageErrorCode["SnapshotOperationRateExceeded"] = "SnapshotOperationRateExceeded";
+    /** SnapshotsPresent */
+    KnownStorageErrorCode["SnapshotsPresent"] = "SnapshotsPresent";
+    /** SourceConditionNotMet */
+    KnownStorageErrorCode["SourceConditionNotMet"] = "SourceConditionNotMet";
+    /** SystemInUse */
+    KnownStorageErrorCode["SystemInUse"] = "SystemInUse";
+    /** TargetConditionNotMet */
+    KnownStorageErrorCode["TargetConditionNotMet"] = "TargetConditionNotMet";
+    /** UnauthorizedBlobOverwrite */
+    KnownStorageErrorCode["UnauthorizedBlobOverwrite"] = "UnauthorizedBlobOverwrite";
+    /** BlobBeingRehydrated */
+    KnownStorageErrorCode["BlobBeingRehydrated"] = "BlobBeingRehydrated";
+    /** BlobArchived */
+    KnownStorageErrorCode["BlobArchived"] = "BlobArchived";
+    /** BlobNotArchived */
+    KnownStorageErrorCode["BlobNotArchived"] = "BlobNotArchived";
+    /** AuthorizationSourceIPMismatch */
+    KnownStorageErrorCode["AuthorizationSourceIPMismatch"] = "AuthorizationSourceIPMismatch";
+    /** AuthorizationProtocolMismatch */
+    KnownStorageErrorCode["AuthorizationProtocolMismatch"] = "AuthorizationProtocolMismatch";
+    /** AuthorizationPermissionMismatch */
+    KnownStorageErrorCode["AuthorizationPermissionMismatch"] = "AuthorizationPermissionMismatch";
+    /** AuthorizationServiceMismatch */
+    KnownStorageErrorCode["AuthorizationServiceMismatch"] = "AuthorizationServiceMismatch";
+    /** AuthorizationResourceTypeMismatch */
+    KnownStorageErrorCode["AuthorizationResourceTypeMismatch"] = "AuthorizationResourceTypeMismatch";
+    /** BlobAccessTierNotSupportedForAccountType */
+    KnownStorageErrorCode["BlobAccessTierNotSupportedForAccountType"] = "BlobAccessTierNotSupportedForAccountType";
+})(KnownStorageErrorCode || (KnownStorageErrorCode = {}));
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/models/mappers.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
+const BlobServiceProperties = {
+    serializedName: "BlobServiceProperties",
+    xmlName: "StorageServiceProperties",
+    type: {
+        name: "Composite",
+        className: "BlobServiceProperties",
+        modelProperties: {
+            blobAnalyticsLogging: {
+                serializedName: "Logging",
+                xmlName: "Logging",
+                type: {
+                    name: "Composite",
+                    className: "Logging",
+                },
+            },
+            hourMetrics: {
+                serializedName: "HourMetrics",
+                xmlName: "HourMetrics",
+                type: {
+                    name: "Composite",
+                    className: "Metrics",
+                },
+            },
+            minuteMetrics: {
+                serializedName: "MinuteMetrics",
+                xmlName: "MinuteMetrics",
+                type: {
+                    name: "Composite",
+                    className: "Metrics",
+                },
+            },
+            cors: {
+                serializedName: "Cors",
+                xmlName: "Cors",
+                xmlIsWrapped: true,
+                xmlElementName: "CorsRule",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "CorsRule",
+                        },
+                    },
+                },
+            },
+            defaultServiceVersion: {
+                serializedName: "DefaultServiceVersion",
+                xmlName: "DefaultServiceVersion",
+                type: {
+                    name: "String",
+                },
+            },
+            deleteRetentionPolicy: {
+                serializedName: "DeleteRetentionPolicy",
+                xmlName: "DeleteRetentionPolicy",
+                type: {
+                    name: "Composite",
+                    className: "RetentionPolicy",
+                },
+            },
+            staticWebsite: {
+                serializedName: "StaticWebsite",
+                xmlName: "StaticWebsite",
+                type: {
+                    name: "Composite",
+                    className: "StaticWebsite",
+                },
+            },
+        },
+    },
+};
+const Logging = {
+    serializedName: "Logging",
+    type: {
+        name: "Composite",
+        className: "Logging",
+        modelProperties: {
+            version: {
+                serializedName: "Version",
+                required: true,
+                xmlName: "Version",
+                type: {
+                    name: "String",
+                },
+            },
+            deleteProperty: {
+                serializedName: "Delete",
+                required: true,
+                xmlName: "Delete",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            read: {
+                serializedName: "Read",
+                required: true,
+                xmlName: "Read",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            write: {
+                serializedName: "Write",
+                required: true,
+                xmlName: "Write",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            retentionPolicy: {
+                serializedName: "RetentionPolicy",
+                xmlName: "RetentionPolicy",
+                type: {
+                    name: "Composite",
+                    className: "RetentionPolicy",
+                },
+            },
+        },
+    },
+};
+const RetentionPolicy = {
+    serializedName: "RetentionPolicy",
+    type: {
+        name: "Composite",
+        className: "RetentionPolicy",
+        modelProperties: {
+            enabled: {
+                serializedName: "Enabled",
+                required: true,
+                xmlName: "Enabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            days: {
+                constraints: {
+                    InclusiveMinimum: 1,
+                },
+                serializedName: "Days",
+                xmlName: "Days",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const Metrics = {
+    serializedName: "Metrics",
+    type: {
+        name: "Composite",
+        className: "Metrics",
+        modelProperties: {
+            version: {
+                serializedName: "Version",
+                xmlName: "Version",
+                type: {
+                    name: "String",
+                },
+            },
+            enabled: {
+                serializedName: "Enabled",
+                required: true,
+                xmlName: "Enabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            includeAPIs: {
+                serializedName: "IncludeAPIs",
+                xmlName: "IncludeAPIs",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            retentionPolicy: {
+                serializedName: "RetentionPolicy",
+                xmlName: "RetentionPolicy",
+                type: {
+                    name: "Composite",
+                    className: "RetentionPolicy",
+                },
+            },
+        },
+    },
+};
+const CorsRule = {
+    serializedName: "CorsRule",
+    type: {
+        name: "Composite",
+        className: "CorsRule",
+        modelProperties: {
+            allowedOrigins: {
+                serializedName: "AllowedOrigins",
+                required: true,
+                xmlName: "AllowedOrigins",
+                type: {
+                    name: "String",
+                },
+            },
+            allowedMethods: {
+                serializedName: "AllowedMethods",
+                required: true,
+                xmlName: "AllowedMethods",
+                type: {
+                    name: "String",
+                },
+            },
+            allowedHeaders: {
+                serializedName: "AllowedHeaders",
+                required: true,
+                xmlName: "AllowedHeaders",
+                type: {
+                    name: "String",
+                },
+            },
+            exposedHeaders: {
+                serializedName: "ExposedHeaders",
+                required: true,
+                xmlName: "ExposedHeaders",
+                type: {
+                    name: "String",
+                },
+            },
+            maxAgeInSeconds: {
+                constraints: {
+                    InclusiveMinimum: 0,
+                },
+                serializedName: "MaxAgeInSeconds",
+                required: true,
+                xmlName: "MaxAgeInSeconds",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const StaticWebsite = {
+    serializedName: "StaticWebsite",
+    type: {
+        name: "Composite",
+        className: "StaticWebsite",
+        modelProperties: {
+            enabled: {
+                serializedName: "Enabled",
+                required: true,
+                xmlName: "Enabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            indexDocument: {
+                serializedName: "IndexDocument",
+                xmlName: "IndexDocument",
+                type: {
+                    name: "String",
+                },
+            },
+            errorDocument404Path: {
+                serializedName: "ErrorDocument404Path",
+                xmlName: "ErrorDocument404Path",
+                type: {
+                    name: "String",
+                },
+            },
+            defaultIndexDocumentPath: {
+                serializedName: "DefaultIndexDocumentPath",
+                xmlName: "DefaultIndexDocumentPath",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const StorageError = {
+    serializedName: "StorageError",
+    type: {
+        name: "Composite",
+        className: "StorageError",
+        modelProperties: {
+            message: {
+                serializedName: "Message",
+                xmlName: "Message",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceStatusCode: {
+                serializedName: "CopySourceStatusCode",
+                xmlName: "CopySourceStatusCode",
+                type: {
+                    name: "Number",
+                },
+            },
+            copySourceErrorCode: {
+                serializedName: "CopySourceErrorCode",
+                xmlName: "CopySourceErrorCode",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceErrorMessage: {
+                serializedName: "CopySourceErrorMessage",
+                xmlName: "CopySourceErrorMessage",
+                type: {
+                    name: "String",
+                },
+            },
+            code: {
+                serializedName: "Code",
+                xmlName: "Code",
+                type: {
+                    name: "String",
+                },
+            },
+            authenticationErrorDetail: {
+                serializedName: "AuthenticationErrorDetail",
+                xmlName: "AuthenticationErrorDetail",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobServiceStatistics = {
+    serializedName: "BlobServiceStatistics",
+    xmlName: "StorageServiceStats",
+    type: {
+        name: "Composite",
+        className: "BlobServiceStatistics",
+        modelProperties: {
+            geoReplication: {
+                serializedName: "GeoReplication",
+                xmlName: "GeoReplication",
+                type: {
+                    name: "Composite",
+                    className: "GeoReplication",
+                },
+            },
+        },
+    },
+};
+const GeoReplication = {
+    serializedName: "GeoReplication",
+    type: {
+        name: "Composite",
+        className: "GeoReplication",
+        modelProperties: {
+            status: {
+                serializedName: "Status",
+                required: true,
+                xmlName: "Status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["live", "bootstrap", "unavailable"],
+                },
+            },
+            lastSyncOn: {
+                serializedName: "LastSyncTime",
+                required: true,
+                xmlName: "LastSyncTime",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const ListContainersSegmentResponse = {
+    serializedName: "ListContainersSegmentResponse",
+    xmlName: "EnumerationResults",
+    type: {
+        name: "Composite",
+        className: "ListContainersSegmentResponse",
+        modelProperties: {
+            serviceEndpoint: {
+                serializedName: "ServiceEndpoint",
+                required: true,
+                xmlName: "ServiceEndpoint",
+                xmlIsAttribute: true,
+                type: {
+                    name: "String",
+                },
+            },
+            prefix: {
+                serializedName: "Prefix",
+                xmlName: "Prefix",
+                type: {
+                    name: "String",
+                },
+            },
+            marker: {
+                serializedName: "Marker",
+                xmlName: "Marker",
+                type: {
+                    name: "String",
+                },
+            },
+            maxPageSize: {
+                serializedName: "MaxResults",
+                xmlName: "MaxResults",
+                type: {
+                    name: "Number",
+                },
+            },
+            containerItems: {
+                serializedName: "ContainerItems",
+                required: true,
+                xmlName: "Containers",
+                xmlIsWrapped: true,
+                xmlElementName: "Container",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "ContainerItem",
+                        },
+                    },
+                },
+            },
+            continuationToken: {
+                serializedName: "NextMarker",
+                xmlName: "NextMarker",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerItem = {
+    serializedName: "ContainerItem",
+    xmlName: "Container",
+    type: {
+        name: "Composite",
+        className: "ContainerItem",
+        modelProperties: {
+            name: {
+                serializedName: "Name",
+                required: true,
+                xmlName: "Name",
+                type: {
+                    name: "String",
+                },
+            },
+            deleted: {
+                serializedName: "Deleted",
+                xmlName: "Deleted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            version: {
+                serializedName: "Version",
+                xmlName: "Version",
+                type: {
+                    name: "String",
+                },
+            },
+            properties: {
+                serializedName: "Properties",
+                xmlName: "Properties",
+                type: {
+                    name: "Composite",
+                    className: "ContainerProperties",
+                },
+            },
+            metadata: {
+                serializedName: "Metadata",
+                xmlName: "Metadata",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+        },
+    },
+};
+const ContainerProperties = {
+    serializedName: "ContainerProperties",
+    type: {
+        name: "Composite",
+        className: "ContainerProperties",
+        modelProperties: {
+            lastModified: {
+                serializedName: "Last-Modified",
+                required: true,
+                xmlName: "Last-Modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            etag: {
+                serializedName: "Etag",
+                required: true,
+                xmlName: "Etag",
+                type: {
+                    name: "String",
+                },
+            },
+            leaseStatus: {
+                serializedName: "LeaseStatus",
+                xmlName: "LeaseStatus",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["locked", "unlocked"],
+                },
+            },
+            leaseState: {
+                serializedName: "LeaseState",
+                xmlName: "LeaseState",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "available",
+                        "leased",
+                        "expired",
+                        "breaking",
+                        "broken",
+                    ],
+                },
+            },
+            leaseDuration: {
+                serializedName: "LeaseDuration",
+                xmlName: "LeaseDuration",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["infinite", "fixed"],
+                },
+            },
+            publicAccess: {
+                serializedName: "PublicAccess",
+                xmlName: "PublicAccess",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["container", "blob"],
+                },
+            },
+            hasImmutabilityPolicy: {
+                serializedName: "HasImmutabilityPolicy",
+                xmlName: "HasImmutabilityPolicy",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            hasLegalHold: {
+                serializedName: "HasLegalHold",
+                xmlName: "HasLegalHold",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            defaultEncryptionScope: {
+                serializedName: "DefaultEncryptionScope",
+                xmlName: "DefaultEncryptionScope",
+                type: {
+                    name: "String",
+                },
+            },
+            preventEncryptionScopeOverride: {
+                serializedName: "DenyEncryptionScopeOverride",
+                xmlName: "DenyEncryptionScopeOverride",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            deletedOn: {
+                serializedName: "DeletedTime",
+                xmlName: "DeletedTime",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            remainingRetentionDays: {
+                serializedName: "RemainingRetentionDays",
+                xmlName: "RemainingRetentionDays",
+                type: {
+                    name: "Number",
+                },
+            },
+            isImmutableStorageWithVersioningEnabled: {
+                serializedName: "ImmutableStorageWithVersioningEnabled",
+                xmlName: "ImmutableStorageWithVersioningEnabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const KeyInfo = {
+    serializedName: "KeyInfo",
+    type: {
+        name: "Composite",
+        className: "KeyInfo",
+        modelProperties: {
+            startsOn: {
+                serializedName: "Start",
+                required: true,
+                xmlName: "Start",
+                type: {
+                    name: "String",
+                },
+            },
+            expiresOn: {
+                serializedName: "Expiry",
+                required: true,
+                xmlName: "Expiry",
+                type: {
+                    name: "String",
+                },
+            },
+            delegatedUserTid: {
+                serializedName: "DelegatedUserTid",
+                xmlName: "DelegatedUserTid",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const UserDelegationKey = {
+    serializedName: "UserDelegationKey",
+    type: {
+        name: "Composite",
+        className: "UserDelegationKey",
+        modelProperties: {
+            signedObjectId: {
+                serializedName: "SignedOid",
+                required: true,
+                xmlName: "SignedOid",
+                type: {
+                    name: "String",
+                },
+            },
+            signedTenantId: {
+                serializedName: "SignedTid",
+                required: true,
+                xmlName: "SignedTid",
+                type: {
+                    name: "String",
+                },
+            },
+            signedStartsOn: {
+                serializedName: "SignedStart",
+                required: true,
+                xmlName: "SignedStart",
+                type: {
+                    name: "String",
+                },
+            },
+            signedExpiresOn: {
+                serializedName: "SignedExpiry",
+                required: true,
+                xmlName: "SignedExpiry",
+                type: {
+                    name: "String",
+                },
+            },
+            signedService: {
+                serializedName: "SignedService",
+                required: true,
+                xmlName: "SignedService",
+                type: {
+                    name: "String",
+                },
+            },
+            signedVersion: {
+                serializedName: "SignedVersion",
+                required: true,
+                xmlName: "SignedVersion",
+                type: {
+                    name: "String",
+                },
+            },
+            signedDelegatedUserTenantId: {
+                serializedName: "SignedDelegatedUserTid",
+                xmlName: "SignedDelegatedUserTid",
+                type: {
+                    name: "String",
+                },
+            },
+            value: {
+                serializedName: "Value",
+                required: true,
+                xmlName: "Value",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const FilterBlobSegment = {
+    serializedName: "FilterBlobSegment",
+    xmlName: "EnumerationResults",
+    type: {
+        name: "Composite",
+        className: "FilterBlobSegment",
+        modelProperties: {
+            serviceEndpoint: {
+                serializedName: "ServiceEndpoint",
+                required: true,
+                xmlName: "ServiceEndpoint",
+                xmlIsAttribute: true,
+                type: {
+                    name: "String",
+                },
+            },
+            where: {
+                serializedName: "Where",
+                required: true,
+                xmlName: "Where",
+                type: {
+                    name: "String",
+                },
+            },
+            blobs: {
+                serializedName: "Blobs",
+                required: true,
+                xmlName: "Blobs",
+                xmlIsWrapped: true,
+                xmlElementName: "Blob",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "FilterBlobItem",
+                        },
+                    },
+                },
+            },
+            continuationToken: {
+                serializedName: "NextMarker",
+                xmlName: "NextMarker",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const FilterBlobItem = {
+    serializedName: "FilterBlobItem",
+    xmlName: "Blob",
+    type: {
+        name: "Composite",
+        className: "FilterBlobItem",
+        modelProperties: {
+            name: {
+                serializedName: "Name",
+                required: true,
+                xmlName: "Name",
+                type: {
+                    name: "String",
+                },
+            },
+            containerName: {
+                serializedName: "ContainerName",
+                required: true,
+                xmlName: "ContainerName",
+                type: {
+                    name: "String",
+                },
+            },
+            tags: {
+                serializedName: "Tags",
+                xmlName: "Tags",
+                type: {
+                    name: "Composite",
+                    className: "BlobTags",
+                },
+            },
+        },
+    },
+};
+const BlobTags = {
+    serializedName: "BlobTags",
+    xmlName: "Tags",
+    type: {
+        name: "Composite",
+        className: "BlobTags",
+        modelProperties: {
+            blobTagSet: {
+                serializedName: "BlobTagSet",
+                required: true,
+                xmlName: "TagSet",
+                xmlIsWrapped: true,
+                xmlElementName: "Tag",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "BlobTag",
+                        },
+                    },
+                },
+            },
+        },
+    },
+};
+const BlobTag = {
+    serializedName: "BlobTag",
+    xmlName: "Tag",
+    type: {
+        name: "Composite",
+        className: "BlobTag",
+        modelProperties: {
+            key: {
+                serializedName: "Key",
+                required: true,
+                xmlName: "Key",
+                type: {
+                    name: "String",
+                },
+            },
+            value: {
+                serializedName: "Value",
+                required: true,
+                xmlName: "Value",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const SignedIdentifier = {
+    serializedName: "SignedIdentifier",
+    xmlName: "SignedIdentifier",
+    type: {
+        name: "Composite",
+        className: "SignedIdentifier",
+        modelProperties: {
+            id: {
+                serializedName: "Id",
+                required: true,
+                xmlName: "Id",
+                type: {
+                    name: "String",
+                },
+            },
+            accessPolicy: {
+                serializedName: "AccessPolicy",
+                xmlName: "AccessPolicy",
+                type: {
+                    name: "Composite",
+                    className: "AccessPolicy",
+                },
+            },
+        },
+    },
+};
+const AccessPolicy = {
+    serializedName: "AccessPolicy",
+    type: {
+        name: "Composite",
+        className: "AccessPolicy",
+        modelProperties: {
+            startsOn: {
+                serializedName: "Start",
+                xmlName: "Start",
+                type: {
+                    name: "String",
+                },
+            },
+            expiresOn: {
+                serializedName: "Expiry",
+                xmlName: "Expiry",
+                type: {
+                    name: "String",
+                },
+            },
+            permissions: {
+                serializedName: "Permission",
+                xmlName: "Permission",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ListBlobsFlatSegmentResponse = {
+    serializedName: "ListBlobsFlatSegmentResponse",
+    xmlName: "EnumerationResults",
+    type: {
+        name: "Composite",
+        className: "ListBlobsFlatSegmentResponse",
+        modelProperties: {
+            serviceEndpoint: {
+                serializedName: "ServiceEndpoint",
+                required: true,
+                xmlName: "ServiceEndpoint",
+                xmlIsAttribute: true,
+                type: {
+                    name: "String",
+                },
+            },
+            containerName: {
+                serializedName: "ContainerName",
+                required: true,
+                xmlName: "ContainerName",
+                xmlIsAttribute: true,
+                type: {
+                    name: "String",
+                },
+            },
+            prefix: {
+                serializedName: "Prefix",
+                xmlName: "Prefix",
+                type: {
+                    name: "String",
+                },
+            },
+            marker: {
+                serializedName: "Marker",
+                xmlName: "Marker",
+                type: {
+                    name: "String",
+                },
+            },
+            maxPageSize: {
+                serializedName: "MaxResults",
+                xmlName: "MaxResults",
+                type: {
+                    name: "Number",
+                },
+            },
+            segment: {
+                serializedName: "Segment",
+                xmlName: "Blobs",
+                type: {
+                    name: "Composite",
+                    className: "BlobFlatListSegment",
+                },
+            },
+            continuationToken: {
+                serializedName: "NextMarker",
+                xmlName: "NextMarker",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobFlatListSegment = {
+    serializedName: "BlobFlatListSegment",
+    xmlName: "Blobs",
+    type: {
+        name: "Composite",
+        className: "BlobFlatListSegment",
+        modelProperties: {
+            blobItems: {
+                serializedName: "BlobItems",
+                required: true,
+                xmlName: "BlobItems",
+                xmlElementName: "Blob",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "BlobItemInternal",
+                        },
+                    },
+                },
+            },
+        },
+    },
+};
+const BlobItemInternal = {
+    serializedName: "BlobItemInternal",
+    xmlName: "Blob",
+    type: {
+        name: "Composite",
+        className: "BlobItemInternal",
+        modelProperties: {
+            name: {
+                serializedName: "Name",
+                xmlName: "Name",
+                type: {
+                    name: "Composite",
+                    className: "BlobName",
+                },
+            },
+            deleted: {
+                serializedName: "Deleted",
+                required: true,
+                xmlName: "Deleted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            snapshot: {
+                serializedName: "Snapshot",
+                required: true,
+                xmlName: "Snapshot",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "VersionId",
+                xmlName: "VersionId",
+                type: {
+                    name: "String",
+                },
+            },
+            isCurrentVersion: {
+                serializedName: "IsCurrentVersion",
+                xmlName: "IsCurrentVersion",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            properties: {
+                serializedName: "Properties",
+                xmlName: "Properties",
+                type: {
+                    name: "Composite",
+                    className: "BlobPropertiesInternal",
+                },
+            },
+            metadata: {
+                serializedName: "Metadata",
+                xmlName: "Metadata",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            blobTags: {
+                serializedName: "BlobTags",
+                xmlName: "Tags",
+                type: {
+                    name: "Composite",
+                    className: "BlobTags",
+                },
+            },
+            objectReplicationMetadata: {
+                serializedName: "ObjectReplicationMetadata",
+                xmlName: "OrMetadata",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            hasVersionsOnly: {
+                serializedName: "HasVersionsOnly",
+                xmlName: "HasVersionsOnly",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const BlobName = {
+    serializedName: "BlobName",
+    type: {
+        name: "Composite",
+        className: "BlobName",
+        modelProperties: {
+            encoded: {
+                serializedName: "Encoded",
+                xmlName: "Encoded",
+                xmlIsAttribute: true,
+                type: {
+                    name: "Boolean",
+                },
+            },
+            content: {
+                serializedName: "content",
+                xmlName: "content",
+                xmlIsMsText: true,
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobPropertiesInternal = {
+    serializedName: "BlobPropertiesInternal",
+    xmlName: "Properties",
+    type: {
+        name: "Composite",
+        className: "BlobPropertiesInternal",
+        modelProperties: {
+            createdOn: {
+                serializedName: "Creation-Time",
+                xmlName: "Creation-Time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            lastModified: {
+                serializedName: "Last-Modified",
+                required: true,
+                xmlName: "Last-Modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            etag: {
+                serializedName: "Etag",
+                required: true,
+                xmlName: "Etag",
+                type: {
+                    name: "String",
+                },
+            },
+            contentLength: {
+                serializedName: "Content-Length",
+                xmlName: "Content-Length",
+                type: {
+                    name: "Number",
+                },
+            },
+            contentType: {
+                serializedName: "Content-Type",
+                xmlName: "Content-Type",
+                type: {
+                    name: "String",
+                },
+            },
+            contentEncoding: {
+                serializedName: "Content-Encoding",
+                xmlName: "Content-Encoding",
+                type: {
+                    name: "String",
+                },
+            },
+            contentLanguage: {
+                serializedName: "Content-Language",
+                xmlName: "Content-Language",
+                type: {
+                    name: "String",
+                },
+            },
+            contentMD5: {
+                serializedName: "Content-MD5",
+                xmlName: "Content-MD5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            contentDisposition: {
+                serializedName: "Content-Disposition",
+                xmlName: "Content-Disposition",
+                type: {
+                    name: "String",
+                },
+            },
+            cacheControl: {
+                serializedName: "Cache-Control",
+                xmlName: "Cache-Control",
+                type: {
+                    name: "String",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            blobType: {
+                serializedName: "BlobType",
+                xmlName: "BlobType",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"],
+                },
+            },
+            leaseStatus: {
+                serializedName: "LeaseStatus",
+                xmlName: "LeaseStatus",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["locked", "unlocked"],
+                },
+            },
+            leaseState: {
+                serializedName: "LeaseState",
+                xmlName: "LeaseState",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "available",
+                        "leased",
+                        "expired",
+                        "breaking",
+                        "broken",
+                    ],
+                },
+            },
+            leaseDuration: {
+                serializedName: "LeaseDuration",
+                xmlName: "LeaseDuration",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["infinite", "fixed"],
+                },
+            },
+            copyId: {
+                serializedName: "CopyId",
+                xmlName: "CopyId",
+                type: {
+                    name: "String",
+                },
+            },
+            copyStatus: {
+                serializedName: "CopyStatus",
+                xmlName: "CopyStatus",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["pending", "success", "aborted", "failed"],
+                },
+            },
+            copySource: {
+                serializedName: "CopySource",
+                xmlName: "CopySource",
+                type: {
+                    name: "String",
+                },
+            },
+            copyProgress: {
+                serializedName: "CopyProgress",
+                xmlName: "CopyProgress",
+                type: {
+                    name: "String",
+                },
+            },
+            copyCompletedOn: {
+                serializedName: "CopyCompletionTime",
+                xmlName: "CopyCompletionTime",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            copyStatusDescription: {
+                serializedName: "CopyStatusDescription",
+                xmlName: "CopyStatusDescription",
+                type: {
+                    name: "String",
+                },
+            },
+            serverEncrypted: {
+                serializedName: "ServerEncrypted",
+                xmlName: "ServerEncrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            incrementalCopy: {
+                serializedName: "IncrementalCopy",
+                xmlName: "IncrementalCopy",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            destinationSnapshot: {
+                serializedName: "DestinationSnapshot",
+                xmlName: "DestinationSnapshot",
+                type: {
+                    name: "String",
+                },
+            },
+            deletedOn: {
+                serializedName: "DeletedTime",
+                xmlName: "DeletedTime",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            remainingRetentionDays: {
+                serializedName: "RemainingRetentionDays",
+                xmlName: "RemainingRetentionDays",
+                type: {
+                    name: "Number",
+                },
+            },
+            accessTier: {
+                serializedName: "AccessTier",
+                xmlName: "AccessTier",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "P4",
+                        "P6",
+                        "P10",
+                        "P15",
+                        "P20",
+                        "P30",
+                        "P40",
+                        "P50",
+                        "P60",
+                        "P70",
+                        "P80",
+                        "Hot",
+                        "Cool",
+                        "Archive",
+                        "Cold",
+                    ],
+                },
+            },
+            accessTierInferred: {
+                serializedName: "AccessTierInferred",
+                xmlName: "AccessTierInferred",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            archiveStatus: {
+                serializedName: "ArchiveStatus",
+                xmlName: "ArchiveStatus",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "rehydrate-pending-to-hot",
+                        "rehydrate-pending-to-cool",
+                        "rehydrate-pending-to-cold",
+                    ],
+                },
+            },
+            customerProvidedKeySha256: {
+                serializedName: "CustomerProvidedKeySha256",
+                xmlName: "CustomerProvidedKeySha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "EncryptionScope",
+                xmlName: "EncryptionScope",
+                type: {
+                    name: "String",
+                },
+            },
+            accessTierChangedOn: {
+                serializedName: "AccessTierChangeTime",
+                xmlName: "AccessTierChangeTime",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            tagCount: {
+                serializedName: "TagCount",
+                xmlName: "TagCount",
+                type: {
+                    name: "Number",
+                },
+            },
+            expiresOn: {
+                serializedName: "Expiry-Time",
+                xmlName: "Expiry-Time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isSealed: {
+                serializedName: "Sealed",
+                xmlName: "Sealed",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            rehydratePriority: {
+                serializedName: "RehydratePriority",
+                xmlName: "RehydratePriority",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["High", "Standard"],
+                },
+            },
+            lastAccessedOn: {
+                serializedName: "LastAccessTime",
+                xmlName: "LastAccessTime",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyExpiresOn: {
+                serializedName: "ImmutabilityPolicyUntilDate",
+                xmlName: "ImmutabilityPolicyUntilDate",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyMode: {
+                serializedName: "ImmutabilityPolicyMode",
+                xmlName: "ImmutabilityPolicyMode",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["Mutable", "Unlocked", "Locked"],
+                },
+            },
+            legalHold: {
+                serializedName: "LegalHold",
+                xmlName: "LegalHold",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const ListBlobsHierarchySegmentResponse = {
+    serializedName: "ListBlobsHierarchySegmentResponse",
+    xmlName: "EnumerationResults",
+    type: {
+        name: "Composite",
+        className: "ListBlobsHierarchySegmentResponse",
+        modelProperties: {
+            serviceEndpoint: {
+                serializedName: "ServiceEndpoint",
+                required: true,
+                xmlName: "ServiceEndpoint",
+                xmlIsAttribute: true,
+                type: {
+                    name: "String",
+                },
+            },
+            containerName: {
+                serializedName: "ContainerName",
+                required: true,
+                xmlName: "ContainerName",
+                xmlIsAttribute: true,
+                type: {
+                    name: "String",
+                },
+            },
+            prefix: {
+                serializedName: "Prefix",
+                xmlName: "Prefix",
+                type: {
+                    name: "String",
+                },
+            },
+            marker: {
+                serializedName: "Marker",
+                xmlName: "Marker",
+                type: {
+                    name: "String",
+                },
+            },
+            maxPageSize: {
+                serializedName: "MaxResults",
+                xmlName: "MaxResults",
+                type: {
+                    name: "Number",
+                },
+            },
+            delimiter: {
+                serializedName: "Delimiter",
+                xmlName: "Delimiter",
+                type: {
+                    name: "String",
+                },
+            },
+            segment: {
+                serializedName: "Segment",
+                xmlName: "Blobs",
+                type: {
+                    name: "Composite",
+                    className: "BlobHierarchyListSegment",
+                },
+            },
+            continuationToken: {
+                serializedName: "NextMarker",
+                xmlName: "NextMarker",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobHierarchyListSegment = {
+    serializedName: "BlobHierarchyListSegment",
+    xmlName: "Blobs",
+    type: {
+        name: "Composite",
+        className: "BlobHierarchyListSegment",
+        modelProperties: {
+            blobPrefixes: {
+                serializedName: "BlobPrefixes",
+                xmlName: "BlobPrefixes",
+                xmlElementName: "BlobPrefix",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "BlobPrefix",
+                        },
+                    },
+                },
+            },
+            blobItems: {
+                serializedName: "BlobItems",
+                required: true,
+                xmlName: "BlobItems",
+                xmlElementName: "Blob",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "BlobItemInternal",
+                        },
+                    },
+                },
+            },
+        },
+    },
+};
+const BlobPrefix = {
+    serializedName: "BlobPrefix",
+    type: {
+        name: "Composite",
+        className: "BlobPrefix",
+        modelProperties: {
+            name: {
+                serializedName: "Name",
+                xmlName: "Name",
+                type: {
+                    name: "Composite",
+                    className: "BlobName",
+                },
+            },
+        },
+    },
+};
+const BlockLookupList = {
+    serializedName: "BlockLookupList",
+    xmlName: "BlockList",
+    type: {
+        name: "Composite",
+        className: "BlockLookupList",
+        modelProperties: {
+            committed: {
+                serializedName: "Committed",
+                xmlName: "Committed",
+                xmlElementName: "Committed",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "String",
+                        },
+                    },
+                },
+            },
+            uncommitted: {
+                serializedName: "Uncommitted",
+                xmlName: "Uncommitted",
+                xmlElementName: "Uncommitted",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "String",
+                        },
+                    },
+                },
+            },
+            latest: {
+                serializedName: "Latest",
+                xmlName: "Latest",
+                xmlElementName: "Latest",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "String",
+                        },
+                    },
+                },
+            },
+        },
+    },
+};
+const BlockList = {
+    serializedName: "BlockList",
+    type: {
+        name: "Composite",
+        className: "BlockList",
+        modelProperties: {
+            committedBlocks: {
+                serializedName: "CommittedBlocks",
+                xmlName: "CommittedBlocks",
+                xmlIsWrapped: true,
+                xmlElementName: "Block",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "Block",
+                        },
+                    },
+                },
+            },
+            uncommittedBlocks: {
+                serializedName: "UncommittedBlocks",
+                xmlName: "UncommittedBlocks",
+                xmlIsWrapped: true,
+                xmlElementName: "Block",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "Block",
+                        },
+                    },
+                },
+            },
+        },
+    },
+};
+const Block = {
+    serializedName: "Block",
+    type: {
+        name: "Composite",
+        className: "Block",
+        modelProperties: {
+            name: {
+                serializedName: "Name",
+                required: true,
+                xmlName: "Name",
+                type: {
+                    name: "String",
+                },
+            },
+            size: {
+                serializedName: "Size",
+                required: true,
+                xmlName: "Size",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const PageList = {
+    serializedName: "PageList",
+    type: {
+        name: "Composite",
+        className: "PageList",
+        modelProperties: {
+            pageRange: {
+                serializedName: "PageRange",
+                xmlName: "PageRange",
+                xmlElementName: "PageRange",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "PageRange",
+                        },
+                    },
+                },
+            },
+            clearRange: {
+                serializedName: "ClearRange",
+                xmlName: "ClearRange",
+                xmlElementName: "ClearRange",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "ClearRange",
+                        },
+                    },
+                },
+            },
+            continuationToken: {
+                serializedName: "NextMarker",
+                xmlName: "NextMarker",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageRange = {
+    serializedName: "PageRange",
+    xmlName: "PageRange",
+    type: {
+        name: "Composite",
+        className: "PageRange",
+        modelProperties: {
+            start: {
+                serializedName: "Start",
+                required: true,
+                xmlName: "Start",
+                type: {
+                    name: "Number",
+                },
+            },
+            end: {
+                serializedName: "End",
+                required: true,
+                xmlName: "End",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const ClearRange = {
+    serializedName: "ClearRange",
+    xmlName: "ClearRange",
+    type: {
+        name: "Composite",
+        className: "ClearRange",
+        modelProperties: {
+            start: {
+                serializedName: "Start",
+                required: true,
+                xmlName: "Start",
+                type: {
+                    name: "Number",
+                },
+            },
+            end: {
+                serializedName: "End",
+                required: true,
+                xmlName: "End",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const QueryRequest = {
+    serializedName: "QueryRequest",
+    xmlName: "QueryRequest",
+    type: {
+        name: "Composite",
+        className: "QueryRequest",
+        modelProperties: {
+            queryType: {
+                serializedName: "QueryType",
+                required: true,
+                xmlName: "QueryType",
+                type: {
+                    name: "String",
+                },
+            },
+            expression: {
+                serializedName: "Expression",
+                required: true,
+                xmlName: "Expression",
+                type: {
+                    name: "String",
+                },
+            },
+            inputSerialization: {
+                serializedName: "InputSerialization",
+                xmlName: "InputSerialization",
+                type: {
+                    name: "Composite",
+                    className: "QuerySerialization",
+                },
+            },
+            outputSerialization: {
+                serializedName: "OutputSerialization",
+                xmlName: "OutputSerialization",
+                type: {
+                    name: "Composite",
+                    className: "QuerySerialization",
+                },
+            },
+        },
+    },
+};
+const QuerySerialization = {
+    serializedName: "QuerySerialization",
+    type: {
+        name: "Composite",
+        className: "QuerySerialization",
+        modelProperties: {
+            format: {
+                serializedName: "Format",
+                xmlName: "Format",
+                type: {
+                    name: "Composite",
+                    className: "QueryFormat",
+                },
+            },
+        },
+    },
+};
+const QueryFormat = {
+    serializedName: "QueryFormat",
+    type: {
+        name: "Composite",
+        className: "QueryFormat",
+        modelProperties: {
+            type: {
+                serializedName: "Type",
+                required: true,
+                xmlName: "Type",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["delimited", "json", "arrow", "parquet"],
+                },
+            },
+            delimitedTextConfiguration: {
+                serializedName: "DelimitedTextConfiguration",
+                xmlName: "DelimitedTextConfiguration",
+                type: {
+                    name: "Composite",
+                    className: "DelimitedTextConfiguration",
+                },
+            },
+            jsonTextConfiguration: {
+                serializedName: "JsonTextConfiguration",
+                xmlName: "JsonTextConfiguration",
+                type: {
+                    name: "Composite",
+                    className: "JsonTextConfiguration",
+                },
+            },
+            arrowConfiguration: {
+                serializedName: "ArrowConfiguration",
+                xmlName: "ArrowConfiguration",
+                type: {
+                    name: "Composite",
+                    className: "ArrowConfiguration",
+                },
+            },
+            parquetTextConfiguration: {
+                serializedName: "ParquetTextConfiguration",
+                xmlName: "ParquetTextConfiguration",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "any" } },
+                },
+            },
+        },
+    },
+};
+const DelimitedTextConfiguration = {
+    serializedName: "DelimitedTextConfiguration",
+    xmlName: "DelimitedTextConfiguration",
+    type: {
+        name: "Composite",
+        className: "DelimitedTextConfiguration",
+        modelProperties: {
+            columnSeparator: {
+                serializedName: "ColumnSeparator",
+                xmlName: "ColumnSeparator",
+                type: {
+                    name: "String",
+                },
+            },
+            fieldQuote: {
+                serializedName: "FieldQuote",
+                xmlName: "FieldQuote",
+                type: {
+                    name: "String",
+                },
+            },
+            recordSeparator: {
+                serializedName: "RecordSeparator",
+                xmlName: "RecordSeparator",
+                type: {
+                    name: "String",
+                },
+            },
+            escapeChar: {
+                serializedName: "EscapeChar",
+                xmlName: "EscapeChar",
+                type: {
+                    name: "String",
+                },
+            },
+            headersPresent: {
+                serializedName: "HeadersPresent",
+                xmlName: "HasHeaders",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const JsonTextConfiguration = {
+    serializedName: "JsonTextConfiguration",
+    xmlName: "JsonTextConfiguration",
+    type: {
+        name: "Composite",
+        className: "JsonTextConfiguration",
+        modelProperties: {
+            recordSeparator: {
+                serializedName: "RecordSeparator",
+                xmlName: "RecordSeparator",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ArrowConfiguration = {
+    serializedName: "ArrowConfiguration",
+    xmlName: "ArrowConfiguration",
+    type: {
+        name: "Composite",
+        className: "ArrowConfiguration",
+        modelProperties: {
+            schema: {
+                serializedName: "Schema",
+                required: true,
+                xmlName: "Schema",
+                xmlIsWrapped: true,
+                xmlElementName: "Field",
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: {
+                            name: "Composite",
+                            className: "ArrowField",
+                        },
+                    },
+                },
+            },
+        },
+    },
+};
+const ArrowField = {
+    serializedName: "ArrowField",
+    xmlName: "Field",
+    type: {
+        name: "Composite",
+        className: "ArrowField",
+        modelProperties: {
+            type: {
+                serializedName: "Type",
+                required: true,
+                xmlName: "Type",
+                type: {
+                    name: "String",
+                },
+            },
+            name: {
+                serializedName: "Name",
+                xmlName: "Name",
+                type: {
+                    name: "String",
+                },
+            },
+            precision: {
+                serializedName: "Precision",
+                xmlName: "Precision",
+                type: {
+                    name: "Number",
+                },
+            },
+            scale: {
+                serializedName: "Scale",
+                xmlName: "Scale",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const ServiceSetPropertiesHeaders = {
+    serializedName: "Service_setPropertiesHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceSetPropertiesHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceSetPropertiesExceptionHeaders = {
+    serializedName: "Service_setPropertiesExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceSetPropertiesExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetPropertiesHeaders = {
+    serializedName: "Service_getPropertiesHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetPropertiesHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetPropertiesExceptionHeaders = {
+    serializedName: "Service_getPropertiesExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetPropertiesExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetStatisticsHeaders = {
+    serializedName: "Service_getStatisticsHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetStatisticsHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetStatisticsExceptionHeaders = {
+    serializedName: "Service_getStatisticsExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetStatisticsExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceListContainersSegmentHeaders = {
+    serializedName: "Service_listContainersSegmentHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceListContainersSegmentHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceListContainersSegmentExceptionHeaders = {
+    serializedName: "Service_listContainersSegmentExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceListContainersSegmentExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetUserDelegationKeyHeaders = {
+    serializedName: "Service_getUserDelegationKeyHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetUserDelegationKeyHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetUserDelegationKeyExceptionHeaders = {
+    serializedName: "Service_getUserDelegationKeyExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetUserDelegationKeyExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetAccountInfoHeaders = {
+    serializedName: "Service_getAccountInfoHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetAccountInfoHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            skuName: {
+                serializedName: "x-ms-sku-name",
+                xmlName: "x-ms-sku-name",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "Standard_LRS",
+                        "Standard_GRS",
+                        "Standard_RAGRS",
+                        "Standard_ZRS",
+                        "Premium_LRS",
+                        "Standard_GZRS",
+                        "Premium_ZRS",
+                        "Standard_RAGZRS",
+                    ],
+                },
+            },
+            accountKind: {
+                serializedName: "x-ms-account-kind",
+                xmlName: "x-ms-account-kind",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "Storage",
+                        "BlobStorage",
+                        "StorageV2",
+                        "FileStorage",
+                        "BlockBlobStorage",
+                    ],
+                },
+            },
+            isHierarchicalNamespaceEnabled: {
+                serializedName: "x-ms-is-hns-enabled",
+                xmlName: "x-ms-is-hns-enabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceGetAccountInfoExceptionHeaders = {
+    serializedName: "Service_getAccountInfoExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceGetAccountInfoExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceSubmitBatchHeaders = {
+    serializedName: "Service_submitBatchHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceSubmitBatchHeaders",
+        modelProperties: {
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceSubmitBatchExceptionHeaders = {
+    serializedName: "Service_submitBatchExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceSubmitBatchExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceFilterBlobsHeaders = {
+    serializedName: "Service_filterBlobsHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceFilterBlobsHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ServiceFilterBlobsExceptionHeaders = {
+    serializedName: "Service_filterBlobsExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ServiceFilterBlobsExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerCreateHeaders = {
+    serializedName: "Container_createHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerCreateHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerCreateExceptionHeaders = {
+    serializedName: "Container_createExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerCreateExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerGetPropertiesHeaders = {
+    serializedName: "Container_getPropertiesHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerGetPropertiesHeaders",
+        modelProperties: {
+            metadata: {
+                serializedName: "x-ms-meta",
+                headerCollectionPrefix: "x-ms-meta-",
+                xmlName: "x-ms-meta",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseDuration: {
+                serializedName: "x-ms-lease-duration",
+                xmlName: "x-ms-lease-duration",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["infinite", "fixed"],
+                },
+            },
+            leaseState: {
+                serializedName: "x-ms-lease-state",
+                xmlName: "x-ms-lease-state",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "available",
+                        "leased",
+                        "expired",
+                        "breaking",
+                        "broken",
+                    ],
+                },
+            },
+            leaseStatus: {
+                serializedName: "x-ms-lease-status",
+                xmlName: "x-ms-lease-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["locked", "unlocked"],
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobPublicAccess: {
+                serializedName: "x-ms-blob-public-access",
+                xmlName: "x-ms-blob-public-access",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["container", "blob"],
+                },
+            },
+            hasImmutabilityPolicy: {
+                serializedName: "x-ms-has-immutability-policy",
+                xmlName: "x-ms-has-immutability-policy",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            hasLegalHold: {
+                serializedName: "x-ms-has-legal-hold",
+                xmlName: "x-ms-has-legal-hold",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            defaultEncryptionScope: {
+                serializedName: "x-ms-default-encryption-scope",
+                xmlName: "x-ms-default-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            denyEncryptionScopeOverride: {
+                serializedName: "x-ms-deny-encryption-scope-override",
+                xmlName: "x-ms-deny-encryption-scope-override",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            isImmutableStorageWithVersioningEnabled: {
+                serializedName: "x-ms-immutable-storage-with-versioning-enabled",
+                xmlName: "x-ms-immutable-storage-with-versioning-enabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerGetPropertiesExceptionHeaders = {
+    serializedName: "Container_getPropertiesExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerGetPropertiesExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerDeleteHeaders = {
+    serializedName: "Container_deleteHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerDeleteHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerDeleteExceptionHeaders = {
+    serializedName: "Container_deleteExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerDeleteExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerSetMetadataHeaders = {
+    serializedName: "Container_setMetadataHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerSetMetadataHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerSetMetadataExceptionHeaders = {
+    serializedName: "Container_setMetadataExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerSetMetadataExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerGetAccessPolicyHeaders = {
+    serializedName: "Container_getAccessPolicyHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerGetAccessPolicyHeaders",
+        modelProperties: {
+            blobPublicAccess: {
+                serializedName: "x-ms-blob-public-access",
+                xmlName: "x-ms-blob-public-access",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["container", "blob"],
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerGetAccessPolicyExceptionHeaders = {
+    serializedName: "Container_getAccessPolicyExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerGetAccessPolicyExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerSetAccessPolicyHeaders = {
+    serializedName: "Container_setAccessPolicyHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerSetAccessPolicyHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerSetAccessPolicyExceptionHeaders = {
+    serializedName: "Container_setAccessPolicyExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerSetAccessPolicyExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerRestoreHeaders = {
+    serializedName: "Container_restoreHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerRestoreHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerRestoreExceptionHeaders = {
+    serializedName: "Container_restoreExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerRestoreExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerRenameHeaders = {
+    serializedName: "Container_renameHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerRenameHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerRenameExceptionHeaders = {
+    serializedName: "Container_renameExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerRenameExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerSubmitBatchHeaders = {
+    serializedName: "Container_submitBatchHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerSubmitBatchHeaders",
+        modelProperties: {
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerSubmitBatchExceptionHeaders = {
+    serializedName: "Container_submitBatchExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerSubmitBatchExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerFilterBlobsHeaders = {
+    serializedName: "Container_filterBlobsHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerFilterBlobsHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const ContainerFilterBlobsExceptionHeaders = {
+    serializedName: "Container_filterBlobsExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerFilterBlobsExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerAcquireLeaseHeaders = {
+    serializedName: "Container_acquireLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerAcquireLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseId: {
+                serializedName: "x-ms-lease-id",
+                xmlName: "x-ms-lease-id",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const ContainerAcquireLeaseExceptionHeaders = {
+    serializedName: "Container_acquireLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerAcquireLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerReleaseLeaseHeaders = {
+    serializedName: "Container_releaseLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerReleaseLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const ContainerReleaseLeaseExceptionHeaders = {
+    serializedName: "Container_releaseLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerReleaseLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerRenewLeaseHeaders = {
+    serializedName: "Container_renewLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerRenewLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseId: {
+                serializedName: "x-ms-lease-id",
+                xmlName: "x-ms-lease-id",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const ContainerRenewLeaseExceptionHeaders = {
+    serializedName: "Container_renewLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerRenewLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerBreakLeaseHeaders = {
+    serializedName: "Container_breakLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerBreakLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseTime: {
+                serializedName: "x-ms-lease-time",
+                xmlName: "x-ms-lease-time",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const ContainerBreakLeaseExceptionHeaders = {
+    serializedName: "Container_breakLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerBreakLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerChangeLeaseHeaders = {
+    serializedName: "Container_changeLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerChangeLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseId: {
+                serializedName: "x-ms-lease-id",
+                xmlName: "x-ms-lease-id",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const ContainerChangeLeaseExceptionHeaders = {
+    serializedName: "Container_changeLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerChangeLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerListBlobFlatSegmentHeaders = {
+    serializedName: "Container_listBlobFlatSegmentHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerListBlobFlatSegmentHeaders",
+        modelProperties: {
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerListBlobFlatSegmentExceptionHeaders = {
+    serializedName: "Container_listBlobFlatSegmentExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerListBlobFlatSegmentExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerListBlobHierarchySegmentHeaders = {
+    serializedName: "Container_listBlobHierarchySegmentHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerListBlobHierarchySegmentHeaders",
+        modelProperties: {
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerListBlobHierarchySegmentExceptionHeaders = {
+    serializedName: "Container_listBlobHierarchySegmentExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerListBlobHierarchySegmentExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const ContainerGetAccountInfoHeaders = {
+    serializedName: "Container_getAccountInfoHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerGetAccountInfoHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            skuName: {
+                serializedName: "x-ms-sku-name",
+                xmlName: "x-ms-sku-name",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "Standard_LRS",
+                        "Standard_GRS",
+                        "Standard_RAGRS",
+                        "Standard_ZRS",
+                        "Premium_LRS",
+                        "Standard_GZRS",
+                        "Premium_ZRS",
+                        "Standard_RAGZRS",
+                    ],
+                },
+            },
+            accountKind: {
+                serializedName: "x-ms-account-kind",
+                xmlName: "x-ms-account-kind",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "Storage",
+                        "BlobStorage",
+                        "StorageV2",
+                        "FileStorage",
+                        "BlockBlobStorage",
+                    ],
+                },
+            },
+            isHierarchicalNamespaceEnabled: {
+                serializedName: "x-ms-is-hns-enabled",
+                xmlName: "x-ms-is-hns-enabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const ContainerGetAccountInfoExceptionHeaders = {
+    serializedName: "Container_getAccountInfoExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "ContainerGetAccountInfoExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobDownloadHeaders = {
+    serializedName: "Blob_downloadHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobDownloadHeaders",
+        modelProperties: {
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            createdOn: {
+                serializedName: "x-ms-creation-time",
+                xmlName: "x-ms-creation-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            metadata: {
+                serializedName: "x-ms-meta",
+                headerCollectionPrefix: "x-ms-meta-",
+                xmlName: "x-ms-meta",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            objectReplicationPolicyId: {
+                serializedName: "x-ms-or-policy-id",
+                xmlName: "x-ms-or-policy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            objectReplicationRules: {
+                serializedName: "x-ms-or",
+                headerCollectionPrefix: "x-ms-or-",
+                xmlName: "x-ms-or",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            contentLength: {
+                serializedName: "content-length",
+                xmlName: "content-length",
+                type: {
+                    name: "Number",
+                },
+            },
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            contentRange: {
+                serializedName: "content-range",
+                xmlName: "content-range",
+                type: {
+                    name: "String",
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            contentEncoding: {
+                serializedName: "content-encoding",
+                xmlName: "content-encoding",
+                type: {
+                    name: "String",
+                },
+            },
+            cacheControl: {
+                serializedName: "cache-control",
+                xmlName: "cache-control",
+                type: {
+                    name: "String",
+                },
+            },
+            contentDisposition: {
+                serializedName: "content-disposition",
+                xmlName: "content-disposition",
+                type: {
+                    name: "String",
+                },
+            },
+            contentLanguage: {
+                serializedName: "content-language",
+                xmlName: "content-language",
+                type: {
+                    name: "String",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            blobType: {
+                serializedName: "x-ms-blob-type",
+                xmlName: "x-ms-blob-type",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"],
+                },
+            },
+            copyCompletedOn: {
+                serializedName: "x-ms-copy-completion-time",
+                xmlName: "x-ms-copy-completion-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            copyStatusDescription: {
+                serializedName: "x-ms-copy-status-description",
+                xmlName: "x-ms-copy-status-description",
+                type: {
+                    name: "String",
+                },
+            },
+            copyId: {
+                serializedName: "x-ms-copy-id",
+                xmlName: "x-ms-copy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            copyProgress: {
+                serializedName: "x-ms-copy-progress",
+                xmlName: "x-ms-copy-progress",
+                type: {
+                    name: "String",
+                },
+            },
+            copySource: {
+                serializedName: "x-ms-copy-source",
+                xmlName: "x-ms-copy-source",
+                type: {
+                    name: "String",
+                },
+            },
+            copyStatus: {
+                serializedName: "x-ms-copy-status",
+                xmlName: "x-ms-copy-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["pending", "success", "aborted", "failed"],
+                },
+            },
+            leaseDuration: {
+                serializedName: "x-ms-lease-duration",
+                xmlName: "x-ms-lease-duration",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["infinite", "fixed"],
+                },
+            },
+            leaseState: {
+                serializedName: "x-ms-lease-state",
+                xmlName: "x-ms-lease-state",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "available",
+                        "leased",
+                        "expired",
+                        "breaking",
+                        "broken",
+                    ],
+                },
+            },
+            leaseStatus: {
+                serializedName: "x-ms-lease-status",
+                xmlName: "x-ms-lease-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["locked", "unlocked"],
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            isCurrentVersion: {
+                serializedName: "x-ms-is-current-version",
+                xmlName: "x-ms-is-current-version",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            acceptRanges: {
+                serializedName: "accept-ranges",
+                xmlName: "accept-ranges",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobCommittedBlockCount: {
+                serializedName: "x-ms-blob-committed-block-count",
+                xmlName: "x-ms-blob-committed-block-count",
+                type: {
+                    name: "Number",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-server-encrypted",
+                xmlName: "x-ms-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            blobContentMD5: {
+                serializedName: "x-ms-blob-content-md5",
+                xmlName: "x-ms-blob-content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            tagCount: {
+                serializedName: "x-ms-tag-count",
+                xmlName: "x-ms-tag-count",
+                type: {
+                    name: "Number",
+                },
+            },
+            isSealed: {
+                serializedName: "x-ms-blob-sealed",
+                xmlName: "x-ms-blob-sealed",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            lastAccessed: {
+                serializedName: "x-ms-last-access-time",
+                xmlName: "x-ms-last-access-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyExpiresOn: {
+                serializedName: "x-ms-immutability-policy-until-date",
+                xmlName: "x-ms-immutability-policy-until-date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyMode: {
+                serializedName: "x-ms-immutability-policy-mode",
+                xmlName: "x-ms-immutability-policy-mode",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["Mutable", "Unlocked", "Locked"],
+                },
+            },
+            legalHold: {
+                serializedName: "x-ms-legal-hold",
+                xmlName: "x-ms-legal-hold",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            structuredBodyType: {
+                serializedName: "x-ms-structured-body",
+                xmlName: "x-ms-structured-body",
+                type: {
+                    name: "String",
+                },
+            },
+            structuredContentLength: {
+                serializedName: "x-ms-structured-content-length",
+                xmlName: "x-ms-structured-content-length",
+                type: {
+                    name: "Number",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            contentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+        },
+    },
+};
+const BlobDownloadExceptionHeaders = {
+    serializedName: "Blob_downloadExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobDownloadExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobGetPropertiesHeaders = {
+    serializedName: "Blob_getPropertiesHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobGetPropertiesHeaders",
+        modelProperties: {
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            createdOn: {
+                serializedName: "x-ms-creation-time",
+                xmlName: "x-ms-creation-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            metadata: {
+                serializedName: "x-ms-meta",
+                headerCollectionPrefix: "x-ms-meta-",
+                xmlName: "x-ms-meta",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            objectReplicationPolicyId: {
+                serializedName: "x-ms-or-policy-id",
+                xmlName: "x-ms-or-policy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            objectReplicationRules: {
+                serializedName: "x-ms-or",
+                headerCollectionPrefix: "x-ms-or-",
+                xmlName: "x-ms-or",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            blobType: {
+                serializedName: "x-ms-blob-type",
+                xmlName: "x-ms-blob-type",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"],
+                },
+            },
+            copyCompletedOn: {
+                serializedName: "x-ms-copy-completion-time",
+                xmlName: "x-ms-copy-completion-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            copyStatusDescription: {
+                serializedName: "x-ms-copy-status-description",
+                xmlName: "x-ms-copy-status-description",
+                type: {
+                    name: "String",
+                },
+            },
+            copyId: {
+                serializedName: "x-ms-copy-id",
+                xmlName: "x-ms-copy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            copyProgress: {
+                serializedName: "x-ms-copy-progress",
+                xmlName: "x-ms-copy-progress",
+                type: {
+                    name: "String",
+                },
+            },
+            copySource: {
+                serializedName: "x-ms-copy-source",
+                xmlName: "x-ms-copy-source",
+                type: {
+                    name: "String",
+                },
+            },
+            copyStatus: {
+                serializedName: "x-ms-copy-status",
+                xmlName: "x-ms-copy-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["pending", "success", "aborted", "failed"],
+                },
+            },
+            isIncrementalCopy: {
+                serializedName: "x-ms-incremental-copy",
+                xmlName: "x-ms-incremental-copy",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            destinationSnapshot: {
+                serializedName: "x-ms-copy-destination-snapshot",
+                xmlName: "x-ms-copy-destination-snapshot",
+                type: {
+                    name: "String",
+                },
+            },
+            leaseDuration: {
+                serializedName: "x-ms-lease-duration",
+                xmlName: "x-ms-lease-duration",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["infinite", "fixed"],
+                },
+            },
+            leaseState: {
+                serializedName: "x-ms-lease-state",
+                xmlName: "x-ms-lease-state",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "available",
+                        "leased",
+                        "expired",
+                        "breaking",
+                        "broken",
+                    ],
+                },
+            },
+            leaseStatus: {
+                serializedName: "x-ms-lease-status",
+                xmlName: "x-ms-lease-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["locked", "unlocked"],
+                },
+            },
+            contentLength: {
+                serializedName: "content-length",
+                xmlName: "content-length",
+                type: {
+                    name: "Number",
+                },
+            },
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            contentEncoding: {
+                serializedName: "content-encoding",
+                xmlName: "content-encoding",
+                type: {
+                    name: "String",
+                },
+            },
+            contentDisposition: {
+                serializedName: "content-disposition",
+                xmlName: "content-disposition",
+                type: {
+                    name: "String",
+                },
+            },
+            contentLanguage: {
+                serializedName: "content-language",
+                xmlName: "content-language",
+                type: {
+                    name: "String",
+                },
+            },
+            cacheControl: {
+                serializedName: "cache-control",
+                xmlName: "cache-control",
+                type: {
+                    name: "String",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            acceptRanges: {
+                serializedName: "accept-ranges",
+                xmlName: "accept-ranges",
+                type: {
+                    name: "String",
+                },
+            },
+            blobCommittedBlockCount: {
+                serializedName: "x-ms-blob-committed-block-count",
+                xmlName: "x-ms-blob-committed-block-count",
+                type: {
+                    name: "Number",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-server-encrypted",
+                xmlName: "x-ms-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            accessTier: {
+                serializedName: "x-ms-access-tier",
+                xmlName: "x-ms-access-tier",
+                type: {
+                    name: "String",
+                },
+            },
+            accessTierInferred: {
+                serializedName: "x-ms-access-tier-inferred",
+                xmlName: "x-ms-access-tier-inferred",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            archiveStatus: {
+                serializedName: "x-ms-archive-status",
+                xmlName: "x-ms-archive-status",
+                type: {
+                    name: "String",
+                },
+            },
+            accessTierChangedOn: {
+                serializedName: "x-ms-access-tier-change-time",
+                xmlName: "x-ms-access-tier-change-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            isCurrentVersion: {
+                serializedName: "x-ms-is-current-version",
+                xmlName: "x-ms-is-current-version",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            tagCount: {
+                serializedName: "x-ms-tag-count",
+                xmlName: "x-ms-tag-count",
+                type: {
+                    name: "Number",
+                },
+            },
+            expiresOn: {
+                serializedName: "x-ms-expiry-time",
+                xmlName: "x-ms-expiry-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isSealed: {
+                serializedName: "x-ms-blob-sealed",
+                xmlName: "x-ms-blob-sealed",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            rehydratePriority: {
+                serializedName: "x-ms-rehydrate-priority",
+                xmlName: "x-ms-rehydrate-priority",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["High", "Standard"],
+                },
+            },
+            lastAccessed: {
+                serializedName: "x-ms-last-access-time",
+                xmlName: "x-ms-last-access-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyExpiresOn: {
+                serializedName: "x-ms-immutability-policy-until-date",
+                xmlName: "x-ms-immutability-policy-until-date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyMode: {
+                serializedName: "x-ms-immutability-policy-mode",
+                xmlName: "x-ms-immutability-policy-mode",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["Mutable", "Unlocked", "Locked"],
+                },
+            },
+            legalHold: {
+                serializedName: "x-ms-legal-hold",
+                xmlName: "x-ms-legal-hold",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobGetPropertiesExceptionHeaders = {
+    serializedName: "Blob_getPropertiesExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobGetPropertiesExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobDeleteHeaders = {
+    serializedName: "Blob_deleteHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobDeleteHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobDeleteExceptionHeaders = {
+    serializedName: "Blob_deleteExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobDeleteExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobUndeleteHeaders = {
+    serializedName: "Blob_undeleteHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobUndeleteHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobUndeleteExceptionHeaders = {
+    serializedName: "Blob_undeleteExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobUndeleteExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetExpiryHeaders = {
+    serializedName: "Blob_setExpiryHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetExpiryHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const BlobSetExpiryExceptionHeaders = {
+    serializedName: "Blob_setExpiryExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetExpiryExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetHttpHeadersHeaders = {
+    serializedName: "Blob_setHttpHeadersHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetHttpHeadersHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetHttpHeadersExceptionHeaders = {
+    serializedName: "Blob_setHttpHeadersExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetHttpHeadersExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetImmutabilityPolicyHeaders = {
+    serializedName: "Blob_setImmutabilityPolicyHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetImmutabilityPolicyHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyExpiry: {
+                serializedName: "x-ms-immutability-policy-until-date",
+                xmlName: "x-ms-immutability-policy-until-date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            immutabilityPolicyMode: {
+                serializedName: "x-ms-immutability-policy-mode",
+                xmlName: "x-ms-immutability-policy-mode",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["Mutable", "Unlocked", "Locked"],
+                },
+            },
+        },
+    },
+};
+const BlobSetImmutabilityPolicyExceptionHeaders = {
+    serializedName: "Blob_setImmutabilityPolicyExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetImmutabilityPolicyExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobDeleteImmutabilityPolicyHeaders = {
+    serializedName: "Blob_deleteImmutabilityPolicyHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobDeleteImmutabilityPolicyHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const BlobDeleteImmutabilityPolicyExceptionHeaders = {
+    serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobDeleteImmutabilityPolicyExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetLegalHoldHeaders = {
+    serializedName: "Blob_setLegalHoldHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetLegalHoldHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            legalHold: {
+                serializedName: "x-ms-legal-hold",
+                xmlName: "x-ms-legal-hold",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const BlobSetLegalHoldExceptionHeaders = {
+    serializedName: "Blob_setLegalHoldExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetLegalHoldExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetMetadataHeaders = {
+    serializedName: "Blob_setMetadataHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetMetadataHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetMetadataExceptionHeaders = {
+    serializedName: "Blob_setMetadataExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetMetadataExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobAcquireLeaseHeaders = {
+    serializedName: "Blob_acquireLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobAcquireLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseId: {
+                serializedName: "x-ms-lease-id",
+                xmlName: "x-ms-lease-id",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const BlobAcquireLeaseExceptionHeaders = {
+    serializedName: "Blob_acquireLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobAcquireLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobReleaseLeaseHeaders = {
+    serializedName: "Blob_releaseLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobReleaseLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const BlobReleaseLeaseExceptionHeaders = {
+    serializedName: "Blob_releaseLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobReleaseLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobRenewLeaseHeaders = {
+    serializedName: "Blob_renewLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobRenewLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseId: {
+                serializedName: "x-ms-lease-id",
+                xmlName: "x-ms-lease-id",
+                type: {
+                    name: "String",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const BlobRenewLeaseExceptionHeaders = {
+    serializedName: "Blob_renewLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobRenewLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobChangeLeaseHeaders = {
+    serializedName: "Blob_changeLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobChangeLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            leaseId: {
+                serializedName: "x-ms-lease-id",
+                xmlName: "x-ms-lease-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const BlobChangeLeaseExceptionHeaders = {
+    serializedName: "Blob_changeLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobChangeLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobBreakLeaseHeaders = {
+    serializedName: "Blob_breakLeaseHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobBreakLeaseHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            leaseTime: {
+                serializedName: "x-ms-lease-time",
+                xmlName: "x-ms-lease-time",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+        },
+    },
+};
+const BlobBreakLeaseExceptionHeaders = {
+    serializedName: "Blob_breakLeaseExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobBreakLeaseExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobCreateSnapshotHeaders = {
+    serializedName: "Blob_createSnapshotHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobCreateSnapshotHeaders",
+        modelProperties: {
+            snapshot: {
+                serializedName: "x-ms-snapshot",
+                xmlName: "x-ms-snapshot",
+                type: {
+                    name: "String",
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobCreateSnapshotExceptionHeaders = {
+    serializedName: "Blob_createSnapshotExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobCreateSnapshotExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobStartCopyFromURLHeaders = {
+    serializedName: "Blob_startCopyFromURLHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobStartCopyFromURLHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            copyId: {
+                serializedName: "x-ms-copy-id",
+                xmlName: "x-ms-copy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            copyStatus: {
+                serializedName: "x-ms-copy-status",
+                xmlName: "x-ms-copy-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["pending", "success", "aborted", "failed"],
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobStartCopyFromURLExceptionHeaders = {
+    serializedName: "Blob_startCopyFromURLExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobStartCopyFromURLExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceErrorCode: {
+                serializedName: "x-ms-copy-source-error-code",
+                xmlName: "x-ms-copy-source-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceStatusCode: {
+                serializedName: "x-ms-copy-source-status-code",
+                xmlName: "x-ms-copy-source-status-code",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const BlobCopyFromURLHeaders = {
+    serializedName: "Blob_copyFromURLHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobCopyFromURLHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            copyId: {
+                serializedName: "x-ms-copy-id",
+                xmlName: "x-ms-copy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            copyStatus: {
+                defaultValue: "success",
+                isConstant: true,
+                serializedName: "x-ms-copy-status",
+                type: {
+                    name: "String",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobCopyFromURLExceptionHeaders = {
+    serializedName: "Blob_copyFromURLExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobCopyFromURLExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceErrorCode: {
+                serializedName: "x-ms-copy-source-error-code",
+                xmlName: "x-ms-copy-source-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceStatusCode: {
+                serializedName: "x-ms-copy-source-status-code",
+                xmlName: "x-ms-copy-source-status-code",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const BlobAbortCopyFromURLHeaders = {
+    serializedName: "Blob_abortCopyFromURLHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobAbortCopyFromURLHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobAbortCopyFromURLExceptionHeaders = {
+    serializedName: "Blob_abortCopyFromURLExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobAbortCopyFromURLExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetTierHeaders = {
+    serializedName: "Blob_setTierHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetTierHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetTierExceptionHeaders = {
+    serializedName: "Blob_setTierExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetTierExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobGetAccountInfoHeaders = {
+    serializedName: "Blob_getAccountInfoHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobGetAccountInfoHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            skuName: {
+                serializedName: "x-ms-sku-name",
+                xmlName: "x-ms-sku-name",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "Standard_LRS",
+                        "Standard_GRS",
+                        "Standard_RAGRS",
+                        "Standard_ZRS",
+                        "Premium_LRS",
+                        "Standard_GZRS",
+                        "Premium_ZRS",
+                        "Standard_RAGZRS",
+                    ],
+                },
+            },
+            accountKind: {
+                serializedName: "x-ms-account-kind",
+                xmlName: "x-ms-account-kind",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "Storage",
+                        "BlobStorage",
+                        "StorageV2",
+                        "FileStorage",
+                        "BlockBlobStorage",
+                    ],
+                },
+            },
+            isHierarchicalNamespaceEnabled: {
+                serializedName: "x-ms-is-hns-enabled",
+                xmlName: "x-ms-is-hns-enabled",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const BlobGetAccountInfoExceptionHeaders = {
+    serializedName: "Blob_getAccountInfoExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobGetAccountInfoExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobQueryHeaders = {
+    serializedName: "Blob_queryHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobQueryHeaders",
+        modelProperties: {
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            metadata: {
+                serializedName: "x-ms-meta",
+                headerCollectionPrefix: "x-ms-meta-",
+                xmlName: "x-ms-meta",
+                type: {
+                    name: "Dictionary",
+                    value: { type: { name: "String" } },
+                },
+            },
+            contentLength: {
+                serializedName: "content-length",
+                xmlName: "content-length",
+                type: {
+                    name: "Number",
+                },
+            },
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            contentRange: {
+                serializedName: "content-range",
+                xmlName: "content-range",
+                type: {
+                    name: "String",
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            contentEncoding: {
+                serializedName: "content-encoding",
+                xmlName: "content-encoding",
+                type: {
+                    name: "String",
+                },
+            },
+            cacheControl: {
+                serializedName: "cache-control",
+                xmlName: "cache-control",
+                type: {
+                    name: "String",
+                },
+            },
+            contentDisposition: {
+                serializedName: "content-disposition",
+                xmlName: "content-disposition",
+                type: {
+                    name: "String",
+                },
+            },
+            contentLanguage: {
+                serializedName: "content-language",
+                xmlName: "content-language",
+                type: {
+                    name: "String",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            blobType: {
+                serializedName: "x-ms-blob-type",
+                xmlName: "x-ms-blob-type",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"],
+                },
+            },
+            copyCompletionTime: {
+                serializedName: "x-ms-copy-completion-time",
+                xmlName: "x-ms-copy-completion-time",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            copyStatusDescription: {
+                serializedName: "x-ms-copy-status-description",
+                xmlName: "x-ms-copy-status-description",
+                type: {
+                    name: "String",
+                },
+            },
+            copyId: {
+                serializedName: "x-ms-copy-id",
+                xmlName: "x-ms-copy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            copyProgress: {
+                serializedName: "x-ms-copy-progress",
+                xmlName: "x-ms-copy-progress",
+                type: {
+                    name: "String",
+                },
+            },
+            copySource: {
+                serializedName: "x-ms-copy-source",
+                xmlName: "x-ms-copy-source",
+                type: {
+                    name: "String",
+                },
+            },
+            copyStatus: {
+                serializedName: "x-ms-copy-status",
+                xmlName: "x-ms-copy-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["pending", "success", "aborted", "failed"],
+                },
+            },
+            leaseDuration: {
+                serializedName: "x-ms-lease-duration",
+                xmlName: "x-ms-lease-duration",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["infinite", "fixed"],
+                },
+            },
+            leaseState: {
+                serializedName: "x-ms-lease-state",
+                xmlName: "x-ms-lease-state",
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "available",
+                        "leased",
+                        "expired",
+                        "breaking",
+                        "broken",
+                    ],
+                },
+            },
+            leaseStatus: {
+                serializedName: "x-ms-lease-status",
+                xmlName: "x-ms-lease-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["locked", "unlocked"],
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            acceptRanges: {
+                serializedName: "accept-ranges",
+                xmlName: "accept-ranges",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobCommittedBlockCount: {
+                serializedName: "x-ms-blob-committed-block-count",
+                xmlName: "x-ms-blob-committed-block-count",
+                type: {
+                    name: "Number",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-server-encrypted",
+                xmlName: "x-ms-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            blobContentMD5: {
+                serializedName: "x-ms-blob-content-md5",
+                xmlName: "x-ms-blob-content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            contentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+        },
+    },
+};
+const BlobQueryExceptionHeaders = {
+    serializedName: "Blob_queryExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobQueryExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobGetTagsHeaders = {
+    serializedName: "Blob_getTagsHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobGetTagsHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobGetTagsExceptionHeaders = {
+    serializedName: "Blob_getTagsExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobGetTagsExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetTagsHeaders = {
+    serializedName: "Blob_setTagsHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetTagsHeaders",
+        modelProperties: {
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlobSetTagsExceptionHeaders = {
+    serializedName: "Blob_setTagsExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlobSetTagsExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobCreateHeaders = {
+    serializedName: "PageBlob_createHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobCreateHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobCreateExceptionHeaders = {
+    serializedName: "PageBlob_createExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobCreateExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobUploadPagesHeaders = {
+    serializedName: "PageBlob_uploadPagesHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobUploadPagesHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            structuredBodyType: {
+                serializedName: "x-ms-structured-body",
+                xmlName: "x-ms-structured-body",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobUploadPagesExceptionHeaders = {
+    serializedName: "PageBlob_uploadPagesExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobUploadPagesExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobClearPagesHeaders = {
+    serializedName: "PageBlob_clearPagesHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobClearPagesHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobClearPagesExceptionHeaders = {
+    serializedName: "PageBlob_clearPagesExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobClearPagesExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobUploadPagesFromURLHeaders = {
+    serializedName: "PageBlob_uploadPagesFromURLHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobUploadPagesFromURLHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobUploadPagesFromURLExceptionHeaders = {
+    serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobUploadPagesFromURLExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceErrorCode: {
+                serializedName: "x-ms-copy-source-error-code",
+                xmlName: "x-ms-copy-source-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceStatusCode: {
+                serializedName: "x-ms-copy-source-status-code",
+                xmlName: "x-ms-copy-source-status-code",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const PageBlobGetPageRangesHeaders = {
+    serializedName: "PageBlob_getPageRangesHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobGetPageRangesHeaders",
+        modelProperties: {
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            blobContentLength: {
+                serializedName: "x-ms-blob-content-length",
+                xmlName: "x-ms-blob-content-length",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobGetPageRangesExceptionHeaders = {
+    serializedName: "PageBlob_getPageRangesExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobGetPageRangesExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobGetPageRangesDiffHeaders = {
+    serializedName: "PageBlob_getPageRangesDiffHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobGetPageRangesDiffHeaders",
+        modelProperties: {
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            blobContentLength: {
+                serializedName: "x-ms-blob-content-length",
+                xmlName: "x-ms-blob-content-length",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobGetPageRangesDiffExceptionHeaders = {
+    serializedName: "PageBlob_getPageRangesDiffExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobGetPageRangesDiffExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobResizeHeaders = {
+    serializedName: "PageBlob_resizeHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobResizeHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobResizeExceptionHeaders = {
+    serializedName: "PageBlob_resizeExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobResizeExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobUpdateSequenceNumberHeaders = {
+    serializedName: "PageBlob_updateSequenceNumberHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobUpdateSequenceNumberHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobSequenceNumber: {
+                serializedName: "x-ms-blob-sequence-number",
+                xmlName: "x-ms-blob-sequence-number",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobUpdateSequenceNumberExceptionHeaders = {
+    serializedName: "PageBlob_updateSequenceNumberExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobUpdateSequenceNumberExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobCopyIncrementalHeaders = {
+    serializedName: "PageBlob_copyIncrementalHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobCopyIncrementalHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            copyId: {
+                serializedName: "x-ms-copy-id",
+                xmlName: "x-ms-copy-id",
+                type: {
+                    name: "String",
+                },
+            },
+            copyStatus: {
+                serializedName: "x-ms-copy-status",
+                xmlName: "x-ms-copy-status",
+                type: {
+                    name: "Enum",
+                    allowedValues: ["pending", "success", "aborted", "failed"],
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const PageBlobCopyIncrementalExceptionHeaders = {
+    serializedName: "PageBlob_copyIncrementalExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "PageBlobCopyIncrementalExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const AppendBlobCreateHeaders = {
+    serializedName: "AppendBlob_createHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobCreateHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const AppendBlobCreateExceptionHeaders = {
+    serializedName: "AppendBlob_createExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobCreateExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const AppendBlobAppendBlockHeaders = {
+    serializedName: "AppendBlob_appendBlockHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobAppendBlockHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobAppendOffset: {
+                serializedName: "x-ms-blob-append-offset",
+                xmlName: "x-ms-blob-append-offset",
+                type: {
+                    name: "String",
+                },
+            },
+            blobCommittedBlockCount: {
+                serializedName: "x-ms-blob-committed-block-count",
+                xmlName: "x-ms-blob-committed-block-count",
+                type: {
+                    name: "Number",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            structuredBodyType: {
+                serializedName: "x-ms-structured-body",
+                xmlName: "x-ms-structured-body",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const AppendBlobAppendBlockExceptionHeaders = {
+    serializedName: "AppendBlob_appendBlockExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobAppendBlockExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const AppendBlobAppendBlockFromUrlHeaders = {
+    serializedName: "AppendBlob_appendBlockFromUrlHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobAppendBlockFromUrlHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            blobAppendOffset: {
+                serializedName: "x-ms-blob-append-offset",
+                xmlName: "x-ms-blob-append-offset",
+                type: {
+                    name: "String",
+                },
+            },
+            blobCommittedBlockCount: {
+                serializedName: "x-ms-blob-committed-block-count",
+                xmlName: "x-ms-blob-committed-block-count",
+                type: {
+                    name: "Number",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const AppendBlobAppendBlockFromUrlExceptionHeaders = {
+    serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobAppendBlockFromUrlExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceErrorCode: {
+                serializedName: "x-ms-copy-source-error-code",
+                xmlName: "x-ms-copy-source-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceStatusCode: {
+                serializedName: "x-ms-copy-source-status-code",
+                xmlName: "x-ms-copy-source-status-code",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const AppendBlobSealHeaders = {
+    serializedName: "AppendBlob_sealHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobSealHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isSealed: {
+                serializedName: "x-ms-blob-sealed",
+                xmlName: "x-ms-blob-sealed",
+                type: {
+                    name: "Boolean",
+                },
+            },
+        },
+    },
+};
+const AppendBlobSealExceptionHeaders = {
+    serializedName: "AppendBlob_sealExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "AppendBlobSealExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobUploadHeaders = {
+    serializedName: "BlockBlob_uploadHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobUploadHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            structuredBodyType: {
+                serializedName: "x-ms-structured-body",
+                xmlName: "x-ms-structured-body",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobUploadExceptionHeaders = {
+    serializedName: "BlockBlob_uploadExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobUploadExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobPutBlobFromUrlHeaders = {
+    serializedName: "BlockBlob_putBlobFromUrlHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobPutBlobFromUrlHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobPutBlobFromUrlExceptionHeaders = {
+    serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobPutBlobFromUrlExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceErrorCode: {
+                serializedName: "x-ms-copy-source-error-code",
+                xmlName: "x-ms-copy-source-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceStatusCode: {
+                serializedName: "x-ms-copy-source-status-code",
+                xmlName: "x-ms-copy-source-status-code",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const BlockBlobStageBlockHeaders = {
+    serializedName: "BlockBlob_stageBlockHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobStageBlockHeaders",
+        modelProperties: {
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            structuredBodyType: {
+                serializedName: "x-ms-structured-body",
+                xmlName: "x-ms-structured-body",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobStageBlockExceptionHeaders = {
+    serializedName: "BlockBlob_stageBlockExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobStageBlockExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobStageBlockFromURLHeaders = {
+    serializedName: "BlockBlob_stageBlockFromURLHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobStageBlockFromURLHeaders",
+        modelProperties: {
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobStageBlockFromURLExceptionHeaders = {
+    serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobStageBlockFromURLExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceErrorCode: {
+                serializedName: "x-ms-copy-source-error-code",
+                xmlName: "x-ms-copy-source-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+            copySourceStatusCode: {
+                serializedName: "x-ms-copy-source-status-code",
+                xmlName: "x-ms-copy-source-status-code",
+                type: {
+                    name: "Number",
+                },
+            },
+        },
+    },
+};
+const BlockBlobCommitBlockListHeaders = {
+    serializedName: "BlockBlob_commitBlockListHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobCommitBlockListHeaders",
+        modelProperties: {
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            contentMD5: {
+                serializedName: "content-md5",
+                xmlName: "content-md5",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            xMsContentCrc64: {
+                serializedName: "x-ms-content-crc64",
+                xmlName: "x-ms-content-crc64",
+                type: {
+                    name: "ByteArray",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            versionId: {
+                serializedName: "x-ms-version-id",
+                xmlName: "x-ms-version-id",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            isServerEncrypted: {
+                serializedName: "x-ms-request-server-encrypted",
+                xmlName: "x-ms-request-server-encrypted",
+                type: {
+                    name: "Boolean",
+                },
+            },
+            encryptionKeySha256: {
+                serializedName: "x-ms-encryption-key-sha256",
+                xmlName: "x-ms-encryption-key-sha256",
+                type: {
+                    name: "String",
+                },
+            },
+            encryptionScope: {
+                serializedName: "x-ms-encryption-scope",
+                xmlName: "x-ms-encryption-scope",
+                type: {
+                    name: "String",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobCommitBlockListExceptionHeaders = {
+    serializedName: "BlockBlob_commitBlockListExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobCommitBlockListExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobGetBlockListHeaders = {
+    serializedName: "BlockBlob_getBlockListHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobGetBlockListHeaders",
+        modelProperties: {
+            lastModified: {
+                serializedName: "last-modified",
+                xmlName: "last-modified",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            etag: {
+                serializedName: "etag",
+                xmlName: "etag",
+                type: {
+                    name: "String",
+                },
+            },
+            contentType: {
+                serializedName: "content-type",
+                xmlName: "content-type",
+                type: {
+                    name: "String",
+                },
+            },
+            blobContentLength: {
+                serializedName: "x-ms-blob-content-length",
+                xmlName: "x-ms-blob-content-length",
+                type: {
+                    name: "Number",
+                },
+            },
+            clientRequestId: {
+                serializedName: "x-ms-client-request-id",
+                xmlName: "x-ms-client-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            requestId: {
+                serializedName: "x-ms-request-id",
+                xmlName: "x-ms-request-id",
+                type: {
+                    name: "String",
+                },
+            },
+            version: {
+                serializedName: "x-ms-version",
+                xmlName: "x-ms-version",
+                type: {
+                    name: "String",
+                },
+            },
+            date: {
+                serializedName: "date",
+                xmlName: "date",
+                type: {
+                    name: "DateTimeRfc1123",
+                },
+            },
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+const BlockBlobGetBlockListExceptionHeaders = {
+    serializedName: "BlockBlob_getBlockListExceptionHeaders",
+    type: {
+        name: "Composite",
+        className: "BlockBlobGetBlockListExceptionHeaders",
+        modelProperties: {
+            errorCode: {
+                serializedName: "x-ms-error-code",
+                xmlName: "x-ms-error-code",
+                type: {
+                    name: "String",
+                },
+            },
+        },
+    },
+};
+//# sourceMappingURL=mappers.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/models/parameters.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
-exports.composeDoc = composeDoc;
-
-
-/***/ }),
-
-/***/ 45937:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var Alias = __nccwpck_require__(4065);
-var identity = __nccwpck_require__(41127);
-var composeCollection = __nccwpck_require__(57349);
-var composeScalar = __nccwpck_require__(5413);
-var resolveEnd = __nccwpck_require__(17788);
-var utilEmptyScalarPosition = __nccwpck_require__(22599);
-
-const CN = { composeNode, composeEmptyNode };
-function composeNode(ctx, token, props, onError) {
-    const atKey = ctx.atKey;
-    const { spaceBefore, comment, anchor, tag } = props;
-    let node;
-    let isSrcToken = true;
-    switch (token.type) {
-        case 'alias':
-            node = composeAlias(ctx, token, onError);
-            if (anchor || tag)
-                onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');
-            break;
-        case 'scalar':
-        case 'single-quoted-scalar':
-        case 'double-quoted-scalar':
-        case 'block-scalar':
-            node = composeScalar.composeScalar(ctx, token, tag, onError);
-            if (anchor)
-                node.anchor = anchor.source.substring(1);
-            break;
-        case 'block-map':
-        case 'block-seq':
-        case 'flow-collection':
-            try {
-                node = composeCollection.composeCollection(CN, ctx, token, props, onError);
-                if (anchor)
-                    node.anchor = anchor.source.substring(1);
-            }
-            catch (error) {
-                // Almost certainly here due to a stack overflow
-                const message = error instanceof Error ? error.message : String(error);
-                onError(token, 'RESOURCE_EXHAUSTION', message);
-            }
-            break;
-        default: {
-            const message = token.type === 'error'
-                ? token.message
-                : `Unsupported token (type: ${token.type})`;
-            onError(token, 'UNEXPECTED_TOKEN', message);
-            isSrcToken = false;
-        }
+const contentType = {
+    parameterPath: ["options", "contentType"],
+    mapper: {
+        defaultValue: "application/xml",
+        isConstant: true,
+        serializedName: "Content-Type",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobServiceProperties = {
+    parameterPath: "blobServiceProperties",
+    mapper: BlobServiceProperties,
+};
+const accept = {
+    parameterPath: "accept",
+    mapper: {
+        defaultValue: "application/xml",
+        isConstant: true,
+        serializedName: "Accept",
+        type: {
+            name: "String",
+        },
+    },
+};
+const url = {
+    parameterPath: "url",
+    mapper: {
+        serializedName: "url",
+        required: true,
+        xmlName: "url",
+        type: {
+            name: "String",
+        },
+    },
+    skipEncoding: true,
+};
+const restype = {
+    parameterPath: "restype",
+    mapper: {
+        defaultValue: "service",
+        isConstant: true,
+        serializedName: "restype",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "properties",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const timeoutInSeconds = {
+    parameterPath: ["options", "timeoutInSeconds"],
+    mapper: {
+        constraints: {
+            InclusiveMinimum: 0,
+        },
+        serializedName: "timeout",
+        xmlName: "timeout",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const version = {
+    parameterPath: "version",
+    mapper: {
+        defaultValue: "2026-04-06",
+        isConstant: true,
+        serializedName: "x-ms-version",
+        type: {
+            name: "String",
+        },
+    },
+};
+const requestId = {
+    parameterPath: ["options", "requestId"],
+    mapper: {
+        serializedName: "x-ms-client-request-id",
+        xmlName: "x-ms-client-request-id",
+        type: {
+            name: "String",
+        },
+    },
+};
+const accept1 = {
+    parameterPath: "accept",
+    mapper: {
+        defaultValue: "application/xml",
+        isConstant: true,
+        serializedName: "Accept",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp1 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "stats",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp2 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "list",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const prefix = {
+    parameterPath: ["options", "prefix"],
+    mapper: {
+        serializedName: "prefix",
+        xmlName: "prefix",
+        type: {
+            name: "String",
+        },
+    },
+};
+const marker = {
+    parameterPath: ["options", "marker"],
+    mapper: {
+        serializedName: "marker",
+        xmlName: "marker",
+        type: {
+            name: "String",
+        },
+    },
+};
+const maxPageSize = {
+    parameterPath: ["options", "maxPageSize"],
+    mapper: {
+        constraints: {
+            InclusiveMinimum: 1,
+        },
+        serializedName: "maxresults",
+        xmlName: "maxresults",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const include = {
+    parameterPath: ["options", "include"],
+    mapper: {
+        serializedName: "include",
+        xmlName: "include",
+        xmlElementName: "ListContainersIncludeType",
+        type: {
+            name: "Sequence",
+            element: {
+                type: {
+                    name: "Enum",
+                    allowedValues: ["metadata", "deleted", "system"],
+                },
+            },
+        },
+    },
+    collectionFormat: "CSV",
+};
+const keyInfo = {
+    parameterPath: "keyInfo",
+    mapper: KeyInfo,
+};
+const comp3 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "userdelegationkey",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const restype1 = {
+    parameterPath: "restype",
+    mapper: {
+        defaultValue: "account",
+        isConstant: true,
+        serializedName: "restype",
+        type: {
+            name: "String",
+        },
+    },
+};
+const body = {
+    parameterPath: "body",
+    mapper: {
+        serializedName: "body",
+        required: true,
+        xmlName: "body",
+        type: {
+            name: "Stream",
+        },
+    },
+};
+const comp4 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "batch",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const contentLength = {
+    parameterPath: "contentLength",
+    mapper: {
+        serializedName: "Content-Length",
+        required: true,
+        xmlName: "Content-Length",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const multipartContentType = {
+    parameterPath: "multipartContentType",
+    mapper: {
+        serializedName: "Content-Type",
+        required: true,
+        xmlName: "Content-Type",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp5 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "blobs",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const where = {
+    parameterPath: ["options", "where"],
+    mapper: {
+        serializedName: "where",
+        xmlName: "where",
+        type: {
+            name: "String",
+        },
+    },
+};
+const restype2 = {
+    parameterPath: "restype",
+    mapper: {
+        defaultValue: "container",
+        isConstant: true,
+        serializedName: "restype",
+        type: {
+            name: "String",
+        },
+    },
+};
+const metadata = {
+    parameterPath: ["options", "metadata"],
+    mapper: {
+        serializedName: "x-ms-meta",
+        xmlName: "x-ms-meta",
+        headerCollectionPrefix: "x-ms-meta-",
+        type: {
+            name: "Dictionary",
+            value: { type: { name: "String" } },
+        },
+    },
+};
+const parameters_access = {
+    parameterPath: ["options", "access"],
+    mapper: {
+        serializedName: "x-ms-blob-public-access",
+        xmlName: "x-ms-blob-public-access",
+        type: {
+            name: "Enum",
+            allowedValues: ["container", "blob"],
+        },
+    },
+};
+const defaultEncryptionScope = {
+    parameterPath: [
+        "options",
+        "containerEncryptionScope",
+        "defaultEncryptionScope",
+    ],
+    mapper: {
+        serializedName: "x-ms-default-encryption-scope",
+        xmlName: "x-ms-default-encryption-scope",
+        type: {
+            name: "String",
+        },
+    },
+};
+const preventEncryptionScopeOverride = {
+    parameterPath: [
+        "options",
+        "containerEncryptionScope",
+        "preventEncryptionScopeOverride",
+    ],
+    mapper: {
+        serializedName: "x-ms-deny-encryption-scope-override",
+        xmlName: "x-ms-deny-encryption-scope-override",
+        type: {
+            name: "Boolean",
+        },
+    },
+};
+const leaseId = {
+    parameterPath: ["options", "leaseAccessConditions", "leaseId"],
+    mapper: {
+        serializedName: "x-ms-lease-id",
+        xmlName: "x-ms-lease-id",
+        type: {
+            name: "String",
+        },
+    },
+};
+const ifModifiedSince = {
+    parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"],
+    mapper: {
+        serializedName: "If-Modified-Since",
+        xmlName: "If-Modified-Since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const ifUnmodifiedSince = {
+    parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"],
+    mapper: {
+        serializedName: "If-Unmodified-Since",
+        xmlName: "If-Unmodified-Since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const comp6 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "metadata",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp7 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "acl",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const containerAcl = {
+    parameterPath: ["options", "containerAcl"],
+    mapper: {
+        serializedName: "containerAcl",
+        xmlName: "SignedIdentifiers",
+        xmlIsWrapped: true,
+        xmlElementName: "SignedIdentifier",
+        type: {
+            name: "Sequence",
+            element: {
+                type: {
+                    name: "Composite",
+                    className: "SignedIdentifier",
+                },
+            },
+        },
+    },
+};
+const comp8 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "undelete",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const deletedContainerName = {
+    parameterPath: ["options", "deletedContainerName"],
+    mapper: {
+        serializedName: "x-ms-deleted-container-name",
+        xmlName: "x-ms-deleted-container-name",
+        type: {
+            name: "String",
+        },
+    },
+};
+const deletedContainerVersion = {
+    parameterPath: ["options", "deletedContainerVersion"],
+    mapper: {
+        serializedName: "x-ms-deleted-container-version",
+        xmlName: "x-ms-deleted-container-version",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp9 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "rename",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceContainerName = {
+    parameterPath: "sourceContainerName",
+    mapper: {
+        serializedName: "x-ms-source-container-name",
+        required: true,
+        xmlName: "x-ms-source-container-name",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceLeaseId = {
+    parameterPath: ["options", "sourceLeaseId"],
+    mapper: {
+        serializedName: "x-ms-source-lease-id",
+        xmlName: "x-ms-source-lease-id",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp10 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "lease",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const action = {
+    parameterPath: "action",
+    mapper: {
+        defaultValue: "acquire",
+        isConstant: true,
+        serializedName: "x-ms-lease-action",
+        type: {
+            name: "String",
+        },
+    },
+};
+const duration = {
+    parameterPath: ["options", "duration"],
+    mapper: {
+        serializedName: "x-ms-lease-duration",
+        xmlName: "x-ms-lease-duration",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const proposedLeaseId = {
+    parameterPath: ["options", "proposedLeaseId"],
+    mapper: {
+        serializedName: "x-ms-proposed-lease-id",
+        xmlName: "x-ms-proposed-lease-id",
+        type: {
+            name: "String",
+        },
+    },
+};
+const action1 = {
+    parameterPath: "action",
+    mapper: {
+        defaultValue: "release",
+        isConstant: true,
+        serializedName: "x-ms-lease-action",
+        type: {
+            name: "String",
+        },
+    },
+};
+const leaseId1 = {
+    parameterPath: "leaseId",
+    mapper: {
+        serializedName: "x-ms-lease-id",
+        required: true,
+        xmlName: "x-ms-lease-id",
+        type: {
+            name: "String",
+        },
+    },
+};
+const action2 = {
+    parameterPath: "action",
+    mapper: {
+        defaultValue: "renew",
+        isConstant: true,
+        serializedName: "x-ms-lease-action",
+        type: {
+            name: "String",
+        },
+    },
+};
+const action3 = {
+    parameterPath: "action",
+    mapper: {
+        defaultValue: "break",
+        isConstant: true,
+        serializedName: "x-ms-lease-action",
+        type: {
+            name: "String",
+        },
+    },
+};
+const breakPeriod = {
+    parameterPath: ["options", "breakPeriod"],
+    mapper: {
+        serializedName: "x-ms-lease-break-period",
+        xmlName: "x-ms-lease-break-period",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const action4 = {
+    parameterPath: "action",
+    mapper: {
+        defaultValue: "change",
+        isConstant: true,
+        serializedName: "x-ms-lease-action",
+        type: {
+            name: "String",
+        },
+    },
+};
+const proposedLeaseId1 = {
+    parameterPath: "proposedLeaseId",
+    mapper: {
+        serializedName: "x-ms-proposed-lease-id",
+        required: true,
+        xmlName: "x-ms-proposed-lease-id",
+        type: {
+            name: "String",
+        },
+    },
+};
+const include1 = {
+    parameterPath: ["options", "include"],
+    mapper: {
+        serializedName: "include",
+        xmlName: "include",
+        xmlElementName: "ListBlobsIncludeItem",
+        type: {
+            name: "Sequence",
+            element: {
+                type: {
+                    name: "Enum",
+                    allowedValues: [
+                        "copy",
+                        "deleted",
+                        "metadata",
+                        "snapshots",
+                        "uncommittedblobs",
+                        "versions",
+                        "tags",
+                        "immutabilitypolicy",
+                        "legalhold",
+                        "deletedwithversions",
+                    ],
+                },
+            },
+        },
+    },
+    collectionFormat: "CSV",
+};
+const startFrom = {
+    parameterPath: ["options", "startFrom"],
+    mapper: {
+        serializedName: "startFrom",
+        xmlName: "startFrom",
+        type: {
+            name: "String",
+        },
+    },
+};
+const delimiter = {
+    parameterPath: "delimiter",
+    mapper: {
+        serializedName: "delimiter",
+        required: true,
+        xmlName: "delimiter",
+        type: {
+            name: "String",
+        },
+    },
+};
+const snapshot = {
+    parameterPath: ["options", "snapshot"],
+    mapper: {
+        serializedName: "snapshot",
+        xmlName: "snapshot",
+        type: {
+            name: "String",
+        },
+    },
+};
+const versionId = {
+    parameterPath: ["options", "versionId"],
+    mapper: {
+        serializedName: "versionid",
+        xmlName: "versionid",
+        type: {
+            name: "String",
+        },
+    },
+};
+const range = {
+    parameterPath: ["options", "range"],
+    mapper: {
+        serializedName: "x-ms-range",
+        xmlName: "x-ms-range",
+        type: {
+            name: "String",
+        },
+    },
+};
+const rangeGetContentMD5 = {
+    parameterPath: ["options", "rangeGetContentMD5"],
+    mapper: {
+        serializedName: "x-ms-range-get-content-md5",
+        xmlName: "x-ms-range-get-content-md5",
+        type: {
+            name: "Boolean",
+        },
+    },
+};
+const rangeGetContentCRC64 = {
+    parameterPath: ["options", "rangeGetContentCRC64"],
+    mapper: {
+        serializedName: "x-ms-range-get-content-crc64",
+        xmlName: "x-ms-range-get-content-crc64",
+        type: {
+            name: "Boolean",
+        },
+    },
+};
+const structuredBodyType = {
+    parameterPath: ["options", "structuredBodyType"],
+    mapper: {
+        serializedName: "x-ms-structured-body",
+        xmlName: "x-ms-structured-body",
+        type: {
+            name: "String",
+        },
+    },
+};
+const encryptionKey = {
+    parameterPath: ["options", "cpkInfo", "encryptionKey"],
+    mapper: {
+        serializedName: "x-ms-encryption-key",
+        xmlName: "x-ms-encryption-key",
+        type: {
+            name: "String",
+        },
+    },
+};
+const encryptionKeySha256 = {
+    parameterPath: ["options", "cpkInfo", "encryptionKeySha256"],
+    mapper: {
+        serializedName: "x-ms-encryption-key-sha256",
+        xmlName: "x-ms-encryption-key-sha256",
+        type: {
+            name: "String",
+        },
+    },
+};
+const encryptionAlgorithm = {
+    parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"],
+    mapper: {
+        serializedName: "x-ms-encryption-algorithm",
+        xmlName: "x-ms-encryption-algorithm",
+        type: {
+            name: "String",
+        },
+    },
+};
+const ifMatch = {
+    parameterPath: ["options", "modifiedAccessConditions", "ifMatch"],
+    mapper: {
+        serializedName: "If-Match",
+        xmlName: "If-Match",
+        type: {
+            name: "String",
+        },
+    },
+};
+const ifNoneMatch = {
+    parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"],
+    mapper: {
+        serializedName: "If-None-Match",
+        xmlName: "If-None-Match",
+        type: {
+            name: "String",
+        },
+    },
+};
+const ifTags = {
+    parameterPath: ["options", "modifiedAccessConditions", "ifTags"],
+    mapper: {
+        serializedName: "x-ms-if-tags",
+        xmlName: "x-ms-if-tags",
+        type: {
+            name: "String",
+        },
+    },
+};
+const deleteSnapshots = {
+    parameterPath: ["options", "deleteSnapshots"],
+    mapper: {
+        serializedName: "x-ms-delete-snapshots",
+        xmlName: "x-ms-delete-snapshots",
+        type: {
+            name: "Enum",
+            allowedValues: ["include", "only"],
+        },
+    },
+};
+const blobDeleteType = {
+    parameterPath: ["options", "blobDeleteType"],
+    mapper: {
+        serializedName: "deletetype",
+        xmlName: "deletetype",
+        type: {
+            name: "String",
+        },
+    },
+};
+const accessTierIfModifiedSince = {
+    parameterPath: ["options", "accessTierIfModifiedSince"],
+    mapper: {
+        serializedName: "x-ms-access-tier-if-modified-since",
+        xmlName: "x-ms-access-tier-if-modified-since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const accessTierIfUnmodifiedSince = {
+    parameterPath: ["options", "accessTierIfUnmodifiedSince"],
+    mapper: {
+        serializedName: "x-ms-access-tier-if-unmodified-since",
+        xmlName: "x-ms-access-tier-if-unmodified-since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const comp11 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "expiry",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const expiryOptions = {
+    parameterPath: "expiryOptions",
+    mapper: {
+        serializedName: "x-ms-expiry-option",
+        required: true,
+        xmlName: "x-ms-expiry-option",
+        type: {
+            name: "String",
+        },
+    },
+};
+const expiresOn = {
+    parameterPath: ["options", "expiresOn"],
+    mapper: {
+        serializedName: "x-ms-expiry-time",
+        xmlName: "x-ms-expiry-time",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobCacheControl = {
+    parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"],
+    mapper: {
+        serializedName: "x-ms-blob-cache-control",
+        xmlName: "x-ms-blob-cache-control",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobContentType = {
+    parameterPath: ["options", "blobHttpHeaders", "blobContentType"],
+    mapper: {
+        serializedName: "x-ms-blob-content-type",
+        xmlName: "x-ms-blob-content-type",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobContentMD5 = {
+    parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"],
+    mapper: {
+        serializedName: "x-ms-blob-content-md5",
+        xmlName: "x-ms-blob-content-md5",
+        type: {
+            name: "ByteArray",
+        },
+    },
+};
+const blobContentEncoding = {
+    parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"],
+    mapper: {
+        serializedName: "x-ms-blob-content-encoding",
+        xmlName: "x-ms-blob-content-encoding",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobContentLanguage = {
+    parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"],
+    mapper: {
+        serializedName: "x-ms-blob-content-language",
+        xmlName: "x-ms-blob-content-language",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobContentDisposition = {
+    parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"],
+    mapper: {
+        serializedName: "x-ms-blob-content-disposition",
+        xmlName: "x-ms-blob-content-disposition",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp12 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "immutabilityPolicies",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const immutabilityPolicyExpiry = {
+    parameterPath: ["options", "immutabilityPolicyExpiry"],
+    mapper: {
+        serializedName: "x-ms-immutability-policy-until-date",
+        xmlName: "x-ms-immutability-policy-until-date",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const immutabilityPolicyMode = {
+    parameterPath: ["options", "immutabilityPolicyMode"],
+    mapper: {
+        serializedName: "x-ms-immutability-policy-mode",
+        xmlName: "x-ms-immutability-policy-mode",
+        type: {
+            name: "Enum",
+            allowedValues: ["Mutable", "Unlocked", "Locked"],
+        },
+    },
+};
+const comp13 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "legalhold",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const legalHold = {
+    parameterPath: "legalHold",
+    mapper: {
+        serializedName: "x-ms-legal-hold",
+        required: true,
+        xmlName: "x-ms-legal-hold",
+        type: {
+            name: "Boolean",
+        },
+    },
+};
+const encryptionScope = {
+    parameterPath: ["options", "encryptionScope"],
+    mapper: {
+        serializedName: "x-ms-encryption-scope",
+        xmlName: "x-ms-encryption-scope",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp14 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "snapshot",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const tier = {
+    parameterPath: ["options", "tier"],
+    mapper: {
+        serializedName: "x-ms-access-tier",
+        xmlName: "x-ms-access-tier",
+        type: {
+            name: "Enum",
+            allowedValues: [
+                "P4",
+                "P6",
+                "P10",
+                "P15",
+                "P20",
+                "P30",
+                "P40",
+                "P50",
+                "P60",
+                "P70",
+                "P80",
+                "Hot",
+                "Cool",
+                "Archive",
+                "Cold",
+            ],
+        },
+    },
+};
+const rehydratePriority = {
+    parameterPath: ["options", "rehydratePriority"],
+    mapper: {
+        serializedName: "x-ms-rehydrate-priority",
+        xmlName: "x-ms-rehydrate-priority",
+        type: {
+            name: "Enum",
+            allowedValues: ["High", "Standard"],
+        },
+    },
+};
+const sourceIfModifiedSince = {
+    parameterPath: [
+        "options",
+        "sourceModifiedAccessConditions",
+        "sourceIfModifiedSince",
+    ],
+    mapper: {
+        serializedName: "x-ms-source-if-modified-since",
+        xmlName: "x-ms-source-if-modified-since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const sourceIfUnmodifiedSince = {
+    parameterPath: [
+        "options",
+        "sourceModifiedAccessConditions",
+        "sourceIfUnmodifiedSince",
+    ],
+    mapper: {
+        serializedName: "x-ms-source-if-unmodified-since",
+        xmlName: "x-ms-source-if-unmodified-since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const sourceIfMatch = {
+    parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"],
+    mapper: {
+        serializedName: "x-ms-source-if-match",
+        xmlName: "x-ms-source-if-match",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceIfNoneMatch = {
+    parameterPath: [
+        "options",
+        "sourceModifiedAccessConditions",
+        "sourceIfNoneMatch",
+    ],
+    mapper: {
+        serializedName: "x-ms-source-if-none-match",
+        xmlName: "x-ms-source-if-none-match",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceIfTags = {
+    parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"],
+    mapper: {
+        serializedName: "x-ms-source-if-tags",
+        xmlName: "x-ms-source-if-tags",
+        type: {
+            name: "String",
+        },
+    },
+};
+const copySource = {
+    parameterPath: "copySource",
+    mapper: {
+        serializedName: "x-ms-copy-source",
+        required: true,
+        xmlName: "x-ms-copy-source",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobTagsString = {
+    parameterPath: ["options", "blobTagsString"],
+    mapper: {
+        serializedName: "x-ms-tags",
+        xmlName: "x-ms-tags",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sealBlob = {
+    parameterPath: ["options", "sealBlob"],
+    mapper: {
+        serializedName: "x-ms-seal-blob",
+        xmlName: "x-ms-seal-blob",
+        type: {
+            name: "Boolean",
+        },
+    },
+};
+const legalHold1 = {
+    parameterPath: ["options", "legalHold"],
+    mapper: {
+        serializedName: "x-ms-legal-hold",
+        xmlName: "x-ms-legal-hold",
+        type: {
+            name: "Boolean",
+        },
+    },
+};
+const xMsRequiresSync = {
+    parameterPath: "xMsRequiresSync",
+    mapper: {
+        defaultValue: "true",
+        isConstant: true,
+        serializedName: "x-ms-requires-sync",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceContentMD5 = {
+    parameterPath: ["options", "sourceContentMD5"],
+    mapper: {
+        serializedName: "x-ms-source-content-md5",
+        xmlName: "x-ms-source-content-md5",
+        type: {
+            name: "ByteArray",
+        },
+    },
+};
+const copySourceAuthorization = {
+    parameterPath: ["options", "copySourceAuthorization"],
+    mapper: {
+        serializedName: "x-ms-copy-source-authorization",
+        xmlName: "x-ms-copy-source-authorization",
+        type: {
+            name: "String",
+        },
+    },
+};
+const copySourceTags = {
+    parameterPath: ["options", "copySourceTags"],
+    mapper: {
+        serializedName: "x-ms-copy-source-tag-option",
+        xmlName: "x-ms-copy-source-tag-option",
+        type: {
+            name: "Enum",
+            allowedValues: ["REPLACE", "COPY"],
+        },
+    },
+};
+const fileRequestIntent = {
+    parameterPath: ["options", "fileRequestIntent"],
+    mapper: {
+        serializedName: "x-ms-file-request-intent",
+        xmlName: "x-ms-file-request-intent",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp15 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "copy",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const copyActionAbortConstant = {
+    parameterPath: "copyActionAbortConstant",
+    mapper: {
+        defaultValue: "abort",
+        isConstant: true,
+        serializedName: "x-ms-copy-action",
+        type: {
+            name: "String",
+        },
+    },
+};
+const copyId = {
+    parameterPath: "copyId",
+    mapper: {
+        serializedName: "copyid",
+        required: true,
+        xmlName: "copyid",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp16 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "tier",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const tier1 = {
+    parameterPath: "tier",
+    mapper: {
+        serializedName: "x-ms-access-tier",
+        required: true,
+        xmlName: "x-ms-access-tier",
+        type: {
+            name: "Enum",
+            allowedValues: [
+                "P4",
+                "P6",
+                "P10",
+                "P15",
+                "P20",
+                "P30",
+                "P40",
+                "P50",
+                "P60",
+                "P70",
+                "P80",
+                "Hot",
+                "Cool",
+                "Archive",
+                "Cold",
+            ],
+        },
+    },
+};
+const queryRequest = {
+    parameterPath: ["options", "queryRequest"],
+    mapper: QueryRequest,
+};
+const comp17 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "query",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp18 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "tags",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const ifModifiedSince1 = {
+    parameterPath: ["options", "blobModifiedAccessConditions", "ifModifiedSince"],
+    mapper: {
+        serializedName: "x-ms-blob-if-modified-since",
+        xmlName: "x-ms-blob-if-modified-since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const ifUnmodifiedSince1 = {
+    parameterPath: [
+        "options",
+        "blobModifiedAccessConditions",
+        "ifUnmodifiedSince",
+    ],
+    mapper: {
+        serializedName: "x-ms-blob-if-unmodified-since",
+        xmlName: "x-ms-blob-if-unmodified-since",
+        type: {
+            name: "DateTimeRfc1123",
+        },
+    },
+};
+const ifMatch1 = {
+    parameterPath: ["options", "blobModifiedAccessConditions", "ifMatch"],
+    mapper: {
+        serializedName: "x-ms-blob-if-match",
+        xmlName: "x-ms-blob-if-match",
+        type: {
+            name: "String",
+        },
+    },
+};
+const ifNoneMatch1 = {
+    parameterPath: ["options", "blobModifiedAccessConditions", "ifNoneMatch"],
+    mapper: {
+        serializedName: "x-ms-blob-if-none-match",
+        xmlName: "x-ms-blob-if-none-match",
+        type: {
+            name: "String",
+        },
+    },
+};
+const tags = {
+    parameterPath: ["options", "tags"],
+    mapper: BlobTags,
+};
+const transactionalContentMD5 = {
+    parameterPath: ["options", "transactionalContentMD5"],
+    mapper: {
+        serializedName: "Content-MD5",
+        xmlName: "Content-MD5",
+        type: {
+            name: "ByteArray",
+        },
+    },
+};
+const transactionalContentCrc64 = {
+    parameterPath: ["options", "transactionalContentCrc64"],
+    mapper: {
+        serializedName: "x-ms-content-crc64",
+        xmlName: "x-ms-content-crc64",
+        type: {
+            name: "ByteArray",
+        },
+    },
+};
+const blobType = {
+    parameterPath: "blobType",
+    mapper: {
+        defaultValue: "PageBlob",
+        isConstant: true,
+        serializedName: "x-ms-blob-type",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobContentLength = {
+    parameterPath: "blobContentLength",
+    mapper: {
+        serializedName: "x-ms-blob-content-length",
+        required: true,
+        xmlName: "x-ms-blob-content-length",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const blobSequenceNumber = {
+    parameterPath: ["options", "blobSequenceNumber"],
+    mapper: {
+        defaultValue: 0,
+        serializedName: "x-ms-blob-sequence-number",
+        xmlName: "x-ms-blob-sequence-number",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const contentType1 = {
+    parameterPath: ["options", "contentType"],
+    mapper: {
+        defaultValue: "application/octet-stream",
+        isConstant: true,
+        serializedName: "Content-Type",
+        type: {
+            name: "String",
+        },
+    },
+};
+const body1 = {
+    parameterPath: "body",
+    mapper: {
+        serializedName: "body",
+        required: true,
+        xmlName: "body",
+        type: {
+            name: "Stream",
+        },
+    },
+};
+const accept2 = {
+    parameterPath: "accept",
+    mapper: {
+        defaultValue: "application/xml",
+        isConstant: true,
+        serializedName: "Accept",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp19 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "page",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const pageWrite = {
+    parameterPath: "pageWrite",
+    mapper: {
+        defaultValue: "update",
+        isConstant: true,
+        serializedName: "x-ms-page-write",
+        type: {
+            name: "String",
+        },
+    },
+};
+const ifSequenceNumberLessThanOrEqualTo = {
+    parameterPath: [
+        "options",
+        "sequenceNumberAccessConditions",
+        "ifSequenceNumberLessThanOrEqualTo",
+    ],
+    mapper: {
+        serializedName: "x-ms-if-sequence-number-le",
+        xmlName: "x-ms-if-sequence-number-le",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const ifSequenceNumberLessThan = {
+    parameterPath: [
+        "options",
+        "sequenceNumberAccessConditions",
+        "ifSequenceNumberLessThan",
+    ],
+    mapper: {
+        serializedName: "x-ms-if-sequence-number-lt",
+        xmlName: "x-ms-if-sequence-number-lt",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const ifSequenceNumberEqualTo = {
+    parameterPath: [
+        "options",
+        "sequenceNumberAccessConditions",
+        "ifSequenceNumberEqualTo",
+    ],
+    mapper: {
+        serializedName: "x-ms-if-sequence-number-eq",
+        xmlName: "x-ms-if-sequence-number-eq",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const structuredContentLength = {
+    parameterPath: ["options", "structuredContentLength"],
+    mapper: {
+        serializedName: "x-ms-structured-content-length",
+        xmlName: "x-ms-structured-content-length",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const pageWrite1 = {
+    parameterPath: "pageWrite",
+    mapper: {
+        defaultValue: "clear",
+        isConstant: true,
+        serializedName: "x-ms-page-write",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceUrl = {
+    parameterPath: "sourceUrl",
+    mapper: {
+        serializedName: "x-ms-copy-source",
+        required: true,
+        xmlName: "x-ms-copy-source",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceRange = {
+    parameterPath: "sourceRange",
+    mapper: {
+        serializedName: "x-ms-source-range",
+        required: true,
+        xmlName: "x-ms-source-range",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceContentCrc64 = {
+    parameterPath: ["options", "sourceContentCrc64"],
+    mapper: {
+        serializedName: "x-ms-source-content-crc64",
+        xmlName: "x-ms-source-content-crc64",
+        type: {
+            name: "ByteArray",
+        },
+    },
+};
+const range1 = {
+    parameterPath: "range",
+    mapper: {
+        serializedName: "x-ms-range",
+        required: true,
+        xmlName: "x-ms-range",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceEncryptionKey = {
+    parameterPath: ["options", "sourceCpkInfo", "sourceEncryptionKey"],
+    mapper: {
+        serializedName: "x-ms-source-encryption-key",
+        xmlName: "x-ms-source-encryption-key",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceEncryptionKeySha256 = {
+    parameterPath: ["options", "sourceCpkInfo", "sourceEncryptionKeySha256"],
+    mapper: {
+        serializedName: "x-ms-source-encryption-key-sha256",
+        xmlName: "x-ms-source-encryption-key-sha256",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sourceEncryptionAlgorithm = {
+    parameterPath: ["options", "sourceCpkInfo", "sourceEncryptionAlgorithm"],
+    mapper: {
+        serializedName: "x-ms-source-encryption-algorithm",
+        xmlName: "x-ms-source-encryption-algorithm",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp20 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "pagelist",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const prevsnapshot = {
+    parameterPath: ["options", "prevsnapshot"],
+    mapper: {
+        serializedName: "prevsnapshot",
+        xmlName: "prevsnapshot",
+        type: {
+            name: "String",
+        },
+    },
+};
+const prevSnapshotUrl = {
+    parameterPath: ["options", "prevSnapshotUrl"],
+    mapper: {
+        serializedName: "x-ms-previous-snapshot-url",
+        xmlName: "x-ms-previous-snapshot-url",
+        type: {
+            name: "String",
+        },
+    },
+};
+const sequenceNumberAction = {
+    parameterPath: "sequenceNumberAction",
+    mapper: {
+        serializedName: "x-ms-sequence-number-action",
+        required: true,
+        xmlName: "x-ms-sequence-number-action",
+        type: {
+            name: "Enum",
+            allowedValues: ["max", "update", "increment"],
+        },
+    },
+};
+const comp21 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "incrementalcopy",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobType1 = {
+    parameterPath: "blobType",
+    mapper: {
+        defaultValue: "AppendBlob",
+        isConstant: true,
+        serializedName: "x-ms-blob-type",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp22 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "appendblock",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const maxSize = {
+    parameterPath: ["options", "appendPositionAccessConditions", "maxSize"],
+    mapper: {
+        serializedName: "x-ms-blob-condition-maxsize",
+        xmlName: "x-ms-blob-condition-maxsize",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const appendPosition = {
+    parameterPath: [
+        "options",
+        "appendPositionAccessConditions",
+        "appendPosition",
+    ],
+    mapper: {
+        serializedName: "x-ms-blob-condition-appendpos",
+        xmlName: "x-ms-blob-condition-appendpos",
+        type: {
+            name: "Number",
+        },
+    },
+};
+const sourceRange1 = {
+    parameterPath: ["options", "sourceRange"],
+    mapper: {
+        serializedName: "x-ms-source-range",
+        xmlName: "x-ms-source-range",
+        type: {
+            name: "String",
+        },
+    },
+};
+const comp23 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "seal",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blobType2 = {
+    parameterPath: "blobType",
+    mapper: {
+        defaultValue: "BlockBlob",
+        isConstant: true,
+        serializedName: "x-ms-blob-type",
+        type: {
+            name: "String",
+        },
+    },
+};
+const copySourceBlobProperties = {
+    parameterPath: ["options", "copySourceBlobProperties"],
+    mapper: {
+        serializedName: "x-ms-copy-source-blob-properties",
+        xmlName: "x-ms-copy-source-blob-properties",
+        type: {
+            name: "Boolean",
+        },
+    },
+};
+const comp24 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "block",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blockId = {
+    parameterPath: "blockId",
+    mapper: {
+        serializedName: "blockid",
+        required: true,
+        xmlName: "blockid",
+        type: {
+            name: "String",
+        },
+    },
+};
+const blocks = {
+    parameterPath: "blocks",
+    mapper: BlockLookupList,
+};
+const comp25 = {
+    parameterPath: "comp",
+    mapper: {
+        defaultValue: "blocklist",
+        isConstant: true,
+        serializedName: "comp",
+        type: {
+            name: "String",
+        },
+    },
+};
+const listType = {
+    parameterPath: "listType",
+    mapper: {
+        defaultValue: "committed",
+        serializedName: "blocklisttype",
+        required: true,
+        xmlName: "blocklisttype",
+        type: {
+            name: "Enum",
+            allowedValues: ["committed", "uncommitted", "all"],
+        },
+    },
+};
+//# sourceMappingURL=parameters.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/operations/service.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
+
+
+
+/** Class containing Service operations. */
+class ServiceImpl {
+    client;
+    /**
+     * Initialize a new instance of the class Service class.
+     * @param client Reference to the service client
+     */
+    constructor(client) {
+        this.client = client;
     }
-    node ?? (node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError));
-    if (anchor && node.anchor === '')
-        onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
-    if (atKey &&
-        ctx.options.stringKeys &&
-        (!identity.isScalar(node) ||
-            typeof node.value !== 'string' ||
-            (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
-        const msg = 'With stringKeys, all keys must be strings';
-        onError(tag ?? token, 'NON_STRING_KEY', msg);
+    /**
+     * Sets properties for a storage account's Blob service endpoint, including properties for Storage
+     * Analytics and CORS (Cross-Origin Resource Sharing) rules
+     * @param blobServiceProperties The StorageService properties.
+     * @param options The options parameters.
+     */
+    setProperties(blobServiceProperties, options) {
+        return this.client.sendOperationRequest({ blobServiceProperties, options }, setPropertiesOperationSpec);
     }
-    if (spaceBefore)
-        node.spaceBefore = true;
-    if (comment) {
-        if (token.type === 'scalar' && token.source === '')
-            node.comment = comment;
-        else
-            node.commentBefore = comment;
+    /**
+     * gets the properties of a storage account's Blob service, including properties for Storage Analytics
+     * and CORS (Cross-Origin Resource Sharing) rules.
+     * @param options The options parameters.
+     */
+    getProperties(options) {
+        return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec);
     }
-    // @ts-expect-error Type checking misses meaning of isSrcToken
-    if (ctx.options.keepSourceTokens && isSrcToken)
-        node.srcToken = token;
-    return node;
-}
-function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
-    const token = {
-        type: 'scalar',
-        offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
-        indent: -1,
-        source: ''
-    };
-    const node = composeScalar.composeScalar(ctx, token, tag, onError);
-    if (anchor) {
-        node.anchor = anchor.source.substring(1);
-        if (node.anchor === '')
-            onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
+    /**
+     * Retrieves statistics related to replication for the Blob service. It is only available on the
+     * secondary location endpoint when read-access geo-redundant replication is enabled for the storage
+     * account.
+     * @param options The options parameters.
+     */
+    getStatistics(options) {
+        return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec);
     }
-    if (spaceBefore)
-        node.spaceBefore = true;
-    if (comment) {
-        node.comment = comment;
-        node.range[2] = end;
+    /**
+     * The List Containers Segment operation returns a list of the containers under the specified account
+     * @param options The options parameters.
+     */
+    listContainersSegment(options) {
+        return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec);
+    }
+    /**
+     * Retrieves a user delegation key for the Blob service. This is only a valid operation when using
+     * bearer token authentication.
+     * @param keyInfo Key information
+     * @param options The options parameters.
+     */
+    getUserDelegationKey(keyInfo, options) {
+        return this.client.sendOperationRequest({ keyInfo, options }, getUserDelegationKeyOperationSpec);
+    }
+    /**
+     * Returns the sku name and account kind
+     * @param options The options parameters.
+     */
+    getAccountInfo(options) {
+        return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec);
+    }
+    /**
+     * The Batch operation allows multiple API calls to be embedded into a single HTTP request.
+     * @param contentLength The length of the request.
+     * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch
+     *                             boundary. Example header value: multipart/mixed; boundary=batch_
+     * @param body Initial data
+     * @param options The options parameters.
+     */
+    submitBatch(contentLength, multipartContentType, body, options) {
+        return this.client.sendOperationRequest({ contentLength, multipartContentType, body, options }, submitBatchOperationSpec);
+    }
+    /**
+     * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a
+     * given search expression.  Filter blobs searches across all containers within a storage account but
+     * can be scoped within the expression to a single container.
+     * @param options The options parameters.
+     */
+    filterBlobs(options) {
+        return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec);
     }
-    return node;
-}
-function composeAlias({ options }, { offset, source, end }, onError) {
-    const alias = new Alias.Alias(source.substring(1));
-    if (alias.source === '')
-        onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');
-    if (alias.source.endsWith(':'))
-        onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);
-    const valueEnd = offset + source.length;
-    const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
-    alias.range = [offset, valueEnd, re.offset];
-    if (re.comment)
-        alias.comment = re.comment;
-    return alias;
 }
-
-exports.composeEmptyNode = composeEmptyNode;
-exports.composeNode = composeNode;
-
-
-/***/ }),
-
-/***/ 5413:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
+// Operation Specifications
+const xmlSerializer = createSerializer(mappers_namespaceObject, /* isXml */ true);
+const setPropertiesOperationSpec = {
+    path: "/",
+    httpMethod: "PUT",
+    responses: {
+        202: {
+            headersMapper: ServiceSetPropertiesHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceSetPropertiesExceptionHeaders,
+        },
+    },
+    requestBody: blobServiceProperties,
+    queryParameters: [
+        restype,
+        comp,
+        timeoutInSeconds,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        contentType,
+        accept,
+        version,
+        requestId,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: xmlSerializer,
+};
+const getPropertiesOperationSpec = {
+    path: "/",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: BlobServiceProperties,
+            headersMapper: ServiceGetPropertiesHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceGetPropertiesExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        restype,
+        comp,
+        timeoutInSeconds,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: xmlSerializer,
+};
+const getStatisticsOperationSpec = {
+    path: "/",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: BlobServiceStatistics,
+            headersMapper: ServiceGetStatisticsHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceGetStatisticsExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        restype,
+        timeoutInSeconds,
+        comp1,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: xmlSerializer,
+};
+const listContainersSegmentOperationSpec = {
+    path: "/",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: ListContainersSegmentResponse,
+            headersMapper: ServiceListContainersSegmentHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceListContainersSegmentExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        comp2,
+        prefix,
+        marker,
+        maxPageSize,
+        include,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: xmlSerializer,
+};
+const getUserDelegationKeyOperationSpec = {
+    path: "/",
+    httpMethod: "POST",
+    responses: {
+        200: {
+            bodyMapper: UserDelegationKey,
+            headersMapper: ServiceGetUserDelegationKeyHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceGetUserDelegationKeyExceptionHeaders,
+        },
+    },
+    requestBody: keyInfo,
+    queryParameters: [
+        restype,
+        timeoutInSeconds,
+        comp3,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        contentType,
+        accept,
+        version,
+        requestId,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: xmlSerializer,
+};
+const getAccountInfoOperationSpec = {
+    path: "/",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            headersMapper: ServiceGetAccountInfoHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceGetAccountInfoExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        comp,
+        timeoutInSeconds,
+        restype1,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: xmlSerializer,
+};
+const submitBatchOperationSpec = {
+    path: "/",
+    httpMethod: "POST",
+    responses: {
+        202: {
+            bodyMapper: {
+                type: { name: "Stream" },
+                serializedName: "parsedResponse",
+            },
+            headersMapper: ServiceSubmitBatchHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceSubmitBatchExceptionHeaders,
+        },
+    },
+    requestBody: body,
+    queryParameters: [timeoutInSeconds, comp4],
+    urlParameters: [url],
+    headerParameters: [
+        accept,
+        version,
+        requestId,
+        contentLength,
+        multipartContentType,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: xmlSerializer,
+};
+const filterBlobsOperationSpec = {
+    path: "/",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: FilterBlobSegment,
+            headersMapper: ServiceFilterBlobsHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ServiceFilterBlobsExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        marker,
+        maxPageSize,
+        comp5,
+        where,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: xmlSerializer,
+};
+//# sourceMappingURL=service.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/operations/container.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
 
-var identity = __nccwpck_require__(41127);
-var Scalar = __nccwpck_require__(63301);
-var resolveBlockScalar = __nccwpck_require__(48913);
-var resolveFlowScalar = __nccwpck_require__(76842);
 
-function composeScalar(ctx, token, tagToken, onError) {
-    const { value, type, comment, range } = token.type === 'block-scalar'
-        ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError)
-        : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
-    const tagName = tagToken
-        ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
-        : null;
-    let tag;
-    if (ctx.options.stringKeys && ctx.atKey) {
-        tag = ctx.schema[identity.SCALAR];
+/** Class containing Container operations. */
+class ContainerImpl {
+    client;
+    /**
+     * Initialize a new instance of the class Container class.
+     * @param client Reference to the service client
+     */
+    constructor(client) {
+        this.client = client;
     }
-    else if (tagName)
-        tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
-    else if (token.type === 'scalar')
-        tag = findScalarTagByTest(ctx, value, token, onError);
-    else
-        tag = ctx.schema[identity.SCALAR];
-    let scalar;
-    try {
-        const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
-        scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
+    /**
+     * creates a new container under the specified account. If the container with the same name already
+     * exists, the operation fails
+     * @param options The options parameters.
+     */
+    create(options) {
+        return this.client.sendOperationRequest({ options }, createOperationSpec);
     }
-    catch (error) {
-        const msg = error instanceof Error ? error.message : String(error);
-        onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);
-        scalar = new Scalar.Scalar(value);
+    /**
+     * returns all user-defined metadata and system properties for the specified container. The data
+     * returned does not include the container's list of blobs
+     * @param options The options parameters.
+     */
+    getProperties(options) {
+        return this.client.sendOperationRequest({ options }, container_getPropertiesOperationSpec);
     }
-    scalar.range = range;
-    scalar.source = value;
-    if (type)
-        scalar.type = type;
-    if (tagName)
-        scalar.tag = tagName;
-    if (tag.format)
-        scalar.format = tag.format;
-    if (comment)
-        scalar.comment = comment;
-    return scalar;
-}
-function findScalarTagByName(schema, value, tagName, tagToken, onError) {
-    if (tagName === '!')
-        return schema[identity.SCALAR]; // non-specific tag
-    const matchWithTest = [];
-    for (const tag of schema.tags) {
-        if (!tag.collection && tag.tag === tagName) {
-            if (tag.default && tag.test)
-                matchWithTest.push(tag);
-            else
-                return tag;
-        }
+    /**
+     * operation marks the specified container for deletion. The container and any blobs contained within
+     * it are later deleted during garbage collection
+     * @param options The options parameters.
+     */
+    delete(options) {
+        return this.client.sendOperationRequest({ options }, deleteOperationSpec);
     }
-    for (const tag of matchWithTest)
-        if (tag.test?.test(value))
-            return tag;
-    const kt = schema.knownTags[tagName];
-    if (kt && !kt.collection) {
-        // Ensure that the known tag is available for stringifying,
-        // but does not get used by default.
-        schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));
-        return kt;
+    /**
+     * operation sets one or more user-defined name-value pairs for the specified container.
+     * @param options The options parameters.
+     */
+    setMetadata(options) {
+        return this.client.sendOperationRequest({ options }, setMetadataOperationSpec);
     }
-    onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
-    return schema[identity.SCALAR];
-}
-function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
-    const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
-        tag.test?.test(value)) || schema[identity.SCALAR];
-    if (schema.compat) {
-        const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
-            schema[identity.SCALAR];
-        if (tag.tag !== compat.tag) {
-            const ts = directives.tagString(tag.tag);
-            const cs = directives.tagString(compat.tag);
-            const msg = `Value may be parsed as either ${ts} or ${cs}`;
-            onError(token, 'TAG_RESOLVE_FAILED', msg, true);
-        }
+    /**
+     * gets the permissions for the specified container. The permissions indicate whether container data
+     * may be accessed publicly.
+     * @param options The options parameters.
+     */
+    getAccessPolicy(options) {
+        return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec);
+    }
+    /**
+     * sets the permissions for the specified container. The permissions indicate whether blobs in a
+     * container may be accessed publicly.
+     * @param options The options parameters.
+     */
+    setAccessPolicy(options) {
+        return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec);
+    }
+    /**
+     * Restores a previously-deleted container.
+     * @param options The options parameters.
+     */
+    restore(options) {
+        return this.client.sendOperationRequest({ options }, restoreOperationSpec);
+    }
+    /**
+     * Renames an existing container.
+     * @param sourceContainerName Required.  Specifies the name of the container to rename.
+     * @param options The options parameters.
+     */
+    rename(sourceContainerName, options) {
+        return this.client.sendOperationRequest({ sourceContainerName, options }, renameOperationSpec);
+    }
+    /**
+     * The Batch operation allows multiple API calls to be embedded into a single HTTP request.
+     * @param contentLength The length of the request.
+     * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch
+     *                             boundary. Example header value: multipart/mixed; boundary=batch_
+     * @param body Initial data
+     * @param options The options parameters.
+     */
+    submitBatch(contentLength, multipartContentType, body, options) {
+        return this.client.sendOperationRequest({ contentLength, multipartContentType, body, options }, container_submitBatchOperationSpec);
+    }
+    /**
+     * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given
+     * search expression.  Filter blobs searches within the given container.
+     * @param options The options parameters.
+     */
+    filterBlobs(options) {
+        return this.client.sendOperationRequest({ options }, container_filterBlobsOperationSpec);
+    }
+    /**
+     * [Update] establishes and manages a lock on a container for delete operations. The lock duration can
+     * be 15 to 60 seconds, or can be infinite
+     * @param options The options parameters.
+     */
+    acquireLease(options) {
+        return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec);
+    }
+    /**
+     * [Update] establishes and manages a lock on a container for delete operations. The lock duration can
+     * be 15 to 60 seconds, or can be infinite
+     * @param leaseId Specifies the current lease ID on the resource.
+     * @param options The options parameters.
+     */
+    releaseLease(leaseId, options) {
+        return this.client.sendOperationRequest({ leaseId, options }, releaseLeaseOperationSpec);
+    }
+    /**
+     * [Update] establishes and manages a lock on a container for delete operations. The lock duration can
+     * be 15 to 60 seconds, or can be infinite
+     * @param leaseId Specifies the current lease ID on the resource.
+     * @param options The options parameters.
+     */
+    renewLease(leaseId, options) {
+        return this.client.sendOperationRequest({ leaseId, options }, renewLeaseOperationSpec);
+    }
+    /**
+     * [Update] establishes and manages a lock on a container for delete operations. The lock duration can
+     * be 15 to 60 seconds, or can be infinite
+     * @param options The options parameters.
+     */
+    breakLease(options) {
+        return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec);
+    }
+    /**
+     * [Update] establishes and manages a lock on a container for delete operations. The lock duration can
+     * be 15 to 60 seconds, or can be infinite
+     * @param leaseId Specifies the current lease ID on the resource.
+     * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400
+     *                        (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor
+     *                        (String) for a list of valid GUID string formats.
+     * @param options The options parameters.
+     */
+    changeLease(leaseId, proposedLeaseId, options) {
+        return this.client.sendOperationRequest({ leaseId, proposedLeaseId, options }, changeLeaseOperationSpec);
+    }
+    /**
+     * [Update] The List Blobs operation returns a list of the blobs under the specified container
+     * @param options The options parameters.
+     */
+    listBlobFlatSegment(options) {
+        return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec);
+    }
+    /**
+     * [Update] The List Blobs operation returns a list of the blobs under the specified container
+     * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix
+     *                  element in the response body that acts as a placeholder for all blobs whose names begin with the
+     *                  same substring up to the appearance of the delimiter character. The delimiter may be a single
+     *                  character or a string.
+     * @param options The options parameters.
+     */
+    listBlobHierarchySegment(delimiter, options) {
+        return this.client.sendOperationRequest({ delimiter, options }, listBlobHierarchySegmentOperationSpec);
+    }
+    /**
+     * Returns the sku name and account kind
+     * @param options The options parameters.
+     */
+    getAccountInfo(options) {
+        return this.client.sendOperationRequest({ options }, container_getAccountInfoOperationSpec);
     }
-    return tag;
 }
-
-exports.composeScalar = composeScalar;
-
-
-/***/ }),
-
-/***/ 89984:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
+// Operation Specifications
+const container_xmlSerializer = createSerializer(mappers_namespaceObject, /* isXml */ true);
+const createOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: ContainerCreateHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerCreateExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, restype2],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        metadata,
+        parameters_access,
+        defaultEncryptionScope,
+        preventEncryptionScopeOverride,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const container_getPropertiesOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            headersMapper: ContainerGetPropertiesHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerGetPropertiesExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, restype2],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const deleteOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "DELETE",
+    responses: {
+        202: {
+            headersMapper: ContainerDeleteHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerDeleteExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, restype2],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const setMetadataOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: ContainerSetMetadataHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerSetMetadataExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp6,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const getAccessPolicyOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: {
+                type: {
+                    name: "Sequence",
+                    element: {
+                        type: { name: "Composite", className: "SignedIdentifier" },
+                    },
+                },
+                serializedName: "SignedIdentifiers",
+                xmlName: "SignedIdentifiers",
+                xmlIsWrapped: true,
+                xmlElementName: "SignedIdentifier",
+            },
+            headersMapper: ContainerGetAccessPolicyHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerGetAccessPolicyExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp7,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const setAccessPolicyOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: ContainerSetAccessPolicyHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerSetAccessPolicyExceptionHeaders,
+        },
+    },
+    requestBody: containerAcl,
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp7,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        contentType,
+        accept,
+        version,
+        requestId,
+        parameters_access,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: container_xmlSerializer,
+};
+const restoreOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: ContainerRestoreHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerRestoreExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp8,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        deletedContainerName,
+        deletedContainerVersion,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const renameOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: ContainerRenameHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerRenameExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp9,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        sourceContainerName,
+        sourceLeaseId,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const container_submitBatchOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "POST",
+    responses: {
+        202: {
+            bodyMapper: {
+                type: { name: "Stream" },
+                serializedName: "parsedResponse",
+            },
+            headersMapper: ContainerSubmitBatchHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerSubmitBatchExceptionHeaders,
+        },
+    },
+    requestBody: body,
+    queryParameters: [
+        timeoutInSeconds,
+        comp4,
+        restype2,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        accept,
+        version,
+        requestId,
+        contentLength,
+        multipartContentType,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: container_xmlSerializer,
+};
+const container_filterBlobsOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: FilterBlobSegment,
+            headersMapper: ContainerFilterBlobsHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerFilterBlobsExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        marker,
+        maxPageSize,
+        comp5,
+        where,
+        restype2,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const acquireLeaseOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: ContainerAcquireLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerAcquireLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp10,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        action,
+        duration,
+        proposedLeaseId,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const releaseLeaseOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: ContainerReleaseLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerReleaseLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp10,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        action1,
+        leaseId1,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const renewLeaseOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: ContainerRenewLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerRenewLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp10,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        leaseId1,
+        action2,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const breakLeaseOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        202: {
+            headersMapper: ContainerBreakLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerBreakLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp10,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        action3,
+        breakPeriod,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const changeLeaseOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: ContainerChangeLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerChangeLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        restype2,
+        comp10,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        leaseId1,
+        action4,
+        proposedLeaseId1,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const listBlobFlatSegmentOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: ListBlobsFlatSegmentResponse,
+            headersMapper: ContainerListBlobFlatSegmentHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerListBlobFlatSegmentExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        comp2,
+        prefix,
+        marker,
+        maxPageSize,
+        restype2,
+        include1,
+        startFrom,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const listBlobHierarchySegmentOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: ListBlobsHierarchySegmentResponse,
+            headersMapper: ContainerListBlobHierarchySegmentHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        comp2,
+        prefix,
+        marker,
+        maxPageSize,
+        restype2,
+        include1,
+        startFrom,
+        delimiter,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+const container_getAccountInfoOperationSpec = {
+    path: "/{containerName}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            headersMapper: ContainerGetAccountInfoHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: ContainerGetAccountInfoExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        comp,
+        timeoutInSeconds,
+        restype1,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: container_xmlSerializer,
+};
+//# sourceMappingURL=container.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/operations/blob.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
 
-var node_process = __nccwpck_require__(932);
-var directives = __nccwpck_require__(61342);
-var Document = __nccwpck_require__(3021);
-var errors = __nccwpck_require__(91464);
-var identity = __nccwpck_require__(41127);
-var composeDoc = __nccwpck_require__(23683);
-var resolveEnd = __nccwpck_require__(17788);
 
-function getErrorPos(src) {
-    if (typeof src === 'number')
-        return [src, src + 1];
-    if (Array.isArray(src))
-        return src.length === 2 ? src : [src[0], src[1]];
-    const { offset, source } = src;
-    return [offset, offset + (typeof source === 'string' ? source.length : 1)];
-}
-function parsePrelude(prelude) {
-    let comment = '';
-    let atComment = false;
-    let afterEmptyLine = false;
-    for (let i = 0; i < prelude.length; ++i) {
-        const source = prelude[i];
-        switch (source[0]) {
-            case '#':
-                comment +=
-                    (comment === '' ? '' : afterEmptyLine ? '\n\n' : '\n') +
-                        (source.substring(1) || ' ');
-                atComment = true;
-                afterEmptyLine = false;
-                break;
-            case '%':
-                if (prelude[i + 1]?.[0] !== '#')
-                    i += 1;
-                atComment = false;
-                break;
-            default:
-                // This may be wrong after doc-end, but in that case it doesn't matter
-                if (!atComment)
-                    afterEmptyLine = true;
-                atComment = false;
-        }
+/** Class containing Blob operations. */
+class BlobImpl {
+    client;
+    /**
+     * Initialize a new instance of the class Blob class.
+     * @param client Reference to the service client
+     */
+    constructor(client) {
+        this.client = client;
+    }
+    /**
+     * The Download operation reads or downloads a blob from the system, including its metadata and
+     * properties. You can also call Download to read a snapshot.
+     * @param options The options parameters.
+     */
+    download(options) {
+        return this.client.sendOperationRequest({ options }, downloadOperationSpec);
+    }
+    /**
+     * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system
+     * properties for the blob. It does not return the content of the blob.
+     * @param options The options parameters.
+     */
+    getProperties(options) {
+        return this.client.sendOperationRequest({ options }, blob_getPropertiesOperationSpec);
+    }
+    /**
+     * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is
+     * permanently removed from the storage account. If the storage account's soft delete feature is
+     * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible
+     * immediately. However, the blob service retains the blob or snapshot for the number of days specified
+     * by the DeleteRetentionPolicy section of [Storage service properties]
+     * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is
+     * permanently removed from the storage account. Note that you continue to be charged for the
+     * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the
+     * "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You
+     * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a
+     * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404
+     * (ResourceNotFound).
+     * @param options The options parameters.
+     */
+    delete(options) {
+        return this.client.sendOperationRequest({ options }, blob_deleteOperationSpec);
+    }
+    /**
+     * Undelete a blob that was previously soft deleted
+     * @param options The options parameters.
+     */
+    undelete(options) {
+        return this.client.sendOperationRequest({ options }, undeleteOperationSpec);
     }
-    return { comment, afterEmptyLine };
-}
-/**
- * Compose a stream of CST nodes into a stream of YAML Documents.
- *
- * ```ts
- * import { Composer, Parser } from 'yaml'
- *
- * const src: string = ...
- * const tokens = new Parser().parse(src)
- * const docs = new Composer().compose(tokens)
- * ```
- */
-class Composer {
-    constructor(options = {}) {
-        this.doc = null;
-        this.atDirectives = false;
-        this.prelude = [];
-        this.errors = [];
-        this.warnings = [];
-        this.onError = (source, code, message, warning) => {
-            const pos = getErrorPos(source);
-            if (warning)
-                this.warnings.push(new errors.YAMLWarning(pos, code, message));
-            else
-                this.errors.push(new errors.YAMLParseError(pos, code, message));
-        };
-        // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
-        this.directives = new directives.Directives({ version: options.version || '1.2' });
-        this.options = options;
+    /**
+     * Sets the time a blob will expire and be deleted.
+     * @param expiryOptions Required. Indicates mode of the expiry time
+     * @param options The options parameters.
+     */
+    setExpiry(expiryOptions, options) {
+        return this.client.sendOperationRequest({ expiryOptions, options }, setExpiryOperationSpec);
     }
-    decorate(doc, afterDoc) {
-        const { comment, afterEmptyLine } = parsePrelude(this.prelude);
-        //console.log({ dc: doc.comment, prelude, comment })
-        if (comment) {
-            const dc = doc.contents;
-            if (afterDoc) {
-                doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment;
-            }
-            else if (afterEmptyLine || doc.directives.docStart || !dc) {
-                doc.commentBefore = comment;
-            }
-            else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
-                let it = dc.items[0];
-                if (identity.isPair(it))
-                    it = it.key;
-                const cb = it.commentBefore;
-                it.commentBefore = cb ? `${comment}\n${cb}` : comment;
-            }
-            else {
-                const cb = dc.commentBefore;
-                dc.commentBefore = cb ? `${comment}\n${cb}` : comment;
-            }
-        }
-        if (afterDoc) {
-            for (let i = 0; i < this.errors.length; ++i)
-                doc.errors.push(this.errors[i]);
-            for (let i = 0; i < this.warnings.length; ++i)
-                doc.warnings.push(this.warnings[i]);
-        }
-        else {
-            doc.errors = this.errors;
-            doc.warnings = this.warnings;
-        }
-        this.prelude = [];
-        this.errors = [];
-        this.warnings = [];
+    /**
+     * The Set HTTP Headers operation sets system properties on the blob
+     * @param options The options parameters.
+     */
+    setHttpHeaders(options) {
+        return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec);
     }
     /**
-     * Current stream status information.
-     *
-     * Mostly useful at the end of input for an empty stream.
+     * The Set Immutability Policy operation sets the immutability policy on the blob
+     * @param options The options parameters.
      */
-    streamInfo() {
-        return {
-            comment: parsePrelude(this.prelude).comment,
-            directives: this.directives,
-            errors: this.errors,
-            warnings: this.warnings
-        };
+    setImmutabilityPolicy(options) {
+        return this.client.sendOperationRequest({ options }, setImmutabilityPolicyOperationSpec);
     }
     /**
-     * Compose tokens into documents.
-     *
-     * @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.
-     * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
+     * The Delete Immutability Policy operation deletes the immutability policy on the blob
+     * @param options The options parameters.
      */
-    *compose(tokens, forceDoc = false, endOffset = -1) {
-        for (const token of tokens)
-            yield* this.next(token);
-        yield* this.end(forceDoc, endOffset);
+    deleteImmutabilityPolicy(options) {
+        return this.client.sendOperationRequest({ options }, deleteImmutabilityPolicyOperationSpec);
     }
-    /** Advance the composer by one CST token. */
-    *next(token) {
-        if (node_process.env.LOG_STREAM)
-            console.dir(token, { depth: null });
-        switch (token.type) {
-            case 'directive':
-                this.directives.add(token.source, (offset, message, warning) => {
-                    const pos = getErrorPos(token);
-                    pos[0] += offset;
-                    this.onError(pos, 'BAD_DIRECTIVE', message, warning);
-                });
-                this.prelude.push(token.source);
-                this.atDirectives = true;
-                break;
-            case 'document': {
-                const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError);
-                if (this.atDirectives && !doc.directives.docStart)
-                    this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');
-                this.decorate(doc, false);
-                if (this.doc)
-                    yield this.doc;
-                this.doc = doc;
-                this.atDirectives = false;
-                break;
-            }
-            case 'byte-order-mark':
-            case 'space':
-                break;
-            case 'comment':
-            case 'newline':
-                this.prelude.push(token.source);
-                break;
-            case 'error': {
-                const msg = token.source
-                    ? `${token.message}: ${JSON.stringify(token.source)}`
-                    : token.message;
-                const error = new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);
-                if (this.atDirectives || !this.doc)
-                    this.errors.push(error);
-                else
-                    this.doc.errors.push(error);
-                break;
-            }
-            case 'doc-end': {
-                if (!this.doc) {
-                    const msg = 'Unexpected doc-end without preceding document';
-                    this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));
-                    break;
-                }
-                this.doc.directives.docEnd = true;
-                const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);
-                this.decorate(this.doc, true);
-                if (end.comment) {
-                    const dc = this.doc.comment;
-                    this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment;
-                }
-                this.doc.range[2] = end.offset;
-                break;
-            }
-            default:
-                this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));
-        }
+    /**
+     * The Set Legal Hold operation sets a legal hold on the blob.
+     * @param legalHold Specified if a legal hold should be set on the blob.
+     * @param options The options parameters.
+     */
+    setLegalHold(legalHold, options) {
+        return this.client.sendOperationRequest({ legalHold, options }, setLegalHoldOperationSpec);
     }
     /**
-     * Call at end of input to yield any remaining document.
-     *
-     * @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.
-     * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
+     * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more
+     * name-value pairs
+     * @param options The options parameters.
      */
-    *end(forceDoc = false, endOffset = -1) {
-        if (this.doc) {
-            this.decorate(this.doc, true);
-            yield this.doc;
-            this.doc = null;
-        }
-        else if (forceDoc) {
-            const opts = Object.assign({ _directives: this.directives }, this.options);
-            const doc = new Document.Document(undefined, opts);
-            if (this.atDirectives)
-                this.onError(endOffset, 'MISSING_CHAR', 'Missing directives-end indicator line');
-            doc.range = [0, endOffset, endOffset];
-            this.decorate(doc, false);
-            yield doc;
-        }
+    setMetadata(options) {
+        return this.client.sendOperationRequest({ options }, blob_setMetadataOperationSpec);
     }
-}
-
-exports.Composer = Composer;
-
-
-/***/ }),
-
-/***/ 87103:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var Pair = __nccwpck_require__(57165);
-var YAMLMap = __nccwpck_require__(84454);
-var resolveProps = __nccwpck_require__(34631);
-var utilContainsNewline = __nccwpck_require__(9499);
-var utilFlowIndentCheck = __nccwpck_require__(74051);
-var utilMapIncludes = __nccwpck_require__(81187);
-
-const startColMsg = 'All mapping items must start at the same column';
-function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
-    const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;
-    const map = new NodeClass(ctx.schema);
-    if (ctx.atRoot)
-        ctx.atRoot = false;
-    let offset = bm.offset;
-    let commentEnd = null;
-    for (const collItem of bm.items) {
-        const { start, key, sep, value } = collItem;
-        // key properties
-        const keyProps = resolveProps.resolveProps(start, {
-            indicator: 'explicit-key-ind',
-            next: key ?? sep?.[0],
-            offset,
-            onError,
-            parentIndent: bm.indent,
-            startOnNewline: true
-        });
-        const implicitKey = !keyProps.found;
-        if (implicitKey) {
-            if (key) {
-                if (key.type === 'block-seq')
-                    onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'A block sequence may not be used as an implicit map key');
-                else if ('indent' in key && key.indent !== bm.indent)
-                    onError(offset, 'BAD_INDENT', startColMsg);
-            }
-            if (!keyProps.anchor && !keyProps.tag && !sep) {
-                commentEnd = keyProps.end;
-                if (keyProps.comment) {
-                    if (map.comment)
-                        map.comment += '\n' + keyProps.comment;
-                    else
-                        map.comment = keyProps.comment;
-                }
-                continue;
-            }
-            if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
-                onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');
-            }
-        }
-        else if (keyProps.found?.indent !== bm.indent) {
-            onError(offset, 'BAD_INDENT', startColMsg);
-        }
-        // key value
-        ctx.atKey = true;
-        const keyStart = keyProps.end;
-        const keyNode = key
-            ? composeNode(ctx, key, keyProps, onError)
-            : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
-        if (ctx.schema.compat)
-            utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
-        ctx.atKey = false;
-        if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
-            onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
-        // value properties
-        const valueProps = resolveProps.resolveProps(sep ?? [], {
-            indicator: 'map-value-ind',
-            next: value,
-            offset: keyNode.range[2],
-            onError,
-            parentIndent: bm.indent,
-            startOnNewline: !key || key.type === 'block-scalar'
-        });
-        offset = valueProps.end;
-        if (valueProps.found) {
-            if (implicitKey) {
-                if (value?.type === 'block-map' && !valueProps.hasNewline)
-                    onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'Nested mappings are not allowed in compact mappings');
-                if (ctx.options.strict &&
-                    keyProps.start < valueProps.found.offset - 1024)
-                    onError(keyNode.range, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit block mapping key');
-            }
-            // value value
-            const valueNode = value
-                ? composeNode(ctx, value, valueProps, onError)
-                : composeEmptyNode(ctx, offset, sep, null, valueProps, onError);
-            if (ctx.schema.compat)
-                utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
-            offset = valueNode.range[2];
-            const pair = new Pair.Pair(keyNode, valueNode);
-            if (ctx.options.keepSourceTokens)
-                pair.srcToken = collItem;
-            map.items.push(pair);
-        }
-        else {
-            // key with no value
-            if (implicitKey)
-                onError(keyNode.range, 'MISSING_CHAR', 'Implicit map keys need to be followed by map values');
-            if (valueProps.comment) {
-                if (keyNode.comment)
-                    keyNode.comment += '\n' + valueProps.comment;
-                else
-                    keyNode.comment = valueProps.comment;
-            }
-            const pair = new Pair.Pair(keyNode);
-            if (ctx.options.keepSourceTokens)
-                pair.srcToken = collItem;
-            map.items.push(pair);
-        }
+    /**
+     * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
+     * operations
+     * @param options The options parameters.
+     */
+    acquireLease(options) {
+        return this.client.sendOperationRequest({ options }, blob_acquireLeaseOperationSpec);
+    }
+    /**
+     * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
+     * operations
+     * @param leaseId Specifies the current lease ID on the resource.
+     * @param options The options parameters.
+     */
+    releaseLease(leaseId, options) {
+        return this.client.sendOperationRequest({ leaseId, options }, blob_releaseLeaseOperationSpec);
+    }
+    /**
+     * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
+     * operations
+     * @param leaseId Specifies the current lease ID on the resource.
+     * @param options The options parameters.
+     */
+    renewLease(leaseId, options) {
+        return this.client.sendOperationRequest({ leaseId, options }, blob_renewLeaseOperationSpec);
+    }
+    /**
+     * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
+     * operations
+     * @param leaseId Specifies the current lease ID on the resource.
+     * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400
+     *                        (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor
+     *                        (String) for a list of valid GUID string formats.
+     * @param options The options parameters.
+     */
+    changeLease(leaseId, proposedLeaseId, options) {
+        return this.client.sendOperationRequest({ leaseId, proposedLeaseId, options }, blob_changeLeaseOperationSpec);
+    }
+    /**
+     * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
+     * operations
+     * @param options The options parameters.
+     */
+    breakLease(options) {
+        return this.client.sendOperationRequest({ options }, blob_breakLeaseOperationSpec);
+    }
+    /**
+     * The Create Snapshot operation creates a read-only snapshot of a blob
+     * @param options The options parameters.
+     */
+    createSnapshot(options) {
+        return this.client.sendOperationRequest({ options }, createSnapshotOperationSpec);
+    }
+    /**
+     * The Start Copy From URL operation copies a blob or an internet resource to a new blob.
+     * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
+     *                   2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
+     *                   appear in a request URI. The source blob must either be public or must be authenticated via a shared
+     *                   access signature.
+     * @param options The options parameters.
+     */
+    startCopyFromURL(copySource, options) {
+        return this.client.sendOperationRequest({ copySource, options }, startCopyFromURLOperationSpec);
+    }
+    /**
+     * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return
+     * a response until the copy is complete.
+     * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
+     *                   2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
+     *                   appear in a request URI. The source blob must either be public or must be authenticated via a shared
+     *                   access signature.
+     * @param options The options parameters.
+     */
+    copyFromURL(copySource, options) {
+        return this.client.sendOperationRequest({ copySource, options }, copyFromURLOperationSpec);
+    }
+    /**
+     * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination
+     * blob with zero length and full metadata.
+     * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob
+     *               operation.
+     * @param options The options parameters.
+     */
+    abortCopyFromURL(copyId, options) {
+        return this.client.sendOperationRequest({ copyId, options }, abortCopyFromURLOperationSpec);
+    }
+    /**
+     * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium
+     * storage account and on a block blob in a blob storage account (locally redundant storage only). A
+     * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block
+     * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's
+     * ETag.
+     * @param tier Indicates the tier to be set on the blob.
+     * @param options The options parameters.
+     */
+    setTier(tier, options) {
+        return this.client.sendOperationRequest({ tier, options }, setTierOperationSpec);
+    }
+    /**
+     * Returns the sku name and account kind
+     * @param options The options parameters.
+     */
+    getAccountInfo(options) {
+        return this.client.sendOperationRequest({ options }, blob_getAccountInfoOperationSpec);
+    }
+    /**
+     * The Query operation enables users to select/project on blob data by providing simple query
+     * expressions.
+     * @param options The options parameters.
+     */
+    query(options) {
+        return this.client.sendOperationRequest({ options }, queryOperationSpec);
+    }
+    /**
+     * The Get Tags operation enables users to get the tags associated with a blob.
+     * @param options The options parameters.
+     */
+    getTags(options) {
+        return this.client.sendOperationRequest({ options }, getTagsOperationSpec);
+    }
+    /**
+     * The Set Tags operation enables users to set tags on a blob.
+     * @param options The options parameters.
+     */
+    setTags(options) {
+        return this.client.sendOperationRequest({ options }, setTagsOperationSpec);
     }
-    if (commentEnd && commentEnd < offset)
-        onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');
-    map.range = [bm.offset, offset, commentEnd ?? offset];
-    return map;
 }
-
-exports.resolveBlockMap = resolveBlockMap;
-
-
-/***/ }),
-
-/***/ 48913:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
+// Operation Specifications
+const blob_xmlSerializer = createSerializer(mappers_namespaceObject, /* isXml */ true);
+const downloadOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: {
+                type: { name: "Stream" },
+                serializedName: "parsedResponse",
+            },
+            headersMapper: BlobDownloadHeaders,
+        },
+        206: {
+            bodyMapper: {
+                type: { name: "Stream" },
+                serializedName: "parsedResponse",
+            },
+            headersMapper: BlobDownloadHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobDownloadExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        range,
+        rangeGetContentMD5,
+        rangeGetContentCRC64,
+        structuredBodyType,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_getPropertiesOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "HEAD",
+    responses: {
+        200: {
+            headersMapper: BlobGetPropertiesHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobGetPropertiesExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_deleteOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "DELETE",
+    responses: {
+        202: {
+            headersMapper: BlobDeleteHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobDeleteExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+        blobDeleteType,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        deleteSnapshots,
+        accessTierIfModifiedSince,
+        accessTierIfUnmodifiedSince,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const undeleteOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobUndeleteHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobUndeleteExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp8],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const setExpiryOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobSetExpiryHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobSetExpiryExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp11],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        expiryOptions,
+        expiresOn,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const setHttpHeadersOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobSetHttpHeadersHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobSetHttpHeadersExceptionHeaders,
+        },
+    },
+    queryParameters: [comp, timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        blobCacheControl,
+        blobContentType,
+        blobContentMD5,
+        blobContentEncoding,
+        blobContentLanguage,
+        blobContentDisposition,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const setImmutabilityPolicyOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobSetImmutabilityPolicyHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobSetImmutabilityPolicyExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+        comp12,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifUnmodifiedSince,
+        immutabilityPolicyExpiry,
+        immutabilityPolicyMode,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const deleteImmutabilityPolicyOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "DELETE",
+    responses: {
+        200: {
+            headersMapper: BlobDeleteImmutabilityPolicyHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+        comp12,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const setLegalHoldOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobSetLegalHoldHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobSetLegalHoldExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+        comp13,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        legalHold,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_setMetadataOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobSetMetadataHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobSetMetadataExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp6],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_acquireLeaseOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: BlobAcquireLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobAcquireLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp10],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        action,
+        duration,
+        proposedLeaseId,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_releaseLeaseOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobReleaseLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobReleaseLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp10],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        action1,
+        leaseId1,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_renewLeaseOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobRenewLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobRenewLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp10],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        leaseId1,
+        action2,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_changeLeaseOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobChangeLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobChangeLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp10],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        leaseId1,
+        action4,
+        proposedLeaseId1,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_breakLeaseOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        202: {
+            headersMapper: BlobBreakLeaseHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobBreakLeaseExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp10],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        action3,
+        breakPeriod,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const createSnapshotOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: BlobCreateSnapshotHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobCreateSnapshotExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp14],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const startCopyFromURLOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        202: {
+            headersMapper: BlobStartCopyFromURLHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobStartCopyFromURLExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        immutabilityPolicyExpiry,
+        immutabilityPolicyMode,
+        tier,
+        rehydratePriority,
+        sourceIfModifiedSince,
+        sourceIfUnmodifiedSince,
+        sourceIfMatch,
+        sourceIfNoneMatch,
+        sourceIfTags,
+        copySource,
+        blobTagsString,
+        sealBlob,
+        legalHold1,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const copyFromURLOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        202: {
+            headersMapper: BlobCopyFromURLHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobCopyFromURLExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        immutabilityPolicyExpiry,
+        immutabilityPolicyMode,
+        encryptionScope,
+        tier,
+        sourceIfModifiedSince,
+        sourceIfUnmodifiedSince,
+        sourceIfMatch,
+        sourceIfNoneMatch,
+        copySource,
+        blobTagsString,
+        legalHold1,
+        xMsRequiresSync,
+        sourceContentMD5,
+        copySourceAuthorization,
+        copySourceTags,
+        fileRequestIntent,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const abortCopyFromURLOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        204: {
+            headersMapper: BlobAbortCopyFromURLHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobAbortCopyFromURLExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        comp15,
+        copyId,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        copyActionAbortConstant,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const setTierOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: BlobSetTierHeaders,
+        },
+        202: {
+            headersMapper: BlobSetTierHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobSetTierExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+        comp16,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifTags,
+        rehydratePriority,
+        tier1,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const blob_getAccountInfoOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            headersMapper: BlobGetAccountInfoHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobGetAccountInfoExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        comp,
+        timeoutInSeconds,
+        restype1,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const queryOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "POST",
+    responses: {
+        200: {
+            bodyMapper: {
+                type: { name: "Stream" },
+                serializedName: "parsedResponse",
+            },
+            headersMapper: BlobQueryHeaders,
+        },
+        206: {
+            bodyMapper: {
+                type: { name: "Stream" },
+                serializedName: "parsedResponse",
+            },
+            headersMapper: BlobQueryHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobQueryExceptionHeaders,
+        },
+    },
+    requestBody: queryRequest,
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        comp17,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        contentType,
+        accept,
+        version,
+        requestId,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: blob_xmlSerializer,
+};
+const getTagsOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: BlobTags,
+            headersMapper: BlobGetTagsHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobGetTagsExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        versionId,
+        comp18,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifTags,
+        ifModifiedSince1,
+        ifUnmodifiedSince1,
+        ifMatch1,
+        ifNoneMatch1,
+    ],
+    isXML: true,
+    serializer: blob_xmlSerializer,
+};
+const setTagsOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        204: {
+            headersMapper: BlobSetTagsHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlobSetTagsExceptionHeaders,
+        },
+    },
+    requestBody: tags,
+    queryParameters: [
+        timeoutInSeconds,
+        versionId,
+        comp18,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        contentType,
+        accept,
+        version,
+        requestId,
+        leaseId,
+        ifTags,
+        ifModifiedSince1,
+        ifUnmodifiedSince1,
+        ifMatch1,
+        ifNoneMatch1,
+        transactionalContentMD5,
+        transactionalContentCrc64,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: blob_xmlSerializer,
+};
+//# sourceMappingURL=blob.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/operations/pageBlob.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
 
-var Scalar = __nccwpck_require__(63301);
 
-function resolveBlockScalar(ctx, scalar, onError) {
-    const start = scalar.offset;
-    const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
-    if (!header)
-        return { value: '', type: null, comment: '', range: [start, start, start] };
-    const type = header.mode === '>' ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
-    const lines = scalar.source ? splitLines(scalar.source) : [];
-    // determine the end of content & start of chomping
-    let chompStart = lines.length;
-    for (let i = lines.length - 1; i >= 0; --i) {
-        const content = lines[i][1];
-        if (content === '' || content === '\r')
-            chompStart = i;
-        else
-            break;
+/** Class containing PageBlob operations. */
+class PageBlobImpl {
+    client;
+    /**
+     * Initialize a new instance of the class PageBlob class.
+     * @param client Reference to the service client
+     */
+    constructor(client) {
+        this.client = client;
     }
-    // shortcut for empty contents
-    if (chompStart === 0) {
-        const value = header.chomp === '+' && lines.length > 0
-            ? '\n'.repeat(Math.max(1, lines.length - 1))
-            : '';
-        let end = start + header.length;
-        if (scalar.source)
-            end += scalar.source.length;
-        return { value, type, comment: header.comment, range: [start, end, end] };
+    /**
+     * The Create operation creates a new page blob.
+     * @param contentLength The length of the request.
+     * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The
+     *                          page blob size must be aligned to a 512-byte boundary.
+     * @param options The options parameters.
+     */
+    create(contentLength, blobContentLength, options) {
+        return this.client.sendOperationRequest({ contentLength, blobContentLength, options }, pageBlob_createOperationSpec);
     }
-    // find the indentation level to trim from start
-    let trimIndent = scalar.indent + header.indent;
-    let offset = scalar.offset + header.length;
-    let contentStart = 0;
-    for (let i = 0; i < chompStart; ++i) {
-        const [indent, content] = lines[i];
-        if (content === '' || content === '\r') {
-            if (header.indent === 0 && indent.length > trimIndent)
-                trimIndent = indent.length;
-        }
-        else {
-            if (indent.length < trimIndent) {
-                const message = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';
-                onError(offset + indent.length, 'MISSING_CHAR', message);
-            }
-            if (header.indent === 0)
-                trimIndent = indent.length;
-            contentStart = i;
-            if (trimIndent === 0 && !ctx.atRoot) {
-                const message = 'Block scalar values in collections must be indented';
-                onError(offset, 'BAD_INDENT', message);
-            }
-            break;
-        }
-        offset += indent.length + content.length + 1;
+    /**
+     * The Upload Pages operation writes a range of pages to a page blob
+     * @param contentLength The length of the request.
+     * @param body Initial data
+     * @param options The options parameters.
+     */
+    uploadPages(contentLength, body, options) {
+        return this.client.sendOperationRequest({ contentLength, body, options }, uploadPagesOperationSpec);
     }
-    // include trailing more-indented empty lines in content
-    for (let i = lines.length - 1; i >= chompStart; --i) {
-        if (lines[i][0].length > trimIndent)
-            chompStart = i + 1;
+    /**
+     * The Clear Pages operation clears a set of pages from a page blob
+     * @param contentLength The length of the request.
+     * @param options The options parameters.
+     */
+    clearPages(contentLength, options) {
+        return this.client.sendOperationRequest({ contentLength, options }, clearPagesOperationSpec);
     }
-    let value = '';
-    let sep = '';
-    let prevMoreIndented = false;
-    // leading whitespace is kept intact
-    for (let i = 0; i < contentStart; ++i)
-        value += lines[i][0].slice(trimIndent) + '\n';
-    for (let i = contentStart; i < chompStart; ++i) {
-        let [indent, content] = lines[i];
-        offset += indent.length + content.length + 1;
-        const crlf = content[content.length - 1] === '\r';
-        if (crlf)
-            content = content.slice(0, -1);
-        /* istanbul ignore if already caught in lexer */
-        if (content && indent.length < trimIndent) {
-            const src = header.indent
-                ? 'explicit indentation indicator'
-                : 'first line';
-            const message = `Block scalar lines must not be less indented than their ${src}`;
-            onError(offset - content.length - (crlf ? 2 : 1), 'BAD_INDENT', message);
-            indent = '';
-        }
-        if (type === Scalar.Scalar.BLOCK_LITERAL) {
-            value += sep + indent.slice(trimIndent) + content;
-            sep = '\n';
-        }
-        else if (indent.length > trimIndent || content[0] === '\t') {
-            // more-indented content within a folded block
-            if (sep === ' ')
-                sep = '\n';
-            else if (!prevMoreIndented && sep === '\n')
-                sep = '\n\n';
-            value += sep + indent.slice(trimIndent) + content;
-            sep = '\n';
-            prevMoreIndented = true;
-        }
-        else if (content === '') {
-            // empty line
-            if (sep === '\n')
-                value += '\n';
-            else
-                sep = '\n';
-        }
-        else {
-            value += sep + content;
-            sep = ' ';
-            prevMoreIndented = false;
-        }
+    /**
+     * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a
+     * URL
+     * @param sourceUrl Specify a URL to the copy source.
+     * @param sourceRange Bytes of source data in the specified range. The length of this range should
+     *                    match the ContentLength header and x-ms-range/Range destination range header.
+     * @param contentLength The length of the request.
+     * @param range The range of bytes to which the source range would be written. The range should be 512
+     *              aligned and range-end is required.
+     * @param options The options parameters.
+     */
+    uploadPagesFromURL(sourceUrl, sourceRange, contentLength, range, options) {
+        return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec);
     }
-    switch (header.chomp) {
-        case '-':
-            break;
-        case '+':
-            for (let i = chompStart; i < lines.length; ++i)
-                value += '\n' + lines[i][0].slice(trimIndent);
-            if (value[value.length - 1] !== '\n')
-                value += '\n';
-            break;
-        default:
-            value += '\n';
+    /**
+     * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a
+     * page blob
+     * @param options The options parameters.
+     */
+    getPageRanges(options) {
+        return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec);
     }
-    const end = start + header.length + scalar.source.length;
-    return { value, type, comment: header.comment, range: [start, end, end] };
-}
-function parseBlockScalarHeader({ offset, props }, strict, onError) {
-    /* istanbul ignore if should not happen */
-    if (props[0].type !== 'block-scalar-header') {
-        onError(props[0], 'IMPOSSIBLE', 'Block scalar header not found');
-        return null;
+    /**
+     * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were
+     * changed between target blob and previous snapshot.
+     * @param options The options parameters.
+     */
+    getPageRangesDiff(options) {
+        return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec);
     }
-    const { source } = props[0];
-    const mode = source[0];
-    let indent = 0;
-    let chomp = '';
-    let error = -1;
-    for (let i = 1; i < source.length; ++i) {
-        const ch = source[i];
-        if (!chomp && (ch === '-' || ch === '+'))
-            chomp = ch;
-        else {
-            const n = Number(ch);
-            if (!indent && n)
-                indent = n;
-            else if (error === -1)
-                error = offset + i;
-        }
+    /**
+     * Resize the Blob
+     * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The
+     *                          page blob size must be aligned to a 512-byte boundary.
+     * @param options The options parameters.
+     */
+    resize(blobContentLength, options) {
+        return this.client.sendOperationRequest({ blobContentLength, options }, resizeOperationSpec);
     }
-    if (error !== -1)
-        onError(error, 'UNEXPECTED_TOKEN', `Block scalar header includes extra characters: ${source}`);
-    let hasSpace = false;
-    let comment = '';
-    let length = source.length;
-    for (let i = 1; i < props.length; ++i) {
-        const token = props[i];
-        switch (token.type) {
-            case 'space':
-                hasSpace = true;
-            // fallthrough
-            case 'newline':
-                length += token.source.length;
-                break;
-            case 'comment':
-                if (strict && !hasSpace) {
-                    const message = 'Comments must be separated from other tokens by white space characters';
-                    onError(token, 'MISSING_CHAR', message);
-                }
-                length += token.source.length;
-                comment = token.source.substring(1);
-                break;
-            case 'error':
-                onError(token, 'UNEXPECTED_TOKEN', token.message);
-                length += token.source.length;
-                break;
-            /* istanbul ignore next should not happen */
-            default: {
-                const message = `Unexpected token in block scalar header: ${token.type}`;
-                onError(token, 'UNEXPECTED_TOKEN', message);
-                const ts = token.source;
-                if (ts && typeof ts === 'string')
-                    length += ts.length;
-            }
-        }
+    /**
+     * Update the sequence number of the blob
+     * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request.
+     *                             This property applies to page blobs only. This property indicates how the service should modify the
+     *                             blob's sequence number
+     * @param options The options parameters.
+     */
+    updateSequenceNumber(sequenceNumberAction, options) {
+        return this.client.sendOperationRequest({ sequenceNumberAction, options }, updateSequenceNumberOperationSpec);
+    }
+    /**
+     * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob.
+     * The snapshot is copied such that only the differential changes between the previously copied
+     * snapshot are transferred to the destination. The copied snapshots are complete copies of the
+     * original snapshot and can be read or copied from as usual. This API is supported since REST version
+     * 2016-05-31.
+     * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
+     *                   2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
+     *                   appear in a request URI. The source blob must either be public or must be authenticated via a shared
+     *                   access signature.
+     * @param options The options parameters.
+     */
+    copyIncremental(copySource, options) {
+        return this.client.sendOperationRequest({ copySource, options }, copyIncrementalOperationSpec);
     }
-    return { mode, indent, chomp, comment, length };
-}
-/** @returns Array of lines split up as `[indent, content]` */
-function splitLines(source) {
-    const split = source.split(/\n( *)/);
-    const first = split[0];
-    const m = first.match(/^( *)/);
-    const line0 = m?.[1]
-        ? [m[1], first.slice(m[1].length)]
-        : ['', first];
-    const lines = [line0];
-    for (let i = 1; i < split.length; i += 2)
-        lines.push([split[i], split[i + 1]]);
-    return lines;
 }
-
-exports.resolveBlockScalar = resolveBlockScalar;
-
-
-/***/ }),
-
-/***/ 90334:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
+// Operation Specifications
+const pageBlob_xmlSerializer = createSerializer(mappers_namespaceObject, /* isXml */ true);
+const pageBlob_createOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: PageBlobCreateHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobCreateExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        contentLength,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        blobCacheControl,
+        blobContentType,
+        blobContentMD5,
+        blobContentEncoding,
+        blobContentLanguage,
+        blobContentDisposition,
+        immutabilityPolicyExpiry,
+        immutabilityPolicyMode,
+        encryptionScope,
+        tier,
+        blobTagsString,
+        legalHold1,
+        blobType,
+        blobContentLength,
+        blobSequenceNumber,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+const uploadPagesOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: PageBlobUploadPagesHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobUploadPagesExceptionHeaders,
+        },
+    },
+    requestBody: body1,
+    queryParameters: [timeoutInSeconds, comp19],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        contentLength,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        range,
+        structuredBodyType,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+        transactionalContentMD5,
+        transactionalContentCrc64,
+        contentType1,
+        accept2,
+        pageWrite,
+        ifSequenceNumberLessThanOrEqualTo,
+        ifSequenceNumberLessThan,
+        ifSequenceNumberEqualTo,
+        structuredContentLength,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "binary",
+    serializer: pageBlob_xmlSerializer,
+};
+const clearPagesOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: PageBlobClearPagesHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobClearPagesExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp19],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        contentLength,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        range,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+        ifSequenceNumberLessThanOrEqualTo,
+        ifSequenceNumberLessThan,
+        ifSequenceNumberEqualTo,
+        pageWrite1,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+const uploadPagesFromURLOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: PageBlobUploadPagesFromURLHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobUploadPagesFromURLExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp19],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        contentLength,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+        sourceIfModifiedSince,
+        sourceIfUnmodifiedSince,
+        sourceIfMatch,
+        sourceIfNoneMatch,
+        sourceContentMD5,
+        copySourceAuthorization,
+        fileRequestIntent,
+        pageWrite,
+        ifSequenceNumberLessThanOrEqualTo,
+        ifSequenceNumberLessThan,
+        ifSequenceNumberEqualTo,
+        sourceUrl,
+        sourceRange,
+        sourceContentCrc64,
+        range1,
+        sourceEncryptionKey,
+        sourceEncryptionKeySha256,
+        sourceEncryptionAlgorithm,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+const getPageRangesOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: PageList,
+            headersMapper: PageBlobGetPageRangesHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobGetPageRangesExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        marker,
+        maxPageSize,
+        snapshot,
+        comp20,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        range,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+const getPageRangesDiffOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: PageList,
+            headersMapper: PageBlobGetPageRangesDiffHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobGetPageRangesDiffExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        marker,
+        maxPageSize,
+        snapshot,
+        comp20,
+        prevsnapshot,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        range,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        prevSnapshotUrl,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+const resizeOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: PageBlobResizeHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobResizeExceptionHeaders,
+        },
+    },
+    queryParameters: [comp, timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+        blobContentLength,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+const updateSequenceNumberOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: PageBlobUpdateSequenceNumberHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders,
+        },
+    },
+    queryParameters: [comp, timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        blobSequenceNumber,
+        sequenceNumberAction,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+const copyIncrementalOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        202: {
+            headersMapper: PageBlobCopyIncrementalHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: PageBlobCopyIncrementalExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp21],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        copySource,
+    ],
+    isXML: true,
+    serializer: pageBlob_xmlSerializer,
+};
+//# sourceMappingURL=pageBlob.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/operations/appendBlob.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
 
-var YAMLSeq = __nccwpck_require__(92223);
-var resolveProps = __nccwpck_require__(34631);
-var utilFlowIndentCheck = __nccwpck_require__(74051);
 
-function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
-    const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq;
-    const seq = new NodeClass(ctx.schema);
-    if (ctx.atRoot)
-        ctx.atRoot = false;
-    if (ctx.atKey)
-        ctx.atKey = false;
-    let offset = bs.offset;
-    let commentEnd = null;
-    for (const { start, value } of bs.items) {
-        const props = resolveProps.resolveProps(start, {
-            indicator: 'seq-item-ind',
-            next: value,
-            offset,
-            onError,
-            parentIndent: bs.indent,
-            startOnNewline: true
-        });
-        if (!props.found) {
-            if (props.anchor || props.tag || value) {
-                if (value?.type === 'block-seq')
-                    onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
-                else
-                    onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
-            }
-            else {
-                commentEnd = props.end;
-                if (props.comment)
-                    seq.comment = props.comment;
-                continue;
-            }
-        }
-        const node = value
-            ? composeNode(ctx, value, props, onError)
-            : composeEmptyNode(ctx, props.end, start, null, props, onError);
-        if (ctx.schema.compat)
-            utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
-        offset = node.range[2];
-        seq.items.push(node);
+/** Class containing AppendBlob operations. */
+class AppendBlobImpl {
+    client;
+    /**
+     * Initialize a new instance of the class AppendBlob class.
+     * @param client Reference to the service client
+     */
+    constructor(client) {
+        this.client = client;
+    }
+    /**
+     * The Create Append Blob operation creates a new append blob.
+     * @param contentLength The length of the request.
+     * @param options The options parameters.
+     */
+    create(contentLength, options) {
+        return this.client.sendOperationRequest({ contentLength, options }, appendBlob_createOperationSpec);
+    }
+    /**
+     * The Append Block operation commits a new block of data to the end of an existing append blob. The
+     * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to
+     * AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
+     * @param contentLength The length of the request.
+     * @param body Initial data
+     * @param options The options parameters.
+     */
+    appendBlock(contentLength, body, options) {
+        return this.client.sendOperationRequest({ contentLength, body, options }, appendBlockOperationSpec);
+    }
+    /**
+     * The Append Block operation commits a new block of data to the end of an existing append blob where
+     * the contents are read from a source url. The Append Block operation is permitted only if the blob
+     * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version
+     * 2015-02-21 version or later.
+     * @param sourceUrl Specify a URL to the copy source.
+     * @param contentLength The length of the request.
+     * @param options The options parameters.
+     */
+    appendBlockFromUrl(sourceUrl, contentLength, options) {
+        return this.client.sendOperationRequest({ sourceUrl, contentLength, options }, appendBlockFromUrlOperationSpec);
+    }
+    /**
+     * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version
+     * 2019-12-12 version or later.
+     * @param options The options parameters.
+     */
+    seal(options) {
+        return this.client.sendOperationRequest({ options }, sealOperationSpec);
     }
-    seq.range = [bs.offset, offset, commentEnd ?? offset];
-    return seq;
 }
+// Operation Specifications
+const appendBlob_xmlSerializer = createSerializer(mappers_namespaceObject, /* isXml */ true);
+const appendBlob_createOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: AppendBlobCreateHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: AppendBlobCreateExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        contentLength,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        blobCacheControl,
+        blobContentType,
+        blobContentMD5,
+        blobContentEncoding,
+        blobContentLanguage,
+        blobContentDisposition,
+        immutabilityPolicyExpiry,
+        immutabilityPolicyMode,
+        encryptionScope,
+        blobTagsString,
+        legalHold1,
+        blobType1,
+    ],
+    isXML: true,
+    serializer: appendBlob_xmlSerializer,
+};
+const appendBlockOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: AppendBlobAppendBlockHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: AppendBlobAppendBlockExceptionHeaders,
+        },
+    },
+    requestBody: body1,
+    queryParameters: [timeoutInSeconds, comp22],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        contentLength,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        structuredBodyType,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+        transactionalContentMD5,
+        transactionalContentCrc64,
+        contentType1,
+        accept2,
+        structuredContentLength,
+        maxSize,
+        appendPosition,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "binary",
+    serializer: appendBlob_xmlSerializer,
+};
+const appendBlockFromUrlOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: AppendBlobAppendBlockFromUrlHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp22],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        contentLength,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        encryptionScope,
+        sourceIfModifiedSince,
+        sourceIfUnmodifiedSince,
+        sourceIfMatch,
+        sourceIfNoneMatch,
+        sourceContentMD5,
+        copySourceAuthorization,
+        fileRequestIntent,
+        transactionalContentMD5,
+        sourceUrl,
+        sourceContentCrc64,
+        sourceEncryptionKey,
+        sourceEncryptionKeySha256,
+        sourceEncryptionAlgorithm,
+        maxSize,
+        appendPosition,
+        sourceRange1,
+    ],
+    isXML: true,
+    serializer: appendBlob_xmlSerializer,
+};
+const sealOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        200: {
+            headersMapper: AppendBlobSealHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: AppendBlobSealExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds, comp23],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        ifMatch,
+        ifNoneMatch,
+        appendPosition,
+    ],
+    isXML: true,
+    serializer: appendBlob_xmlSerializer,
+};
+//# sourceMappingURL=appendBlob.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/operations/blockBlob.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
-exports.resolveBlockSeq = resolveBlockSeq;
-
-
-/***/ }),
-
-/***/ 17788:
-/***/ ((__unused_webpack_module, exports) => {
 
-"use strict";
 
+/** Class containing BlockBlob operations. */
+class BlockBlobImpl {
+    client;
+    /**
+     * Initialize a new instance of the class BlockBlob class.
+     * @param client Reference to the service client
+     */
+    constructor(client) {
+        this.client = client;
+    }
+    /**
+     * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing
+     * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put
+     * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a
+     * partial update of the content of a block blob, use the Put Block List operation.
+     * @param contentLength The length of the request.
+     * @param body Initial data
+     * @param options The options parameters.
+     */
+    upload(contentLength, body, options) {
+        return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec);
+    }
+    /**
+     * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read
+     * from a given URL.  This API is supported beginning with the 2020-04-08 version. Partial updates are
+     * not supported with Put Blob from URL; the content of an existing blob is overwritten with the
+     * content of the new blob.  To perform partial updates to a block blob’s contents using a source URL,
+     * use the Put Block from URL API in conjunction with Put Block List.
+     * @param contentLength The length of the request.
+     * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
+     *                   2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
+     *                   appear in a request URI. The source blob must either be public or must be authenticated via a shared
+     *                   access signature.
+     * @param options The options parameters.
+     */
+    putBlobFromUrl(contentLength, copySource, options) {
+        return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec);
+    }
+    /**
+     * The Stage Block operation creates a new block to be committed as part of a blob
+     * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string
+     *                must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified
+     *                for the blockid parameter must be the same size for each block.
+     * @param contentLength The length of the request.
+     * @param body Initial data
+     * @param options The options parameters.
+     */
+    stageBlock(blockId, contentLength, body, options) {
+        return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec);
+    }
+    /**
+     * The Stage Block operation creates a new block to be committed as part of a blob where the contents
+     * are read from a URL.
+     * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string
+     *                must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified
+     *                for the blockid parameter must be the same size for each block.
+     * @param contentLength The length of the request.
+     * @param sourceUrl Specify a URL to the copy source.
+     * @param options The options parameters.
+     */
+    stageBlockFromURL(blockId, contentLength, sourceUrl, options) {
+        return this.client.sendOperationRequest({ blockId, contentLength, sourceUrl, options }, stageBlockFromURLOperationSpec);
+    }
+    /**
+     * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the
+     * blob. In order to be written as part of a blob, a block must have been successfully written to the
+     * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading
+     * only those blocks that have changed, then committing the new and existing blocks together. You can
+     * do this by specifying whether to commit a block from the committed block list or from the
+     * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list
+     * it may belong to.
+     * @param blocks Blob Blocks.
+     * @param options The options parameters.
+     */
+    commitBlockList(blocks, options) {
+        return this.client.sendOperationRequest({ blocks, options }, commitBlockListOperationSpec);
+    }
+    /**
+     * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block
+     * blob
+     * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted
+     *                 blocks, or both lists together.
+     * @param options The options parameters.
+     */
+    getBlockList(listType, options) {
+        return this.client.sendOperationRequest({ listType, options }, getBlockListOperationSpec);
+    }
+}
+// Operation Specifications
+const blockBlob_xmlSerializer = createSerializer(mappers_namespaceObject, /* isXml */ true);
+const uploadOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: BlockBlobUploadHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlockBlobUploadExceptionHeaders,
+        },
+    },
+    requestBody: body1,
+    queryParameters: [timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        contentLength,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        structuredBodyType,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        blobCacheControl,
+        blobContentType,
+        blobContentMD5,
+        blobContentEncoding,
+        blobContentLanguage,
+        blobContentDisposition,
+        immutabilityPolicyExpiry,
+        immutabilityPolicyMode,
+        encryptionScope,
+        tier,
+        blobTagsString,
+        legalHold1,
+        transactionalContentMD5,
+        transactionalContentCrc64,
+        contentType1,
+        accept2,
+        structuredContentLength,
+        blobType2,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "binary",
+    serializer: blockBlob_xmlSerializer,
+};
+const putBlobFromUrlOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: BlockBlobPutBlobFromUrlHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders,
+        },
+    },
+    queryParameters: [timeoutInSeconds],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        contentLength,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        blobCacheControl,
+        blobContentType,
+        blobContentMD5,
+        blobContentEncoding,
+        blobContentLanguage,
+        blobContentDisposition,
+        encryptionScope,
+        tier,
+        sourceIfModifiedSince,
+        sourceIfUnmodifiedSince,
+        sourceIfMatch,
+        sourceIfNoneMatch,
+        sourceIfTags,
+        copySource,
+        blobTagsString,
+        sourceContentMD5,
+        copySourceAuthorization,
+        copySourceTags,
+        fileRequestIntent,
+        transactionalContentMD5,
+        sourceEncryptionKey,
+        sourceEncryptionKeySha256,
+        sourceEncryptionAlgorithm,
+        blobType2,
+        copySourceBlobProperties,
+    ],
+    isXML: true,
+    serializer: blockBlob_xmlSerializer,
+};
+const stageBlockOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: BlockBlobStageBlockHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlockBlobStageBlockExceptionHeaders,
+        },
+    },
+    requestBody: body1,
+    queryParameters: [
+        timeoutInSeconds,
+        comp24,
+        blockId,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        contentLength,
+        leaseId,
+        structuredBodyType,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        encryptionScope,
+        transactionalContentMD5,
+        transactionalContentCrc64,
+        contentType1,
+        accept2,
+        structuredContentLength,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "binary",
+    serializer: blockBlob_xmlSerializer,
+};
+const stageBlockFromURLOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: BlockBlobStageBlockFromURLHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlockBlobStageBlockFromURLExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        comp24,
+        blockId,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        contentLength,
+        leaseId,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        encryptionScope,
+        sourceIfModifiedSince,
+        sourceIfUnmodifiedSince,
+        sourceIfMatch,
+        sourceIfNoneMatch,
+        sourceContentMD5,
+        copySourceAuthorization,
+        fileRequestIntent,
+        sourceUrl,
+        sourceContentCrc64,
+        sourceEncryptionKey,
+        sourceEncryptionKeySha256,
+        sourceEncryptionAlgorithm,
+        sourceRange1,
+    ],
+    isXML: true,
+    serializer: blockBlob_xmlSerializer,
+};
+const commitBlockListOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "PUT",
+    responses: {
+        201: {
+            headersMapper: BlockBlobCommitBlockListHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlockBlobCommitBlockListExceptionHeaders,
+        },
+    },
+    requestBody: blocks,
+    queryParameters: [timeoutInSeconds, comp25],
+    urlParameters: [url],
+    headerParameters: [
+        contentType,
+        accept,
+        version,
+        requestId,
+        metadata,
+        leaseId,
+        ifModifiedSince,
+        ifUnmodifiedSince,
+        encryptionKey,
+        encryptionKeySha256,
+        encryptionAlgorithm,
+        ifMatch,
+        ifNoneMatch,
+        ifTags,
+        blobCacheControl,
+        blobContentType,
+        blobContentMD5,
+        blobContentEncoding,
+        blobContentLanguage,
+        blobContentDisposition,
+        immutabilityPolicyExpiry,
+        immutabilityPolicyMode,
+        encryptionScope,
+        tier,
+        blobTagsString,
+        legalHold1,
+        transactionalContentMD5,
+        transactionalContentCrc64,
+    ],
+    isXML: true,
+    contentType: "application/xml; charset=utf-8",
+    mediaType: "xml",
+    serializer: blockBlob_xmlSerializer,
+};
+const getBlockListOperationSpec = {
+    path: "/{containerName}/{blob}",
+    httpMethod: "GET",
+    responses: {
+        200: {
+            bodyMapper: BlockList,
+            headersMapper: BlockBlobGetBlockListHeaders,
+        },
+        default: {
+            bodyMapper: StorageError,
+            headersMapper: BlockBlobGetBlockListExceptionHeaders,
+        },
+    },
+    queryParameters: [
+        timeoutInSeconds,
+        snapshot,
+        comp25,
+        listType,
+    ],
+    urlParameters: [url],
+    headerParameters: [
+        version,
+        requestId,
+        accept1,
+        leaseId,
+        ifTags,
+    ],
+    isXML: true,
+    serializer: blockBlob_xmlSerializer,
+};
+//# sourceMappingURL=blockBlob.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/operations/index.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
-function resolveEnd(end, offset, reqSpace, onError) {
-    let comment = '';
-    if (end) {
-        let hasSpace = false;
-        let sep = '';
-        for (const token of end) {
-            const { source, type } = token;
-            switch (type) {
-                case 'space':
-                    hasSpace = true;
-                    break;
-                case 'comment': {
-                    if (reqSpace && !hasSpace)
-                        onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
-                    const cb = source.substring(1) || ' ';
-                    if (!comment)
-                        comment = cb;
-                    else
-                        comment += sep + cb;
-                    sep = '';
-                    break;
-                }
-                case 'newline':
-                    if (comment)
-                        sep += source;
-                    hasSpace = true;
-                    break;
-                default:
-                    onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);
-            }
-            offset += source.length;
+
+
+
+
+
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/storageClient.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
+
+
+class StorageClient extends ExtendedServiceClient {
+    url;
+    version;
+    /**
+     * Initializes a new instance of the StorageClient class.
+     * @param url The URL of the service account, container, or blob that is the target of the desired
+     *            operation.
+     * @param options The parameter options
+     */
+    constructor(url, options) {
+        if (url === undefined) {
+            throw new Error("'url' cannot be null");
         }
-    }
-    return { comment, offset };
+        // Initializing default values for options
+        if (!options) {
+            options = {};
+        }
+        const defaults = {
+            requestContentType: "application/json; charset=utf-8",
+        };
+        const packageDetails = `azsdk-js-azure-storage-blob/12.32.0`;
+        const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
+            ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
+            : `${packageDetails}`;
+        const optionsWithDefaults = {
+            ...defaults,
+            ...options,
+            userAgentOptions: {
+                userAgentPrefix,
+            },
+            endpoint: options.endpoint ?? options.baseUri ?? "{url}",
+        };
+        super(optionsWithDefaults);
+        // Parameter assignments
+        this.url = url;
+        // Assigning values to Constant parameters
+        this.version = options.version || "2026-04-06";
+        this.service = new ServiceImpl(this);
+        this.container = new ContainerImpl(this);
+        this.blob = new BlobImpl(this);
+        this.pageBlob = new PageBlobImpl(this);
+        this.appendBlob = new AppendBlobImpl(this);
+        this.blockBlob = new BlockBlobImpl(this);
+    }
+    service;
+    container;
+    blob;
+    pageBlob;
+    appendBlob;
+    blockBlob;
 }
+//# sourceMappingURL=storageClient.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generated/src/index.js
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
 
-exports.resolveEnd = resolveEnd;
 
 
-/***/ }),
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/StorageContextClient.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-/***/ 13142:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/**
+ * @internal
+ */
+class StorageContextClient extends StorageClient {
+    async sendOperationRequest(operationArguments, operationSpec) {
+        const operationSpecToSend = { ...operationSpec };
+        if (operationSpecToSend.path === "/{containerName}" ||
+            operationSpecToSend.path === "/{containerName}/{blob}") {
+            operationSpecToSend.path = "";
+        }
+        return super.sendOperationRequest(operationArguments, operationSpecToSend);
+    }
+}
+//# sourceMappingURL=StorageContextClient.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/utils/utils.common.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-"use strict";
 
 
-var identity = __nccwpck_require__(41127);
-var Pair = __nccwpck_require__(57165);
-var YAMLMap = __nccwpck_require__(84454);
-var YAMLSeq = __nccwpck_require__(92223);
-var resolveEnd = __nccwpck_require__(17788);
-var resolveProps = __nccwpck_require__(34631);
-var utilContainsNewline = __nccwpck_require__(9499);
-var utilMapIncludes = __nccwpck_require__(81187);
 
-const blockMsg = 'Block collections are not allowed within flow collections';
-const isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');
-function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
-    const isMap = fc.start.source === '{';
-    const fcName = isMap ? 'flow map' : 'flow sequence';
-    const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq));
-    const coll = new NodeClass(ctx.schema);
-    coll.flow = true;
-    const atRoot = ctx.atRoot;
-    if (atRoot)
-        ctx.atRoot = false;
-    if (ctx.atKey)
-        ctx.atKey = false;
-    let offset = fc.offset + fc.start.source.length;
-    for (let i = 0; i < fc.items.length; ++i) {
-        const collItem = fc.items[i];
-        const { start, key, sep, value } = collItem;
-        const props = resolveProps.resolveProps(start, {
-            flow: fcName,
-            indicator: 'explicit-key-ind',
-            next: key ?? sep?.[0],
-            offset,
-            onError,
-            parentIndent: fc.indent,
-            startOnNewline: false
-        });
-        if (!props.found) {
-            if (!props.anchor && !props.tag && !sep && !value) {
-                if (i === 0 && props.comma)
-                    onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
-                else if (i < fc.items.length - 1)
-                    onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`);
-                if (props.comment) {
-                    if (coll.comment)
-                        coll.comment += '\n' + props.comment;
-                    else
-                        coll.comment = props.comment;
-                }
-                offset = props.end;
-                continue;
-            }
-            if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key))
-                onError(key, // checked by containsNewline()
-                'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
+/**
+ * Reserved URL characters must be properly escaped for Storage services like Blob or File.
+ *
+ * ## URL encode and escape strategy for JS SDKs
+ *
+ * When customers pass a URL string into XxxClient classes constructor, the URL string may already be URL encoded or not.
+ * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL
+ * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors.
+ *
+ * ### Strategy One: Assume the customer URL string is not encoded, and always encode URL string in SDK.
+ *
+ * This is what legacy V2 SDK does, simple and works for most of the cases.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b:",
+ *   SDK will encode it to "http://account.blob.core.windows.net/con/b%3A" and send to server. A blob named "b:" will be created.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b%3A",
+ *   SDK will encode it to "http://account.blob.core.windows.net/con/b%253A" and send to server. A blob named "b%3A" will be created.
+ *
+ * But this strategy will make it not possible to create a blob with "?" in it's name. Because when customer URL string is
+ * "http://account.blob.core.windows.net/con/blob?name", the "?name" will be treated as URL paramter instead of blob name.
+ * If customer URL string is "http://account.blob.core.windows.net/con/blob%3Fname", a blob named "blob%3Fname" will be created.
+ * V2 SDK doesn't have this issue because it doesn't allow customer pass in a full URL, it accepts a separate blob name and encodeURIComponent for it.
+ * We cannot accept a SDK cannot create a blob name with "?". So we implement strategy two:
+ *
+ * ### Strategy Two: SDK doesn't assume the URL has been encoded or not. It will just escape the special characters.
+ *
+ * This is what V10 Blob Go SDK does. It accepts a URL type in Go, and call url.EscapedPath() to escape the special chars unescaped.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b:",
+ *   SDK will escape ":" like "http://account.blob.core.windows.net/con/b%3A" and send to server. A blob named "b:" will be created.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b%3A",
+ *   There is no special characters, so send "http://account.blob.core.windows.net/con/b%3A" to server. A blob named "b:" will be created.
+ * - When customer URL string is "http://account.blob.core.windows.net/con/b%253A",
+ *   There is no special characters, so send "http://account.blob.core.windows.net/con/b%253A" to server. A blob named "b%3A" will be created.
+ *
+ * This strategy gives us flexibility to create with any special characters. But "%" will be treated as a special characters, if the URL string
+ * is not encoded, there shouldn't a "%" in the URL string, otherwise the URL is not a valid URL.
+ * If customer needs to create a blob with "%" in it's blob name, use "%25" instead of "%". Just like above 3rd sample.
+ * And following URL strings are invalid:
+ * - "http://account.blob.core.windows.net/con/b%"
+ * - "http://account.blob.core.windows.net/con/b%2"
+ * - "http://account.blob.core.windows.net/con/b%G"
+ *
+ * Another special character is "?", use "%2F" to represent a blob name with "?" in a URL string.
+ *
+ * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `containerClient.getBlobClient(blobName)`
+ *
+ * We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.
+ *
+ * @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
+ * @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata
+ *
+ * @param url -
+ */
+function utils_common_escapeURLPath(url) {
+    const urlParsed = new URL(url);
+    let path = urlParsed.pathname;
+    path = path || "/";
+    path = utils_utils_common_escape(path);
+    urlParsed.pathname = path;
+    return urlParsed.toString();
+}
+function utils_common_getProxyUriFromDevConnString(connectionString) {
+    // Development Connection String
+    // https://learn.microsoft.com/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key
+    let proxyUri = "";
+    if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) {
+        // CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri
+        const matchCredentials = connectionString.split(";");
+        for (const element of matchCredentials) {
+            if (element.trim().startsWith("DevelopmentStorageProxyUri=")) {
+                proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1];
+            }
+        }
+    }
+    return proxyUri;
+}
+function utils_common_getValueInConnString(connectionString, argument) {
+    const elements = connectionString.split(";");
+    for (const element of elements) {
+        if (element.trim().startsWith(argument)) {
+            return element.trim().match(argument + "=(.*)")[1];
+        }
+    }
+    return "";
+}
+/**
+ * Extracts the parts of an Azure Storage account connection string.
+ *
+ * @param connectionString - Connection string.
+ * @returns String key value pairs of the storage account's url and credentials.
+ */
+function utils_common_extractConnectionStringParts(connectionString) {
+    let proxyUri = "";
+    if (connectionString.startsWith("UseDevelopmentStorage=true")) {
+        // Development connection string
+        proxyUri = utils_common_getProxyUriFromDevConnString(connectionString);
+        connectionString = utils_constants_DevelopmentConnectionString;
+    }
+    // Matching BlobEndpoint in the Account connection string
+    let blobEndpoint = utils_common_getValueInConnString(connectionString, "BlobEndpoint");
+    // Slicing off '/' at the end if exists
+    // (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end)
+    blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint;
+    if (connectionString.search("DefaultEndpointsProtocol=") !== -1 &&
+        connectionString.search("AccountKey=") !== -1) {
+        // Account connection string
+        let defaultEndpointsProtocol = "";
+        let accountName = "";
+        let accountKey = Buffer.from("accountKey", "base64");
+        let endpointSuffix = "";
+        // Get account name and key
+        accountName = utils_common_getValueInConnString(connectionString, "AccountName");
+        accountKey = Buffer.from(utils_common_getValueInConnString(connectionString, "AccountKey"), "base64");
+        if (!blobEndpoint) {
+            // BlobEndpoint is not present in the Account connection string
+            // Can be obtained from `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`
+            defaultEndpointsProtocol = utils_common_getValueInConnString(connectionString, "DefaultEndpointsProtocol");
+            const protocol = defaultEndpointsProtocol.toLowerCase();
+            if (protocol !== "https" && protocol !== "http") {
+                throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
+            }
+            endpointSuffix = utils_common_getValueInConnString(connectionString, "EndpointSuffix");
+            if (!endpointSuffix) {
+                throw new Error("Invalid EndpointSuffix in the provided Connection String");
+            }
+            blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;
+        }
+        if (!accountName) {
+            throw new Error("Invalid AccountName in the provided Connection String");
+        }
+        else if (accountKey.length === 0) {
+            throw new Error("Invalid AccountKey in the provided Connection String");
         }
-        if (i === 0) {
-            if (props.comma)
-                onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
+        return {
+            kind: "AccountConnString",
+            url: blobEndpoint,
+            accountName,
+            accountKey,
+            proxyUri,
+        };
+    }
+    else {
+        // SAS connection string
+        let accountSas = utils_common_getValueInConnString(connectionString, "SharedAccessSignature");
+        let accountName = utils_common_getValueInConnString(connectionString, "AccountName");
+        // if accountName is empty, try to read it from BlobEndpoint
+        if (!accountName) {
+            accountName = utils_common_getAccountNameFromUrl(blobEndpoint);
         }
-        else {
-            if (!props.comma)
-                onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`);
-            if (props.comment) {
-                let prevItemComment = '';
-                loop: for (const st of start) {
-                    switch (st.type) {
-                        case 'comma':
-                        case 'space':
-                            break;
-                        case 'comment':
-                            prevItemComment = st.source.substring(1);
-                            break loop;
-                        default:
-                            break loop;
-                    }
-                }
-                if (prevItemComment) {
-                    let prev = coll.items[coll.items.length - 1];
-                    if (identity.isPair(prev))
-                        prev = prev.value ?? prev.key;
-                    if (prev.comment)
-                        prev.comment += '\n' + prevItemComment;
-                    else
-                        prev.comment = prevItemComment;
-                    props.comment = props.comment.substring(prevItemComment.length + 1);
-                }
-            }
+        if (!blobEndpoint) {
+            throw new Error("Invalid BlobEndpoint in the provided SAS Connection String");
         }
-        if (!isMap && !sep && !props.found) {
-            // item is a value in a seq
-            // → key & sep are empty, start does not include ? or :
-            const valueNode = value
-                ? composeNode(ctx, value, props, onError)
-                : composeEmptyNode(ctx, props.end, sep, null, props, onError);
-            coll.items.push(valueNode);
-            offset = valueNode.range[2];
-            if (isBlock(value))
-                onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
+        else if (!accountSas) {
+            throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
         }
-        else {
-            // item is a key+value pair
-            // key value
-            ctx.atKey = true;
-            const keyStart = props.end;
-            const keyNode = key
-                ? composeNode(ctx, key, props, onError)
-                : composeEmptyNode(ctx, keyStart, start, null, props, onError);
-            if (isBlock(key))
-                onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
-            ctx.atKey = false;
-            // value properties
-            const valueProps = resolveProps.resolveProps(sep ?? [], {
-                flow: fcName,
-                indicator: 'map-value-ind',
-                next: value,
-                offset: keyNode.range[2],
-                onError,
-                parentIndent: fc.indent,
-                startOnNewline: false
-            });
-            if (valueProps.found) {
-                if (!isMap && !props.found && ctx.options.strict) {
-                    if (sep)
-                        for (const st of sep) {
-                            if (st === valueProps.found)
-                                break;
-                            if (st.type === 'newline') {
-                                onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
-                                break;
-                            }
-                        }
-                    if (props.start < valueProps.found.offset - 1024)
-                        onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key');
-                }
-            }
-            else if (value) {
-                if ('source' in value && value.source?.[0] === ':')
-                    onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);
-                else
-                    onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);
-            }
-            // value value
-            const valueNode = value
-                ? composeNode(ctx, value, valueProps, onError)
-                : valueProps.found
-                    ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)
-                    : null;
-            if (valueNode) {
-                if (isBlock(value))
-                    onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
-            }
-            else if (valueProps.comment) {
-                if (keyNode.comment)
-                    keyNode.comment += '\n' + valueProps.comment;
-                else
-                    keyNode.comment = valueProps.comment;
+        // client constructors assume accountSas does *not* start with ?
+        if (accountSas.startsWith("?")) {
+            accountSas = accountSas.substring(1);
+        }
+        return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas };
+    }
+}
+/**
+ * Internal escape method implemented Strategy Two mentioned in escapeURL() description.
+ *
+ * @param text -
+ */
+function utils_utils_common_escape(text) {
+    return encodeURIComponent(text)
+        .replace(/%2F/g, "/") // Don't escape for "/"
+        .replace(/'/g, "%27") // Escape for "'"
+        .replace(/\+/g, "%20")
+        .replace(/%25/g, "%"); // Revert encoded "%"
+}
+/**
+ * Append a string to URL path. Will remove duplicated "/" in front of the string
+ * when URL path ends with a "/".
+ *
+ * @param url - Source URL string
+ * @param name - String to be appended to URL
+ * @returns An updated URL string
+ */
+function utils_common_appendToURLPath(url, name) {
+    const urlParsed = new URL(url);
+    let path = urlParsed.pathname;
+    path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name;
+    urlParsed.pathname = path;
+    return urlParsed.toString();
+}
+/**
+ * Set URL parameter name and value. If name exists in URL parameters, old value
+ * will be replaced by name key. If not provide value, the parameter will be deleted.
+ *
+ * @param url - Source URL string
+ * @param name - Parameter name
+ * @param value - Parameter value
+ * @returns An updated URL string
+ */
+function utils_common_setURLParameter(url, name, value) {
+    const urlParsed = new URL(url);
+    const encodedName = encodeURIComponent(name);
+    const encodedValue = value ? encodeURIComponent(value) : undefined;
+    // mutating searchParams will change the encoding, so we have to do this ourselves
+    const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
+    const searchPieces = [];
+    for (const pair of searchString.slice(1).split("&")) {
+        if (pair) {
+            const [key] = pair.split("=", 2);
+            if (key !== encodedName) {
+                searchPieces.push(pair);
             }
-            const pair = new Pair.Pair(keyNode, valueNode);
-            if (ctx.options.keepSourceTokens)
-                pair.srcToken = collItem;
-            if (isMap) {
-                const map = coll;
-                if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
-                    onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
-                map.items.push(pair);
+        }
+    }
+    if (encodedValue) {
+        searchPieces.push(`${encodedName}=${encodedValue}`);
+    }
+    urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
+    return urlParsed.toString();
+}
+/**
+ * Get URL parameter by name.
+ *
+ * @param url -
+ * @param name -
+ */
+function utils_common_getURLParameter(url, name) {
+    const urlParsed = new URL(url);
+    return urlParsed.searchParams.get(name) ?? undefined;
+}
+/**
+ * Set URL host.
+ *
+ * @param url - Source URL string
+ * @param host - New host string
+ * @returns An updated URL string
+ */
+function utils_common_setURLHost(url, host) {
+    const urlParsed = new URL(url);
+    urlParsed.hostname = host;
+    return urlParsed.toString();
+}
+/**
+ * Get URL path from an URL string.
+ *
+ * @param url - Source URL string
+ */
+function utils_common_getURLPath(url) {
+    try {
+        const urlParsed = new URL(url);
+        return urlParsed.pathname;
+    }
+    catch (e) {
+        return undefined;
+    }
+}
+/**
+ * Get URL scheme from an URL string.
+ *
+ * @param url - Source URL string
+ */
+function utils_common_getURLScheme(url) {
+    try {
+        const urlParsed = new URL(url);
+        return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol;
+    }
+    catch (e) {
+        return undefined;
+    }
+}
+/**
+ * Get URL path and query from an URL string.
+ *
+ * @param url - Source URL string
+ */
+function utils_common_getURLPathAndQuery(url) {
+    const urlParsed = new URL(url);
+    const pathString = urlParsed.pathname;
+    if (!pathString) {
+        throw new RangeError("Invalid url without valid path.");
+    }
+    let queryString = urlParsed.search || "";
+    queryString = queryString.trim();
+    if (queryString !== "") {
+        queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; // Ensure query string start with '?'
+    }
+    return `${pathString}${queryString}`;
+}
+/**
+ * Get URL query key value pairs from an URL string.
+ *
+ * @param url -
+ */
+function utils_common_getURLQueries(url) {
+    let queryString = new URL(url).search;
+    if (!queryString) {
+        return {};
+    }
+    queryString = queryString.trim();
+    queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString;
+    let querySubStrings = queryString.split("&");
+    querySubStrings = querySubStrings.filter((value) => {
+        const indexOfEqual = value.indexOf("=");
+        const lastIndexOfEqual = value.lastIndexOf("=");
+        return (indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1);
+    });
+    const queries = {};
+    for (const querySubString of querySubStrings) {
+        const splitResults = querySubString.split("=");
+        const key = splitResults[0];
+        const value = splitResults[1];
+        queries[key] = value;
+    }
+    return queries;
+}
+/**
+ * Append a string to URL query.
+ *
+ * @param url - Source URL string.
+ * @param queryParts - String to be appended to the URL query.
+ * @returns An updated URL string.
+ */
+function utils_common_appendToURLQuery(url, queryParts) {
+    const urlParsed = new URL(url);
+    let query = urlParsed.search;
+    if (query) {
+        query += "&" + queryParts;
+    }
+    else {
+        query = queryParts;
+    }
+    urlParsed.search = query;
+    return urlParsed.toString();
+}
+/**
+ * Rounds a date off to seconds.
+ *
+ * @param date -
+ * @param withMilliseconds - If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned;
+ *                                          If false, YYYY-MM-DDThh:mm:ssZ will be returned.
+ * @returns Date string in ISO8061 format, with or without 7 milliseconds component
+ */
+function utils_common_truncatedISO8061Date(date, withMilliseconds = true) {
+    // Date.toISOString() will return like "2018-10-29T06:34:36.139Z"
+    const dateString = date.toISOString();
+    return withMilliseconds
+        ? dateString.substring(0, dateString.length - 1) + "0000" + "Z"
+        : dateString.substring(0, dateString.length - 5) + "Z";
+}
+/**
+ * Base64 encode.
+ *
+ * @param content -
+ */
+function base64encode(content) {
+    return !esm_isNodeLike ? btoa(content) : Buffer.from(content).toString("base64");
+}
+/**
+ * Base64 decode.
+ *
+ * @param encodedString -
+ */
+function base64decode(encodedString) {
+    return !isNodeLike ? atob(encodedString) : Buffer.from(encodedString, "base64").toString();
+}
+/**
+ * Generate a 64 bytes base64 block ID string.
+ *
+ * @param blockIndex -
+ */
+function utils_common_generateBlockID(blockIDPrefix, blockIndex) {
+    // To generate a 64 bytes base64 string, source string should be 48
+    const maxSourceStringLength = 48;
+    // A blob can have a maximum of 100,000 uncommitted blocks at any given time
+    const maxBlockIndexLength = 6;
+    const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength;
+    if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) {
+        blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength);
+    }
+    const res = blockIDPrefix +
+        utils_common_padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0");
+    return base64encode(res);
+}
+/**
+ * Delay specified time interval.
+ *
+ * @param timeInMs -
+ * @param aborter -
+ * @param abortError -
+ */
+async function utils_utils_common_delay(timeInMs, aborter, abortError) {
+    return new Promise((resolve, reject) => {
+        /* eslint-disable-next-line prefer-const */
+        let timeout;
+        const abortHandler = () => {
+            if (timeout !== undefined) {
+                clearTimeout(timeout);
             }
-            else {
-                const map = new YAMLMap.YAMLMap(ctx.schema);
-                map.flow = true;
-                map.items.push(pair);
-                const endRange = (valueNode ?? keyNode).range;
-                map.range = [keyNode.range[0], endRange[1], endRange[2]];
-                coll.items.push(map);
+            reject(abortError);
+        };
+        const resolveHandler = () => {
+            if (aborter !== undefined) {
+                aborter.removeEventListener("abort", abortHandler);
             }
-            offset = valueNode ? valueNode.range[2] : valueProps.end;
+            resolve();
+        };
+        timeout = setTimeout(resolveHandler, timeInMs);
+        if (aborter !== undefined) {
+            aborter.addEventListener("abort", abortHandler);
         }
+    });
+}
+/**
+ * String.prototype.padStart()
+ *
+ * @param currentString -
+ * @param targetLength -
+ * @param padString -
+ */
+function utils_common_padStart(currentString, targetLength, padString = " ") {
+    // @ts-expect-error: TS doesn't know this code needs to run downlevel sometimes
+    if (String.prototype.padStart) {
+        return currentString.padStart(targetLength, padString);
+    }
+    padString = padString || " ";
+    if (currentString.length > targetLength) {
+        return currentString;
     }
-    const expectedEnd = isMap ? '}' : ']';
-    const [ce, ...ee] = fc.end;
-    let cePos = offset;
-    if (ce?.source === expectedEnd)
-        cePos = ce.offset + ce.source.length;
     else {
-        const name = fcName[0].toUpperCase() + fcName.substring(1);
-        const msg = atRoot
-            ? `${name} must end with a ${expectedEnd}`
-            : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
-        onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg);
-        if (ce && ce.source.length !== 1)
-            ee.unshift(ce);
+        targetLength = targetLength - currentString.length;
+        if (targetLength > padString.length) {
+            padString += padString.repeat(targetLength / padString.length);
+        }
+        return padString.slice(0, targetLength) + currentString;
     }
-    if (ee.length > 0) {
-        const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
-        if (end.comment) {
-            if (coll.comment)
-                coll.comment += '\n' + end.comment;
-            else
-                coll.comment = end.comment;
+}
+function utils_common_sanitizeURL(url) {
+    let safeURL = url;
+    if (utils_common_getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) {
+        safeURL = utils_common_setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****");
+    }
+    return safeURL;
+}
+function utils_common_sanitizeHeaders(originalHeader) {
+    const headers = createHttpHeaders();
+    for (const [name, value] of originalHeader) {
+        if (name.toLowerCase() === HeaderConstants.AUTHORIZATION.toLowerCase()) {
+            headers.set(name, "*****");
+        }
+        else if (name.toLowerCase() === HeaderConstants.X_MS_COPY_SOURCE) {
+            headers.set(name, utils_common_sanitizeURL(value));
+        }
+        else {
+            headers.set(name, value);
         }
-        coll.range = [fc.offset, cePos, end.offset];
     }
-    else {
-        coll.range = [fc.offset, cePos, cePos];
+    return headers;
+}
+/**
+ * If two strings are equal when compared case insensitive.
+ *
+ * @param str1 -
+ * @param str2 -
+ */
+function utils_common_iEqual(str1, str2) {
+    return str1.toLocaleLowerCase() === str2.toLocaleLowerCase();
+}
+/**
+ * Extracts account name from the url
+ * @param url - url to extract the account name from
+ * @returns with the account name
+ */
+function utils_common_getAccountNameFromUrl(url) {
+    const parsedUrl = new URL(url);
+    let accountName;
+    try {
+        if (parsedUrl.hostname.split(".")[1] === "blob") {
+            // `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;
+            accountName = parsedUrl.hostname.split(".")[0];
+        }
+        else if (utils_common_isIpEndpointStyle(parsedUrl)) {
+            // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/
+            // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/
+            // .getPath() -> /devstoreaccount1/
+            accountName = parsedUrl.pathname.split("/")[1];
+        }
+        else {
+            // Custom domain case: "https://customdomain.com/containername/blob".
+            accountName = "";
+        }
+        return accountName;
+    }
+    catch (error) {
+        throw new Error("Unable to extract accountName with provided information.");
     }
-    return coll;
 }
-
-exports.resolveFlowCollection = resolveFlowCollection;
-
-
-/***/ }),
-
-/***/ 76842:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var Scalar = __nccwpck_require__(63301);
-var resolveEnd = __nccwpck_require__(17788);
-
-function resolveFlowScalar(scalar, strict, onError) {
-    const { offset, type, source, end } = scalar;
-    let _type;
-    let value;
-    const _onError = (rel, code, msg) => onError(offset + rel, code, msg);
-    switch (type) {
-        case 'scalar':
-            _type = Scalar.Scalar.PLAIN;
-            value = plainValue(source, _onError);
-            break;
-        case 'single-quoted-scalar':
-            _type = Scalar.Scalar.QUOTE_SINGLE;
-            value = singleQuotedValue(source, _onError);
-            break;
-        case 'double-quoted-scalar':
-            _type = Scalar.Scalar.QUOTE_DOUBLE;
-            value = doubleQuotedValue(source, _onError);
-            break;
-        /* istanbul ignore next should not happen */
-        default:
-            onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`);
+function utils_common_isIpEndpointStyle(parsedUrl) {
+    const host = parsedUrl.host;
+    // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.
+    // Case 2: localhost(:port) or host.docker.internal, use broad regex to match port part.
+    // Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
+    // For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
+    return (/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
+        (Boolean(parsedUrl.port) && utils_constants_PathStylePorts.includes(parsedUrl.port)));
+}
+/**
+ * Convert Tags to encoded string.
+ *
+ * @param tags -
+ */
+function toBlobTagsString(tags) {
+    if (tags === undefined) {
+        return undefined;
+    }
+    const tagPairs = [];
+    for (const key in tags) {
+        if (Object.prototype.hasOwnProperty.call(tags, key)) {
+            const value = tags[key];
+            tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
+        }
+    }
+    return tagPairs.join("&");
+}
+/**
+ * Convert Tags type to BlobTags.
+ *
+ * @param tags -
+ */
+function toBlobTags(tags) {
+    if (tags === undefined) {
+        return undefined;
+    }
+    const res = {
+        blobTagSet: [],
+    };
+    for (const key in tags) {
+        if (Object.prototype.hasOwnProperty.call(tags, key)) {
+            const value = tags[key];
+            res.blobTagSet.push({
+                key,
+                value,
+            });
+        }
+    }
+    return res;
+}
+/**
+ * Covert BlobTags to Tags type.
+ *
+ * @param tags -
+ */
+function toTags(tags) {
+    if (tags === undefined) {
+        return undefined;
+    }
+    const res = {};
+    for (const blobTag of tags.blobTagSet) {
+        res[blobTag.key] = blobTag.value;
+    }
+    return res;
+}
+/**
+ * Convert BlobQueryTextConfiguration to QuerySerialization type.
+ *
+ * @param textConfiguration -
+ */
+function toQuerySerialization(textConfiguration) {
+    if (textConfiguration === undefined) {
+        return undefined;
+    }
+    switch (textConfiguration.kind) {
+        case "csv":
             return {
-                value: '',
-                type: null,
-                comment: '',
-                range: [offset, offset + source.length, offset + source.length]
+                format: {
+                    type: "delimited",
+                    delimitedTextConfiguration: {
+                        columnSeparator: textConfiguration.columnSeparator || ",",
+                        fieldQuote: textConfiguration.fieldQuote || "",
+                        recordSeparator: textConfiguration.recordSeparator,
+                        escapeChar: textConfiguration.escapeCharacter || "",
+                        headersPresent: textConfiguration.hasHeaders || false,
+                    },
+                },
+            };
+        case "json":
+            return {
+                format: {
+                    type: "json",
+                    jsonTextConfiguration: {
+                        recordSeparator: textConfiguration.recordSeparator,
+                    },
+                },
+            };
+        case "arrow":
+            return {
+                format: {
+                    type: "arrow",
+                    arrowConfiguration: {
+                        schema: textConfiguration.schema,
+                    },
+                },
+            };
+        case "parquet":
+            return {
+                format: {
+                    type: "parquet",
+                },
             };
+        default:
+            throw Error("Invalid BlobQueryTextConfiguration.");
     }
-    const valueEnd = offset + source.length;
-    const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError);
+}
+function parseObjectReplicationRecord(objectReplicationRecord) {
+    if (!objectReplicationRecord) {
+        return undefined;
+    }
+    if ("policy-id" in objectReplicationRecord) {
+        // If the dictionary contains a key with policy id, we are not required to do any parsing since
+        // the policy id should already be stored in the ObjectReplicationDestinationPolicyId.
+        return undefined;
+    }
+    const orProperties = [];
+    for (const key in objectReplicationRecord) {
+        const ids = key.split("_");
+        const policyPrefix = "or-";
+        if (ids[0].startsWith(policyPrefix)) {
+            ids[0] = ids[0].substring(policyPrefix.length);
+        }
+        const rule = {
+            ruleId: ids[1],
+            replicationStatus: objectReplicationRecord[key],
+        };
+        const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]);
+        if (policyIndex > -1) {
+            orProperties[policyIndex].rules.push(rule);
+        }
+        else {
+            orProperties.push({
+                policyId: ids[0],
+                rules: [rule],
+            });
+        }
+    }
+    return orProperties;
+}
+/**
+ * Attach a TokenCredential to an object.
+ *
+ * @param thing -
+ * @param credential -
+ */
+function utils_common_attachCredential(thing, credential) {
+    thing.credential = credential;
+    return thing;
+}
+function utils_common_httpAuthorizationToString(httpAuthorization) {
+    return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
+}
+function BlobNameToString(name) {
+    if (name.encoded) {
+        return decodeURIComponent(name.content);
+    }
+    else {
+        return name.content;
+    }
+}
+function ConvertInternalResponseOfListBlobFlat(internalResponse) {
     return {
-        value,
-        type: _type,
-        comment: re.comment,
-        range: [offset, valueEnd, re.offset]
+        ...internalResponse,
+        segment: {
+            blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
+                const blobItem = {
+                    ...blobItemInteral,
+                    name: BlobNameToString(blobItemInteral.name),
+                };
+                return blobItem;
+            }),
+        },
+    };
+}
+function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
+    return {
+        ...internalResponse,
+        segment: {
+            blobPrefixes: internalResponse.segment.blobPrefixes?.map((blobPrefixInternal) => {
+                const blobPrefix = {
+                    ...blobPrefixInternal,
+                    name: BlobNameToString(blobPrefixInternal.name),
+                };
+                return blobPrefix;
+            }),
+            blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
+                const blobItem = {
+                    ...blobItemInteral,
+                    name: BlobNameToString(blobItemInteral.name),
+                };
+                return blobItem;
+            }),
+        },
     };
 }
-function plainValue(source, onError) {
-    let badChar = '';
-    switch (source[0]) {
-        /* istanbul ignore next should not happen */
-        case '\t':
-            badChar = 'a tab character';
-            break;
-        case ',':
-            badChar = 'flow indicator character ,';
-            break;
-        case '%':
-            badChar = 'directive indicator character %';
-            break;
-        case '|':
-        case '>': {
-            badChar = `block scalar indicator ${source[0]}`;
-            break;
+function* ExtractPageRangeInfoItems(getPageRangesSegment) {
+    let pageRange = [];
+    let clearRange = [];
+    if (getPageRangesSegment.pageRange)
+        pageRange = getPageRangesSegment.pageRange;
+    if (getPageRangesSegment.clearRange)
+        clearRange = getPageRangesSegment.clearRange;
+    let pageRangeIndex = 0;
+    let clearRangeIndex = 0;
+    while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) {
+        if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) {
+            yield {
+                start: pageRange[pageRangeIndex].start,
+                end: pageRange[pageRangeIndex].end,
+                isClear: false,
+            };
+            ++pageRangeIndex;
         }
-        case '@':
-        case '`': {
-            badChar = `reserved character ${source[0]}`;
-            break;
+        else {
+            yield {
+                start: clearRange[clearRangeIndex].start,
+                end: clearRange[clearRangeIndex].end,
+                isClear: true,
+            };
+            ++clearRangeIndex;
         }
     }
-    if (badChar)
-        onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);
-    return foldLines(source);
+    for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) {
+        yield {
+            start: pageRange[pageRangeIndex].start,
+            end: pageRange[pageRangeIndex].end,
+            isClear: false,
+        };
+    }
+    for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) {
+        yield {
+            start: clearRange[clearRangeIndex].start,
+            end: clearRange[clearRangeIndex].end,
+            isClear: true,
+        };
+    }
 }
-function singleQuotedValue(source, onError) {
-    if (source[source.length - 1] !== "'" || source.length === 1)
-        onError(source.length, 'MISSING_CHAR', "Missing closing 'quote");
-    return foldLines(source.slice(1, -1)).replace(/''/g, "'");
+/**
+ * Escape the blobName but keep path separator ('/').
+ */
+function utils_common_EscapePath(blobName) {
+    const split = blobName.split("/");
+    for (let i = 0; i < split.length; i++) {
+        split[i] = encodeURIComponent(split[i]);
+    }
+    return split.join("/");
 }
-function foldLines(source) {
+/**
+ * A typesafe helper for ensuring that a given response object has
+ * the original _response attached.
+ * @param response - A response object from calling a client operation
+ * @returns The same object, but with known _response property
+ */
+function utils_common_assertResponse(response) {
+    if (`_response` in response) {
+        return response;
+    }
+    throw new TypeError(`Unexpected response object ${response}`);
+}
+async function setUploadChecksumParameters(body, contentLength, parameters, uploadOptions, configContentChecksumAlgorithm) {
+    let contentChecksumAlgorithm = uploadOptions.contentChecksumAlgorithm ?? configContentChecksumAlgorithm;
+    if (contentChecksumAlgorithm === undefined) {
+        contentChecksumAlgorithm = "Customized";
+    }
+    if (contentChecksumAlgorithm === "Auto") {
+        contentChecksumAlgorithm = "StorageCrc64";
+    }
+    let bodyInfo = undefined;
+    if (contentChecksumAlgorithm === "Customized") {
+        parameters.transactionalContentMD5 = uploadOptions.transactionalContentMD5;
+        parameters.transactionalContentCrc64 = uploadOptions.transactionalContentCrc64;
+    }
+    else if (contentChecksumAlgorithm === "StorageCrc64") {
+        await StorageCRC64Calculator.init();
+        bodyInfo = await structuredMessageEncoding(body, contentLength);
+        parameters.structuredBodyType = "XSM/1.0; properties=crc64";
+        parameters.structuredContentLength = contentLength;
+    }
+    return {
+        body: contentChecksumAlgorithm === "StorageCrc64" ? bodyInfo.body : body,
+        contentLength: contentChecksumAlgorithm === "StorageCrc64" ? bodyInfo.encodedContentLength : contentLength,
+        contentChecksumAlgorithm: contentChecksumAlgorithm,
+    };
+}
+//# sourceMappingURL=utils.common.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/StorageClient.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+/**
+ * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}
+ * and etc.
+ */
+class StorageClient_StorageClient {
     /**
-     * The negative lookbehind here and in the `re` RegExp is to
-     * prevent causing a polynomial search time in certain cases.
+     * Encoded URL string value.
+     */
+    url;
+    accountName;
+    /**
+     * Request policy pipeline.
      *
-     * The try-catch is for Safari, which doesn't support this yet:
-     * https://caniuse.com/js-regexp-lookbehind
+     * @internal
      */
-    let first, line;
-    try {
-        first = new RegExp('(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch;
+        if (this.create) {
+            permissions.push("c");
         }
-        else {
-            res += ch;
+        if (this.write) {
+            permissions.push("w");
         }
+        if (this.delete) {
+            permissions.push("d");
+        }
+        if (this.deleteVersion) {
+            permissions.push("x");
+        }
+        if (this.tag) {
+            permissions.push("t");
+        }
+        if (this.move) {
+            permissions.push("m");
+        }
+        if (this.execute) {
+            permissions.push("e");
+        }
+        if (this.setImmutabilityPolicy) {
+            permissions.push("i");
+        }
+        if (this.permanentDelete) {
+            permissions.push("y");
+        }
+        return permissions.join("");
     }
-    if (source[source.length - 1] !== '"' || source.length === 1)
-        onError(source.length, 'MISSING_CHAR', 'Missing closing "quote');
-    return res;
 }
+//# sourceMappingURL=BlobSASPermissions.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/ContainerSASPermissions.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 /**
- * Fold a single newline into a space, multiple newlines to N - 1 newlines.
- * Presumes `source[offset] === '\n'`
+ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a container.
+ * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation.
+ * Once all the values are set, this should be serialized with toString and set as the permissions field on a
+ * {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but
+ * the order of the permissions is particular and this class guarantees correctness.
  */
-function foldNewline(source, offset) {
-    let fold = '';
-    let ch = source[offset + 1];
-    while (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r') {
-        if (ch === '\r' && source[offset + 2] !== '\n')
-            break;
-        if (ch === '\n')
-            fold += '\n';
-        offset += 1;
-        ch = source[offset + 1];
+class ContainerSASPermissions {
+    /**
+     * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
+     * Error if it encounters a character that does not correspond to a valid permission.
+     *
+     * @param permissions -
+     */
+    static parse(permissions) {
+        const containerSASPermissions = new ContainerSASPermissions();
+        for (const char of permissions) {
+            switch (char) {
+                case "r":
+                    containerSASPermissions.read = true;
+                    break;
+                case "a":
+                    containerSASPermissions.add = true;
+                    break;
+                case "c":
+                    containerSASPermissions.create = true;
+                    break;
+                case "w":
+                    containerSASPermissions.write = true;
+                    break;
+                case "d":
+                    containerSASPermissions.delete = true;
+                    break;
+                case "l":
+                    containerSASPermissions.list = true;
+                    break;
+                case "t":
+                    containerSASPermissions.tag = true;
+                    break;
+                case "x":
+                    containerSASPermissions.deleteVersion = true;
+                    break;
+                case "m":
+                    containerSASPermissions.move = true;
+                    break;
+                case "e":
+                    containerSASPermissions.execute = true;
+                    break;
+                case "i":
+                    containerSASPermissions.setImmutabilityPolicy = true;
+                    break;
+                case "y":
+                    containerSASPermissions.permanentDelete = true;
+                    break;
+                case "f":
+                    containerSASPermissions.filterByTags = true;
+                    break;
+                default:
+                    throw new RangeError(`Invalid permission ${char}`);
+            }
+        }
+        return containerSASPermissions;
+    }
+    /**
+     * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it
+     * and boolean values for them.
+     *
+     * @param permissionLike -
+     */
+    static from(permissionLike) {
+        const containerSASPermissions = new ContainerSASPermissions();
+        if (permissionLike.read) {
+            containerSASPermissions.read = true;
+        }
+        if (permissionLike.add) {
+            containerSASPermissions.add = true;
+        }
+        if (permissionLike.create) {
+            containerSASPermissions.create = true;
+        }
+        if (permissionLike.write) {
+            containerSASPermissions.write = true;
+        }
+        if (permissionLike.delete) {
+            containerSASPermissions.delete = true;
+        }
+        if (permissionLike.list) {
+            containerSASPermissions.list = true;
+        }
+        if (permissionLike.deleteVersion) {
+            containerSASPermissions.deleteVersion = true;
+        }
+        if (permissionLike.tag) {
+            containerSASPermissions.tag = true;
+        }
+        if (permissionLike.move) {
+            containerSASPermissions.move = true;
+        }
+        if (permissionLike.execute) {
+            containerSASPermissions.execute = true;
+        }
+        if (permissionLike.setImmutabilityPolicy) {
+            containerSASPermissions.setImmutabilityPolicy = true;
+        }
+        if (permissionLike.permanentDelete) {
+            containerSASPermissions.permanentDelete = true;
+        }
+        if (permissionLike.filterByTags) {
+            containerSASPermissions.filterByTags = true;
+        }
+        return containerSASPermissions;
+    }
+    /**
+     * Specifies Read access granted.
+     */
+    read = false;
+    /**
+     * Specifies Add access granted.
+     */
+    add = false;
+    /**
+     * Specifies Create access granted.
+     */
+    create = false;
+    /**
+     * Specifies Write access granted.
+     */
+    write = false;
+    /**
+     * Specifies Delete access granted.
+     */
+    delete = false;
+    /**
+     * Specifies Delete version access granted.
+     */
+    deleteVersion = false;
+    /**
+     * Specifies List access granted.
+     */
+    list = false;
+    /**
+     * Specfies Tag access granted.
+     */
+    tag = false;
+    /**
+     * Specifies Move access granted.
+     */
+    move = false;
+    /**
+     * Specifies Execute access granted.
+     */
+    execute = false;
+    /**
+     * Specifies SetImmutabilityPolicy access granted.
+     */
+    setImmutabilityPolicy = false;
+    /**
+     * Specifies that Permanent Delete is permitted.
+     */
+    permanentDelete = false;
+    /**
+     * Specifies that Filter Blobs by Tags is permitted.
+     */
+    filterByTags = false;
+    /**
+     * Converts the given permissions to a string. Using this method will guarantee the permissions are in an
+     * order accepted by the service.
+     *
+     * The order of the characters should be as specified here to ensure correctness.
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     */
+    toString() {
+        const permissions = [];
+        if (this.read) {
+            permissions.push("r");
+        }
+        if (this.add) {
+            permissions.push("a");
+        }
+        if (this.create) {
+            permissions.push("c");
+        }
+        if (this.write) {
+            permissions.push("w");
+        }
+        if (this.delete) {
+            permissions.push("d");
+        }
+        if (this.deleteVersion) {
+            permissions.push("x");
+        }
+        if (this.list) {
+            permissions.push("l");
+        }
+        if (this.tag) {
+            permissions.push("t");
+        }
+        if (this.move) {
+            permissions.push("m");
+        }
+        if (this.execute) {
+            permissions.push("e");
+        }
+        if (this.setImmutabilityPolicy) {
+            permissions.push("i");
+        }
+        if (this.permanentDelete) {
+            permissions.push("y");
+        }
+        if (this.filterByTags) {
+            permissions.push("f");
+        }
+        return permissions.join("");
     }
-    if (!fold)
-        fold = ' ';
-    return { fold, offset };
 }
-const escapeCodes = {
-    '0': '\0', // null character
-    a: '\x07', // bell character
-    b: '\b', // backspace
-    e: '\x1b', // escape character
-    f: '\f', // form feed
-    n: '\n', // line feed
-    r: '\r', // carriage return
-    t: '\t', // horizontal tab
-    v: '\v', // vertical tab
-    N: '\u0085', // Unicode next line
-    _: '\u00a0', // Unicode non-breaking space
-    L: '\u2028', // Unicode line separator
-    P: '\u2029', // Unicode paragraph separator
-    ' ': ' ',
-    '"': '"',
-    '/': '/',
-    '\\': '\\',
-    '\t': '\t'
-};
-function parseCharCode(source, offset, length, onError) {
-    const cc = source.substr(offset, length);
-    const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
-    const code = ok ? parseInt(cc, 16) : NaN;
-    try {
-        return String.fromCodePoint(code);
+//# sourceMappingURL=ContainerSASPermissions.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/SasIPRange.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * Generate SasIPRange format string. For example:
+ *
+ * "8.8.8.8" or "1.1.1.1-255.255.255.255"
+ *
+ * @param ipRange -
+ */
+function ipRangeToString(ipRange) {
+    return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;
+}
+//# sourceMappingURL=SasIPRange.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/SASQueryParameters.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+/**
+ * Protocols for generated SAS.
+ */
+var SASProtocol;
+(function (SASProtocol) {
+    /**
+     * Protocol that allows HTTPS only
+     */
+    SASProtocol["Https"] = "https";
+    /**
+     * Protocol that allows both HTTPS and HTTP
+     */
+    SASProtocol["HttpsAndHttp"] = "https,http";
+})(SASProtocol || (SASProtocol = {}));
+/**
+ * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly
+ * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link BlobSASSignatureValues}
+ * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should
+ * be taken here in case there are existing query parameters, which might affect the appropriate means of appending
+ * these query parameters).
+ *
+ * NOTE: Instances of this class are immutable.
+ */
+class SASQueryParameters {
+    /**
+     * The storage API version.
+     */
+    version;
+    /**
+     * Optional. The allowed HTTP protocol(s).
+     */
+    protocol;
+    /**
+     * Optional. The start time for this SAS token.
+     */
+    startsOn;
+    /**
+     * Optional only when identifier is provided. The expiry time for this SAS token.
+     */
+    expiresOn;
+    /**
+     * Optional only when identifier is provided.
+     * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for
+     * more details.
+     */
+    permissions;
+    /**
+     * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices}
+     * for more details.
+     */
+    services;
+    /**
+     * Optional. The storage resource types being accessed (only for Account SAS). Please refer to
+     * {@link AccountSASResourceTypes} for more details.
+     */
+    resourceTypes;
+    /**
+     * Optional. The signed identifier (only for {@link BlobSASSignatureValues}).
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy
+     */
+    identifier;
+    /**
+     * Optional. Beginning in version 2025-07-05, this value specifies the Entra ID of the user would is authorized to
+     * use the resulting SAS URL.  The resulting SAS URL must be used in conjunction with an Entra ID token that has been
+     * issued to the user specified in this value.
+     */
+    delegatedUserObjectId;
+    /**
+     * Optional. Encryption scope to use when sending requests authorized with this SAS URI.
+     */
+    encryptionScope;
+    /**
+     * Optional. Specifies which resources are accessible via the SAS (only for {@link BlobSASSignatureValues}).
+     * @see https://learn.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only
+     */
+    resource;
+    /**
+     * The signature for the SAS token.
+     */
+    signature;
+    /**
+     * Value for cache-control header in Blob/File Service SAS.
+     */
+    cacheControl;
+    /**
+     * Value for content-disposition header in Blob/File Service SAS.
+     */
+    contentDisposition;
+    /**
+     * Value for content-encoding header in Blob/File Service SAS.
+     */
+    contentEncoding;
+    /**
+     * Value for content-length header in Blob/File Service SAS.
+     */
+    contentLanguage;
+    /**
+     * Value for content-type header in Blob/File Service SAS.
+     */
+    contentType;
+    /**
+     * Inner value of getter ipRange.
+     */
+    ipRangeInner;
+    /**
+     * The Azure Active Directory object ID in GUID format.
+     * Property of user delegation key.
+     */
+    signedOid;
+    /**
+     * The Azure Active Directory tenant ID in GUID format.
+     * Property of user delegation key.
+     */
+    signedTenantId;
+    /**
+     * The date-time the key is active.
+     * Property of user delegation key.
+     */
+    signedStartsOn;
+    /**
+     * The date-time the key expires.
+     * Property of user delegation key.
+     */
+    signedExpiresOn;
+    /**
+     * Abbreviation of the Azure Storage service that accepts the user delegation key.
+     * Property of user delegation key.
+     */
+    signedService;
+    /**
+     * The service version that created the user delegation key.
+     * Property of user delegation key.
+     */
+    signedVersion;
+    /**
+     * The delegated user tenant id in Azure AD.
+     * Property of user delegation key.
+     */
+    signedDelegatedUserTid;
+    /**
+     * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key
+     * to perform the action granted by the SAS. The Azure Storage service will ensure that the owner of the user delegation key
+     * has the required permissions before granting access but no additional permission check for the user specified in
+     * this value will be performed. This is only used for User Delegation SAS.
+     */
+    preauthorizedAgentObjectId;
+    /**
+     * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access.
+     * This is only used for User Delegation SAS.
+     */
+    correlationId;
+    /**
+     * Keys for request headers required in the SAS token
+     */
+    requestHeaderKeys;
+    /**
+     * Keys for request query parameters required in the SAS token
+     */
+    requestQueryParameterKeys;
+    /**
+     * Optional. IP range allowed for this SAS.
+     *
+     * @readonly
+     */
+    get ipRange() {
+        if (this.ipRangeInner) {
+            return {
+                end: this.ipRangeInner.end,
+                start: this.ipRangeInner.start,
+            };
+        }
+        return undefined;
     }
-    catch {
-        const raw = source.substr(offset - 2, length + 2);
-        onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
-        return raw;
+    constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope, delegatedUserObjectId, requestHeaderKeys, requestQueryParameterKeys) {
+        this.version = version;
+        this.signature = signature;
+        if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
+            // SASQueryParametersOptions
+            this.permissions = permissionsOrOptions.permissions;
+            this.services = permissionsOrOptions.services;
+            this.resourceTypes = permissionsOrOptions.resourceTypes;
+            this.protocol = permissionsOrOptions.protocol;
+            this.startsOn = permissionsOrOptions.startsOn;
+            this.expiresOn = permissionsOrOptions.expiresOn;
+            this.ipRangeInner = permissionsOrOptions.ipRange;
+            this.identifier = permissionsOrOptions.identifier;
+            this.delegatedUserObjectId = permissionsOrOptions.delegatedUserObjectId;
+            this.encryptionScope = permissionsOrOptions.encryptionScope;
+            this.resource = permissionsOrOptions.resource;
+            this.cacheControl = permissionsOrOptions.cacheControl;
+            this.contentDisposition = permissionsOrOptions.contentDisposition;
+            this.contentEncoding = permissionsOrOptions.contentEncoding;
+            this.contentLanguage = permissionsOrOptions.contentLanguage;
+            this.contentType = permissionsOrOptions.contentType;
+            this.requestHeaderKeys = permissionsOrOptions.requestHeaderKeys;
+            this.requestQueryParameterKeys = permissionsOrOptions.requestQueryParameterKeys;
+            if (permissionsOrOptions.userDelegationKey) {
+                this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId;
+                this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId;
+                this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn;
+                this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn;
+                this.signedService = permissionsOrOptions.userDelegationKey.signedService;
+                this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion;
+                this.signedDelegatedUserTid =
+                    permissionsOrOptions.userDelegationKey.signedDelegatedUserTenantId;
+                this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId;
+                this.correlationId = permissionsOrOptions.correlationId;
+            }
+        }
+        else {
+            this.services = services;
+            this.resourceTypes = resourceTypes;
+            this.expiresOn = expiresOn;
+            this.permissions = permissionsOrOptions;
+            this.protocol = protocol;
+            this.startsOn = startsOn;
+            this.ipRangeInner = ipRange;
+            this.delegatedUserObjectId = delegatedUserObjectId;
+            this.encryptionScope = encryptionScope;
+            this.identifier = identifier;
+            this.resource = resource;
+            this.cacheControl = cacheControl;
+            this.contentDisposition = contentDisposition;
+            this.contentEncoding = contentEncoding;
+            this.contentLanguage = contentLanguage;
+            this.contentType = contentType;
+            this.requestHeaderKeys = requestHeaderKeys;
+            this.requestQueryParameterKeys = requestQueryParameterKeys;
+            if (userDelegationKey) {
+                this.signedOid = userDelegationKey.signedObjectId;
+                this.signedTenantId = userDelegationKey.signedTenantId;
+                this.signedStartsOn = userDelegationKey.signedStartsOn;
+                this.signedExpiresOn = userDelegationKey.signedExpiresOn;
+                this.signedService = userDelegationKey.signedService;
+                this.signedVersion = userDelegationKey.signedVersion;
+                this.signedDelegatedUserTid = userDelegationKey.signedDelegatedUserTenantId;
+                this.preauthorizedAgentObjectId = preauthorizedAgentObjectId;
+                this.correlationId = correlationId;
+            }
+        }
+    }
+    /**
+     * Encodes all SAS query parameters into a string that can be appended to a URL.
+     *
+     */
+    toString() {
+        const params = [
+            "sv",
+            "ss",
+            "srt",
+            "spr",
+            "st",
+            "se",
+            "sip",
+            "si",
+            "ses",
+            "skoid", // Signed object ID
+            "sktid", // Signed tenant ID
+            "skt", // Signed key start time
+            "ske", // Signed key expiry time
+            "sks", // Signed key service
+            "skv", // Signed key version
+            "sr",
+            "sp",
+            "rscc",
+            "rscd",
+            "rsce",
+            "rscl",
+            "rsct",
+            "saoid",
+            "scid",
+            "sduoid", // Signed key user delegation object ID
+            "skdutid", // Signed key user delegation tenant ID
+            "srh", // Request Headers
+            "srq", // Request QueryParameters
+            "sig",
+        ];
+        const queries = [];
+        for (const param of params) {
+            switch (param) {
+                case "sv":
+                    this.tryAppendQueryParameter(queries, param, this.version);
+                    break;
+                case "ss":
+                    this.tryAppendQueryParameter(queries, param, this.services);
+                    break;
+                case "srt":
+                    this.tryAppendQueryParameter(queries, param, this.resourceTypes);
+                    break;
+                case "spr":
+                    this.tryAppendQueryParameter(queries, param, this.protocol);
+                    break;
+                case "st":
+                    this.tryAppendQueryParameter(queries, param, this.startsOn ? utils_common_truncatedISO8061Date(this.startsOn, false) : undefined);
+                    break;
+                case "se":
+                    this.tryAppendQueryParameter(queries, param, this.expiresOn ? utils_common_truncatedISO8061Date(this.expiresOn, false) : undefined);
+                    break;
+                case "sip":
+                    this.tryAppendQueryParameter(queries, param, this.ipRange ? ipRangeToString(this.ipRange) : undefined);
+                    break;
+                case "si":
+                    this.tryAppendQueryParameter(queries, param, this.identifier);
+                    break;
+                case "ses":
+                    this.tryAppendQueryParameter(queries, param, this.encryptionScope);
+                    break;
+                case "skoid": // Signed object ID
+                    this.tryAppendQueryParameter(queries, param, this.signedOid);
+                    break;
+                case "sktid": // Signed tenant ID
+                    this.tryAppendQueryParameter(queries, param, this.signedTenantId);
+                    break;
+                case "skt": // Signed key start time
+                    this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? utils_common_truncatedISO8061Date(this.signedStartsOn, false) : undefined);
+                    break;
+                case "ske": // Signed key expiry time
+                    this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? utils_common_truncatedISO8061Date(this.signedExpiresOn, false) : undefined);
+                    break;
+                case "sks": // Signed key service
+                    this.tryAppendQueryParameter(queries, param, this.signedService);
+                    break;
+                case "skv": // Signed key version
+                    this.tryAppendQueryParameter(queries, param, this.signedVersion);
+                    break;
+                case "skdutid":
+                    this.tryAppendQueryParameter(queries, param, this.signedDelegatedUserTid);
+                    break;
+                case "sr":
+                    this.tryAppendQueryParameter(queries, param, this.resource);
+                    break;
+                case "sp":
+                    this.tryAppendQueryParameter(queries, param, this.permissions);
+                    break;
+                case "sig":
+                    this.tryAppendQueryParameter(queries, param, this.signature);
+                    break;
+                case "rscc":
+                    this.tryAppendQueryParameter(queries, param, this.cacheControl);
+                    break;
+                case "rscd":
+                    this.tryAppendQueryParameter(queries, param, this.contentDisposition);
+                    break;
+                case "rsce":
+                    this.tryAppendQueryParameter(queries, param, this.contentEncoding);
+                    break;
+                case "rscl":
+                    this.tryAppendQueryParameter(queries, param, this.contentLanguage);
+                    break;
+                case "rsct":
+                    this.tryAppendQueryParameter(queries, param, this.contentType);
+                    break;
+                case "saoid":
+                    this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);
+                    break;
+                case "scid":
+                    this.tryAppendQueryParameter(queries, param, this.correlationId);
+                    break;
+                case "sduoid":
+                    this.tryAppendQueryParameter(queries, param, this.delegatedUserObjectId);
+                    break;
+                case "srh": // Request headers
+                    this.tryAppendQueryParameter(queries, param, this.requestHeaderKeys);
+                    break;
+                case "srq": // Request headers
+                    this.tryAppendQueryParameter(queries, param, this.requestQueryParameterKeys);
+                    break;
+            }
+        }
+        return queries.join("&");
+    }
+    /**
+     * A private helper method used to filter and append query key/value pairs into an array.
+     *
+     * @param queries -
+     * @param key -
+     * @param value -
+     */
+    tryAppendQueryParameter(queries, key, value) {
+        if (!value) {
+            return;
+        }
+        key = encodeURIComponent(key);
+        value = encodeURIComponent(value);
+        if (key.length > 0 && value.length > 0) {
+            queries.push(`${key}=${value}`);
+        }
     }
 }
+//# sourceMappingURL=SASQueryParameters.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/BlobSASSignatureValues.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-exports.resolveFlowScalar = resolveFlowScalar;
 
 
-/***/ }),
 
-/***/ 34631:
-/***/ ((__unused_webpack_module, exports) => {
 
-"use strict";
 
 
-function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
-    let spaceBefore = false;
-    let atNewline = startOnNewline;
-    let hasSpace = startOnNewline;
-    let comment = '';
-    let commentSep = '';
-    let hasNewline = false;
-    let reqSpace = false;
-    let tab = null;
-    let anchor = null;
-    let tag = null;
-    let newlineAfterProp = null;
-    let comma = null;
-    let found = null;
-    let start = null;
-    for (const token of tokens) {
-        if (reqSpace) {
-            if (token.type !== 'space' &&
-                token.type !== 'newline' &&
-                token.type !== 'comma')
-                onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
-            reqSpace = false;
+
+function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) {
+    return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters;
+}
+function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) {
+    const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
+    const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential
+        ? sharedKeyCredentialOrUserDelegationKey
+        : undefined;
+    let userDelegationKeyCredential;
+    if (sharedKeyCredential === undefined && accountName !== undefined) {
+        userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey);
+    }
+    if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {
+        throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.");
+    }
+    // Version 2020-12-06 adds support for encryptionscope in SAS.
+    if (version >= "2020-12-06") {
+        if (sharedKeyCredential !== undefined) {
+            return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential);
         }
-        if (tab) {
-            if (atNewline && token.type !== 'comment' && token.type !== 'newline') {
-                onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
+        else {
+            if (version >= "2026-04-06") {
+                return generateBlobSASQueryParametersUDK20260406(blobSASSignatureValues, userDelegationKeyCredential);
+            }
+            else if (version >= "2025-07-05") {
+                return generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userDelegationKeyCredential);
+            }
+            else {
+                return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential);
             }
-            tab = null;
         }
-        switch (token.type) {
-            case 'space':
-                // At the doc level, tabs at line start may be parsed
-                // as leading white space rather than indentation.
-                // In a flow collection, only the parser handles indent.
-                if (!flow &&
-                    (indicator !== 'doc-start' || next?.type !== 'flow-collection') &&
-                    token.source.includes('\t')) {
-                    tab = token;
-                }
-                hasSpace = true;
-                break;
-            case 'comment': {
-                if (!hasSpace)
-                    onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
-                const cb = token.source.substring(1) || ' ';
-                if (!comment)
-                    comment = cb;
-                else
-                    comment += commentSep + cb;
-                commentSep = '';
-                atNewline = false;
-                break;
+    }
+    // Version 2019-12-12 adds support for the blob tags permission.
+    // Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.
+    // https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string
+    if (version >= "2018-11-09") {
+        if (sharedKeyCredential !== undefined) {
+            return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential);
+        }
+        else {
+            // Version 2020-02-10 delegation SAS signature construction includes preauthorizedAgentObjectId, agentObjectId, correlationId.
+            if (version >= "2020-02-10") {
+                return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential);
             }
-            case 'newline':
-                if (atNewline) {
-                    if (comment)
-                        comment += token.source;
-                    else if (!found || indicator !== 'seq-item-ind')
-                        spaceBefore = true;
-                }
-                else
-                    commentSep += token.source;
-                atNewline = true;
-                hasNewline = true;
-                if (anchor || tag)
-                    newlineAfterProp = token;
-                hasSpace = true;
-                break;
-            case 'anchor':
-                if (anchor)
-                    onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor');
-                if (token.source.endsWith(':'))
-                    onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
-                anchor = token;
-                start ?? (start = token.offset);
-                atNewline = false;
-                hasSpace = false;
-                reqSpace = true;
-                break;
-            case 'tag': {
-                if (tag)
-                    onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
-                tag = token;
-                start ?? (start = token.offset);
-                atNewline = false;
-                hasSpace = false;
-                reqSpace = true;
-                break;
+            else {
+                return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential);
             }
-            case indicator:
-                // Could here handle preceding comments differently
-                if (anchor || tag)
-                    onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`);
-                if (found)
-                    onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);
-                found = token;
-                atNewline =
-                    indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';
-                hasSpace = false;
-                break;
-            case 'comma':
-                if (flow) {
-                    if (comma)
-                        onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`);
-                    comma = token;
-                    atNewline = false;
-                    hasSpace = false;
-                    break;
-                }
-            // else fallthrough
-            default:
-                onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`);
-                atNewline = false;
-                hasSpace = false;
         }
     }
-    const last = tokens[tokens.length - 1];
-    const end = last ? last.offset + last.source.length : offset;
-    if (reqSpace &&
-        next &&
-        next.type !== 'space' &&
-        next.type !== 'newline' &&
-        next.type !== 'comma' &&
-        (next.type !== 'scalar' || next.source !== '')) {
-        onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
+    if (version >= "2015-04-05") {
+        if (sharedKeyCredential !== undefined) {
+            return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential);
+        }
+        else {
+            throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.");
+        }
     }
-    if (tab &&
-        ((atNewline && tab.indent <= parentIndent) ||
-            next?.type === 'block-map' ||
-            next?.type === 'block-seq'))
-        onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
+    throw new RangeError("'version' must be >= '2015-04-05'.");
+}
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2015-04-05 AND BEFORE 2018-11-09.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn and identifier.
+ *
+ * WARNING: When identifier is not provided, permissions and expiresOn are required.
+ * You MUST assign value to identifier or expiresOn & permissions manually if you initial with
+ * this constructor.
+ *
+ * @param blobSASSignatureValues -
+ * @param sharedKeyCredential -
+ */
+function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    if (!blobSASSignatureValues.identifier &&
+        !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
+    }
+    let resource = "c";
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+    }
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+    }
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        blobSASSignatureValues.identifier,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
+        blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
+        blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
+        blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
+        blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
+    ].join("\n");
+    const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
     return {
-        comma,
-        found,
-        spaceBefore,
-        comment,
-        hasNewline,
-        anchor,
-        tag,
-        newlineAfterProp,
-        end,
-        start: start ?? end
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType),
+        stringToSign: stringToSign,
     };
 }
-
-exports.resolveProps = resolveProps;
-
-
-/***/ }),
-
-/***/ 9499:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-function containsNewline(key) {
-    if (!key)
-        return null;
-    switch (key.type) {
-        case 'alias':
-        case 'scalar':
-        case 'double-quoted-scalar':
-        case 'single-quoted-scalar':
-            if (key.source.includes('\n'))
-                return true;
-            if (key.end)
-                for (const st of key.end)
-                    if (st.type === 'newline')
-                        return true;
-            return false;
-        case 'flow-collection':
-            for (const it of key.items) {
-                for (const st of it.start)
-                    if (st.type === 'newline')
-                        return true;
-                if (it.sep)
-                    for (const st of it.sep)
-                        if (st.type === 'newline')
-                            return true;
-                if (containsNewline(it.key) || containsNewline(it.value))
-                    return true;
-            }
-            return false;
-        default:
-            return true;
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn and identifier.
+ *
+ * WARNING: When identifier is not provided, permissions and expiresOn are required.
+ * You MUST assign value to identifier or expiresOn & permissions manually if you initial with
+ * this constructor.
+ *
+ * @param blobSASSignatureValues -
+ * @param sharedKeyCredential -
+ */
+function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    if (!blobSASSignatureValues.identifier &&
+        !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
     }
-}
-
-exports.containsNewline = containsNewline;
-
-
-/***/ }),
-
-/***/ 22599:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-function emptyScalarPosition(offset, before, pos) {
-    if (before) {
-        pos ?? (pos = before.length);
-        for (let i = pos - 1; i >= 0; --i) {
-            let st = before[i];
-            switch (st.type) {
-                case 'space':
-                case 'comment':
-                case 'newline':
-                    offset -= st.source.length;
-                    continue;
-            }
-            // Technically, an empty scalar is immediately after the last non-empty
-            // node, but it's more useful to place it after any whitespace.
-            st = before[++i];
-            while (st?.type === 'space') {
-                offset += st.source.length;
-                st = before[++i];
-            }
-            break;
+    let resource = "c";
+    let timestamp = blobSASSignatureValues.snapshotTime;
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+        if (blobSASSignatureValues.snapshotTime) {
+            resource = "bs";
+        }
+        else if (blobSASSignatureValues.versionId) {
+            resource = "bv";
+            timestamp = blobSASSignatureValues.versionId;
         }
     }
-    return offset;
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+    }
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        blobSASSignatureValues.identifier,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        resource,
+        timestamp,
+        blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
+        blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
+        blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
+        blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
+        blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
+    ].join("\n");
+    const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType),
+        stringToSign: stringToSign,
+    };
 }
-
-exports.emptyScalarPosition = emptyScalarPosition;
-
-
-/***/ }),
-
-/***/ 74051:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var utilContainsNewline = __nccwpck_require__(9499);
-
-function flowIndentCheck(indent, fc, onError) {
-    if (fc?.type === 'flow-collection') {
-        const end = fc.end[0];
-        if (end.indent === indent &&
-            (end.source === ']' || end.source === '}') &&
-            utilContainsNewline.containsNewline(fc)) {
-            const msg = 'Flow end indicator should be more indented than parent';
-            onError(end, 'BAD_INDENT', msg, true);
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn and identifier.
+ *
+ * WARNING: When identifier is not provided, permissions and expiresOn are required.
+ * You MUST assign value to identifier or expiresOn & permissions manually if you initial with
+ * this constructor.
+ *
+ * @param blobSASSignatureValues -
+ * @param sharedKeyCredential -
+ */
+function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    if (!blobSASSignatureValues.identifier &&
+        !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
+    }
+    let resource = "c";
+    let timestamp = blobSASSignatureValues.snapshotTime;
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+        if (blobSASSignatureValues.snapshotTime) {
+            resource = "bs";
+        }
+        else if (blobSASSignatureValues.versionId) {
+            resource = "bv";
+            timestamp = blobSASSignatureValues.versionId;
+        }
+    }
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
         }
     }
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        blobSASSignatureValues.identifier,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        resource,
+        timestamp,
+        blobSASSignatureValues.encryptionScope,
+        blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
+        blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
+        blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
+        blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
+        blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
+    ].join("\n");
+    const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, undefined, undefined, undefined, blobSASSignatureValues.encryptionScope),
+        stringToSign: stringToSign,
+    };
 }
-
-exports.flowIndentCheck = flowIndentCheck;
-
-
-/***/ }),
-
-/***/ 81187:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var identity = __nccwpck_require__(41127);
-
-function mapIncludes(ctx, items, search) {
-    const { uniqueKeys } = ctx.options;
-    if (uniqueKeys === false)
-        return false;
-    const isEqual = typeof uniqueKeys === 'function'
-        ? uniqueKeys
-        : (a, b) => a === b || (identity.isScalar(a) && identity.isScalar(b) && a.value === b.value);
-    return items.some(pair => isEqual(pair.key, search));
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn.
+ *
+ * WARNING: identifier will be ignored, permissions and expiresOn are required.
+ *
+ * @param blobSASSignatureValues -
+ * @param userDelegationKeyCredential -
+ */
+function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    // Stored access policies are not supported for a user delegation SAS.
+    if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
+    }
+    let resource = "c";
+    let timestamp = blobSASSignatureValues.snapshotTime;
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+        if (blobSASSignatureValues.snapshotTime) {
+            resource = "bs";
+        }
+        else if (blobSASSignatureValues.versionId) {
+            resource = "bv";
+            timestamp = blobSASSignatureValues.versionId;
+        }
+    }
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+    }
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        userDelegationKeyCredential.userDelegationKey.signedObjectId,
+        userDelegationKeyCredential.userDelegationKey.signedTenantId,
+        userDelegationKeyCredential.userDelegationKey.signedStartsOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedExpiresOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedService,
+        userDelegationKeyCredential.userDelegationKey.signedVersion,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        resource,
+        timestamp,
+        blobSASSignatureValues.cacheControl,
+        blobSASSignatureValues.contentDisposition,
+        blobSASSignatureValues.contentEncoding,
+        blobSASSignatureValues.contentLanguage,
+        blobSASSignatureValues.contentType,
+    ].join("\n");
+    const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey),
+        stringToSign: stringToSign,
+    };
 }
-
-exports.mapIncludes = mapIncludes;
-
-
-/***/ }),
-
-/***/ 3021:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var Alias = __nccwpck_require__(4065);
-var Collection = __nccwpck_require__(40101);
-var identity = __nccwpck_require__(41127);
-var Pair = __nccwpck_require__(57165);
-var toJS = __nccwpck_require__(74043);
-var Schema = __nccwpck_require__(45840);
-var stringifyDocument = __nccwpck_require__(6829);
-var anchors = __nccwpck_require__(71596);
-var applyReviver = __nccwpck_require__(83661);
-var createNode = __nccwpck_require__(42404);
-var directives = __nccwpck_require__(61342);
-
-class Document {
-    constructor(value, replacer, options) {
-        /** A comment before this Document */
-        this.commentBefore = null;
-        /** A comment immediately after this Document */
-        this.comment = null;
-        /** Errors encountered during parsing. */
-        this.errors = [];
-        /** Warnings encountered during parsing. */
-        this.warnings = [];
-        Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });
-        let _replacer = null;
-        if (typeof replacer === 'function' || Array.isArray(replacer)) {
-            _replacer = replacer;
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2020-02-10.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn.
+ *
+ * WARNING: identifier will be ignored, permissions and expiresOn are required.
+ *
+ * @param blobSASSignatureValues -
+ * @param userDelegationKeyCredential -
+ */
+function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    // Stored access policies are not supported for a user delegation SAS.
+    if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
+    }
+    let resource = "c";
+    let timestamp = blobSASSignatureValues.snapshotTime;
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+        if (blobSASSignatureValues.snapshotTime) {
+            resource = "bs";
         }
-        else if (options === undefined && replacer) {
-            options = replacer;
-            replacer = undefined;
+        else if (blobSASSignatureValues.versionId) {
+            resource = "bv";
+            timestamp = blobSASSignatureValues.versionId;
         }
-        const opt = Object.assign({
-            intAsBigInt: false,
-            keepSourceTokens: false,
-            logLevel: 'warn',
-            prettyErrors: true,
-            strict: true,
-            stringKeys: false,
-            uniqueKeys: true,
-            version: '1.2'
-        }, options);
-        this.options = opt;
-        let { version } = opt;
-        if (options?._directives) {
-            this.directives = options._directives.atDocument();
-            if (this.directives.yaml.explicit)
-                version = this.directives.yaml.version;
+    }
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
         }
-        else
-            this.directives = new directives.Directives({ version });
-        this.setSchema(version, options);
-        // @ts-expect-error We can't really know that this matches Contents.
-        this.contents =
-            value === undefined ? null : this.createNode(value, _replacer, options);
     }
-    /**
-     * Create a deep copy of this Document and its contents.
-     *
-     * Custom Node values that inherit from `Object` still refer to their original instances.
-     */
-    clone() {
-        const copy = Object.create(Document.prototype, {
-            [identity.NODE_TYPE]: { value: identity.DOC }
-        });
-        copy.commentBefore = this.commentBefore;
-        copy.comment = this.comment;
-        copy.errors = this.errors.slice();
-        copy.warnings = this.warnings.slice();
-        copy.options = Object.assign({}, this.options);
-        if (this.directives)
-            copy.directives = this.directives.clone();
-        copy.schema = this.schema.clone();
-        // @ts-expect-error We can't really know that this matches Contents.
-        copy.contents = identity.isNode(this.contents)
-            ? this.contents.clone(copy.schema)
-            : this.contents;
-        if (this.range)
-            copy.range = this.range.slice();
-        return copy;
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        userDelegationKeyCredential.userDelegationKey.signedObjectId,
+        userDelegationKeyCredential.userDelegationKey.signedTenantId,
+        userDelegationKeyCredential.userDelegationKey.signedStartsOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedExpiresOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedService,
+        userDelegationKeyCredential.userDelegationKey.signedVersion,
+        blobSASSignatureValues.preauthorizedAgentObjectId,
+        undefined, // agentObjectId
+        blobSASSignatureValues.correlationId,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        resource,
+        timestamp,
+        blobSASSignatureValues.cacheControl,
+        blobSASSignatureValues.contentDisposition,
+        blobSASSignatureValues.contentEncoding,
+        blobSASSignatureValues.contentLanguage,
+        blobSASSignatureValues.contentType,
+    ].join("\n");
+    const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId),
+        stringToSign: stringToSign,
+    };
+}
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn.
+ *
+ * WARNING: identifier will be ignored, permissions and expiresOn are required.
+ *
+ * @param blobSASSignatureValues -
+ * @param userDelegationKeyCredential -
+ */
+function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    // Stored access policies are not supported for a user delegation SAS.
+    if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
     }
-    /** Adds a value to the document. */
-    add(value) {
-        if (assertCollection(this.contents))
-            this.contents.add(value);
+    let resource = "c";
+    let timestamp = blobSASSignatureValues.snapshotTime;
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+        if (blobSASSignatureValues.snapshotTime) {
+            resource = "bs";
+        }
+        else if (blobSASSignatureValues.versionId) {
+            resource = "bv";
+            timestamp = blobSASSignatureValues.versionId;
+        }
     }
-    /** Adds a value to the document. */
-    addIn(path, value) {
-        if (assertCollection(this.contents))
-            this.contents.addIn(path, value);
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
     }
-    /**
-     * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
-     *
-     * If `node` already has an anchor, `name` is ignored.
-     * Otherwise, the `node.anchor` value will be set to `name`,
-     * or if an anchor with that name is already present in the document,
-     * `name` will be used as a prefix for a new unique anchor.
-     * If `name` is undefined, the generated anchor will use 'a' as a prefix.
-     */
-    createAlias(node, name) {
-        if (!node.anchor) {
-            const prev = anchors.anchorNames(this);
-            node.anchor =
-                // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
-                !name || prev.has(name) ? anchors.findNewAnchor(name || 'a', prev) : name;
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        userDelegationKeyCredential.userDelegationKey.signedObjectId,
+        userDelegationKeyCredential.userDelegationKey.signedTenantId,
+        userDelegationKeyCredential.userDelegationKey.signedStartsOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedExpiresOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedService,
+        userDelegationKeyCredential.userDelegationKey.signedVersion,
+        blobSASSignatureValues.preauthorizedAgentObjectId,
+        undefined, // agentObjectId
+        blobSASSignatureValues.correlationId,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        resource,
+        timestamp,
+        blobSASSignatureValues.encryptionScope,
+        blobSASSignatureValues.cacheControl,
+        blobSASSignatureValues.contentDisposition,
+        blobSASSignatureValues.contentEncoding,
+        blobSASSignatureValues.contentLanguage,
+        blobSASSignatureValues.contentType,
+    ].join("\n");
+    const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope),
+        stringToSign: stringToSign,
+    };
+}
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn.
+ *
+ * WARNING: identifier will be ignored, permissions and expiresOn are required.
+ *
+ * @param blobSASSignatureValues -
+ * @param userDelegationKeyCredential -
+ */
+function generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userDelegationKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    // Stored access policies are not supported for a user delegation SAS.
+    if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
+    }
+    let resource = "c";
+    let timestamp = blobSASSignatureValues.snapshotTime;
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+        if (blobSASSignatureValues.snapshotTime) {
+            resource = "bs";
         }
-        return new Alias.Alias(node.anchor);
+        else if (blobSASSignatureValues.versionId) {
+            resource = "bv";
+            timestamp = blobSASSignatureValues.versionId;
+        }
+    }
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+    }
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        userDelegationKeyCredential.userDelegationKey.signedObjectId,
+        userDelegationKeyCredential.userDelegationKey.signedTenantId,
+        userDelegationKeyCredential.userDelegationKey.signedStartsOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedExpiresOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedService,
+        userDelegationKeyCredential.userDelegationKey.signedVersion,
+        blobSASSignatureValues.preauthorizedAgentObjectId,
+        undefined, // agentObjectId
+        blobSASSignatureValues.correlationId,
+        userDelegationKeyCredential.userDelegationKey.signedDelegatedUserTenantId, // SignedKeyDelegatedUserTenantId, will be added in a future release.
+        blobSASSignatureValues.delegatedUserObjectId,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        resource,
+        timestamp,
+        blobSASSignatureValues.encryptionScope,
+        blobSASSignatureValues.cacheControl,
+        blobSASSignatureValues.contentDisposition,
+        blobSASSignatureValues.contentEncoding,
+        blobSASSignatureValues.contentLanguage,
+        blobSASSignatureValues.contentType,
+    ].join("\n");
+    const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope, blobSASSignatureValues.delegatedUserObjectId),
+        stringToSign: stringToSign,
+    };
+}
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startsOn.
+ *
+ * WARNING: identifier will be ignored, permissions and expiresOn are required.
+ *
+ * @param blobSASSignatureValues -
+ * @param userDelegationKeyCredential -
+ */
+function generateBlobSASQueryParametersUDK20260406(blobSASSignatureValues, userDelegationKeyCredential) {
+    blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
+    // Stored access policies are not supported for a user delegation SAS.
+    if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
+        throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
     }
-    createNode(value, replacer, options) {
-        let _replacer = undefined;
-        if (typeof replacer === 'function') {
-            value = replacer.call({ '': value }, '', value);
-            _replacer = replacer;
+    let resource = "c";
+    let timestamp = blobSASSignatureValues.snapshotTime;
+    if (blobSASSignatureValues.blobName) {
+        resource = "b";
+        if (blobSASSignatureValues.snapshotTime) {
+            resource = "bs";
         }
-        else if (Array.isArray(replacer)) {
-            const keyToStr = (v) => typeof v === 'number' || v instanceof String || v instanceof Number;
-            const asStr = replacer.filter(keyToStr).map(String);
-            if (asStr.length > 0)
-                replacer = replacer.concat(asStr);
-            _replacer = replacer;
+        else if (blobSASSignatureValues.versionId) {
+            resource = "bv";
+            timestamp = blobSASSignatureValues.versionId;
         }
-        else if (options === undefined && replacer) {
-            options = replacer;
-            replacer = undefined;
+    }
+    // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+    let verifiedPermissions;
+    if (blobSASSignatureValues.permissions) {
+        if (blobSASSignatureValues.blobName) {
+            verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
+        }
+        else {
+            verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
         }
-        const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};
-        const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(this, 
-        // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
-        anchorPrefix || 'a');
-        const ctx = {
-            aliasDuplicateObjects: aliasDuplicateObjects ?? true,
-            keepUndefined: keepUndefined ?? false,
-            onAnchor,
-            onTagObj,
-            replacer: _replacer,
-            schema: this.schema,
-            sourceObjects
-        };
-        const node = createNode.createNode(value, tag, ctx);
-        if (flow && identity.isCollection(node))
-            node.flow = true;
-        setAnchors();
-        return node;
     }
-    /**
-     * Convert a key and a value into a `Pair` using the current schema,
-     * recursively wrapping all values as `Scalar` or `Collection` nodes.
-     */
-    createPair(key, value, options = {}) {
-        const k = this.createNode(key, null, options);
-        const v = this.createNode(value, null, options);
-        return new Pair.Pair(k, v);
+    // Signature is generated on the un-url-encoded values.
+    const stringToSign = [
+        verifiedPermissions ? verifiedPermissions : "",
+        blobSASSignatureValues.startsOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
+            : "",
+        blobSASSignatureValues.expiresOn
+            ? utils_common_truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
+            : "",
+        getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
+        userDelegationKeyCredential.userDelegationKey.signedObjectId,
+        userDelegationKeyCredential.userDelegationKey.signedTenantId,
+        userDelegationKeyCredential.userDelegationKey.signedStartsOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedExpiresOn
+            ? utils_common_truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
+            : "",
+        userDelegationKeyCredential.userDelegationKey.signedService,
+        userDelegationKeyCredential.userDelegationKey.signedVersion,
+        blobSASSignatureValues.preauthorizedAgentObjectId,
+        undefined, // agentObjectId
+        blobSASSignatureValues.correlationId,
+        userDelegationKeyCredential.userDelegationKey.signedDelegatedUserTenantId, // SignedKeyDelegatedUserTenantId, will be added in a future release.
+        blobSASSignatureValues.delegatedUserObjectId,
+        blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
+        blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+        blobSASSignatureValues.version,
+        resource,
+        timestamp,
+        blobSASSignatureValues.encryptionScope,
+        formatRequestHeadersForSasSigning(blobSASSignatureValues.requestHeaders),
+        formatRequestQueryParametersForSasSigning(blobSASSignatureValues.requestQueryParameters),
+        blobSASSignatureValues.cacheControl,
+        blobSASSignatureValues.contentDisposition,
+        blobSASSignatureValues.contentEncoding,
+        blobSASSignatureValues.contentLanguage,
+        blobSASSignatureValues.contentType,
+    ].join("\n");
+    const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope, blobSASSignatureValues.delegatedUserObjectId, getKeysOfRequestHeaders(blobSASSignatureValues.requestHeaders), getKeysOfRequestHeaders(blobSASSignatureValues.requestQueryParameters)),
+        stringToSign: stringToSign,
+    };
+}
+function formatRequestHeadersForSasSigning(requestHeaders) {
+    if (requestHeaders === undefined) {
+        return undefined;
     }
-    /**
-     * Removes a value from the document.
-     * @returns `true` if the item was found and removed.
-     */
-    delete(key) {
-        return assertCollection(this.contents) ? this.contents.delete(key) : false;
+    let canonicalValue = "";
+    Object.keys(requestHeaders).forEach(function (key) {
+        // key: the name of the object key
+        // index: the ordinal position of the key within the object
+        canonicalValue = canonicalValue + key + ":" + requestHeaders[key] + "\n";
+    });
+    return canonicalValue;
+}
+function formatRequestQueryParametersForSasSigning(queryParameters) {
+    if (queryParameters === undefined) {
+        return undefined;
     }
-    /**
-     * Removes a value from the document.
-     * @returns `true` if the item was found and removed.
-     */
-    deleteIn(path) {
-        if (Collection.isEmptyPath(path)) {
-            if (this.contents == null)
-                return false;
-            // @ts-expect-error Presumed impossible if Strict extends false
-            this.contents = null;
-            return true;
+    let canonicalValue = "";
+    Object.keys(queryParameters).forEach(function (key) {
+        // key: the name of the object key
+        // index: the ordinal position of the key within the object
+        canonicalValue = canonicalValue + "\n" + key + ":" + queryParameters[key];
+    });
+    return canonicalValue;
+}
+function getKeysOfRequestHeaders(requestHeaders) {
+    if (requestHeaders === undefined) {
+        return undefined;
+    }
+    let requestKeys = "";
+    let index = 0;
+    Object.keys(requestHeaders).forEach(function (key) {
+        // key: the name of the object key
+        // index: the ordinal position of the key within the object
+        if (index !== 0) {
+            requestKeys = requestKeys + ",";
         }
-        return assertCollection(this.contents)
-            ? this.contents.deleteIn(path)
-            : false;
+        requestKeys = requestKeys + key;
+        ++index;
+    });
+    return requestKeys;
+}
+function getCanonicalName(accountName, containerName, blobName) {
+    // Container: "/blob/account/containerName"
+    // Blob:      "/blob/account/containerName/blobName"
+    const elements = [`/blob/${accountName}/${containerName}`];
+    if (blobName) {
+        elements.push(`/${blobName}`);
+    }
+    return elements.join("");
+}
+function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
+    const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
+    if (blobSASSignatureValues.snapshotTime && version < "2018-11-09") {
+        throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.");
+    }
+    if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {
+        throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.");
+    }
+    if (blobSASSignatureValues.versionId && version < "2019-10-10") {
+        throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.");
+    }
+    if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {
+        throw RangeError("Must provide 'blobName' when providing 'versionId'.");
+    }
+    if (blobSASSignatureValues.permissions &&
+        blobSASSignatureValues.permissions.setImmutabilityPolicy &&
+        version < "2020-08-04") {
+        throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.");
+    }
+    if (blobSASSignatureValues.permissions &&
+        blobSASSignatureValues.permissions.deleteVersion &&
+        version < "2019-10-10") {
+        throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");
+    }
+    if (blobSASSignatureValues.permissions &&
+        blobSASSignatureValues.permissions.permanentDelete &&
+        version < "2019-10-10") {
+        throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");
+    }
+    if (blobSASSignatureValues.permissions &&
+        blobSASSignatureValues.permissions.tag &&
+        version < "2019-12-12") {
+        throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.");
     }
+    if (version < "2020-02-10" &&
+        blobSASSignatureValues.permissions &&
+        (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) {
+        throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");
+    }
+    if (version < "2021-04-10" &&
+        blobSASSignatureValues.permissions &&
+        blobSASSignatureValues.permissions.filterByTags) {
+        throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.");
+    }
+    if (version < "2020-02-10" &&
+        (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
+        throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
+    }
+    if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") {
+        throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
+    }
+    blobSASSignatureValues.version = version;
+    return blobSASSignatureValues;
+}
+//# sourceMappingURL=BlobSASSignatureValues.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BlobLeaseClient.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+/**
+ * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}.
+ */
+class BlobLeaseClient {
+    _leaseId;
+    _url;
+    _containerOrBlobOperation;
+    _isContainer;
     /**
-     * Returns item at `key`, or `undefined` if not found. By default unwraps
-     * scalar values from their surrounding node; to disable set `keepScalar` to
-     * `true` (collections are always returned intact).
+     * Gets the lease Id.
+     *
+     * @readonly
      */
-    get(key, keepScalar) {
-        return identity.isCollection(this.contents)
-            ? this.contents.get(key, keepScalar)
-            : undefined;
+    get leaseId() {
+        return this._leaseId;
     }
     /**
-     * Returns item at `path`, or `undefined` if not found. By default unwraps
-     * scalar values from their surrounding node; to disable set `keepScalar` to
-     * `true` (collections are always returned intact).
+     * Gets the url.
+     *
+     * @readonly
      */
-    getIn(path, keepScalar) {
-        if (Collection.isEmptyPath(path))
-            return !keepScalar && identity.isScalar(this.contents)
-                ? this.contents.value
-                : this.contents;
-        return identity.isCollection(this.contents)
-            ? this.contents.getIn(path, keepScalar)
-            : undefined;
+    get url() {
+        return this._url;
     }
     /**
-     * Checks if the document includes a value with the key `key`.
+     * Creates an instance of BlobLeaseClient.
+     * @param client - The client to make the lease operation requests.
+     * @param leaseId - Initial proposed lease id.
      */
-    has(key) {
-        return identity.isCollection(this.contents) ? this.contents.has(key) : false;
+    constructor(client, leaseId) {
+        const clientContext = client.storageClientContext;
+        this._url = client.url;
+        if (client.name === undefined) {
+            this._isContainer = true;
+            this._containerOrBlobOperation = clientContext.container;
+        }
+        else {
+            this._isContainer = false;
+            this._containerOrBlobOperation = clientContext.blob;
+        }
+        if (!leaseId) {
+            leaseId = esm_randomUUID();
+        }
+        this._leaseId = leaseId;
     }
     /**
-     * Checks if the document includes a value at `path`.
+     * Establishes and manages a lock on a container for delete operations, or on a blob
+     * for write and delete operations.
+     * The lock duration can be 15 to 60 seconds, or can be infinite.
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
+     * and
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
+     *
+     * @param duration - Must be between 15 to 60 seconds, or infinite (-1)
+     * @param options - option to configure lease management operations.
+     * @returns Response data for acquire lease operation.
      */
-    hasIn(path) {
-        if (Collection.isEmptyPath(path))
-            return this.contents !== undefined;
-        return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;
+    async acquireLease(duration, options = {}) {
+        if (this._isContainer &&
+            ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
+                (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
+                options.conditions?.tagConditions)) {
+            throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
+        }
+        return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this._containerOrBlobOperation.acquireLease({
+                abortSignal: options.abortSignal,
+                duration,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                proposedLeaseId: this._leaseId,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
     /**
-     * Sets a value in this document. For `!!set`, `value` needs to be a
-     * boolean to add/remove the item from the set.
+     * To change the ID of the lease.
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
+     * and
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
+     *
+     * @param proposedLeaseId - the proposed new lease Id.
+     * @param options - option to configure lease management operations.
+     * @returns Response data for change lease operation.
      */
-    set(key, value) {
-        if (this.contents == null) {
-            // @ts-expect-error We can't really know that this matches Contents.
-            this.contents = Collection.collectionFromPath(this.schema, [key], value);
-        }
-        else if (assertCollection(this.contents)) {
-            this.contents.set(key, value);
+    async changeLease(proposedLeaseId, options = {}) {
+        if (this._isContainer &&
+            ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
+                (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
+                options.conditions?.tagConditions)) {
+            throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
         }
+        return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, {
+                abortSignal: options.abortSignal,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            this._leaseId = proposedLeaseId;
+            return response;
+        });
     }
     /**
-     * Sets a value in this document. For `!!set`, `value` needs to be a
-     * boolean to add/remove the item from the set.
+     * To free the lease if it is no longer needed so that another client may
+     * immediately acquire a lease against the container or the blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
+     * and
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
+     *
+     * @param options - option to configure lease management operations.
+     * @returns Response data for release lease operation.
      */
-    setIn(path, value) {
-        if (Collection.isEmptyPath(path)) {
-            // @ts-expect-error We can't really know that this matches Contents.
-            this.contents = value;
-        }
-        else if (this.contents == null) {
-            // @ts-expect-error We can't really know that this matches Contents.
-            this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);
-        }
-        else if (assertCollection(this.contents)) {
-            this.contents.setIn(path, value);
+    async releaseLease(options = {}) {
+        if (this._isContainer &&
+            ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
+                (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
+                options.conditions?.tagConditions)) {
+            throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
         }
+        return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, {
+                abortSignal: options.abortSignal,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
     /**
-     * Change the YAML version and schema used by the document.
-     * A `null` version disables support for directives, explicit tags, anchors, and aliases.
-     * It also requires the `schema` option to be given as a `Schema` instance value.
+     * To renew the lease.
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
+     * and
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
      *
-     * Overrides all previously set schema options.
+     * @param options - Optional option to configure lease management operations.
+     * @returns Response data for renew lease operation.
      */
-    setSchema(version, options = {}) {
-        if (typeof version === 'number')
-            version = String(version);
-        let opt;
-        switch (version) {
-            case '1.1':
-                if (this.directives)
-                    this.directives.yaml.version = '1.1';
-                else
-                    this.directives = new directives.Directives({ version: '1.1' });
-                opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
-                break;
-            case '1.2':
-            case 'next':
-                if (this.directives)
-                    this.directives.yaml.version = version;
-                else
-                    this.directives = new directives.Directives({ version });
-                opt = { resolveKnownTags: true, schema: 'core' };
-                break;
-            case null:
-                if (this.directives)
-                    delete this.directives;
-                opt = null;
-                break;
-            default: {
-                const sv = JSON.stringify(version);
-                throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);
-            }
+    async renewLease(options = {}) {
+        if (this._isContainer &&
+            ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
+                (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
+                options.conditions?.tagConditions)) {
+            throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
         }
-        // Not using `instanceof Schema` to allow for duck typing
-        if (options.schema instanceof Object)
-            this.schema = options.schema;
-        else if (opt)
-            this.schema = new Schema.Schema(Object.assign(opt, options));
-        else
-            throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
-    }
-    // json & jsonArg are only used from toJSON()
-    toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
-        const ctx = {
-            anchors: new Map(),
-            doc: this,
-            keep: !json,
-            mapAsMap: mapAsMap === true,
-            mapKeyWarned: false,
-            maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
-        };
-        const res = toJS.toJS(this.contents, jsonArg ?? '', ctx);
-        if (typeof onAnchor === 'function')
-            for (const { count, res } of ctx.anchors.values())
-                onAnchor(res, count);
-        return typeof reviver === 'function'
-            ? applyReviver.applyReviver(reviver, { '': res }, '', res)
-            : res;
+        return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => {
+            return this._containerOrBlobOperation.renewLease(this._leaseId, {
+                abortSignal: options.abortSignal,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            });
+        });
     }
     /**
-     * A JSON representation of the document `contents`.
+     * To end the lease but ensure that another client cannot acquire a new lease
+     * until the current lease period has expired.
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
+     * and
+     * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
      *
-     * @param jsonArg Used by `JSON.stringify` to indicate the array index or
-     *   property name.
+     * @param breakPeriod - Break period
+     * @param options - Optional options to configure lease management operations.
+     * @returns Response data for break lease operation.
      */
-    toJSON(jsonArg, onAnchor) {
-        return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });
-    }
-    /** A YAML representation of the document. */
-    toString(options = {}) {
-        if (this.errors.length > 0)
-            throw new Error('Document with errors cannot be stringified');
-        if ('indent' in options &&
-            (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {
-            const s = JSON.stringify(options.indent);
-            throw new Error(`"indent" option must be a positive integer, not ${s}`);
+    async breakLease(breakPeriod, options = {}) {
+        if (this._isContainer &&
+            ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
+                (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
+                options.conditions?.tagConditions)) {
+            throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
         }
-        return stringifyDocument.stringifyDocument(this, options);
+        return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => {
+            const operationOptions = {
+                abortSignal: options.abortSignal,
+                breakPeriod,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            };
+            return utils_common_assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions));
+        });
     }
 }
-function assertCollection(contents) {
-    if (identity.isCollection(contents))
-        return true;
-    throw new Error('Expected a YAML collection as document contents');
-}
-
-exports.Document = Document;
-
-
-/***/ }),
-
-/***/ 71596:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var identity = __nccwpck_require__(41127);
-var visit = __nccwpck_require__(10204);
-
+//# sourceMappingURL=BlobLeaseClient.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/esm/AbortError.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
 /**
- * Verify that the input string is a valid anchor.
+ * This error is thrown when an asynchronous operation has been aborted.
+ * Check for this error by testing the `name` that the name property of the
+ * error matches `"AbortError"`.
  *
- * Will throw on errors.
+ * @example
+ * ```ts
+ * const controller = new AbortController();
+ * controller.abort();
+ * try {
+ *   doAsyncWork(controller.signal)
+ * } catch (e) {
+ *   if (e.name === 'AbortError') {
+ *     // handle abort error here.
+ *   }
+ * }
+ * ```
  */
-function anchorIsValid(anchor) {
-    if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
-        const sa = JSON.stringify(anchor);
-        const msg = `Anchor must not contain whitespace or control characters: ${sa}`;
-        throw new Error(msg);
-    }
-    return true;
-}
-function anchorNames(root) {
-    const anchors = new Set();
-    visit.visit(root, {
-        Value(_key, node) {
-            if (node.anchor)
-                anchors.add(node.anchor);
-        }
-    });
-    return anchors;
-}
-/** Find a new anchor name with the given `prefix` and a one-indexed suffix. */
-function findNewAnchor(prefix, exclude) {
-    for (let i = 1; true; ++i) {
-        const name = `${prefix}${i}`;
-        if (!exclude.has(name))
-            return name;
+class dist_esm_AbortError_AbortError extends Error {
+    constructor(message) {
+        super(message);
+        this.name = "AbortError";
     }
 }
-function createNodeAnchors(doc, prefix) {
-    const aliasObjects = [];
-    const sourceObjects = new Map();
-    let prevAnchors = null;
-    return {
-        onAnchor: (source) => {
-            aliasObjects.push(source);
-            prevAnchors ?? (prevAnchors = anchorNames(doc));
-            const anchor = findNewAnchor(prefix, prevAnchors);
-            prevAnchors.add(anchor);
-            return anchor;
-        },
-        /**
-         * With circular references, the source node is only resolved after all
-         * of its child nodes are. This is why anchors are set only after all of
-         * the nodes have been created.
-         */
-        setAnchors: () => {
-            for (const source of aliasObjects) {
-                const ref = sourceObjects.get(source);
-                if (typeof ref === 'object' &&
-                    ref.anchor &&
-                    (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
-                    ref.node.anchor = ref.anchor;
-                }
-                else {
-                    const error = new Error('Failed to resolve repeated object (this should not happen)');
-                    error.source = source;
-                    throw error;
-                }
-            }
-        },
-        sourceObjects
-    };
-}
-
-exports.anchorIsValid = anchorIsValid;
-exports.anchorNames = anchorNames;
-exports.createNodeAnchors = createNodeAnchors;
-exports.findNewAnchor = findNewAnchor;
-
-
-/***/ }),
-
-/***/ 83661:
-/***/ ((__unused_webpack_module, exports) => {
+//# sourceMappingURL=AbortError.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/esm/index.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
 
-"use strict";
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/utils/RetriableReadableStream.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
 
 /**
- * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,
- * in section 24.5.1.1 "Runtime Semantics: InternalizeJSONProperty" of the
- * 2021 edition: https://tc39.es/ecma262/#sec-json.parse
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
  *
- * Includes extensions for handling Map and Set objects.
+ * A Node.js ReadableStream will internally retry when internal ReadableStream unexpected ends.
  */
-function applyReviver(reviver, obj, key, val) {
-    if (val && typeof val === 'object') {
-        if (Array.isArray(val)) {
-            for (let i = 0, len = val.length; i < len; ++i) {
-                const v0 = val[i];
-                const v1 = applyReviver(reviver, val, String(i), v0);
-                // eslint-disable-next-line @typescript-eslint/no-array-delete
-                if (v1 === undefined)
-                    delete val[i];
-                else if (v1 !== v0)
-                    val[i] = v1;
-            }
+class RetriableReadableStream extends external_node_stream_.Readable {
+    start;
+    offset;
+    end;
+    getter;
+    source;
+    retries = 0;
+    maxRetryRequests;
+    onProgress;
+    options;
+    /**
+     * Creates an instance of RetriableReadableStream.
+     *
+     * @param source - The current ReadableStream returned from getter
+     * @param getter - A method calling downloading request returning
+     *                                      a new ReadableStream from specified offset
+     * @param offset - Offset position in original data source to read
+     * @param count - How much data in original data source to read
+     * @param options -
+     */
+    constructor(source, getter, offset, count, options = {}) {
+        super({ highWaterMark: options.highWaterMark });
+        this.getter = getter;
+        this.source = source;
+        this.start = offset;
+        this.offset = offset;
+        this.end = offset + count - 1;
+        this.maxRetryRequests =
+            options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0;
+        this.onProgress = options.onProgress;
+        this.options = options;
+        this.setSourceEventHandlers();
+    }
+    _read() {
+        this.source.resume();
+    }
+    setSourceEventHandlers() {
+        this.source.on("data", this.sourceDataHandler);
+        this.source.on("end", this.sourceErrorOrEndHandler);
+        this.source.on("error", this.sourceErrorOrEndHandler);
+        // needed for Node14
+        this.source.on("aborted", this.sourceAbortedHandler);
+    }
+    removeSourceEventHandlers() {
+        this.source.removeListener("data", this.sourceDataHandler);
+        this.source.removeListener("end", this.sourceErrorOrEndHandler);
+        this.source.removeListener("error", this.sourceErrorOrEndHandler);
+        this.source.removeListener("aborted", this.sourceAbortedHandler);
+    }
+    sourceDataHandler = (data) => {
+        if (this.options.doInjectErrorOnce) {
+            this.options.doInjectErrorOnce = undefined;
+            this.source.pause();
+            this.sourceErrorOrEndHandler();
+            this.source.destroy();
+            return;
         }
-        else if (val instanceof Map) {
-            for (const k of Array.from(val.keys())) {
-                const v0 = val.get(k);
-                const v1 = applyReviver(reviver, val, k, v0);
-                if (v1 === undefined)
-                    val.delete(k);
-                else if (v1 !== v0)
-                    val.set(k, v1);
-            }
+        // console.log(
+        //   `Offset: ${this.offset}, Received ${data.length} from internal stream`
+        // );
+        this.offset += data.length;
+        if (this.onProgress) {
+            this.onProgress({ loadedBytes: this.offset - this.start });
         }
-        else if (val instanceof Set) {
-            for (const v0 of Array.from(val)) {
-                const v1 = applyReviver(reviver, val, v0, v0);
-                if (v1 === undefined)
-                    val.delete(v0);
-                else if (v1 !== v0) {
-                    val.delete(v0);
-                    val.add(v1);
-                }
+        if (!this.push(data)) {
+            this.source.pause();
+        }
+    };
+    sourceAbortedHandler = () => {
+        const abortError = new dist_esm_AbortError_AbortError("The operation was aborted.");
+        this.destroy(abortError);
+    };
+    sourceErrorOrEndHandler = (err) => {
+        if (err && err.name === "AbortError") {
+            this.destroy(err);
+            return;
+        }
+        // console.log(
+        //   `Source stream emits end or error, offset: ${
+        //     this.offset
+        //   }, dest end : ${this.end}`
+        // );
+        this.removeSourceEventHandlers();
+        if (this.offset - 1 === this.end) {
+            this.push(null);
+        }
+        else if (this.offset <= this.end) {
+            // TODO if error is CRC64 not match, directly throw out the error.
+            // console.log(
+            //   `retries: ${this.retries}, max retries: ${this.maxRetries}`
+            // );
+            if (this.retries < this.maxRetryRequests) {
+                this.retries += 1;
+                this.getter(this.offset)
+                    .then((newSource) => {
+                    this.source = newSource;
+                    this.setSourceEventHandlers();
+                    return;
+                })
+                    .catch((error) => {
+                    this.destroy(error);
+                });
+            }
+            else {
+                this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));
             }
         }
         else {
-            for (const [k, v0] of Object.entries(val)) {
-                const v1 = applyReviver(reviver, val, k, v0);
-                if (v1 === undefined)
-                    delete val[k];
-                else if (v1 !== v0)
-                    val[k] = v1;
-            }
+            this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset - 1}`));
         }
+    };
+    _destroy(error, callback) {
+        // remove listener from source and release source
+        this.removeSourceEventHandlers();
+        this.source.destroy();
+        callback(error === null ? undefined : error);
+    }
+}
+//# sourceMappingURL=RetriableReadableStream.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BlobDownloadResponse.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * BlobDownloadResponse implements BlobDownloadResponseParsed interface, and in Node.js runtime it will
+ * automatically retry when internal read stream unexpected ends. (This kind of unexpected ends cannot
+ * trigger retries defined in pipeline retry policy.)
+ *
+ * The {@link readableStreamBody} stream will retry underlayer, you can just use it as a normal Node.js
+ * Readable stream.
+ */
+class BlobDownloadResponse {
+    /**
+     * Indicates that the service supports
+     * requests for partial file content.
+     *
+     * @readonly
+     */
+    get acceptRanges() {
+        return this.originalResponse.acceptRanges;
+    }
+    /**
+     * Returns if it was previously specified
+     * for the file.
+     *
+     * @readonly
+     */
+    get cacheControl() {
+        return this.originalResponse.cacheControl;
+    }
+    /**
+     * Returns the value that was specified
+     * for the 'x-ms-content-disposition' header and specifies how to process the
+     * response.
+     *
+     * @readonly
+     */
+    get contentDisposition() {
+        return this.originalResponse.contentDisposition;
+    }
+    /**
+     * Returns the value that was specified
+     * for the Content-Encoding request header.
+     *
+     * @readonly
+     */
+    get contentEncoding() {
+        return this.originalResponse.contentEncoding;
+    }
+    /**
+     * Returns the value that was specified
+     * for the Content-Language request header.
+     *
+     * @readonly
+     */
+    get contentLanguage() {
+        return this.originalResponse.contentLanguage;
+    }
+    /**
+     * The current sequence number for a
+     * page blob. This header is not returned for block blobs or append blobs.
+     *
+     * @readonly
+     */
+    get blobSequenceNumber() {
+        return this.originalResponse.blobSequenceNumber;
+    }
+    /**
+     * The blob's type. Possible values include:
+     * 'BlockBlob', 'PageBlob', 'AppendBlob'.
+     *
+     * @readonly
+     */
+    get blobType() {
+        return this.originalResponse.blobType;
+    }
+    /**
+     * The number of bytes present in the
+     * response body.
+     *
+     * @readonly
+     */
+    get contentLength() {
+        return this.originalResponse.contentLength;
+    }
+    /**
+     * If the file has an MD5 hash and the
+     * request is to read the full file, this response header is returned so that
+     * the client can check for message content integrity. If the request is to
+     * read a specified range and the 'x-ms-range-get-content-md5' is set to
+     * true, then the request returns an MD5 hash for the range, as long as the
+     * range size is less than or equal to 4 MB. If neither of these sets of
+     * conditions is true, then no value is returned for the 'Content-MD5'
+     * header.
+     *
+     * @readonly
+     */
+    get contentMD5() {
+        return this.originalResponse.contentMD5;
+    }
+    /**
+     * Indicates the range of bytes returned if
+     * the client requested a subset of the file by setting the Range request
+     * header.
+     *
+     * @readonly
+     */
+    get contentRange() {
+        return this.originalResponse.contentRange;
+    }
+    /**
+     * The content type specified for the file.
+     * The default content type is 'application/octet-stream'
+     *
+     * @readonly
+     */
+    get contentType() {
+        return this.originalResponse.contentType;
+    }
+    /**
+     * Conclusion time of the last attempted
+     * Copy File operation where this file was the destination file. This value
+     * can specify the time of a completed, aborted, or failed copy attempt.
+     *
+     * @readonly
+     */
+    get copyCompletedOn() {
+        return this.originalResponse.copyCompletedOn;
     }
-    return reviver.call(obj, key, val);
-}
-
-exports.applyReviver = applyReviver;
-
-
-/***/ }),
-
-/***/ 42404:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var Alias = __nccwpck_require__(4065);
-var identity = __nccwpck_require__(41127);
-var Scalar = __nccwpck_require__(63301);
-
-const defaultTagPrefix = 'tag:yaml.org,2002:';
-function findTagObject(value, tagName, tags) {
-    if (tagName) {
-        const match = tags.filter(t => t.tag === tagName);
-        const tagObj = match.find(t => !t.format) ?? match[0];
-        if (!tagObj)
-            throw new Error(`Tag ${tagName} not found`);
-        return tagObj;
+    /**
+     * String identifier for the last attempted Copy
+     * File operation where this file was the destination file.
+     *
+     * @readonly
+     */
+    get copyId() {
+        return this.originalResponse.copyId;
     }
-    return tags.find(t => t.identify?.(value) && !t.format);
-}
-function createNode(value, tagName, ctx) {
-    if (identity.isDocument(value))
-        value = value.contents;
-    if (identity.isNode(value))
-        return value;
-    if (identity.isPair(value)) {
-        const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
-        map.items.push(value);
-        return map;
+    /**
+     * Contains the number of bytes copied and
+     * the total bytes in the source in the last attempted Copy File operation
+     * where this file was the destination file. Can show between 0 and
+     * Content-Length bytes copied.
+     *
+     * @readonly
+     */
+    get copyProgress() {
+        return this.originalResponse.copyProgress;
     }
-    if (value instanceof String ||
-        value instanceof Number ||
-        value instanceof Boolean ||
-        (typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere
-    ) {
-        // https://tc39.es/ecma262/#sec-serializejsonproperty
-        value = value.valueOf();
+    /**
+     * URL up to 2KB in length that specifies the
+     * source file used in the last attempted Copy File operation where this file
+     * was the destination file.
+     *
+     * @readonly
+     */
+    get copySource() {
+        return this.originalResponse.copySource;
     }
-    const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
-    // Detect duplicate references to the same object & use Alias nodes for all
-    // after first. The `ref` wrapper allows for circular references to resolve.
-    let ref = undefined;
-    if (aliasDuplicateObjects && value && typeof value === 'object') {
-        ref = sourceObjects.get(value);
-        if (ref) {
-            ref.anchor ?? (ref.anchor = onAnchor(value));
-            return new Alias.Alias(ref.anchor);
-        }
-        else {
-            ref = { anchor: null, node: null };
-            sourceObjects.set(value, ref);
-        }
+    /**
+     * State of the copy operation
+     * identified by 'x-ms-copy-id'. Possible values include: 'pending',
+     * 'success', 'aborted', 'failed'
+     *
+     * @readonly
+     */
+    get copyStatus() {
+        return this.originalResponse.copyStatus;
     }
-    if (tagName?.startsWith('!!'))
-        tagName = defaultTagPrefix + tagName.slice(2);
-    let tagObj = findTagObject(value, tagName, schema.tags);
-    if (!tagObj) {
-        if (value && typeof value.toJSON === 'function') {
-            // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-            value = value.toJSON();
-        }
-        if (!value || typeof value !== 'object') {
-            const node = new Scalar.Scalar(value);
-            if (ref)
-                ref.node = node;
-            return node;
-        }
-        tagObj =
-            value instanceof Map
-                ? schema[identity.MAP]
-                : Symbol.iterator in Object(value)
-                    ? schema[identity.SEQ]
-                    : schema[identity.MAP];
+    /**
+     * Only appears when
+     * x-ms-copy-status is failed or pending. Describes cause of fatal or
+     * non-fatal copy operation failure.
+     *
+     * @readonly
+     */
+    get copyStatusDescription() {
+        return this.originalResponse.copyStatusDescription;
     }
-    if (onTagObj) {
-        onTagObj(tagObj);
-        delete ctx.onTagObj;
+    /**
+     * When a blob is leased,
+     * specifies whether the lease is of infinite or fixed duration. Possible
+     * values include: 'infinite', 'fixed'.
+     *
+     * @readonly
+     */
+    get leaseDuration() {
+        return this.originalResponse.leaseDuration;
     }
-    const node = tagObj?.createNode
-        ? tagObj.createNode(ctx.schema, value, ctx)
-        : typeof tagObj?.nodeClass?.from === 'function'
-            ? tagObj.nodeClass.from(ctx.schema, value, ctx)
-            : new Scalar.Scalar(value);
-    if (tagName)
-        node.tag = tagName;
-    else if (!tagObj.default)
-        node.tag = tagObj.tag;
-    if (ref)
-        ref.node = node;
-    return node;
-}
-
-exports.createNode = createNode;
-
-
-/***/ }),
-
-/***/ 61342:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var identity = __nccwpck_require__(41127);
-var visit = __nccwpck_require__(10204);
-
-const escapeChars = {
-    '!': '%21',
-    ',': '%2C',
-    '[': '%5B',
-    ']': '%5D',
-    '{': '%7B',
-    '}': '%7D'
-};
-const escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, ch => escapeChars[ch]);
-class Directives {
-    constructor(yaml, tags) {
-        /**
-         * The directives-end/doc-start marker `---`. If `null`, a marker may still be
-         * included in the document's stringified representation.
-         */
-        this.docStart = null;
-        /** The doc-end marker `...`.  */
-        this.docEnd = false;
-        this.yaml = Object.assign({}, Directives.defaultYaml, yaml);
-        this.tags = Object.assign({}, Directives.defaultTags, tags);
+    /**
+     * Lease state of the blob. Possible
+     * values include: 'available', 'leased', 'expired', 'breaking', 'broken'.
+     *
+     * @readonly
+     */
+    get leaseState() {
+        return this.originalResponse.leaseState;
     }
-    clone() {
-        const copy = new Directives(this.yaml, this.tags);
-        copy.docStart = this.docStart;
-        return copy;
+    /**
+     * The current lease status of the
+     * blob. Possible values include: 'locked', 'unlocked'.
+     *
+     * @readonly
+     */
+    get leaseStatus() {
+        return this.originalResponse.leaseStatus;
     }
     /**
-     * During parsing, get a Directives instance for the current document and
-     * update the stream state according to the current version's spec.
+     * A UTC date/time value generated by the service that
+     * indicates the time at which the response was initiated.
+     *
+     * @readonly
      */
-    atDocument() {
-        const res = new Directives(this.yaml, this.tags);
-        switch (this.yaml.version) {
-            case '1.1':
-                this.atNextDocument = true;
-                break;
-            case '1.2':
-                this.atNextDocument = false;
-                this.yaml = {
-                    explicit: Directives.defaultYaml.explicit,
-                    version: '1.2'
-                };
-                this.tags = Object.assign({}, Directives.defaultTags);
-                break;
-        }
-        return res;
+    get date() {
+        return this.originalResponse.date;
     }
     /**
-     * @param onError - May be called even if the action was successful
-     * @returns `true` on success
+     * The number of committed blocks
+     * present in the blob. This header is returned only for append blobs.
+     *
+     * @readonly
      */
-    add(line, onError) {
-        if (this.atNextDocument) {
-            this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' };
-            this.tags = Object.assign({}, Directives.defaultTags);
-            this.atNextDocument = false;
-        }
-        const parts = line.trim().split(/[ \t]+/);
-        const name = parts.shift();
-        switch (name) {
-            case '%TAG': {
-                if (parts.length !== 2) {
-                    onError(0, '%TAG directive should contain exactly two parts');
-                    if (parts.length < 2)
-                        return false;
-                }
-                const [handle, prefix] = parts;
-                this.tags[handle] = prefix;
-                return true;
-            }
-            case '%YAML': {
-                this.yaml.explicit = true;
-                if (parts.length !== 1) {
-                    onError(0, '%YAML directive should contain exactly one part');
-                    return false;
-                }
-                const [version] = parts;
-                if (version === '1.1' || version === '1.2') {
-                    this.yaml.version = version;
-                    return true;
-                }
-                else {
-                    const isValid = /^\d+\.\d+$/.test(version);
-                    onError(6, `Unsupported YAML version ${version}`, isValid);
-                    return false;
-                }
-            }
-            default:
-                onError(0, `Unknown directive ${name}`, true);
-                return false;
-        }
+    get blobCommittedBlockCount() {
+        return this.originalResponse.blobCommittedBlockCount;
     }
     /**
-     * Resolves a tag, matching handles to those defined in %TAG directives.
+     * The ETag contains a value that you can use to
+     * perform operations conditionally, in quotes.
      *
-     * @returns Resolved tag, which may also be the non-specific tag `'!'` or a
-     *   `'!local'` tag, or `null` if unresolvable.
+     * @readonly
      */
-    tagName(source, onError) {
-        if (source === '!')
-            return '!'; // non-specific tag
-        if (source[0] !== '!') {
-            onError(`Not a valid tag: ${source}`);
-            return null;
-        }
-        if (source[1] === '<') {
-            const verbatim = source.slice(2, -1);
-            if (verbatim === '!' || verbatim === '!!') {
-                onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
-                return null;
-            }
-            if (source[source.length - 1] !== '>')
-                onError('Verbatim tags must end with a >');
-            return verbatim;
-        }
-        const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
-        if (!suffix)
-            onError(`The ${source} tag has no suffix`);
-        const prefix = this.tags[handle];
-        if (prefix) {
-            try {
-                return prefix + decodeURIComponent(suffix);
-            }
-            catch (error) {
-                onError(String(error));
-                return null;
-            }
-        }
-        if (handle === '!')
-            return source; // local tag
-        onError(`Could not resolve tag: ${source}`);
-        return null;
+    get etag() {
+        return this.originalResponse.etag;
     }
     /**
-     * Given a fully resolved tag, returns its printable string form,
-     * taking into account current tag prefixes and defaults.
+     * The number of tags associated with the blob
+     *
+     * @readonly
      */
-    tagString(tag) {
-        for (const [handle, prefix] of Object.entries(this.tags)) {
-            if (tag.startsWith(prefix))
-                return handle + escapeTagName(tag.substring(prefix.length));
-        }
-        return tag[0] === '!' ? tag : `!<${tag}>`;
+    get tagCount() {
+        return this.originalResponse.tagCount;
     }
-    toString(doc) {
-        const lines = this.yaml.explicit
-            ? [`%YAML ${this.yaml.version || '1.2'}`]
-            : [];
-        const tagEntries = Object.entries(this.tags);
-        let tagNames;
-        if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {
-            const tags = {};
-            visit.visit(doc.contents, (_key, node) => {
-                if (identity.isNode(node) && node.tag)
-                    tags[node.tag] = true;
-            });
-            tagNames = Object.keys(tags);
-        }
-        else
-            tagNames = [];
-        for (const [handle, prefix] of tagEntries) {
-            if (handle === '!!' && prefix === 'tag:yaml.org,2002:')
-                continue;
-            if (!doc || tagNames.some(tn => tn.startsWith(prefix)))
-                lines.push(`%TAG ${handle} ${prefix}`);
-        }
-        return lines.join('\n');
+    /**
+     * The error code.
+     *
+     * @readonly
+     */
+    get errorCode() {
+        return this.originalResponse.errorCode;
     }
-}
-Directives.defaultYaml = { explicit: false, version: '1.2' };
-Directives.defaultTags = { '!!': 'tag:yaml.org,2002:' };
-
-exports.Directives = Directives;
-
-
-/***/ }),
-
-/***/ 91464:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-class YAMLError extends Error {
-    constructor(name, pos, code, message) {
-        super();
-        this.name = name;
-        this.code = code;
-        this.message = message;
-        this.pos = pos;
+    /**
+     * The value of this header is set to
+     * true if the file data and application metadata are completely encrypted
+     * using the specified algorithm. Otherwise, the value is set to false (when
+     * the file is unencrypted, or if only parts of the file/application metadata
+     * are encrypted).
+     *
+     * @readonly
+     */
+    get isServerEncrypted() {
+        return this.originalResponse.isServerEncrypted;
     }
-}
-class YAMLParseError extends YAMLError {
-    constructor(pos, code, message) {
-        super('YAMLParseError', pos, code, message);
+    /**
+     * If the blob has a MD5 hash, and if
+     * request contains range header (Range or x-ms-range), this response header
+     * is returned with the value of the whole blob's MD5 value. This value may
+     * or may not be equal to the value returned in Content-MD5 header, with the
+     * latter calculated from the requested range.
+     *
+     * @readonly
+     */
+    get blobContentMD5() {
+        return this.originalResponse.blobContentMD5;
     }
-}
-class YAMLWarning extends YAMLError {
-    constructor(pos, code, message) {
-        super('YAMLWarning', pos, code, message);
+    /**
+     * Returns the date and time the file was last
+     * modified. Any operation that modifies the file or its properties updates
+     * the last modified time.
+     *
+     * @readonly
+     */
+    get lastModified() {
+        return this.originalResponse.lastModified;
     }
-}
-const prettifyError = (src, lc) => (error) => {
-    if (error.pos[0] === -1)
-        return;
-    error.linePos = error.pos.map(pos => lc.linePos(pos));
-    const { line, col } = error.linePos[0];
-    error.message += ` at line ${line}, column ${col}`;
-    let ci = col - 1;
-    let lineStr = src
-        .substring(lc.lineStarts[line - 1], lc.lineStarts[line])
-        .replace(/[\n\r]+$/, '');
-    // Trim to max 80 chars, keeping col position near the middle
-    if (ci >= 60 && lineStr.length > 80) {
-        const trimStart = Math.min(ci - 39, lineStr.length - 79);
-        lineStr = '…' + lineStr.substring(trimStart);
-        ci -= trimStart - 1;
+    /**
+     * Returns the UTC date and time generated by the service that indicates the time at which the blob was
+     * last read or written to.
+     *
+     * @readonly
+     */
+    get lastAccessed() {
+        return this.originalResponse.lastAccessed;
     }
-    if (lineStr.length > 80)
-        lineStr = lineStr.substring(0, 79) + '…';
-    // Include previous line in context if pointing at line start
-    if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {
-        // Regexp won't match if start is trimmed
-        let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
-        if (prev.length > 80)
-            prev = prev.substring(0, 79) + '…\n';
-        lineStr = prev + lineStr;
+    /**
+     * Returns the date and time the blob was created.
+     *
+     * @readonly
+     */
+    get createdOn() {
+        return this.originalResponse.createdOn;
     }
-    if (/[^ ]/.test(lineStr)) {
-        let count = 1;
-        const end = error.linePos[1];
-        if (end?.line === line && end.col > col) {
-            count = Math.max(1, Math.min(end.col - col, 80 - ci));
-        }
-        const pointer = ' '.repeat(ci) + '^'.repeat(count);
-        error.message += `:\n\n${lineStr}\n${pointer}\n`;
+    /**
+     * A name-value pair
+     * to associate with a file storage object.
+     *
+     * @readonly
+     */
+    get metadata() {
+        return this.originalResponse.metadata;
     }
-};
-
-exports.YAMLError = YAMLError;
-exports.YAMLParseError = YAMLParseError;
-exports.YAMLWarning = YAMLWarning;
-exports.prettifyError = prettifyError;
-
-
-/***/ }),
-
-/***/ 38815:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var composer = __nccwpck_require__(89984);
-var Document = __nccwpck_require__(3021);
-var Schema = __nccwpck_require__(45840);
-var errors = __nccwpck_require__(91464);
-var Alias = __nccwpck_require__(4065);
-var identity = __nccwpck_require__(41127);
-var Pair = __nccwpck_require__(57165);
-var Scalar = __nccwpck_require__(63301);
-var YAMLMap = __nccwpck_require__(84454);
-var YAMLSeq = __nccwpck_require__(92223);
-var cst = __nccwpck_require__(3461);
-var lexer = __nccwpck_require__(40361);
-var lineCounter = __nccwpck_require__(66628);
-var parser = __nccwpck_require__(3456);
-var publicApi = __nccwpck_require__(84047);
-var visit = __nccwpck_require__(10204);
-
-
-
-exports.Composer = composer.Composer;
-exports.Document = Document.Document;
-exports.Schema = Schema.Schema;
-exports.YAMLError = errors.YAMLError;
-exports.YAMLParseError = errors.YAMLParseError;
-exports.YAMLWarning = errors.YAMLWarning;
-exports.Alias = Alias.Alias;
-exports.isAlias = identity.isAlias;
-exports.isCollection = identity.isCollection;
-exports.isDocument = identity.isDocument;
-exports.isMap = identity.isMap;
-exports.isNode = identity.isNode;
-exports.isPair = identity.isPair;
-exports.isScalar = identity.isScalar;
-exports.isSeq = identity.isSeq;
-exports.Pair = Pair.Pair;
-exports.Scalar = Scalar.Scalar;
-exports.YAMLMap = YAMLMap.YAMLMap;
-exports.YAMLSeq = YAMLSeq.YAMLSeq;
-exports.CST = cst;
-exports.Lexer = lexer.Lexer;
-exports.LineCounter = lineCounter.LineCounter;
-exports.Parser = parser.Parser;
-exports.parse = publicApi.parse;
-exports.parseAllDocuments = publicApi.parseAllDocuments;
-exports.parseDocument = publicApi.parseDocument;
-exports.stringify = publicApi.stringify;
-exports.visit = visit.visit;
-exports.visitAsync = visit.visitAsync;
-
-
-/***/ }),
-
-/***/ 57249:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var node_process = __nccwpck_require__(932);
-
-function debug(logLevel, ...messages) {
-    if (logLevel === 'debug')
-        console.log(...messages);
-}
-function warn(logLevel, warning) {
-    if (logLevel === 'debug' || logLevel === 'warn') {
-        if (typeof node_process.emitWarning === 'function')
-            node_process.emitWarning(warning);
-        else
-            console.warn(warning);
+    /**
+     * This header uniquely identifies the request
+     * that was made and can be used for troubleshooting the request.
+     *
+     * @readonly
+     */
+    get requestId() {
+        return this.originalResponse.requestId;
     }
-}
-
-exports.debug = debug;
-exports.warn = warn;
-
-
-/***/ }),
-
-/***/ 4065:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var anchors = __nccwpck_require__(71596);
-var visit = __nccwpck_require__(10204);
-var identity = __nccwpck_require__(41127);
-var Node = __nccwpck_require__(66673);
-var toJS = __nccwpck_require__(74043);
-
-class Alias extends Node.NodeBase {
-    constructor(source) {
-        super(identity.ALIAS);
-        this.source = source;
-        Object.defineProperty(this, 'tag', {
-            set() {
-                throw new Error('Alias nodes cannot have tags');
-            }
-        });
+    /**
+     * If a client request id header is sent in the request, this header will be present in the
+     * response with the same value.
+     *
+     * @readonly
+     */
+    get clientRequestId() {
+        return this.originalResponse.clientRequestId;
+    }
+    /**
+     * Indicates the version of the Blob service used
+     * to execute the request.
+     *
+     * @readonly
+     */
+    get version() {
+        return this.originalResponse.version;
     }
     /**
-     * Resolve the value of this alias within `doc`, finding the last
-     * instance of the `source` anchor before this node.
+     * Indicates the versionId of the downloaded blob version.
+     *
+     * @readonly
      */
-    resolve(doc, ctx) {
-        if (ctx?.maxAliasCount === 0)
-            throw new ReferenceError('Alias resolution is disabled');
-        let nodes;
-        if (ctx?.aliasResolveCache) {
-            nodes = ctx.aliasResolveCache;
-        }
-        else {
-            nodes = [];
-            visit.visit(doc, {
-                Node: (_key, node) => {
-                    if (identity.isAlias(node) || identity.hasAnchor(node))
-                        nodes.push(node);
-                }
-            });
-            if (ctx)
-                ctx.aliasResolveCache = nodes;
-        }
-        let found = undefined;
-        for (const node of nodes) {
-            if (node === this)
-                break;
-            if (node.anchor === this.source)
-                found = node;
-        }
-        return found;
+    get versionId() {
+        return this.originalResponse.versionId;
     }
-    toJSON(_arg, ctx) {
-        if (!ctx)
-            return { source: this.source };
-        const { anchors, doc, maxAliasCount } = ctx;
-        const source = this.resolve(doc, ctx);
-        if (!source) {
-            const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
-            throw new ReferenceError(msg);
-        }
-        let data = anchors.get(source);
-        if (!data) {
-            // Resolve anchors for Node.prototype.toJS()
-            toJS.toJS(source, null, ctx);
-            data = anchors.get(source);
-        }
-        /* istanbul ignore if */
-        if (data?.res === undefined) {
-            const msg = 'This should not happen: Alias anchor was not resolved?';
-            throw new ReferenceError(msg);
-        }
-        if (maxAliasCount >= 0) {
-            data.count += 1;
-            if (data.aliasCount === 0)
-                data.aliasCount = getAliasCount(doc, source, anchors);
-            if (data.count * data.aliasCount > maxAliasCount) {
-                const msg = 'Excessive alias count indicates a resource exhaustion attack';
-                throw new ReferenceError(msg);
-            }
-        }
-        return data.res;
+    /**
+     * Indicates whether version of this blob is a current version.
+     *
+     * @readonly
+     */
+    get isCurrentVersion() {
+        return this.originalResponse.isCurrentVersion;
     }
-    toString(ctx, _onComment, _onChompKeep) {
-        const src = `*${this.source}`;
-        if (ctx) {
-            anchors.anchorIsValid(this.source);
-            if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
-                const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
-                throw new Error(msg);
-            }
-            if (ctx.implicitKey)
-                return `${src} `;
-        }
-        return src;
+    /**
+     * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned
+     * when the blob was encrypted with a customer-provided key.
+     *
+     * @readonly
+     */
+    get encryptionKeySha256() {
+        return this.originalResponse.encryptionKeySha256;
     }
-}
-function getAliasCount(doc, node, anchors) {
-    if (identity.isAlias(node)) {
-        const source = node.resolve(doc);
-        const anchor = anchors && source && anchors.get(source);
-        return anchor ? anchor.count * anchor.aliasCount : 0;
+    /**
+     * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to
+     * true, then the request returns a crc64 for the range, as long as the range size is less than
+     * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is
+     * specified in the same request, it will fail with 400(Bad Request)
+     */
+    get contentCrc64() {
+        return this.originalResponse.contentCrc64;
     }
-    else if (identity.isCollection(node)) {
-        let count = 0;
-        for (const item of node.items) {
-            const c = getAliasCount(doc, item, anchors);
-            if (c > count)
-                count = c;
-        }
-        return count;
+    /**
+     * Object Replication Policy Id of the destination blob.
+     *
+     * @readonly
+     */
+    get objectReplicationDestinationPolicyId() {
+        return this.originalResponse.objectReplicationDestinationPolicyId;
     }
-    else if (identity.isPair(node)) {
-        const kc = getAliasCount(doc, node.key, anchors);
-        const vc = getAliasCount(doc, node.value, anchors);
-        return Math.max(kc, vc);
+    /**
+     * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob.
+     *
+     * @readonly
+     */
+    get objectReplicationSourceProperties() {
+        return this.originalResponse.objectReplicationSourceProperties;
     }
-    return 1;
-}
-
-exports.Alias = Alias;
-
-
-/***/ }),
-
-/***/ 40101:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var createNode = __nccwpck_require__(42404);
-var identity = __nccwpck_require__(41127);
-var Node = __nccwpck_require__(66673);
-
-function collectionFromPath(schema, path, value) {
-    let v = value;
-    for (let i = path.length - 1; i >= 0; --i) {
-        const k = path[i];
-        if (typeof k === 'number' && Number.isInteger(k) && k >= 0) {
-            const a = [];
-            a[k] = v;
-            v = a;
-        }
-        else {
-            v = new Map([[k, v]]);
-        }
+    /**
+     * If this blob has been sealed.
+     *
+     * @readonly
+     */
+    get isSealed() {
+        return this.originalResponse.isSealed;
     }
-    return createNode.createNode(v, undefined, {
-        aliasDuplicateObjects: false,
-        keepUndefined: false,
-        onAnchor: () => {
-            throw new Error('This should not happen, please report a bug.');
-        },
-        schema,
-        sourceObjects: new Map()
-    });
-}
-// Type guard is intentionally a little wrong so as to be more useful,
-// as it does not cover untypable empty non-string iterables (e.g. []).
-const isEmptyPath = (path) => path == null ||
-    (typeof path === 'object' && !!path[Symbol.iterator]().next().done);
-class Collection extends Node.NodeBase {
-    constructor(type, schema) {
-        super(type);
-        Object.defineProperty(this, 'schema', {
-            value: schema,
-            configurable: true,
-            enumerable: false,
-            writable: true
-        });
+    /**
+     * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire.
+     *
+     * @readonly
+     */
+    get immutabilityPolicyExpiresOn() {
+        return this.originalResponse.immutabilityPolicyExpiresOn;
     }
     /**
-     * Create a copy of this collection.
+     * Indicates immutability policy mode.
      *
-     * @param schema - If defined, overwrites the original's schema
+     * @readonly
      */
-    clone(schema) {
-        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
-        if (schema)
-            copy.schema = schema;
-        copy.items = copy.items.map(it => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);
-        if (this.range)
-            copy.range = this.range.slice();
-        return copy;
+    get immutabilityPolicyMode() {
+        return this.originalResponse.immutabilityPolicyMode;
     }
     /**
-     * Adds a value to the collection. For `!!map` and `!!omap` the value must
-     * be a Pair instance or a `{ key, value }` object, which may not have a key
-     * that already exists in the map.
+     * Indicates if a legal hold is present on the blob.
+     *
+     * @readonly
      */
-    addIn(path, value) {
-        if (isEmptyPath(path))
-            this.add(value);
-        else {
-            const [key, ...rest] = path;
-            const node = this.get(key, true);
-            if (identity.isCollection(node))
-                node.addIn(rest, value);
-            else if (node === undefined && this.schema)
-                this.set(key, collectionFromPath(this.schema, rest, value));
-            else
-                throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
-        }
+    get legalHold() {
+        return this.originalResponse.legalHold;
+    }
+    get structuredBodyType() {
+        return this.originalResponse.structuredBodyType;
     }
     /**
-     * Removes a value from the collection.
-     * @returns `true` if the item was found and removed.
+     * The response body as a browser Blob.
+     * Always undefined in node.js.
+     *
+     * @readonly
      */
-    deleteIn(path) {
-        const [key, ...rest] = path;
-        if (rest.length === 0)
-            return this.delete(key);
-        const node = this.get(key, true);
-        if (identity.isCollection(node))
-            return node.deleteIn(rest);
-        else
-            throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
+    get contentAsBlob() {
+        return this.originalResponse.blobBody;
     }
     /**
-     * Returns item at `key`, or `undefined` if not found. By default unwraps
-     * scalar values from their surrounding node; to disable set `keepScalar` to
-     * `true` (collections are always returned intact).
+     * The response body as a node.js Readable stream.
+     * Always undefined in the browser.
+     *
+     * It will automatically retry when internal read stream unexpected ends.
+     *
+     * @readonly
      */
-    getIn(path, keepScalar) {
-        const [key, ...rest] = path;
-        const node = this.get(key, true);
-        if (rest.length === 0)
-            return !keepScalar && identity.isScalar(node) ? node.value : node;
-        else
-            return identity.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
+    get readableStreamBody() {
+        return esm_isNodeLike ? this.blobDownloadStream : undefined;
     }
-    hasAllNullValues(allowScalar) {
-        return this.items.every(node => {
-            if (!identity.isPair(node))
-                return false;
-            const n = node.value;
-            return (n == null ||
-                (allowScalar &&
-                    identity.isScalar(n) &&
-                    n.value == null &&
-                    !n.commentBefore &&
-                    !n.comment &&
-                    !n.tag));
-        });
+    /**
+     * The HTTP response.
+     */
+    get _response() {
+        return this.originalResponse._response;
     }
+    originalResponse;
+    blobDownloadStream;
     /**
-     * Checks if the collection includes a value with the key `key`.
+     * Creates an instance of BlobDownloadResponse.
+     *
+     * @param originalResponse -
+     * @param getter -
+     * @param offset -
+     * @param count -
+     * @param options -
      */
-    hasIn(path) {
-        const [key, ...rest] = path;
-        if (rest.length === 0)
-            return this.has(key);
-        const node = this.get(key, true);
-        return identity.isCollection(node) ? node.hasIn(rest) : false;
+    constructor(originalResponse, getter, offset, count, options = {}) {
+        this.originalResponse = originalResponse;
+        const streamBody = this.originalResponse.structuredBodyType === undefined
+            ? this.originalResponse.readableStreamBody
+            : structuredMessageDecodingStream(this.originalResponse.readableStreamBody, options);
+        this.blobDownloadStream = new RetriableReadableStream(streamBody, getter, offset, count, options);
+    }
+}
+//# sourceMappingURL=BlobDownloadResponse.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/internal-avro/AvroConstants.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+const AVRO_SYNC_MARKER_SIZE = 16;
+const AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]);
+const AVRO_CODEC_KEY = "avro.codec";
+const AVRO_SCHEMA_KEY = "avro.schema";
+//# sourceMappingURL=AvroConstants.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/internal-avro/AvroParser.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+class AvroParser {
+    /**
+     * Reads a fixed number of bytes from the stream.
+     *
+     * @param stream -
+     * @param length -
+     * @param options -
+     */
+    static async readFixedBytes(stream, length, options = {}) {
+        const bytes = await stream.read(length, { abortSignal: options.abortSignal });
+        if (bytes.length !== length) {
+            throw new Error("Hit stream end.");
+        }
+        return bytes;
     }
     /**
-     * Sets a value in this collection. For `!!set`, `value` needs to be a
-     * boolean to add/remove the item from the set.
+     * Reads a single byte from the stream.
+     *
+     * @param stream -
+     * @param options -
      */
-    setIn(path, value) {
-        const [key, ...rest] = path;
-        if (rest.length === 0) {
-            this.set(key, value);
+    static async readByte(stream, options = {}) {
+        const buf = await AvroParser.readFixedBytes(stream, 1, options);
+        return buf[0];
+    }
+    // int and long are stored in variable-length zig-zag coding.
+    // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt
+    // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types
+    static async readZigZagLong(stream, options = {}) {
+        let zigZagEncoded = 0;
+        let significanceInBit = 0;
+        let byte, haveMoreByte, significanceInFloat;
+        do {
+            byte = await AvroParser.readByte(stream, options);
+            haveMoreByte = byte & 0x80;
+            zigZagEncoded |= (byte & 0x7f) << significanceInBit;
+            significanceInBit += 7;
+        } while (haveMoreByte && significanceInBit < 28); // bitwise operation only works for 32-bit integers
+        if (haveMoreByte) {
+            // Switch to float arithmetic
+            // eslint-disable-next-line no-self-assign
+            zigZagEncoded = zigZagEncoded;
+            significanceInFloat = 268435456; // 2 ** 28.
+            do {
+                byte = await AvroParser.readByte(stream, options);
+                zigZagEncoded += (byte & 0x7f) * significanceInFloat;
+                significanceInFloat *= 128; // 2 ** 7
+            } while (byte & 0x80);
+            const res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2;
+            if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) {
+                throw new Error("Integer overflow.");
+            }
+            return res;
+        }
+        return (zigZagEncoded >> 1) ^ -(zigZagEncoded & 1);
+    }
+    static async readLong(stream, options = {}) {
+        return AvroParser.readZigZagLong(stream, options);
+    }
+    static async readInt(stream, options = {}) {
+        return AvroParser.readZigZagLong(stream, options);
+    }
+    static async readNull() {
+        return null;
+    }
+    static async readBoolean(stream, options = {}) {
+        const b = await AvroParser.readByte(stream, options);
+        if (b === 1) {
+            return true;
+        }
+        else if (b === 0) {
+            return false;
         }
         else {
-            const node = this.get(key, true);
-            if (identity.isCollection(node))
-                node.setIn(rest, value);
-            else if (node === undefined && this.schema)
-                this.set(key, collectionFromPath(this.schema, rest, value));
-            else
-                throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
+            throw new Error("Byte was not a boolean.");
+        }
+    }
+    static async readFloat(stream, options = {}) {
+        const u8arr = await AvroParser.readFixedBytes(stream, 4, options);
+        const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength);
+        return view.getFloat32(0, true); // littleEndian = true
+    }
+    static async readDouble(stream, options = {}) {
+        const u8arr = await AvroParser.readFixedBytes(stream, 8, options);
+        const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength);
+        return view.getFloat64(0, true); // littleEndian = true
+    }
+    static async readBytes(stream, options = {}) {
+        const size = await AvroParser.readLong(stream, options);
+        if (size < 0) {
+            throw new Error("Bytes size was negative.");
+        }
+        return stream.read(size, { abortSignal: options.abortSignal });
+    }
+    static async readString(stream, options = {}) {
+        const u8arr = await AvroParser.readBytes(stream, options);
+        const utf8decoder = new TextDecoder();
+        return utf8decoder.decode(u8arr);
+    }
+    static async readMapPair(stream, readItemMethod, options = {}) {
+        const key = await AvroParser.readString(stream, options);
+        // FUTURE: this won't work with readFixed (currently not supported) which needs a length as the parameter.
+        const value = await readItemMethod(stream, options);
+        return { key, value };
+    }
+    static async readMap(stream, readItemMethod, options = {}) {
+        const readPairMethod = (s, opts = {}) => {
+            return AvroParser.readMapPair(s, readItemMethod, opts);
+        };
+        const pairs = await AvroParser.readArray(stream, readPairMethod, options);
+        const dict = {};
+        for (const pair of pairs) {
+            dict[pair.key] = pair.value;
+        }
+        return dict;
+    }
+    static async readArray(stream, readItemMethod, options = {}) {
+        const items = [];
+        for (let count = await AvroParser.readLong(stream, options); count !== 0; count = await AvroParser.readLong(stream, options)) {
+            if (count < 0) {
+                // Ignore block sizes
+                await AvroParser.readLong(stream, options);
+                count = -count;
+            }
+            while (count--) {
+                const item = await readItemMethod(stream, options);
+                items.push(item);
+            }
+        }
+        return items;
+    }
+}
+var AvroComplex;
+(function (AvroComplex) {
+    AvroComplex["RECORD"] = "record";
+    AvroComplex["ENUM"] = "enum";
+    AvroComplex["ARRAY"] = "array";
+    AvroComplex["MAP"] = "map";
+    AvroComplex["UNION"] = "union";
+    AvroComplex["FIXED"] = "fixed";
+})(AvroComplex || (AvroComplex = {}));
+var AvroPrimitive;
+(function (AvroPrimitive) {
+    AvroPrimitive["NULL"] = "null";
+    AvroPrimitive["BOOLEAN"] = "boolean";
+    AvroPrimitive["INT"] = "int";
+    AvroPrimitive["LONG"] = "long";
+    AvroPrimitive["FLOAT"] = "float";
+    AvroPrimitive["DOUBLE"] = "double";
+    AvroPrimitive["BYTES"] = "bytes";
+    AvroPrimitive["STRING"] = "string";
+})(AvroPrimitive || (AvroPrimitive = {}));
+class AvroType {
+    /**
+     * Determines the AvroType from the Avro Schema.
+     */
+    // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
+    static fromSchema(schema) {
+        if (typeof schema === "string") {
+            return AvroType.fromStringSchema(schema);
+        }
+        else if (Array.isArray(schema)) {
+            return AvroType.fromArraySchema(schema);
+        }
+        else {
+            return AvroType.fromObjectSchema(schema);
+        }
+    }
+    static fromStringSchema(schema) {
+        switch (schema) {
+            case AvroPrimitive.NULL:
+            case AvroPrimitive.BOOLEAN:
+            case AvroPrimitive.INT:
+            case AvroPrimitive.LONG:
+            case AvroPrimitive.FLOAT:
+            case AvroPrimitive.DOUBLE:
+            case AvroPrimitive.BYTES:
+            case AvroPrimitive.STRING:
+                return new AvroPrimitiveType(schema);
+            default:
+                throw new Error(`Unexpected Avro type ${schema}`);
+        }
+    }
+    static fromArraySchema(schema) {
+        return new AvroUnionType(schema.map(AvroType.fromSchema));
+    }
+    static fromObjectSchema(schema) {
+        const type = schema.type;
+        // Primitives can be defined as strings or objects
+        try {
+            return AvroType.fromStringSchema(type);
+        }
+        catch {
+            // no-op
+        }
+        switch (type) {
+            case AvroComplex.RECORD:
+                if (schema.aliases) {
+                    throw new Error(`aliases currently is not supported, schema: ${schema}`);
+                }
+                if (!schema.name) {
+                    throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`);
+                }
+                // eslint-disable-next-line no-case-declarations
+                const fields = {};
+                if (!schema.fields) {
+                    throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`);
+                }
+                for (const field of schema.fields) {
+                    fields[field.name] = AvroType.fromSchema(field.type);
+                }
+                return new AvroRecordType(fields, schema.name);
+            case AvroComplex.ENUM:
+                if (schema.aliases) {
+                    throw new Error(`aliases currently is not supported, schema: ${schema}`);
+                }
+                if (!schema.symbols) {
+                    throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema}`);
+                }
+                return new AvroEnumType(schema.symbols);
+            case AvroComplex.MAP:
+                if (!schema.values) {
+                    throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema}`);
+                }
+                return new AvroMapType(AvroType.fromSchema(schema.values));
+            case AvroComplex.ARRAY: // Unused today
+            case AvroComplex.FIXED: // Unused today
+            default:
+                throw new Error(`Unexpected Avro type ${type} in ${schema}`);
         }
     }
 }
-
-exports.Collection = Collection;
-exports.collectionFromPath = collectionFromPath;
-exports.isEmptyPath = isEmptyPath;
-
-
-/***/ }),
-
-/***/ 66673:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var applyReviver = __nccwpck_require__(83661);
-var identity = __nccwpck_require__(41127);
-var toJS = __nccwpck_require__(74043);
-
-class NodeBase {
-    constructor(type) {
-        Object.defineProperty(this, identity.NODE_TYPE, { value: type });
+class AvroPrimitiveType extends AvroType {
+    _primitive;
+    constructor(primitive) {
+        super();
+        this._primitive = primitive;
+    }
+    // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
+    read(stream, options = {}) {
+        switch (this._primitive) {
+            case AvroPrimitive.NULL:
+                return AvroParser.readNull();
+            case AvroPrimitive.BOOLEAN:
+                return AvroParser.readBoolean(stream, options);
+            case AvroPrimitive.INT:
+                return AvroParser.readInt(stream, options);
+            case AvroPrimitive.LONG:
+                return AvroParser.readLong(stream, options);
+            case AvroPrimitive.FLOAT:
+                return AvroParser.readFloat(stream, options);
+            case AvroPrimitive.DOUBLE:
+                return AvroParser.readDouble(stream, options);
+            case AvroPrimitive.BYTES:
+                return AvroParser.readBytes(stream, options);
+            case AvroPrimitive.STRING:
+                return AvroParser.readString(stream, options);
+            default:
+                throw new Error("Unknown Avro Primitive");
+        }
     }
-    /** Create a copy of this node.  */
-    clone() {
-        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
-        if (this.range)
-            copy.range = this.range.slice();
-        return copy;
+}
+class AvroEnumType extends AvroType {
+    _symbols;
+    constructor(symbols) {
+        super();
+        this._symbols = symbols;
     }
-    /** A plain JavaScript representation of this node. */
-    toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
-        if (!identity.isDocument(doc))
-            throw new TypeError('A document argument is required');
-        const ctx = {
-            anchors: new Map(),
-            doc,
-            keep: true,
-            mapAsMap: mapAsMap === true,
-            mapKeyWarned: false,
-            maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
+    // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
+    async read(stream, options = {}) {
+        const value = await AvroParser.readInt(stream, options);
+        return this._symbols[value];
+    }
+}
+class AvroUnionType extends AvroType {
+    _types;
+    constructor(types) {
+        super();
+        this._types = types;
+    }
+    async read(stream, options = {}) {
+        const typeIndex = await AvroParser.readInt(stream, options);
+        return this._types[typeIndex].read(stream, options);
+    }
+}
+class AvroMapType extends AvroType {
+    _itemType;
+    constructor(itemType) {
+        super();
+        this._itemType = itemType;
+    }
+    // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
+    read(stream, options = {}) {
+        const readItemMethod = (s, opts) => {
+            return this._itemType.read(s, opts);
         };
-        const res = toJS.toJS(this, '', ctx);
-        if (typeof onAnchor === 'function')
-            for (const { count, res } of ctx.anchors.values())
-                onAnchor(res, count);
-        return typeof reviver === 'function'
-            ? applyReviver.applyReviver(reviver, { '': res }, '', res)
-            : res;
+        return AvroParser.readMap(stream, readItemMethod, options);
     }
 }
+class AvroRecordType extends AvroType {
+    _name;
+    _fields;
+    constructor(fields, name) {
+        super();
+        this._fields = fields;
+        this._name = name;
+    }
+    // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
+    async read(stream, options = {}) {
+        // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
+        const record = {};
+        record["$schema"] = this._name;
+        for (const key in this._fields) {
+            if (Object.prototype.hasOwnProperty.call(this._fields, key)) {
+                record[key] = await this._fields[key].read(stream, options);
+            }
+        }
+        return record;
+    }
+}
+//# sourceMappingURL=AvroParser.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/internal-avro/utils/utils.common.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+function arraysEqual(a, b) {
+    if (a === b)
+        return true;
+    if (a == null || b == null)
+        return false;
+    if (a.length !== b.length)
+        return false;
+    for (let i = 0; i < a.length; ++i) {
+        if (a[i] !== b[i])
+            return false;
+    }
+    return true;
+}
+//# sourceMappingURL=utils.common.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/internal-avro/AvroReader.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+// TODO: Do a review of non-interfaces
+/* eslint-disable @azure/azure-sdk/ts-use-interface-parameters */
 
-exports.NodeBase = NodeBase;
-
-
-/***/ }),
 
-/***/ 57165:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
+class AvroReader {
+    _dataStream;
+    _headerStream;
+    _syncMarker;
+    _metadata;
+    _itemType;
+    _itemsRemainingInBlock;
+    // Remembers where we started if partial data stream was provided.
+    _initialBlockOffset;
+    /// The byte offset within the Avro file (both header and data)
+    /// of the start of the current block.
+    _blockOffset;
+    get blockOffset() {
+        return this._blockOffset;
+    }
+    _objectIndex;
+    get objectIndex() {
+        return this._objectIndex;
+    }
+    _initialized;
+    constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) {
+        this._dataStream = dataStream;
+        this._headerStream = headerStream || dataStream;
+        this._initialized = false;
+        this._blockOffset = currentBlockOffset || 0;
+        this._objectIndex = indexWithinCurrentBlock || 0;
+        this._initialBlockOffset = currentBlockOffset || 0;
+    }
+    async initialize(options = {}) {
+        const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, {
+            abortSignal: options.abortSignal,
+        });
+        if (!arraysEqual(header, AVRO_INIT_BYTES)) {
+            throw new Error("Stream is not an Avro file.");
+        }
+        // File metadata is written as if defined by the following map schema:
+        // { "type": "map", "values": "bytes"}
+        this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, {
+            abortSignal: options.abortSignal,
+        });
+        // Validate codec
+        const codec = this._metadata[AVRO_CODEC_KEY];
+        if (!(codec === undefined || codec === null || codec === "null")) {
+            throw new Error("Codecs are not supported");
+        }
+        // The 16-byte, randomly-generated sync marker for this file.
+        this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, {
+            abortSignal: options.abortSignal,
+        });
+        // Parse the schema
+        const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]);
+        this._itemType = AvroType.fromSchema(schema);
+        if (this._blockOffset === 0) {
+            this._blockOffset = this._initialBlockOffset + this._dataStream.position;
+        }
+        this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
+            abortSignal: options.abortSignal,
+        });
+        // skip block length
+        await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });
+        this._initialized = true;
+        if (this._objectIndex && this._objectIndex > 0) {
+            for (let i = 0; i < this._objectIndex; i++) {
+                await this._itemType.read(this._dataStream, { abortSignal: options.abortSignal });
+                this._itemsRemainingInBlock--;
+            }
+        }
+    }
+    hasNext() {
+        return !this._initialized || this._itemsRemainingInBlock > 0;
+    }
+    async *parseObjects(options = {}) {
+        if (!this._initialized) {
+            await this.initialize(options);
+        }
+        while (this.hasNext()) {
+            const result = await this._itemType.read(this._dataStream, {
+                abortSignal: options.abortSignal,
+            });
+            this._itemsRemainingInBlock--;
+            this._objectIndex++;
+            if (this._itemsRemainingInBlock === 0) {
+                const marker = await AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
+                    abortSignal: options.abortSignal,
+                });
+                this._blockOffset = this._initialBlockOffset + this._dataStream.position;
+                this._objectIndex = 0;
+                if (!arraysEqual(this._syncMarker, marker)) {
+                    throw new Error("Stream is not a valid Avro file.");
+                }
+                try {
+                    this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
+                        abortSignal: options.abortSignal,
+                    });
+                }
+                catch {
+                    // We hit the end of the stream.
+                    this._itemsRemainingInBlock = 0;
+                }
+                if (this._itemsRemainingInBlock > 0) {
+                    // Ignore block size
+                    await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });
+                }
+            }
+            yield result;
+        }
+    }
+}
+//# sourceMappingURL=AvroReader.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/internal-avro/AvroReadable.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+class AvroReadable {
+}
+//# sourceMappingURL=AvroReadable.js.map
+// EXTERNAL MODULE: external "buffer"
+var external_buffer_ = __nccwpck_require__(20181);
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/internal-avro/AvroReadableFromStream.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
 
-var createNode = __nccwpck_require__(42404);
-var stringifyPair = __nccwpck_require__(59748);
-var addPairToJSMap = __nccwpck_require__(97104);
-var identity = __nccwpck_require__(41127);
 
-function createPair(key, value, ctx) {
-    const k = createNode.createNode(key, undefined, ctx);
-    const v = createNode.createNode(value, undefined, ctx);
-    return new Pair(k, v);
-}
-class Pair {
-    constructor(key, value = null) {
-        Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });
-        this.key = key;
-        this.value = value;
+const ABORT_ERROR = new dist_esm_AbortError_AbortError("Reading from the avro stream was aborted.");
+class AvroReadableFromStream extends AvroReadable {
+    _position;
+    _readable;
+    toUint8Array(data) {
+        if (typeof data === "string") {
+            return external_buffer_.Buffer.from(data);
+        }
+        return data;
     }
-    clone(schema) {
-        let { key, value } = this;
-        if (identity.isNode(key))
-            key = key.clone(schema);
-        if (identity.isNode(value))
-            value = value.clone(schema);
-        return new Pair(key, value);
+    constructor(readable) {
+        super();
+        this._readable = readable;
+        this._position = 0;
     }
-    toJSON(_, ctx) {
-        const pair = ctx?.mapAsMap ? new Map() : {};
-        return addPairToJSMap.addPairToJSMap(ctx, pair, this);
+    get position() {
+        return this._position;
     }
-    toString(ctx, onComment, onChompKeep) {
-        return ctx?.doc
-            ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep)
-            : JSON.stringify(this);
+    async read(size, options = {}) {
+        if (options.abortSignal?.aborted) {
+            throw ABORT_ERROR;
+        }
+        if (size < 0) {
+            throw new Error(`size parameter should be positive: ${size}`);
+        }
+        if (size === 0) {
+            return new Uint8Array();
+        }
+        if (!this._readable.readable) {
+            throw new Error("Stream no longer readable.");
+        }
+        // See if there is already enough data.
+        const chunk = this._readable.read(size);
+        if (chunk) {
+            this._position += chunk.length;
+            // chunk.length maybe less than desired size if the stream ends.
+            return this.toUint8Array(chunk);
+        }
+        else {
+            // register callback to wait for enough data to read
+            return new Promise((resolve, reject) => {
+                /* eslint-disable @typescript-eslint/no-use-before-define */
+                const cleanUp = () => {
+                    this._readable.removeListener("readable", readableCallback);
+                    this._readable.removeListener("error", rejectCallback);
+                    this._readable.removeListener("end", rejectCallback);
+                    this._readable.removeListener("close", rejectCallback);
+                    if (options.abortSignal) {
+                        options.abortSignal.removeEventListener("abort", abortHandler);
+                    }
+                };
+                const readableCallback = () => {
+                    const callbackChunk = this._readable.read(size);
+                    if (callbackChunk) {
+                        this._position += callbackChunk.length;
+                        cleanUp();
+                        // callbackChunk.length maybe less than desired size if the stream ends.
+                        resolve(this.toUint8Array(callbackChunk));
+                    }
+                };
+                const rejectCallback = () => {
+                    cleanUp();
+                    reject();
+                };
+                const abortHandler = () => {
+                    cleanUp();
+                    reject(ABORT_ERROR);
+                };
+                this._readable.on("readable", readableCallback);
+                this._readable.once("error", rejectCallback);
+                this._readable.once("end", rejectCallback);
+                this._readable.once("close", rejectCallback);
+                if (options.abortSignal) {
+                    options.abortSignal.addEventListener("abort", abortHandler);
+                }
+                /* eslint-enable @typescript-eslint/no-use-before-define */
+            });
+        }
     }
 }
+//# sourceMappingURL=AvroReadableFromStream.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/internal-avro/index.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-exports.Pair = Pair;
-exports.createPair = createPair;
-
-
-/***/ }),
-
-/***/ 63301:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/utils/BlobQuickQueryStream.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-var identity = __nccwpck_require__(41127);
-var Node = __nccwpck_require__(66673);
-var toJS = __nccwpck_require__(74043);
 
-const isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');
-class Scalar extends Node.NodeBase {
-    constructor(value) {
-        super(identity.SCALAR);
-        this.value = value;
-    }
-    toJSON(arg, ctx) {
-        return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx);
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * A Node.js BlobQuickQueryStream will internally parse avro data stream for blob query.
+ */
+class BlobQuickQueryStream extends external_node_stream_.Readable {
+    source;
+    avroReader;
+    avroIter;
+    avroPaused = true;
+    onProgress;
+    onError;
+    /**
+     * Creates an instance of BlobQuickQueryStream.
+     *
+     * @param source - The current ReadableStream returned from getter
+     * @param options -
+     */
+    constructor(source, options = {}) {
+        super();
+        this.source = source;
+        this.onProgress = options.onProgress;
+        this.onError = options.onError;
+        this.avroReader = new AvroReader(new AvroReadableFromStream(this.source));
+        this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal });
+    }
+    _read() {
+        if (this.avroPaused) {
+            this.readInternal().catch((err) => {
+                this.emit("error", err);
+            });
+        }
     }
-    toString() {
-        return String(this.value);
+    async readInternal() {
+        this.avroPaused = false;
+        let avroNext;
+        do {
+            avroNext = await this.avroIter.next();
+            if (avroNext.done) {
+                break;
+            }
+            const obj = avroNext.value;
+            const schema = obj.$schema;
+            if (typeof schema !== "string") {
+                throw Error("Missing schema in avro record.");
+            }
+            switch (schema) {
+                case "com.microsoft.azure.storage.queryBlobContents.resultData":
+                    {
+                        const data = obj.data;
+                        if (data instanceof Uint8Array === false) {
+                            throw Error("Invalid data in avro result record.");
+                        }
+                        if (!this.push(Buffer.from(data))) {
+                            this.avroPaused = true;
+                        }
+                    }
+                    break;
+                case "com.microsoft.azure.storage.queryBlobContents.progress":
+                    {
+                        const bytesScanned = obj.bytesScanned;
+                        if (typeof bytesScanned !== "number") {
+                            throw Error("Invalid bytesScanned in avro progress record.");
+                        }
+                        if (this.onProgress) {
+                            this.onProgress({ loadedBytes: bytesScanned });
+                        }
+                    }
+                    break;
+                case "com.microsoft.azure.storage.queryBlobContents.end":
+                    if (this.onProgress) {
+                        const totalBytes = obj.totalBytes;
+                        if (typeof totalBytes !== "number") {
+                            throw Error("Invalid totalBytes in avro end record.");
+                        }
+                        this.onProgress({ loadedBytes: totalBytes });
+                    }
+                    this.push(null);
+                    break;
+                case "com.microsoft.azure.storage.queryBlobContents.error":
+                    if (this.onError) {
+                        const fatal = obj.fatal;
+                        if (typeof fatal !== "boolean") {
+                            throw Error("Invalid fatal in avro error record.");
+                        }
+                        const name = obj.name;
+                        if (typeof name !== "string") {
+                            throw Error("Invalid name in avro error record.");
+                        }
+                        const description = obj.description;
+                        if (typeof description !== "string") {
+                            throw Error("Invalid description in avro error record.");
+                        }
+                        const position = obj.position;
+                        if (typeof position !== "number") {
+                            throw Error("Invalid position in avro error record.");
+                        }
+                        this.onError({
+                            position,
+                            name,
+                            isFatal: fatal,
+                            description,
+                        });
+                    }
+                    break;
+                default:
+                    throw Error(`Unknown schema ${schema} in avro progress record.`);
+            }
+        } while (!avroNext.done && !this.avroPaused);
     }
 }
-Scalar.BLOCK_FOLDED = 'BLOCK_FOLDED';
-Scalar.BLOCK_LITERAL = 'BLOCK_LITERAL';
-Scalar.PLAIN = 'PLAIN';
-Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
-Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
-
-exports.Scalar = Scalar;
-exports.isScalarValue = isScalarValue;
-
-
-/***/ }),
-
-/***/ 84454:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
+//# sourceMappingURL=BlobQuickQueryStream.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BlobQueryResponse.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-var stringifyCollection = __nccwpck_require__(61212);
-var addPairToJSMap = __nccwpck_require__(97104);
-var Collection = __nccwpck_require__(40101);
-var identity = __nccwpck_require__(41127);
-var Pair = __nccwpck_require__(57165);
-var Scalar = __nccwpck_require__(63301);
 
-function findPair(items, key) {
-    const k = identity.isScalar(key) ? key.value : key;
-    for (const it of items) {
-        if (identity.isPair(it)) {
-            if (it.key === key || it.key === k)
-                return it;
-            if (identity.isScalar(it.key) && it.key.value === k)
-                return it;
-        }
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * BlobQueryResponse implements BlobDownloadResponseModel interface, and in Node.js runtime it will
+ * parse avro data returned by blob query.
+ */
+class BlobQueryResponse {
+    /**
+     * Indicates that the service supports
+     * requests for partial file content.
+     *
+     * @readonly
+     */
+    get acceptRanges() {
+        return this.originalResponse.acceptRanges;
     }
-    return undefined;
-}
-class YAMLMap extends Collection.Collection {
-    static get tagName() {
-        return 'tag:yaml.org,2002:map';
+    /**
+     * Returns if it was previously specified
+     * for the file.
+     *
+     * @readonly
+     */
+    get cacheControl() {
+        return this.originalResponse.cacheControl;
     }
-    constructor(schema) {
-        super(identity.MAP, schema);
-        this.items = [];
+    /**
+     * Returns the value that was specified
+     * for the 'x-ms-content-disposition' header and specifies how to process the
+     * response.
+     *
+     * @readonly
+     */
+    get contentDisposition() {
+        return this.originalResponse.contentDisposition;
     }
     /**
-     * A generic collection parsing method that can be extended
-     * to other node classes that inherit from YAMLMap
+     * Returns the value that was specified
+     * for the Content-Encoding request header.
+     *
+     * @readonly
      */
-    static from(schema, obj, ctx) {
-        const { keepUndefined, replacer } = ctx;
-        const map = new this(schema);
-        const add = (key, value) => {
-            if (typeof replacer === 'function')
-                value = replacer.call(obj, key, value);
-            else if (Array.isArray(replacer) && !replacer.includes(key))
-                return;
-            if (value !== undefined || keepUndefined)
-                map.items.push(Pair.createPair(key, value, ctx));
-        };
-        if (obj instanceof Map) {
-            for (const [key, value] of obj)
-                add(key, value);
-        }
-        else if (obj && typeof obj === 'object') {
-            for (const key of Object.keys(obj))
-                add(key, obj[key]);
-        }
-        if (typeof schema.sortMapEntries === 'function') {
-            map.items.sort(schema.sortMapEntries);
-        }
-        return map;
+    get contentEncoding() {
+        return this.originalResponse.contentEncoding;
     }
     /**
-     * Adds a value to the collection.
+     * Returns the value that was specified
+     * for the Content-Language request header.
      *
-     * @param overwrite - If not set `true`, using a key that is already in the
-     *   collection will throw. Otherwise, overwrites the previous value.
+     * @readonly
      */
-    add(pair, overwrite) {
-        let _pair;
-        if (identity.isPair(pair))
-            _pair = pair;
-        else if (!pair || typeof pair !== 'object' || !('key' in pair)) {
-            // In TypeScript, this never happens.
-            _pair = new Pair.Pair(pair, pair?.value);
-        }
-        else
-            _pair = new Pair.Pair(pair.key, pair.value);
-        const prev = findPair(this.items, _pair.key);
-        const sortEntries = this.schema?.sortMapEntries;
-        if (prev) {
-            if (!overwrite)
-                throw new Error(`Key ${_pair.key} already set`);
-            // For scalars, keep the old node & its comments and anchors
-            if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))
-                prev.value.value = _pair.value;
-            else
-                prev.value = _pair.value;
-        }
-        else if (sortEntries) {
-            const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);
-            if (i === -1)
-                this.items.push(_pair);
-            else
-                this.items.splice(i, 0, _pair);
-        }
-        else {
-            this.items.push(_pair);
-        }
+    get contentLanguage() {
+        return this.originalResponse.contentLanguage;
     }
-    delete(key) {
-        const it = findPair(this.items, key);
-        if (!it)
-            return false;
-        const del = this.items.splice(this.items.indexOf(it), 1);
-        return del.length > 0;
+    /**
+     * The current sequence number for a
+     * page blob. This header is not returned for block blobs or append blobs.
+     *
+     * @readonly
+     */
+    get blobSequenceNumber() {
+        return this.originalResponse.blobSequenceNumber;
     }
-    get(key, keepScalar) {
-        const it = findPair(this.items, key);
-        const node = it?.value;
-        return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? undefined;
+    /**
+     * The blob's type. Possible values include:
+     * 'BlockBlob', 'PageBlob', 'AppendBlob'.
+     *
+     * @readonly
+     */
+    get blobType() {
+        return this.originalResponse.blobType;
     }
-    has(key) {
-        return !!findPair(this.items, key);
+    /**
+     * The number of bytes present in the
+     * response body.
+     *
+     * @readonly
+     */
+    get contentLength() {
+        return this.originalResponse.contentLength;
     }
-    set(key, value) {
-        this.add(new Pair.Pair(key, value), true);
+    /**
+     * If the file has an MD5 hash and the
+     * request is to read the full file, this response header is returned so that
+     * the client can check for message content integrity. If the request is to
+     * read a specified range and the 'x-ms-range-get-content-md5' is set to
+     * true, then the request returns an MD5 hash for the range, as long as the
+     * range size is less than or equal to 4 MB. If neither of these sets of
+     * conditions is true, then no value is returned for the 'Content-MD5'
+     * header.
+     *
+     * @readonly
+     */
+    get contentMD5() {
+        return this.originalResponse.contentMD5;
     }
     /**
-     * @param ctx - Conversion context, originally set in Document#toJS()
-     * @param {Class} Type - If set, forces the returned collection type
-     * @returns Instance of Type, Map, or Object
+     * Indicates the range of bytes returned if
+     * the client requested a subset of the file by setting the Range request
+     * header.
+     *
+     * @readonly
      */
-    toJSON(_, ctx, Type) {
-        const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {};
-        if (ctx?.onCreate)
-            ctx.onCreate(map);
-        for (const item of this.items)
-            addPairToJSMap.addPairToJSMap(ctx, map, item);
-        return map;
+    get contentRange() {
+        return this.originalResponse.contentRange;
     }
-    toString(ctx, onComment, onChompKeep) {
-        if (!ctx)
-            return JSON.stringify(this);
-        for (const item of this.items) {
-            if (!identity.isPair(item))
-                throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
-        }
-        if (!ctx.allNullValues && this.hasAllNullValues(false))
-            ctx = Object.assign({}, ctx, { allNullValues: true });
-        return stringifyCollection.stringifyCollection(this, ctx, {
-            blockItemPrefix: '',
-            flowChars: { start: '{', end: '}' },
-            itemIndent: ctx.indent || '',
-            onChompKeep,
-            onComment
-        });
+    /**
+     * The content type specified for the file.
+     * The default content type is 'application/octet-stream'
+     *
+     * @readonly
+     */
+    get contentType() {
+        return this.originalResponse.contentType;
     }
-}
-
-exports.YAMLMap = YAMLMap;
-exports.findPair = findPair;
-
-
-/***/ }),
-
-/***/ 92223:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var createNode = __nccwpck_require__(42404);
-var stringifyCollection = __nccwpck_require__(61212);
-var Collection = __nccwpck_require__(40101);
-var identity = __nccwpck_require__(41127);
-var Scalar = __nccwpck_require__(63301);
-var toJS = __nccwpck_require__(74043);
-
-class YAMLSeq extends Collection.Collection {
-    static get tagName() {
-        return 'tag:yaml.org,2002:seq';
+    /**
+     * Conclusion time of the last attempted
+     * Copy File operation where this file was the destination file. This value
+     * can specify the time of a completed, aborted, or failed copy attempt.
+     *
+     * @readonly
+     */
+    get copyCompletedOn() {
+        return undefined;
     }
-    constructor(schema) {
-        super(identity.SEQ, schema);
-        this.items = [];
+    /**
+     * String identifier for the last attempted Copy
+     * File operation where this file was the destination file.
+     *
+     * @readonly
+     */
+    get copyId() {
+        return this.originalResponse.copyId;
     }
-    add(value) {
-        this.items.push(value);
+    /**
+     * Contains the number of bytes copied and
+     * the total bytes in the source in the last attempted Copy File operation
+     * where this file was the destination file. Can show between 0 and
+     * Content-Length bytes copied.
+     *
+     * @readonly
+     */
+    get copyProgress() {
+        return this.originalResponse.copyProgress;
     }
     /**
-     * Removes a value from the collection.
+     * URL up to 2KB in length that specifies the
+     * source file used in the last attempted Copy File operation where this file
+     * was the destination file.
      *
-     * `key` must contain a representation of an integer for this to succeed.
-     * It may be wrapped in a `Scalar`.
+     * @readonly
+     */
+    get copySource() {
+        return this.originalResponse.copySource;
+    }
+    /**
+     * State of the copy operation
+     * identified by 'x-ms-copy-id'. Possible values include: 'pending',
+     * 'success', 'aborted', 'failed'
      *
-     * @returns `true` if the item was found and removed.
+     * @readonly
      */
-    delete(key) {
-        const idx = asItemIndex(key);
-        if (typeof idx !== 'number')
-            return false;
-        const del = this.items.splice(idx, 1);
-        return del.length > 0;
+    get copyStatus() {
+        return this.originalResponse.copyStatus;
     }
-    get(key, keepScalar) {
-        const idx = asItemIndex(key);
-        if (typeof idx !== 'number')
-            return undefined;
-        const it = this.items[idx];
-        return !keepScalar && identity.isScalar(it) ? it.value : it;
+    /**
+     * Only appears when
+     * x-ms-copy-status is failed or pending. Describes cause of fatal or
+     * non-fatal copy operation failure.
+     *
+     * @readonly
+     */
+    get copyStatusDescription() {
+        return this.originalResponse.copyStatusDescription;
     }
     /**
-     * Checks if the collection includes a value with the key `key`.
+     * When a blob is leased,
+     * specifies whether the lease is of infinite or fixed duration. Possible
+     * values include: 'infinite', 'fixed'.
      *
-     * `key` must contain a representation of an integer for this to succeed.
-     * It may be wrapped in a `Scalar`.
+     * @readonly
      */
-    has(key) {
-        const idx = asItemIndex(key);
-        return typeof idx === 'number' && idx < this.items.length;
+    get leaseDuration() {
+        return this.originalResponse.leaseDuration;
     }
     /**
-     * Sets a value in this collection. For `!!set`, `value` needs to be a
-     * boolean to add/remove the item from the set.
+     * Lease state of the blob. Possible
+     * values include: 'available', 'leased', 'expired', 'breaking', 'broken'.
      *
-     * If `key` does not contain a representation of an integer, this will throw.
-     * It may be wrapped in a `Scalar`.
+     * @readonly
      */
-    set(key, value) {
-        const idx = asItemIndex(key);
-        if (typeof idx !== 'number')
-            throw new Error(`Expected a valid index, not ${key}.`);
-        const prev = this.items[idx];
-        if (identity.isScalar(prev) && Scalar.isScalarValue(value))
-            prev.value = value;
-        else
-            this.items[idx] = value;
+    get leaseState() {
+        return this.originalResponse.leaseState;
     }
-    toJSON(_, ctx) {
-        const seq = [];
-        if (ctx?.onCreate)
-            ctx.onCreate(seq);
-        let i = 0;
-        for (const item of this.items)
-            seq.push(toJS.toJS(item, String(i++), ctx));
-        return seq;
+    /**
+     * The current lease status of the
+     * blob. Possible values include: 'locked', 'unlocked'.
+     *
+     * @readonly
+     */
+    get leaseStatus() {
+        return this.originalResponse.leaseStatus;
     }
-    toString(ctx, onComment, onChompKeep) {
-        if (!ctx)
-            return JSON.stringify(this);
-        return stringifyCollection.stringifyCollection(this, ctx, {
-            blockItemPrefix: '- ',
-            flowChars: { start: '[', end: ']' },
-            itemIndent: (ctx.indent || '') + '  ',
-            onChompKeep,
-            onComment
-        });
+    /**
+     * A UTC date/time value generated by the service that
+     * indicates the time at which the response was initiated.
+     *
+     * @readonly
+     */
+    get date() {
+        return this.originalResponse.date;
     }
-    static from(schema, obj, ctx) {
-        const { replacer } = ctx;
-        const seq = new this(schema);
-        if (obj && Symbol.iterator in Object(obj)) {
-            let i = 0;
-            for (let it of obj) {
-                if (typeof replacer === 'function') {
-                    const key = obj instanceof Set ? it : String(i++);
-                    it = replacer.call(obj, key, it);
-                }
-                seq.items.push(createNode.createNode(it, undefined, ctx));
-            }
-        }
-        return seq;
+    /**
+     * The number of committed blocks
+     * present in the blob. This header is returned only for append blobs.
+     *
+     * @readonly
+     */
+    get blobCommittedBlockCount() {
+        return this.originalResponse.blobCommittedBlockCount;
     }
-}
-function asItemIndex(key) {
-    let idx = identity.isScalar(key) ? key.value : key;
-    if (idx && typeof idx === 'string')
-        idx = Number(idx);
-    return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0
-        ? idx
-        : null;
-}
-
-exports.YAMLSeq = YAMLSeq;
-
-
-/***/ }),
-
-/***/ 97104:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var log = __nccwpck_require__(57249);
-var merge = __nccwpck_require__(90452);
-var stringify = __nccwpck_require__(2148);
-var identity = __nccwpck_require__(41127);
-var toJS = __nccwpck_require__(74043);
-
-function addPairToJSMap(ctx, map, { key, value }) {
-    if (identity.isNode(key) && key.addToJSMap)
-        key.addToJSMap(ctx, map, value);
-    // TODO: Should drop this special case for bare << handling
-    else if (merge.isMergeKey(ctx, key))
-        merge.addMergeToJSMap(ctx, map, value);
-    else {
-        const jsKey = toJS.toJS(key, '', ctx);
-        if (map instanceof Map) {
-            map.set(jsKey, toJS.toJS(value, jsKey, ctx));
-        }
-        else if (map instanceof Set) {
-            map.add(jsKey);
-        }
-        else {
-            const stringKey = stringifyKey(key, jsKey, ctx);
-            const jsValue = toJS.toJS(value, stringKey, ctx);
-            if (stringKey in map)
-                Object.defineProperty(map, stringKey, {
-                    value: jsValue,
-                    writable: true,
-                    enumerable: true,
-                    configurable: true
-                });
-            else
-                map[stringKey] = jsValue;
-        }
+    /**
+     * The ETag contains a value that you can use to
+     * perform operations conditionally, in quotes.
+     *
+     * @readonly
+     */
+    get etag() {
+        return this.originalResponse.etag;
     }
-    return map;
-}
-function stringifyKey(key, jsKey, ctx) {
-    if (jsKey === null)
-        return '';
-    // eslint-disable-next-line @typescript-eslint/no-base-to-string
-    if (typeof jsKey !== 'object')
-        return String(jsKey);
-    if (identity.isNode(key) && ctx?.doc) {
-        const strCtx = stringify.createStringifyContext(ctx.doc, {});
-        strCtx.anchors = new Set();
-        for (const node of ctx.anchors.keys())
-            strCtx.anchors.add(node.anchor);
-        strCtx.inFlow = true;
-        strCtx.inStringifyKey = true;
-        const strKey = key.toString(strCtx);
-        if (!ctx.mapKeyWarned) {
-            let jsonStr = JSON.stringify(strKey);
-            if (jsonStr.length > 40)
-                jsonStr = jsonStr.substring(0, 36) + '..."';
-            log.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.`);
-            ctx.mapKeyWarned = true;
-        }
-        return strKey;
+    /**
+     * The error code.
+     *
+     * @readonly
+     */
+    get errorCode() {
+        return this.originalResponse.errorCode;
+    }
+    /**
+     * The value of this header is set to
+     * true if the file data and application metadata are completely encrypted
+     * using the specified algorithm. Otherwise, the value is set to false (when
+     * the file is unencrypted, or if only parts of the file/application metadata
+     * are encrypted).
+     *
+     * @readonly
+     */
+    get isServerEncrypted() {
+        return this.originalResponse.isServerEncrypted;
+    }
+    /**
+     * If the blob has a MD5 hash, and if
+     * request contains range header (Range or x-ms-range), this response header
+     * is returned with the value of the whole blob's MD5 value. This value may
+     * or may not be equal to the value returned in Content-MD5 header, with the
+     * latter calculated from the requested range.
+     *
+     * @readonly
+     */
+    get blobContentMD5() {
+        return this.originalResponse.blobContentMD5;
+    }
+    /**
+     * Returns the date and time the file was last
+     * modified. Any operation that modifies the file or its properties updates
+     * the last modified time.
+     *
+     * @readonly
+     */
+    get lastModified() {
+        return this.originalResponse.lastModified;
+    }
+    /**
+     * A name-value pair
+     * to associate with a file storage object.
+     *
+     * @readonly
+     */
+    get metadata() {
+        return this.originalResponse.metadata;
+    }
+    /**
+     * This header uniquely identifies the request
+     * that was made and can be used for troubleshooting the request.
+     *
+     * @readonly
+     */
+    get requestId() {
+        return this.originalResponse.requestId;
+    }
+    /**
+     * If a client request id header is sent in the request, this header will be present in the
+     * response with the same value.
+     *
+     * @readonly
+     */
+    get clientRequestId() {
+        return this.originalResponse.clientRequestId;
+    }
+    /**
+     * Indicates the version of the File service used
+     * to execute the request.
+     *
+     * @readonly
+     */
+    get version() {
+        return this.originalResponse.version;
+    }
+    /**
+     * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned
+     * when the blob was encrypted with a customer-provided key.
+     *
+     * @readonly
+     */
+    get encryptionKeySha256() {
+        return this.originalResponse.encryptionKeySha256;
+    }
+    /**
+     * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to
+     * true, then the request returns a crc64 for the range, as long as the range size is less than
+     * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is
+     * specified in the same request, it will fail with 400(Bad Request)
+     */
+    get contentCrc64() {
+        return this.originalResponse.contentCrc64;
+    }
+    /**
+     * The response body as a browser Blob.
+     * Always undefined in node.js.
+     *
+     * @readonly
+     */
+    get blobBody() {
+        return undefined;
+    }
+    /**
+     * The response body as a node.js Readable stream.
+     * Always undefined in the browser.
+     *
+     * It will parse avor data returned by blob query.
+     *
+     * @readonly
+     */
+    get readableStreamBody() {
+        return esm_isNodeLike ? this.blobDownloadStream : undefined;
+    }
+    /**
+     * The HTTP response.
+     */
+    get _response() {
+        return this.originalResponse._response;
+    }
+    originalResponse;
+    blobDownloadStream;
+    /**
+     * Creates an instance of BlobQueryResponse.
+     *
+     * @param originalResponse -
+     * @param options -
+     */
+    constructor(originalResponse, options = {}) {
+        this.originalResponse = originalResponse;
+        this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options);
     }
-    return JSON.stringify(jsKey);
 }
+//# sourceMappingURL=BlobQueryResponse.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/models.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-exports.addPairToJSMap = addPairToJSMap;
-
-
-/***/ }),
-
-/***/ 41127:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-const ALIAS = Symbol.for('yaml.alias');
-const DOC = Symbol.for('yaml.document');
-const MAP = Symbol.for('yaml.map');
-const PAIR = Symbol.for('yaml.pair');
-const SCALAR = Symbol.for('yaml.scalar');
-const SEQ = Symbol.for('yaml.seq');
-const NODE_TYPE = Symbol.for('yaml.node.type');
-const isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;
-const isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;
-const isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;
-const isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;
-const isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR;
-const isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;
-function isCollection(node) {
-    if (node && typeof node === 'object')
-        switch (node[NODE_TYPE]) {
-            case MAP:
-            case SEQ:
-                return true;
-        }
-    return false;
+/**
+ * Represents the access tier on a blob.
+ * For detailed information about block blob level tiering see {@link https://learn.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.}
+ */
+var BlockBlobTier;
+(function (BlockBlobTier) {
+    /**
+     * Optimized for storing data that is accessed frequently.
+     */
+    BlockBlobTier["Hot"] = "Hot";
+    /**
+     * Optimized for storing data that is infrequently accessed and stored for at least 30 days.
+     */
+    BlockBlobTier["Cool"] = "Cool";
+    /**
+     * Optimized for storing data that is rarely accessed.
+     */
+    BlockBlobTier["Cold"] = "Cold";
+    /**
+     * Optimized for storing data that is rarely accessed and stored for at least 180 days
+     * with flexible latency requirements (on the order of hours).
+     */
+    BlockBlobTier["Archive"] = "Archive";
+})(BlockBlobTier || (BlockBlobTier = {}));
+/**
+ * Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts.
+ * Please see {@link https://learn.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here}
+ * for detailed information on the corresponding IOPS and throughput per PageBlobTier.
+ */
+var PremiumPageBlobTier;
+(function (PremiumPageBlobTier) {
+    /**
+     * P4 Tier.
+     */
+    PremiumPageBlobTier["P4"] = "P4";
+    /**
+     * P6 Tier.
+     */
+    PremiumPageBlobTier["P6"] = "P6";
+    /**
+     * P10 Tier.
+     */
+    PremiumPageBlobTier["P10"] = "P10";
+    /**
+     * P15 Tier.
+     */
+    PremiumPageBlobTier["P15"] = "P15";
+    /**
+     * P20 Tier.
+     */
+    PremiumPageBlobTier["P20"] = "P20";
+    /**
+     * P30 Tier.
+     */
+    PremiumPageBlobTier["P30"] = "P30";
+    /**
+     * P40 Tier.
+     */
+    PremiumPageBlobTier["P40"] = "P40";
+    /**
+     * P50 Tier.
+     */
+    PremiumPageBlobTier["P50"] = "P50";
+    /**
+     * P60 Tier.
+     */
+    PremiumPageBlobTier["P60"] = "P60";
+    /**
+     * P70 Tier.
+     */
+    PremiumPageBlobTier["P70"] = "P70";
+    /**
+     * P80 Tier.
+     */
+    PremiumPageBlobTier["P80"] = "P80";
+})(PremiumPageBlobTier || (PremiumPageBlobTier = {}));
+function toAccessTier(tier) {
+    if (tier === undefined) {
+        return undefined;
+    }
+    return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service).
 }
-function isNode(node) {
-    if (node && typeof node === 'object')
-        switch (node[NODE_TYPE]) {
-            case ALIAS:
-            case MAP:
-            case SCALAR:
-            case SEQ:
-                return true;
-        }
-    return false;
+function ensureCpkIfSpecified(cpk, isHttps) {
+    if (cpk && !isHttps) {
+        throw new RangeError("Customer-provided encryption key must be used over HTTPS.");
+    }
+    if (cpk && !cpk.encryptionAlgorithm) {
+        cpk.encryptionAlgorithm = EncryptionAlgorithmAES25;
+    }
 }
-const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
-
-exports.ALIAS = ALIAS;
-exports.DOC = DOC;
-exports.MAP = MAP;
-exports.NODE_TYPE = NODE_TYPE;
-exports.PAIR = PAIR;
-exports.SCALAR = SCALAR;
-exports.SEQ = SEQ;
-exports.hasAnchor = hasAnchor;
-exports.isAlias = isAlias;
-exports.isCollection = isCollection;
-exports.isDocument = isDocument;
-exports.isMap = isMap;
-exports.isNode = isNode;
-exports.isPair = isPair;
-exports.isScalar = isScalar;
-exports.isSeq = isSeq;
-
-
-/***/ }),
-
-/***/ 74043:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var identity = __nccwpck_require__(41127);
-
 /**
- * Recursively convert any node or its contents to native JavaScript
+ * Defines the known cloud audiences for Storage.
+ */
+var StorageBlobAudience;
+(function (StorageBlobAudience) {
+    /**
+     * The OAuth scope to use to retrieve an AAD token for Azure Storage.
+     */
+    StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default";
+    /**
+     * The OAuth scope to use to retrieve an AAD token for Azure Disk.
+     */
+    StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default";
+})(StorageBlobAudience || (StorageBlobAudience = {}));
+/**
  *
- * @param value - The input value
- * @param arg - If `value` defines a `toJSON()` method, use this
- *   as its first argument
- * @param ctx - Conversion context, originally set in Document#toJS(). If
- *   `{ keep: true }` is not set, output should be suitable for JSON
- *   stringification.
+ * To get OAuth audience for a storage account for blob service.
  */
-function toJS(value, arg, ctx) {
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-return
-    if (Array.isArray(value))
-        return value.map((v, i) => toJS(v, String(i), ctx));
-    if (value && typeof value.toJSON === 'function') {
-        // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-        if (!ctx || !identity.hasAnchor(value))
-            return value.toJSON(arg, ctx);
-        const data = { aliasCount: 0, count: 1, res: undefined };
-        ctx.anchors.set(value, data);
-        ctx.onCreate = res => {
-            data.res = res;
-            delete ctx.onCreate;
-        };
-        const res = value.toJSON(arg, ctx);
-        if (ctx.onCreate)
-            ctx.onCreate(res);
-        return res;
-    }
-    if (typeof value === 'bigint' && !ctx?.keep)
-        return Number(value);
-    return value;
+function getBlobServiceAccountAudience(storageAccountName) {
+    return `https://${storageAccountName}.blob.core.windows.net/.default`;
 }
+//# sourceMappingURL=models.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/PageBlobRangeResponse.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * Function that converts PageRange and ClearRange to a common Range object.
+ * PageRange and ClearRange have start and end while Range offset and count
+ * this function normalizes to Range.
+ * @param response - Model PageBlob Range response
+ */
+function rangeResponseFromModel(response) {
+    const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({
+        offset: x.start,
+        count: x.end - x.start,
+    }));
+    const clearRange = (response._response.parsedBody.clearRange || []).map((x) => ({
+        offset: x.start,
+        count: x.end - x.start,
+    }));
+    return {
+        ...response,
+        pageRange,
+        clearRange,
+        _response: {
+            ...response._response,
+            parsedBody: {
+                pageRange,
+                clearRange,
+            },
+        },
+    };
+}
+//# sourceMappingURL=PageBlobRangeResponse.js.map
+// EXTERNAL MODULE: ./node_modules/@azure/core-lro/dist/index.js
+var core_lro_dist = __nccwpck_require__(15862);
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/pollers/BlobStartCopyFromUrlPoller.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-exports.toJS = toJS;
-
-
-/***/ }),
-
-/***/ 60110:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var resolveBlockScalar = __nccwpck_require__(48913);
-var resolveFlowScalar = __nccwpck_require__(76842);
-var errors = __nccwpck_require__(91464);
-var stringifyString = __nccwpck_require__(83069);
 
-function resolveAsScalar(token, strict = true, onError) {
-    if (token) {
-        const _onError = (pos, code, message) => {
-            const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset;
-            if (onError)
-                onError(offset, code, message);
-            else
-                throw new errors.YAMLParseError([offset, offset + 1], code, message);
-        };
-        switch (token.type) {
-            case 'scalar':
-            case 'single-quoted-scalar':
-            case 'double-quoted-scalar':
-                return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);
-            case 'block-scalar':
-                return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);
+/**
+ * This is the poller returned by {@link BlobClient.beginCopyFromURL}.
+ * This can not be instantiated directly outside of this package.
+ *
+ * @hidden
+ */
+class BlobBeginCopyFromUrlPoller extends core_lro_dist/* Poller */.vu {
+    intervalInMs;
+    constructor(options) {
+        const { blobClient, copySource, intervalInMs = 15000, onProgress, resumeFrom, startCopyFromURLOptions, } = options;
+        let state;
+        if (resumeFrom) {
+            state = JSON.parse(resumeFrom).state;
+        }
+        const operation = makeBlobBeginCopyFromURLPollOperation({
+            ...state,
+            blobClient,
+            copySource,
+            startCopyFromURLOptions,
+        });
+        super(operation);
+        if (typeof onProgress === "function") {
+            this.onProgress(onProgress);
         }
+        this.intervalInMs = intervalInMs;
+    }
+    delay() {
+        return delay_delay(this.intervalInMs);
     }
-    return null;
 }
 /**
- * Create a new scalar token with `value`
- *
- * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
- * as this function does not support any schema operations and won't check for such conflicts.
- *
- * @param value The string representation of the value, which will have its content properly indented.
- * @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.
- * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
- * @param context.indent The indent level of the token.
- * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.
- * @param context.offset The offset position of the token.
- * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
+ * Note: Intentionally using function expression over arrow function expression
+ * so that the function can be invoked with a different context.
+ * This affects what `this` refers to.
+ * @hidden
  */
-function createScalarToken(value, context) {
-    const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context;
-    const source = stringifyString.stringifyString({ type, value }, {
-        implicitKey,
-        indent: indent > 0 ? ' '.repeat(indent) : '',
-        inFlow,
-        options: { blockQuote: true, lineWidth: -1 }
+const cancel = async function cancel(options = {}) {
+    const state = this.state;
+    const { copyId } = state;
+    if (state.isCompleted) {
+        return makeBlobBeginCopyFromURLPollOperation(state);
+    }
+    if (!copyId) {
+        state.isCancelled = true;
+        return makeBlobBeginCopyFromURLPollOperation(state);
+    }
+    // if abortCopyFromURL throws, it will bubble up to user's poller.cancelOperation call
+    await state.blobClient.abortCopyFromURL(copyId, {
+        abortSignal: options.abortSignal,
     });
-    const end = context.end ?? [
-        { type: 'newline', offset: -1, indent, source: '\n' }
-    ];
-    switch (source[0]) {
-        case '|':
-        case '>': {
-            const he = source.indexOf('\n');
-            const head = source.substring(0, he);
-            const body = source.substring(he + 1) + '\n';
-            const props = [
-                { type: 'block-scalar-header', offset, indent, source: head }
-            ];
-            if (!addEndtoBlockProps(props, end))
-                props.push({ type: 'newline', offset: -1, indent, source: '\n' });
-            return { type: 'block-scalar', offset, indent, props, source: body };
+    state.isCancelled = true;
+    return makeBlobBeginCopyFromURLPollOperation(state);
+};
+/**
+ * Note: Intentionally using function expression over arrow function expression
+ * so that the function can be invoked with a different context.
+ * This affects what `this` refers to.
+ * @hidden
+ */
+const update = async function update(options = {}) {
+    const state = this.state;
+    const { blobClient, copySource, startCopyFromURLOptions } = state;
+    if (!state.isStarted) {
+        state.isStarted = true;
+        const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions);
+        // copyId is needed to abort
+        state.copyId = result.copyId;
+        if (result.copyStatus === "success") {
+            state.result = result;
+            state.isCompleted = true;
         }
-        case '"':
-            return { type: 'double-quoted-scalar', offset, indent, source, end };
-        case "'":
-            return { type: 'single-quoted-scalar', offset, indent, source, end };
-        default:
-            return { type: 'scalar', offset, indent, source, end };
     }
-}
+    else if (!state.isCompleted) {
+        try {
+            const result = await state.blobClient.getProperties({ abortSignal: options.abortSignal });
+            const { copyStatus, copyProgress } = result;
+            const prevCopyProgress = state.copyProgress;
+            if (copyProgress) {
+                state.copyProgress = copyProgress;
+            }
+            if (copyStatus === "pending" &&
+                copyProgress !== prevCopyProgress &&
+                typeof options.fireProgress === "function") {
+                // trigger in setTimeout, or swallow error?
+                options.fireProgress(state);
+            }
+            else if (copyStatus === "success") {
+                state.result = result;
+                state.isCompleted = true;
+            }
+            else if (copyStatus === "failed") {
+                state.error = new Error(`Blob copy failed with reason: "${result.copyStatusDescription || "unknown"}"`);
+                state.isCompleted = true;
+            }
+        }
+        catch (err) {
+            state.error = err;
+            state.isCompleted = true;
+        }
+    }
+    return makeBlobBeginCopyFromURLPollOperation(state);
+};
 /**
- * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.
- *
- * Best efforts are made to retain any comments previously associated with the `token`,
- * though all contents within a collection's `items` will be overwritten.
- *
- * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
- * as this function does not support any schema operations and won't check for such conflicts.
- *
- * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.
- * @param value The string representation of the value, which will have its content properly indented.
- * @param context.afterKey In most cases, values after a key should have an additional level of indentation.
- * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
- * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.
- * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
+ * Note: Intentionally using function expression over arrow function expression
+ * so that the function can be invoked with a different context.
+ * This affects what `this` refers to.
+ * @hidden
  */
-function setScalarValue(token, value, context = {}) {
-    let { afterKey = false, implicitKey = false, inFlow = false, type } = context;
-    let indent = 'indent' in token ? token.indent : null;
-    if (afterKey && typeof indent === 'number')
-        indent += 2;
-    if (!type)
-        switch (token.type) {
-            case 'single-quoted-scalar':
-                type = 'QUOTE_SINGLE';
-                break;
-            case 'double-quoted-scalar':
-                type = 'QUOTE_DOUBLE';
-                break;
-            case 'block-scalar': {
-                const header = token.props[0];
-                if (header.type !== 'block-scalar-header')
-                    throw new Error('Invalid block scalar header');
-                type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL';
-                break;
-            }
-            default:
-                type = 'PLAIN';
+const BlobStartCopyFromUrlPoller_toString = function toString() {
+    return JSON.stringify({ state: this.state }, (key, value) => {
+        // remove blobClient from serialized state since a client can't be hydrated from this info.
+        if (key === "blobClient") {
+            return undefined;
         }
-    const source = stringifyString.stringifyString({ type, value }, {
-        implicitKey: implicitKey || indent === null,
-        indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '',
-        inFlow,
-        options: { blockQuote: true, lineWidth: -1 }
+        return value;
     });
-    switch (source[0]) {
-        case '|':
-        case '>':
-            setBlockScalarValue(token, source);
-            break;
-        case '"':
-            setFlowScalarValue(token, source, 'double-quoted-scalar');
-            break;
-        case "'":
-            setFlowScalarValue(token, source, 'single-quoted-scalar');
-            break;
-        default:
-            setFlowScalarValue(token, source, 'scalar');
-    }
+};
+/**
+ * Creates a poll operation given the provided state.
+ * @hidden
+ */
+function makeBlobBeginCopyFromURLPollOperation(state) {
+    return {
+        state: { ...state },
+        cancel,
+        toString: BlobStartCopyFromUrlPoller_toString,
+        update,
+    };
 }
-function setBlockScalarValue(token, source) {
-    const he = source.indexOf('\n');
-    const head = source.substring(0, he);
-    const body = source.substring(he + 1) + '\n';
-    if (token.type === 'block-scalar') {
-        const header = token.props[0];
-        if (header.type !== 'block-scalar-header')
-            throw new Error('Invalid block scalar header');
-        header.source = head;
-        token.source = body;
+//# sourceMappingURL=BlobStartCopyFromUrlPoller.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/Range.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * Generate a range string. For example:
+ *
+ * "bytes=255-" or "bytes=0-511"
+ *
+ * @param iRange -
+ */
+function rangeToString(iRange) {
+    if (iRange.offset < 0) {
+        throw new RangeError(`Range.offset cannot be smaller than 0.`);
     }
-    else {
-        const { offset } = token;
-        const indent = 'indent' in token ? token.indent : -1;
-        const props = [
-            { type: 'block-scalar-header', offset, indent, source: head }
-        ];
-        if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined))
-            props.push({ type: 'newline', offset: -1, indent, source: '\n' });
-        for (const key of Object.keys(token))
-            if (key !== 'type' && key !== 'offset')
-                delete token[key];
-        Object.assign(token, { type: 'block-scalar', indent, props, source: body });
+    if (iRange.count && iRange.count <= 0) {
+        throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`);
     }
+    return iRange.count
+        ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}`
+        : `bytes=${iRange.offset}-`;
 }
-/** @returns `true` if last token is a newline */
-function addEndtoBlockProps(props, end) {
-    if (end)
-        for (const st of end)
-            switch (st.type) {
-                case 'space':
-                case 'comment':
-                    props.push(st);
-                    break;
-                case 'newline':
-                    props.push(st);
-                    return true;
+//# sourceMappingURL=Range.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/utils/Batch.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+// In browser, during webpack or browserify bundling, this module will be replaced by 'events'
+// https://github.com/Gozala/events
+
+/**
+ * States for Batch.
+ */
+var BatchStates;
+(function (BatchStates) {
+    BatchStates[BatchStates["Good"] = 0] = "Good";
+    BatchStates[BatchStates["Error"] = 1] = "Error";
+})(BatchStates || (BatchStates = {}));
+/**
+ * Batch provides basic parallel execution with concurrency limits.
+ * Will stop execute left operations when one of the executed operation throws an error.
+ * But Batch cannot cancel ongoing operations, you need to cancel them by yourself.
+ */
+class Batch {
+    /**
+     * Concurrency. Must be lager than 0.
+     */
+    concurrency;
+    /**
+     * Number of active operations under execution.
+     */
+    actives = 0;
+    /**
+     * Number of completed operations under execution.
+     */
+    completed = 0;
+    /**
+     * Offset of next operation to be executed.
+     */
+    offset = 0;
+    /**
+     * Operation array to be executed.
+     */
+    operations = [];
+    /**
+     * States of Batch. When an error happens, state will turn into error.
+     * Batch will stop execute left operations.
+     */
+    state = BatchStates.Good;
+    /**
+     * A private emitter used to pass events inside this class.
+     */
+    emitter;
+    /**
+     * Creates an instance of Batch.
+     * @param concurrency -
+     */
+    constructor(concurrency = 5) {
+        if (concurrency < 1) {
+            throw new RangeError("concurrency must be larger than 0");
+        }
+        this.concurrency = concurrency;
+        this.emitter = new external_events_.EventEmitter();
+    }
+    /**
+     * Add a operation into queue.
+     *
+     * @param operation -
+     */
+    addOperation(operation) {
+        this.operations.push(async () => {
+            try {
+                this.actives++;
+                await operation();
+                this.actives--;
+                this.completed++;
+                this.parallelExecute();
             }
-    return false;
-}
-function setFlowScalarValue(token, source, type) {
-    switch (token.type) {
-        case 'scalar':
-        case 'double-quoted-scalar':
-        case 'single-quoted-scalar':
-            token.type = type;
-            token.source = source;
-            break;
-        case 'block-scalar': {
-            const end = token.props.slice(1);
-            let oa = source.length;
-            if (token.props[0].type === 'block-scalar-header')
-                oa -= token.props[0].source.length;
-            for (const tok of end)
-                tok.offset += oa;
-            delete token.props;
-            Object.assign(token, { type, source, end });
-            break;
+            catch (error) {
+                this.emitter.emit("error", error);
+            }
+        });
+    }
+    /**
+     * Start execute operations in the queue.
+     *
+     */
+    async do() {
+        if (this.operations.length === 0) {
+            return Promise.resolve();
         }
-        case 'block-map':
-        case 'block-seq': {
-            const offset = token.offset + source.length;
-            const nl = { type: 'newline', offset, indent: token.indent, source: '\n' };
-            delete token.items;
-            Object.assign(token, { type, source, end: [nl] });
-            break;
+        this.parallelExecute();
+        return new Promise((resolve, reject) => {
+            this.emitter.on("finish", resolve);
+            this.emitter.on("error", (error) => {
+                this.state = BatchStates.Error;
+                reject(error);
+            });
+        });
+    }
+    /**
+     * Get next operation to be executed. Return null when reaching ends.
+     *
+     */
+    nextOperation() {
+        if (this.offset < this.operations.length) {
+            return this.operations[this.offset++];
         }
-        default: {
-            const indent = 'indent' in token ? token.indent : -1;
-            const end = 'end' in token && Array.isArray(token.end)
-                ? token.end.filter(st => st.type === 'space' ||
-                    st.type === 'comment' ||
-                    st.type === 'newline')
-                : [];
-            for (const key of Object.keys(token))
-                if (key !== 'type' && key !== 'offset')
-                    delete token[key];
-            Object.assign(token, { type, indent, source, end });
+        return null;
+    }
+    /**
+     * Start execute operations. One one the most important difference between
+     * this method with do() is that do() wraps as an sync method.
+     *
+     */
+    parallelExecute() {
+        if (this.state === BatchStates.Error) {
+            return;
+        }
+        if (this.completed >= this.operations.length) {
+            this.emitter.emit("finish");
+            return;
+        }
+        while (this.actives < this.concurrency) {
+            const operation = this.nextOperation();
+            if (operation) {
+                operation();
+            }
+            else {
+                return;
+            }
         }
     }
 }
+//# sourceMappingURL=Batch.js.map
+// EXTERNAL MODULE: external "node:fs"
+var external_node_fs_ = __nccwpck_require__(73024);
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/utils/utils.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+/**
+ * Reads a readable stream into buffer. Fill the buffer from offset to end.
+ *
+ * @param stream - A Node.js Readable stream
+ * @param buffer - Buffer to be filled, length must greater than or equal to offset
+ * @param offset - From which position in the buffer to be filled, inclusive
+ * @param end - To which position in the buffer to be filled, exclusive
+ * @param encoding - Encoding of the Readable stream
+ */
+async function streamToBuffer(stream, buffer, offset, end, encoding) {
+    let pos = 0; // Position in stream
+    const count = end - offset; // Total amount of data needed in stream
+    return new Promise((resolve, reject) => {
+        const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT);
+        stream.on("readable", () => {
+            // Already filled the requested amount; ignore any further `readable` events.
+            if (pos >= count) {
+                clearTimeout(timeout);
+                resolve();
+                return;
+            }
+            // Drain all currently-buffered chunks. Required since Node.js v26, where
+            // `stream.read()` returns one buffered chunk at a time instead of the
+            // concatenation of all queued data (see nodejs/node#60441).
+            let chunk;
+            while ((chunk = stream.read()) !== null) {
+                if (typeof chunk === "string") {
+                    chunk = Buffer.from(chunk, encoding);
+                }
+                // How much data needed in this chunk
+                const chunkLength = pos + chunk.length > count ? count - pos : chunk.length;
+                buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength);
+                pos += chunkLength;
+                if (pos >= count) {
+                    clearTimeout(timeout);
+                    resolve();
+                    return;
+                }
+            }
+        });
+        stream.on("end", () => {
+            clearTimeout(timeout);
+            if (pos < count) {
+                reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`));
+            }
+            resolve();
+        });
+        stream.on("error", (msg) => {
+            clearTimeout(timeout);
+            reject(msg);
+        });
+    });
+}
+/**
+ * Reads a readable stream into buffer entirely.
+ *
+ * @param stream - A Node.js Readable stream
+ * @param buffer - Buffer to be filled, length must greater than or equal to offset
+ * @param encoding - Encoding of the Readable stream
+ * @returns with the count of bytes read.
+ * @throws `RangeError` If buffer size is not big enough.
+ */
+async function streamToBuffer2(stream, buffer, encoding) {
+    let pos = 0; // Position in stream
+    const bufferSize = buffer.length;
+    return new Promise((resolve, reject) => {
+        stream.on("readable", () => {
+            // Drain all currently-buffered chunks. Required since Node.js v26, where
+            // `stream.read()` returns one buffered chunk at a time instead of the
+            // concatenation of all queued data (see nodejs/node#60441).
+            let chunk;
+            while ((chunk = stream.read()) !== null) {
+                if (typeof chunk === "string") {
+                    chunk = Buffer.from(chunk, encoding);
+                }
+                if (pos + chunk.length > bufferSize) {
+                    reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`));
+                    return;
+                }
+                buffer.fill(chunk, pos, pos + chunk.length);
+                pos += chunk.length;
+            }
+        });
+        stream.on("end", () => {
+            resolve(pos);
+        });
+        stream.on("error", reject);
+    });
+}
+/**
+ * Reads a readable stream into a buffer.
+ *
+ * @param stream - A Node.js Readable stream
+ * @param encoding - Encoding of the Readable stream
+ * @returns with the count of bytes read.
+ */
+async function streamToBuffer3(readableStream, encoding) {
+    return new Promise((resolve, reject) => {
+        const chunks = [];
+        readableStream.on("data", (data) => {
+            chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data);
+        });
+        readableStream.on("end", () => {
+            resolve(Buffer.concat(chunks));
+        });
+        readableStream.on("error", reject);
+    });
+}
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed.
+ *
+ * @param rs - The read stream.
+ * @param file - Destination file path.
+ */
+async function readStreamToLocalFile(rs, file) {
+    return new Promise((resolve, reject) => {
+        const ws = external_node_fs_.createWriteStream(file);
+        rs.on("error", (err) => {
+            reject(err);
+        });
+        ws.on("error", (err) => {
+            reject(err);
+        });
+        ws.on("close", resolve);
+        rs.pipe(ws);
+    });
+}
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * Promisified version of fs.stat().
+ */
+const fsStat = external_node_util_.promisify(external_node_fs_.stat);
+const fsCreateReadStream = external_node_fs_.createReadStream;
+//# sourceMappingURL=utils.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/Clients.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+
 
-exports.createScalarToken = createScalarToken;
-exports.resolveAsScalar = resolveAsScalar;
-exports.setScalarValue = setScalarValue;
 
 
-/***/ }),
 
-/***/ 91733:
-/***/ ((__unused_webpack_module, exports) => {
 
-"use strict";
 
 
-/**
- * Stringify a CST document, token, or collection item
- *
- * Fair warning: This applies no validation whatsoever, and
- * simply concatenates the sources in their logical order.
- */
-const stringify = (cst) => 'type' in cst ? stringifyToken(cst) : stringifyItem(cst);
-function stringifyToken(token) {
-    switch (token.type) {
-        case 'block-scalar': {
-            let res = '';
-            for (const tok of token.props)
-                res += stringifyToken(tok);
-            return res + token.source;
-        }
-        case 'block-map':
-        case 'block-seq': {
-            let res = '';
-            for (const item of token.items)
-                res += stringifyItem(item);
-            return res;
-        }
-        case 'flow-collection': {
-            let res = token.start.source;
-            for (const item of token.items)
-                res += stringifyItem(item);
-            for (const st of token.end)
-                res += st.source;
-            return res;
-        }
-        case 'document': {
-            let res = stringifyItem(token);
-            if (token.end)
-                for (const st of token.end)
-                    res += st.source;
-            return res;
-        }
-        default: {
-            let res = token.source;
-            if ('end' in token && token.end)
-                for (const st of token.end)
-                    res += st.source;
-            return res;
-        }
-    }
-}
-function stringifyItem({ start, key, sep, value }) {
-    let res = '';
-    for (const st of start)
-        res += st.source;
-    if (key)
-        res += stringifyToken(key);
-    if (sep)
-        for (const st of sep)
-            res += st.source;
-    if (value)
-        res += stringifyToken(value);
-    return res;
-}
 
-exports.stringify = stringify;
 
 
-/***/ }),
 
-/***/ 97715:
-/***/ ((__unused_webpack_module, exports) => {
 
-"use strict";
 
 
-const BREAK = Symbol('break visit');
-const SKIP = Symbol('skip children');
-const REMOVE = Symbol('remove item');
 /**
- * Apply a visitor to a CST document or item.
- *
- * Walks through the tree (depth-first) starting from the root, calling a
- * `visitor` function with two arguments when entering each item:
- *   - `item`: The current item, which included the following members:
- *     - `start: SourceToken[]` – Source tokens before the key or value,
- *       possibly including its anchor or tag.
- *     - `key?: Token | null` – Set for pair values. May then be `null`, if
- *       the key before the `:` separator is empty.
- *     - `sep?: SourceToken[]` – Source tokens between the key and the value,
- *       which should include the `:` map value indicator if `value` is set.
- *     - `value?: Token` – The value of a sequence item, or of a map pair.
- *   - `path`: The steps from the root to the current node, as an array of
- *     `['key' | 'value', number]` tuples.
- *
- * The return value of the visitor may be used to control the traversal:
- *   - `undefined` (default): Do nothing and continue
- *   - `visit.SKIP`: Do not visit the children of this token, continue with
- *      next sibling
- *   - `visit.BREAK`: Terminate traversal completely
- *   - `visit.REMOVE`: Remove the current item, then continue with the next one
- *   - `number`: Set the index of the next step. This is useful especially if
- *     the index of the current token has changed.
- *   - `function`: Define the next visitor for this item. After the original
- *     visitor is called on item entry, next visitors are called after handling
- *     a non-empty `key` and when exiting the item.
+ * A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob,
+ * append blob, or page blob.
  */
-function visit(cst, visitor) {
-    if ('type' in cst && cst.type === 'document')
-        cst = { start: cst.start, value: cst.value };
-    _visit(Object.freeze([]), cst, visitor);
-}
-// Without the `as symbol` casts, TS declares these in the `visit`
-// namespace using `var`, but then complains about that because
-// `unique symbol` must be `const`.
-/** Terminate visit traversal completely */
-visit.BREAK = BREAK;
-/** Do not visit the children of the current item */
-visit.SKIP = SKIP;
-/** Remove the current item */
-visit.REMOVE = REMOVE;
-/** Find the item at `path` from `cst` as the root */
-visit.itemAtPath = (cst, path) => {
-    let item = cst;
-    for (const [field, index] of path) {
-        const tok = item?.[field];
-        if (tok && 'items' in tok) {
-            item = tok.items[index];
+class BlobClient extends StorageClient_StorageClient {
+    /**
+     * blobContext provided by protocol layer.
+     */
+    blobContext;
+    _name;
+    _containerName;
+    _versionId;
+    _snapshot;
+    /**
+     * Config used in creating blob client instances.
+     */
+    blobClientConfig;
+    /**
+     * The name of the blob.
+     */
+    get name() {
+        return this._name;
+    }
+    /**
+     * The name of the storage container the blob is associated with.
+     */
+    get containerName() {
+        return this._containerName;
+    }
+    constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        options = options || {};
+        let pipeline;
+        let url;
+        if (isPipelineLike(credentialOrPipelineOrContainerName)) {
+            // (url: string, pipeline: Pipeline)
+            url = urlOrConnectionString;
+            pipeline = credentialOrPipelineOrContainerName;
+            options = blobNameOrOptions;
+        }
+        else if ((esm_isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
+            credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
+            isTokenCredential(credentialOrPipelineOrContainerName)) {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            url = urlOrConnectionString;
+            options = blobNameOrOptions;
+            pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
+        }
+        else if (!credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName !== "string") {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            // The second parameter is undefined. Use anonymous credential.
+            url = urlOrConnectionString;
+            if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
+                options = blobNameOrOptions;
+            }
+            pipeline = newPipeline(new AnonymousCredential(), options);
+        }
+        else if (credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName === "string" &&
+            blobNameOrOptions &&
+            typeof blobNameOrOptions === "string") {
+            // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
+            const containerName = credentialOrPipelineOrContainerName;
+            const blobName = blobNameOrOptions;
+            const extractedCreds = utils_common_extractConnectionStringParts(urlOrConnectionString);
+            if (extractedCreds.kind === "AccountConnString") {
+                if (esm_isNodeLike) {
+                    const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
+                    url = utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
+                    if (!options.proxyOptions) {
+                        options.proxyOptions = proxyPolicy_getDefaultProxySettings(extractedCreds.proxyUri);
+                    }
+                    pipeline = newPipeline(sharedKeyCredential, options);
+                }
+                else {
+                    throw new Error("Account connection string is only supported in Node.js environment");
+                }
+            }
+            else if (extractedCreds.kind === "SASConnString") {
+                url =
+                    utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
+                        "?" +
+                        extractedCreds.accountSas;
+                pipeline = newPipeline(new AnonymousCredential(), options);
+            }
+            else {
+                throw new Error("Connection string must be either an Account connection string or a SAS connection string");
+            }
         }
-        else
-            return undefined;
+        else {
+            throw new Error("Expecting non-empty strings for containerName and blobName parameters");
+        }
+        super(url, pipeline);
+        ({ blobName: this._name, containerName: this._containerName } =
+            this.getBlobAndContainerNamesFromUrl());
+        this.blobContext = this.storageClientContext.blob;
+        this._snapshot = utils_common_getURLParameter(this.url, utils_constants_URLConstants.Parameters.SNAPSHOT);
+        this._versionId = utils_common_getURLParameter(this.url, utils_constants_URLConstants.Parameters.VERSIONID);
+        this.blobClientConfig = options;
     }
-    return item;
-};
+    /**
+     * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp.
+     * Provide "" will remove the snapshot and return a Client to the base blob.
+     *
+     * @param snapshot - The snapshot timestamp.
+     * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp
+     */
+    withSnapshot(snapshot) {
+        return new BlobClient(utils_common_setURLParameter(this.url, utils_constants_URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Creates a new BlobClient object pointing to a version of this blob.
+     * Provide "" will remove the versionId and return a Client to the base blob.
+     *
+     * @param versionId - The versionId.
+     * @returns A new BlobClient object pointing to the version of this blob.
+     */
+    withVersion(versionId) {
+        return new BlobClient(utils_common_setURLParameter(this.url, utils_constants_URLConstants.Parameters.VERSIONID, versionId.length === 0 ? undefined : versionId), this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Creates a AppendBlobClient object.
+     *
+     */
+    getAppendBlobClient() {
+        return new AppendBlobClient(this.url, this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Creates a BlockBlobClient object.
+     *
+     */
+    getBlockBlobClient() {
+        return new BlockBlobClient(this.url, this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Creates a PageBlobClient object.
+     *
+     */
+    getPageBlobClient() {
+        return new PageBlobClient(this.url, this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Reads or downloads a blob from the system, including its metadata and properties.
+     * You can also call Get Blob to read a snapshot.
+     *
+     * * In Node.js, data returns in a Readable stream readableStreamBody
+     * * In browsers, data returns in a promise blobBody
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-blob
+     *
+     * @param offset - From which position of the blob to download, greater than or equal to 0
+     * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
+     * @param options - Optional options to Blob Download operation.
+     *
+     *
+     * Example usage (Node.js):
+     *
+     * ```ts snippet:ReadmeSampleDownloadBlob_Node
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blobClient = containerClient.getBlobClient(blobName);
+     *
+     * // Get blob content from position 0 to the end
+     * // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody
+     * const downloadBlockBlobResponse = await blobClient.download();
+     * if (downloadBlockBlobResponse.readableStreamBody) {
+     *   const downloaded = await streamToString(downloadBlockBlobResponse.readableStreamBody);
+     *   console.log(`Downloaded blob content: ${downloaded}`);
+     * }
+     *
+     * async function streamToString(stream: NodeJS.ReadableStream): Promise {
+     *   const result = await new Promise>((resolve, reject) => {
+     *     const chunks: Buffer[] = [];
+     *     stream.on("data", (data) => {
+     *       chunks.push(Buffer.isBuffer(data) ? data : Buffer.from(data));
+     *     });
+     *     stream.on("end", () => {
+     *       resolve(Buffer.concat(chunks));
+     *     });
+     *     stream.on("error", reject);
+     *   });
+     *   return result.toString();
+     * }
+     * ```
+     *
+     * Example usage (browser):
+     *
+     * ```ts snippet:ReadmeSampleDownloadBlob_Browser
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blobClient = containerClient.getBlobClient(blobName);
+     *
+     * // Get blob content from position 0 to the end
+     * // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody
+     * const downloadBlockBlobResponse = await blobClient.download();
+     * const blobBody = await downloadBlockBlobResponse.blobBody;
+     * if (blobBody) {
+     *   const downloaded = await blobBody.text();
+     *   console.log(`Downloaded blob content: ${downloaded}`);
+     * }
+     * ```
+     */
+    async download(offset = 0, count, options = {}) {
+        options.conditions = options.conditions || {};
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => {
+            let contentChecksumAlgorithm = options.contentChecksumAlgorithm ?? this.blobClientConfig?.downloadContentChecksumAlgorithm;
+            if (contentChecksumAlgorithm === undefined) {
+                contentChecksumAlgorithm = "Customized";
+            }
+            else if (contentChecksumAlgorithm === "Auto") {
+                contentChecksumAlgorithm = "StorageCrc64";
+            }
+            if (contentChecksumAlgorithm === "StorageCrc64") {
+                await StorageCRC64Calculator.init();
+            }
+            const res = utils_common_assertResponse((await this.blobContext.download({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                requestOptions: {
+                    onDownloadProgress: esm_isNodeLike ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
+                },
+                range: offset === 0 && !count ? undefined : rangeToString({ offset, count }),
+                rangeGetContentMD5: options.rangeGetContentMD5,
+                rangeGetContentCRC64: options.rangeGetContentCrc64,
+                snapshot: options.snapshot,
+                cpkInfo: options.customerProvidedKey,
+                tracingOptions: updatedOptions.tracingOptions,
+                structuredBodyType: contentChecksumAlgorithm === "StorageCrc64" ? "XSM/1.0; properties=crc64" : undefined,
+            })));
+            const wrappedRes = {
+                ...res,
+                _response: res._response, // _response is made non-enumerable
+                objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
+                objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
+            };
+            // Return browser response immediately
+            if (!esm_isNodeLike) {
+                if (contentChecksumAlgorithm === "StorageCrc64") {
+                    wrappedRes.blobBody = structuredMessageDecodingBrowser(await wrappedRes.blobBody);
+                }
+                return wrappedRes;
+            }
+            // We support retrying when download stream unexpected ends in Node.js runtime
+            // Following code shouldn't be bundled into browser build, however some
+            // bundlers may try to bundle following code and "FileReadResponse.ts".
+            // In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts"
+            // The config is in package.json "browser" field
+            if (options.maxRetryRequests === undefined || options.maxRetryRequests < 0) {
+                // TODO: Default value or make it a required parameter?
+                options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS;
+            }
+            if (res.contentLength === undefined) {
+                throw new RangeError(`File download response doesn't contain valid content length header`);
+            }
+            if (contentChecksumAlgorithm === "StorageCrc64" &&
+                res.structuredContentLength === undefined) {
+                throw new RangeError(`Unexpected structured content length`);
+            }
+            if (!res.etag) {
+                throw new RangeError(`File download response doesn't contain valid etag header`);
+            }
+            const expectedContentLength = contentChecksumAlgorithm === "StorageCrc64"
+                ? res.structuredContentLength
+                : res.contentLength;
+            return new BlobDownloadResponse(wrappedRes, async (start) => {
+                const updatedDownloadOptions = {
+                    leaseAccessConditions: options.conditions,
+                    modifiedAccessConditions: {
+                        ifMatch: options.conditions.ifMatch || res.etag,
+                        ifModifiedSince: options.conditions.ifModifiedSince,
+                        ifNoneMatch: options.conditions.ifNoneMatch,
+                        ifUnmodifiedSince: options.conditions.ifUnmodifiedSince,
+                        ifTags: options.conditions?.tagConditions,
+                    },
+                    range: rangeToString({
+                        count: offset + expectedContentLength - start,
+                        offset: start,
+                    }),
+                    rangeGetContentMD5: options.rangeGetContentMD5,
+                    rangeGetContentCRC64: options.rangeGetContentCrc64,
+                    snapshot: options.snapshot,
+                    cpkInfo: options.customerProvidedKey,
+                    structuredBodyType: contentChecksumAlgorithm === "StorageCrc64" ? "XSM/1.0; properties=crc64" : undefined,
+                };
+                // Debug purpose only
+                // console.log(
+                //   `Read from internal stream, range: ${
+                //     updatedOptions.range
+                //   }, options: ${JSON.stringify(updatedOptions)}`
+                // );
+                const resBody = (await this.blobContext.download({
+                    abortSignal: options.abortSignal,
+                    ...updatedDownloadOptions,
+                })).readableStreamBody;
+                if (contentChecksumAlgorithm === "StorageCrc64") {
+                    return structuredMessageDecodingStream(resBody, {});
+                }
+                else {
+                    return resBody;
+                }
+            }, offset, expectedContentLength, {
+                maxRetryRequests: options.maxRetryRequests,
+                onProgress: options.onProgress,
+            });
+        });
+    }
+    /**
+     * Returns true if the Azure blob resource represented by this client exists; false otherwise.
+     *
+     * NOTE: use this function with care since an existing blob might be deleted by other clients or
+     * applications. Vice versa new blobs might be added by other clients or applications after this
+     * function completes.
+     *
+     * @param options - options to Exists operation.
+     */
+    async exists(options = {}) {
+        return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => {
+            try {
+                ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+                await this.getProperties({
+                    abortSignal: options.abortSignal,
+                    customerProvidedKey: options.customerProvidedKey,
+                    conditions: options.conditions,
+                    tracingOptions: updatedOptions.tracingOptions,
+                });
+                return true;
+            }
+            catch (e) {
+                if (e.statusCode === 404) {
+                    // Expected exception when checking blob existence
+                    return false;
+                }
+                else if (e.statusCode === 409 &&
+                    (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg ||
+                        e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) {
+                    // Expected exception when checking blob existence
+                    return true;
+                }
+                throw e;
+            }
+        });
+    }
+    /**
+     * Returns all user-defined metadata, standard HTTP properties, and system properties
+     * for the blob. It does not return the content of the blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-properties
+     *
+     * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
+     * they originally contained uppercase characters. This differs from the metadata keys returned by
+     * the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which
+     * will retain their original casing.
+     *
+     * @param options - Optional options to Get Properties operation.
+     */
+    async getProperties(options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => {
+            const res = utils_common_assertResponse(await this.blobContext.getProperties({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            return {
+                ...res,
+                _response: res._response, // _response is made non-enumerable
+                objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
+                objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
+            };
+        });
+    }
+    /**
+     * Marks the specified blob or snapshot for deletion. The blob is later deleted
+     * during garbage collection. Note that in order to delete a blob, you must delete
+     * all of its snapshots. You can delete both at the same time with the Delete
+     * Blob operation.
+     * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob
+     *
+     * @param options - Optional options to Blob Delete operation.
+     */
+    async delete(options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.delete({
+                abortSignal: options.abortSignal,
+                deleteSnapshots: options.deleteSnapshots,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+                accessTierIfModifiedSince: options.conditions?.accessTierIfModifiedSince,
+                accessTierIfUnmodifiedSince: options.conditions?.accessTierIfUnmodifiedSince,
+            }));
+        });
+    }
+    /**
+     * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted
+     * during garbage collection. Note that in order to delete a blob, you must delete
+     * all of its snapshots. You can delete both at the same time with the Delete
+     * Blob operation.
+     * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob
+     *
+     * @param options - Optional options to Blob Delete operation.
+     */
+    async deleteIfExists(options = {}) {
+        return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => {
+            try {
+                const res = utils_common_assertResponse(await this.delete(updatedOptions));
+                return {
+                    succeeded: true,
+                    ...res,
+                    _response: res._response, // _response is made non-enumerable
+                };
+            }
+            catch (e) {
+                if (e.details?.errorCode === "BlobNotFound") {
+                    return {
+                        succeeded: false,
+                        ...e.response?.parsedHeaders,
+                        _response: e.response,
+                    };
+                }
+                throw e;
+            }
+        });
+    }
+    /**
+     * Restores the contents and metadata of soft deleted blob and any associated
+     * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29
+     * or later.
+     * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob
+     *
+     * @param options - Optional options to Blob Undelete operation.
+     */
+    async undelete(options = {}) {
+        return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.undelete({
+                abortSignal: options.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Sets system properties on the blob.
+     *
+     * If no value provided, or no value provided for the specified blob HTTP headers,
+     * these blob HTTP headers without a value will be cleared.
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
+     *
+     * @param blobHTTPHeaders - If no value provided, or no value provided for
+     *                                                   the specified blob HTTP headers, these blob HTTP
+     *                                                   headers without a value will be cleared.
+     *                                                   A common header to set is `blobContentType`
+     *                                                   enabling the browser to provide functionality
+     *                                                   based on file type.
+     * @param options - Optional options to Blob Set HTTP Headers operation.
+     */
+    async setHTTPHeaders(blobHTTPHeaders, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.setHttpHeaders({
+                abortSignal: options.abortSignal,
+                blobHttpHeaders: blobHTTPHeaders,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger.
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Sets user-defined metadata for the specified blob as one or more name-value pairs.
+     *
+     * If no option provided, or no metadata defined in the parameter, the blob
+     * metadata will be removed.
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-metadata
+     *
+     * @param metadata - Replace existing metadata with this value.
+     *                               If no value provided the existing metadata will be removed.
+     * @param options - Optional options to Set Metadata operation.
+     */
+    async setMetadata(metadata, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.setMetadata({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                metadata,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Sets tags on the underlying blob.
+     * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters.  Tag values must be between 0 and 256 characters.
+     * Valid tag key and value characters include lower and upper case letters, digits (0-9),
+     * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_').
+     *
+     * @param tags -
+     * @param options -
+     */
+    async setTags(tags, options = {}) {
+        return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.setTags({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                blobModifiedAccessConditions: options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+                tags: toBlobTags(tags),
+            }));
+        });
+    }
+    /**
+     * Gets the tags associated with the underlying blob.
+     *
+     * @param options -
+     */
+    async getTags(options = {}) {
+        return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.blobContext.getTags({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                blobModifiedAccessConditions: options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            const wrappedResponse = {
+                ...response,
+                _response: response._response, // _response is made non-enumerable
+                tags: toTags({ blobTagSet: response.blobTagSet }) || {},
+            };
+            return wrappedResponse;
+        });
+    }
+    /**
+     * Get a {@link BlobLeaseClient} that manages leases on the blob.
+     *
+     * @param proposeLeaseId - Initial proposed lease Id.
+     * @returns A new BlobLeaseClient object for managing leases on the blob.
+     */
+    getBlobLeaseClient(proposeLeaseId) {
+        return new BlobLeaseClient(this, proposeLeaseId);
+    }
+    /**
+     * Creates a read-only snapshot of a blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/snapshot-blob
+     *
+     * @param options - Optional options to the Blob Create Snapshot operation.
+     */
+    async createSnapshot(options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.createSnapshot({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                metadata: options.metadata,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Asynchronously copies a blob to a destination within the storage account.
+     * This method returns a long running operation poller that allows you to wait
+     * indefinitely until the copy is completed.
+     * You can also cancel a copy before it is completed by calling `cancelOperation` on the poller.
+     * Note that the onProgress callback will not be invoked if the operation completes in the first
+     * request, and attempting to cancel a completed copy will result in an error being thrown.
+     *
+     * In version 2012-02-12 and later, the source for a Copy Blob operation can be
+     * a committed blob in any Azure storage account.
+     * Beginning with version 2015-02-21, the source for a Copy Blob operation can be
+     * an Azure file in any Azure storage account.
+     * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob
+     * operation to copy from another storage account.
+     * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob
+     *
+     * ```ts snippet:ClientsBeginCopyFromURL
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blobClient = containerClient.getBlobClient(blobName);
+     *
+     * // Example using automatic polling
+     * const automaticCopyPoller = await blobClient.beginCopyFromURL("url");
+     * const automaticResult = await automaticCopyPoller.pollUntilDone();
+     *
+     * // Example using manual polling
+     * const manualCopyPoller = await blobClient.beginCopyFromURL("url");
+     * while (!manualCopyPoller.isDone()) {
+     *   await manualCopyPoller.poll();
+     * }
+     * const manualResult = manualCopyPoller.getResult();
+     *
+     * // Example using progress updates
+     * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", {
+     *   onProgress(state) {
+     *     console.log(`Progress: ${state.copyProgress}`);
+     *   },
+     * });
+     * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone();
+     *
+     * // Example using a changing polling interval (default 15 seconds)
+     * const pollingIntervalCopyPoller = await blobClient.beginCopyFromURL("url", {
+     *   intervalInMs: 1000, // poll blob every 1 second for copy progress
+     * });
+     * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone();
+     *
+     * // Example using copy cancellation:
+     * const cancelCopyPoller = await blobClient.beginCopyFromURL("url");
+     * // cancel operation after starting it.
+     * try {
+     *   await cancelCopyPoller.cancelOperation();
+     *   // calls to get the result now throw PollerCancelledError
+     *   cancelCopyPoller.getResult();
+     * } catch (err: any) {
+     *   if (err.name === "PollerCancelledError") {
+     *     console.log("The copy was cancelled.");
+     *   }
+     * }
+     * ```
+     *
+     * @param copySource - url to the source Azure Blob/File.
+     * @param options - Optional options to the Blob Start Copy From URL operation.
+     */
+    async beginCopyFromURL(copySource, options = {}) {
+        const client = {
+            abortCopyFromURL: (...args) => this.abortCopyFromURL(...args),
+            getProperties: (...args) => this.getProperties(...args),
+            startCopyFromURL: (...args) => this.startCopyFromURL(...args),
+        };
+        const poller = new BlobBeginCopyFromUrlPoller({
+            blobClient: client,
+            copySource,
+            intervalInMs: options.intervalInMs,
+            onProgress: options.onProgress,
+            resumeFrom: options.resumeFrom,
+            startCopyFromURLOptions: options,
+        });
+        // Trigger the startCopyFromURL call by calling poll.
+        // Any errors from this method should be surfaced to the user.
+        await poller.poll();
+        return poller;
+    }
+    /**
+     * Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero
+     * length and full metadata. Version 2012-02-12 and newer.
+     * @see https://learn.microsoft.com/rest/api/storageservices/abort-copy-blob
+     *
+     * @param copyId - Id of the Copy From URL operation.
+     * @param options - Optional options to the Blob Abort Copy From URL operation.
+     */
+    async abortCopyFromURL(copyId, options = {}) {
+        return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.abortCopyFromURL(copyId, {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not
+     * return a response until the copy is complete.
+     * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob-from-url
+     *
+     * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication
+     * @param options -
+     */
+    async syncCopyFromURL(copySource, options = {}) {
+        options.conditions = options.conditions || {};
+        options.sourceConditions = options.sourceConditions || {};
+        return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.copyFromURL(copySource, {
+                abortSignal: options.abortSignal,
+                metadata: options.metadata,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                sourceModifiedAccessConditions: {
+                    sourceIfMatch: options.sourceConditions?.ifMatch,
+                    sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
+                    sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
+                    sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
+                },
+                sourceContentMD5: options.sourceContentMD5,
+                copySourceAuthorization: utils_common_httpAuthorizationToString(options.sourceAuthorization),
+                tier: toAccessTier(options.tier),
+                blobTagsString: toBlobTagsString(options.tags),
+                immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
+                immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
+                legalHold: options.legalHold,
+                encryptionScope: options.encryptionScope,
+                copySourceTags: options.copySourceTags,
+                fileRequestIntent: options.sourceShareTokenIntent,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Sets the tier on a blob. The operation is allowed on a page blob in a premium
+     * storage account and on a block blob in a blob storage account (locally redundant
+     * storage only). A premium page blob's tier determines the allowed size, IOPS,
+     * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
+     * storage type. This operation does not update the blob's ETag.
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-tier
+     *
+     * @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive.
+     * @param options - Optional options to the Blob Set Tier operation.
+     */
+    async setAccessTier(tier, options = {}) {
+        return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.setTier(toAccessTier(tier), {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                rehydratePriority: options.rehydratePriority,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    async downloadToBuffer(param1, param2, param3, param4 = {}) {
+        let buffer;
+        let offset = 0;
+        let count = 0;
+        let options = param4;
+        if (param1 instanceof Buffer) {
+            buffer = param1;
+            offset = param2 || 0;
+            count = typeof param3 === "number" ? param3 : 0;
+        }
+        else {
+            offset = typeof param1 === "number" ? param1 : 0;
+            count = typeof param2 === "number" ? param2 : 0;
+            options = param3 || {};
+        }
+        let blockSize = options.blockSize ?? 0;
+        if (blockSize < 0) {
+            throw new RangeError("blockSize option must be >= 0");
+        }
+        if (blockSize === 0) {
+            blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;
+        }
+        if (offset < 0) {
+            throw new RangeError("offset option must be >= 0");
+        }
+        if (count && count <= 0) {
+            throw new RangeError("count option must be greater than 0");
+        }
+        if (!options.conditions) {
+            options.conditions = {};
+        }
+        return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => {
+            // Customer doesn't specify length, get it
+            if (!count) {
+                const response = await this.getProperties({
+                    ...options,
+                    tracingOptions: updatedOptions.tracingOptions,
+                });
+                count = response.contentLength - offset;
+                if (count < 0) {
+                    throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`);
+                }
+            }
+            // Allocate the buffer of size = count if the buffer is not provided
+            if (!buffer) {
+                try {
+                    buffer = Buffer.alloc(count);
+                }
+                catch (error) {
+                    throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${error.message}`);
+                }
+            }
+            if (buffer.length < count) {
+                throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`);
+            }
+            let transferProgress = 0;
+            const batch = new Batch(options.concurrency);
+            for (let off = offset; off < offset + count; off = off + blockSize) {
+                batch.addOperation(async () => {
+                    // Exclusive chunk end position
+                    let chunkEnd = offset + count;
+                    if (off + blockSize < chunkEnd) {
+                        chunkEnd = off + blockSize;
+                    }
+                    const response = await this.download(off, chunkEnd - off, {
+                        abortSignal: options.abortSignal,
+                        conditions: options.conditions,
+                        maxRetryRequests: options.maxRetryRequestsPerBlock,
+                        customerProvidedKey: options.customerProvidedKey,
+                        contentChecksumAlgorithm: options.contentChecksumAlgorithm,
+                        tracingOptions: updatedOptions.tracingOptions,
+                    });
+                    const stream = response.readableStreamBody;
+                    await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset);
+                    // Update progress after block is downloaded, in case of block trying
+                    // Could provide finer grained progress updating inside HTTP requests,
+                    // only if convenience layer download try is enabled
+                    transferProgress += chunkEnd - off;
+                    if (options.onProgress) {
+                        options.onProgress({ loadedBytes: transferProgress });
+                    }
+                });
+            }
+            await batch.do();
+            return buffer;
+        });
+    }
+    /**
+     * ONLY AVAILABLE IN NODE.JS RUNTIME.
+     *
+     * Downloads an Azure Blob to a local file.
+     * Fails if the the given file path already exits.
+     * Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
+     *
+     * @param filePath -
+     * @param offset - From which position of the block blob to download.
+     * @param count - How much data to be downloaded. Will download to the end when passing undefined.
+     * @param options - Options to Blob download options.
+     * @returns The response data for blob download operation,
+     *                                                 but with readableStreamBody set to undefined since its
+     *                                                 content is already read and written into a local file
+     *                                                 at the specified path.
+     */
+    async downloadToFile(filePath, offset = 0, count, options = {}) {
+        return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => {
+            const response = await this.download(offset, count, {
+                ...options,
+                tracingOptions: updatedOptions.tracingOptions,
+            });
+            if (response.readableStreamBody) {
+                await readStreamToLocalFile(response.readableStreamBody, filePath);
+            }
+            // The stream is no longer accessible so setting it to undefined.
+            response.blobDownloadStream = undefined;
+            return response;
+        });
+    }
+    getBlobAndContainerNamesFromUrl() {
+        let containerName;
+        let blobName;
+        try {
+            //  URL may look like the following
+            // "https://myaccount.blob.core.windows.net/mycontainer/blob?sasString";
+            // "https://myaccount.blob.core.windows.net/mycontainer/blob";
+            // "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt?sasString";
+            // "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt";
+            // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername/blob`
+            // http://localhost:10001/devstoreaccount1/containername/blob
+            const parsedUrl = new URL(this.url);
+            if (parsedUrl.host.split(".")[1] === "blob") {
+                // "https://myaccount.blob.core.windows.net/containername/blob".
+                // .getPath() -> /containername/blob
+                const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?");
+                containerName = pathComponents[1];
+                blobName = pathComponents[3];
+            }
+            else if (utils_common_isIpEndpointStyle(parsedUrl)) {
+                // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob
+                // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob
+                // .getPath() -> /devstoreaccount1/containername/blob
+                const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?");
+                containerName = pathComponents[2];
+                blobName = pathComponents[4];
+            }
+            else {
+                // "https://customdomain.com/containername/blob".
+                // .getPath() -> /containername/blob
+                const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?");
+                containerName = pathComponents[1];
+                blobName = pathComponents[3];
+            }
+            // decode the encoded blobName, containerName - to get all the special characters that might be present in them
+            containerName = decodeURIComponent(containerName);
+            blobName = decodeURIComponent(blobName);
+            // Azure Storage Server will replace "\" with "/" in the blob names
+            //   doing the same in the SDK side so that the user doesn't have to replace "\" instances in the blobName
+            blobName = blobName.replace(/\\/g, "/");
+            if (!containerName) {
+                throw new Error("Provided containerName is invalid.");
+            }
+            return { blobName, containerName };
+        }
+        catch (error) {
+            throw new Error("Unable to extract blobName and containerName with provided information.");
+        }
+    }
+    /**
+     * Asynchronously copies a blob to a destination within the storage account.
+     * In version 2012-02-12 and later, the source for a Copy Blob operation can be
+     * a committed blob in any Azure storage account.
+     * Beginning with version 2015-02-21, the source for a Copy Blob operation can be
+     * an Azure file in any Azure storage account.
+     * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob
+     * operation to copy from another storage account.
+     * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob
+     *
+     * @param copySource - url to the source Azure Blob/File.
+     * @param options - Optional options to the Blob Start Copy From URL operation.
+     */
+    async startCopyFromURL(copySource, options = {}) {
+        return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => {
+            options.conditions = options.conditions || {};
+            options.sourceConditions = options.sourceConditions || {};
+            return utils_common_assertResponse(await this.blobContext.startCopyFromURL(copySource, {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                metadata: options.metadata,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                sourceModifiedAccessConditions: {
+                    sourceIfMatch: options.sourceConditions.ifMatch,
+                    sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
+                    sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
+                    sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
+                    sourceIfTags: options.sourceConditions.tagConditions,
+                },
+                immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
+                immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
+                legalHold: options.legalHold,
+                rehydratePriority: options.rehydratePriority,
+                tier: toAccessTier(options.tier),
+                blobTagsString: toBlobTagsString(options.tags),
+                sealBlob: options.sealBlob,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Only available for BlobClient constructed with a shared key credential.
+     *
+     * Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties
+     * and parameters passed in. The SAS is signed by the shared key credential of the client.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateSasUrl(options) {
+        return new Promise((resolve) => {
+            if (!(this.credential instanceof StorageSharedKeyCredential)) {
+                throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
+            }
+            const sas = generateBlobSASQueryParameters({
+                containerName: this._containerName,
+                blobName: this._name,
+                snapshotTime: this._snapshot,
+                versionId: this._versionId,
+                ...options,
+            }, this.credential).toString();
+            resolve(utils_common_appendToURLQuery(this.url, sas));
+        });
+    }
+    /**
+     * Only available for BlobClient constructed with a shared key credential.
+     *
+     * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on
+     * the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    generateSasStringToSign(options) {
+        if (!(this.credential instanceof StorageSharedKeyCredential)) {
+            throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
+        }
+        return generateBlobSASQueryParametersInternal({
+            containerName: this._containerName,
+            blobName: this._name,
+            snapshotTime: this._snapshot,
+            versionId: this._versionId,
+            ...options,
+        }, this.credential).stringToSign;
+    }
+    /**
+     *
+     * Generates a Blob Service Shared Access Signature (SAS) URI based on
+     * the client properties and parameters passed in. The SAS is signed by the input user delegation key.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @param userDelegationKey -  Return value of `blobServiceClient.getUserDelegationKey()`
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateUserDelegationSasUrl(options, userDelegationKey) {
+        return new Promise((resolve) => {
+            const sas = generateBlobSASQueryParameters({
+                containerName: this._containerName,
+                blobName: this._name,
+                snapshotTime: this._snapshot,
+                versionId: this._versionId,
+                ...options,
+            }, userDelegationKey, this.accountName).toString();
+            resolve(utils_common_appendToURLQuery(this.url, sas));
+        });
+    }
+    /**
+     * Only available for BlobClient constructed with a shared key credential.
+     *
+     * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on
+     * the client properties and parameters passed in. The SAS is signed by the input user delegation key.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @param userDelegationKey -  Return value of `blobServiceClient.getUserDelegationKey()`
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateUserDelegationSasStringToSign(options, userDelegationKey) {
+        return generateBlobSASQueryParametersInternal({
+            containerName: this._containerName,
+            blobName: this._name,
+            snapshotTime: this._snapshot,
+            versionId: this._versionId,
+            ...options,
+        }, userDelegationKey, this.accountName).stringToSign;
+    }
+    /**
+     * Delete the immutablility policy on the blob.
+     *
+     * @param options - Optional options to delete immutability policy on the blob.
+     */
+    async deleteImmutabilityPolicy(options = {}) {
+        return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.deleteImmutabilityPolicy({
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Set immutability policy on the blob.
+     *
+     * @param options - Optional options to set immutability policy on the blob.
+     */
+    async setImmutabilityPolicy(immutabilityPolicy, options = {}) {
+        return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.setImmutabilityPolicy({
+                immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn,
+                immutabilityPolicyMode: immutabilityPolicy.policyMode,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Set legal hold on the blob.
+     *
+     * @param options - Optional options to set legal hold on the blob.
+     */
+    async setLegalHold(legalHoldEnabled, options = {}) {
+        return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, {
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * The Get Account Information operation returns the sku name and account kind
+     * for the specified account.
+     * The Get Account Information operation is available on service versions beginning
+     * with version 2018-03-28.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
+     *
+     * @param options - Options to the Service Get Account Info operation.
+     * @returns Response data for the Service Get Account Info operation.
+     */
+    async getAccountInfo(options = {}) {
+        return tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blobContext.getAccountInfo({
+                abortSignal: options.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+}
 /**
- * Get the immediate parent collection of the item at `path` from `cst` as the root.
- *
- * Throws an error if the collection is not found, which should never happen if the item itself exists.
+ * AppendBlobClient defines a set of operations applicable to append blobs.
  */
-visit.parentCollection = (cst, path) => {
-    const parent = visit.itemAtPath(cst, path.slice(0, -1));
-    const field = path[path.length - 1][0];
-    const coll = parent?.[field];
-    if (coll && 'items' in coll)
-        return coll;
-    throw new Error('Parent collection not found');
-};
-function _visit(path, item, visitor) {
-    let ctrl = visitor(item, path);
-    if (typeof ctrl === 'symbol')
-        return ctrl;
-    for (const field of ['key', 'value']) {
-        const token = item[field];
-        if (token && 'items' in token) {
-            for (let i = 0; i < token.items.length; ++i) {
-                const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
-                if (typeof ci === 'number')
-                    i = ci - 1;
-                else if (ci === BREAK)
-                    return BREAK;
-                else if (ci === REMOVE) {
-                    token.items.splice(i, 1);
-                    i -= 1;
+class AppendBlobClient extends BlobClient {
+    /**
+     * appendBlobsContext provided by protocol layer.
+     */
+    appendBlobContext;
+    constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
+        //   super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
+        let pipeline;
+        let url;
+        options = options || {};
+        if (isPipelineLike(credentialOrPipelineOrContainerName)) {
+            // (url: string, pipeline: Pipeline)
+            url = urlOrConnectionString;
+            pipeline = credentialOrPipelineOrContainerName;
+            options = blobNameOrOptions;
+        }
+        else if ((esm_isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
+            credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
+            isTokenCredential(credentialOrPipelineOrContainerName)) {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)      url = urlOrConnectionString;
+            url = urlOrConnectionString;
+            options = blobNameOrOptions;
+            pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
+        }
+        else if (!credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName !== "string") {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            url = urlOrConnectionString;
+            options = blobNameOrOptions;
+            // The second parameter is undefined. Use anonymous credential.
+            pipeline = newPipeline(new AnonymousCredential(), options);
+        }
+        else if (credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName === "string" &&
+            blobNameOrOptions &&
+            typeof blobNameOrOptions === "string") {
+            // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
+            const containerName = credentialOrPipelineOrContainerName;
+            const blobName = blobNameOrOptions;
+            const extractedCreds = utils_common_extractConnectionStringParts(urlOrConnectionString);
+            if (extractedCreds.kind === "AccountConnString") {
+                if (esm_isNodeLike) {
+                    const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
+                    url = utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
+                    if (!options.proxyOptions) {
+                        options.proxyOptions = proxyPolicy_getDefaultProxySettings(extractedCreds.proxyUri);
+                    }
+                    pipeline = newPipeline(sharedKeyCredential, options);
+                }
+                else {
+                    throw new Error("Account connection string is only supported in Node.js environment");
                 }
             }
-            if (typeof ctrl === 'function' && field === 'key')
-                ctrl = ctrl(item, path);
+            else if (extractedCreds.kind === "SASConnString") {
+                url =
+                    utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
+                        "?" +
+                        extractedCreds.accountSas;
+                pipeline = newPipeline(new AnonymousCredential(), options);
+            }
+            else {
+                throw new Error("Connection string must be either an Account connection string or a SAS connection string");
+            }
+        }
+        else {
+            throw new Error("Expecting non-empty strings for containerName and blobName parameters");
         }
+        super(url, pipeline);
+        this.appendBlobContext = this.storageClientContext.appendBlob;
+        this.blobClientConfig = options;
     }
-    return typeof ctrl === 'function' ? ctrl(item, path) : ctrl;
-}
-
-exports.visit = visit;
-
-
-/***/ }),
-
-/***/ 3461:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var cstScalar = __nccwpck_require__(60110);
-var cstStringify = __nccwpck_require__(91733);
-var cstVisit = __nccwpck_require__(97715);
-
-/** The byte order mark */
-const BOM = '\u{FEFF}';
-/** Start of doc-mode */
-const DOCUMENT = '\x02'; // C0: Start of Text
-/** Unexpected end of flow-mode */
-const FLOW_END = '\x18'; // C0: Cancel
-/** Next token is a scalar value */
-const SCALAR = '\x1f'; // C0: Unit Separator
-/** @returns `true` if `token` is a flow or block collection */
-const isCollection = (token) => !!token && 'items' in token;
-/** @returns `true` if `token` is a flow or block scalar; not an alias */
-const isScalar = (token) => !!token &&
-    (token.type === 'scalar' ||
-        token.type === 'single-quoted-scalar' ||
-        token.type === 'double-quoted-scalar' ||
-        token.type === 'block-scalar');
-/* istanbul ignore next */
-/** Get a printable representation of a lexer token */
-function prettyToken(token) {
-    switch (token) {
-        case BOM:
-            return '';
-        case DOCUMENT:
-            return '';
-        case FLOW_END:
-            return '';
-        case SCALAR:
-            return '';
-        default:
-            return JSON.stringify(token);
+    /**
+     * Creates a new AppendBlobClient object identical to the source but with the
+     * specified snapshot timestamp.
+     * Provide "" will remove the snapshot and return a Client to the base blob.
+     *
+     * @param snapshot - The snapshot timestamp.
+     * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp.
+     */
+    withSnapshot(snapshot) {
+        return new AppendBlobClient(utils_common_setURLParameter(this.url, utils_constants_URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.blobClientConfig);
     }
-}
-/** Identify the type of a lexer token. May return `null` for unknown tokens. */
-function tokenType(source) {
-    switch (source) {
-        case BOM:
-            return 'byte-order-mark';
-        case DOCUMENT:
-            return 'doc-mode';
-        case FLOW_END:
-            return 'flow-error-end';
-        case SCALAR:
-            return 'scalar';
-        case '---':
-            return 'doc-start';
-        case '...':
-            return 'doc-end';
-        case '':
-        case '\n':
-        case '\r\n':
-            return 'newline';
-        case '-':
-            return 'seq-item-ind';
-        case '?':
-            return 'explicit-key-ind';
-        case ':':
-            return 'map-value-ind';
-        case '{':
-            return 'flow-map-start';
-        case '}':
-            return 'flow-map-end';
-        case '[':
-            return 'flow-seq-start';
-        case ']':
-            return 'flow-seq-end';
-        case ',':
-            return 'comma';
+    /**
+     * Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
+     *
+     * @param options - Options to the Append Block Create operation.
+     *
+     *
+     * Example usage:
+     *
+     * ```ts snippet:ClientsCreateAppendBlob
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     *
+     * const appendBlobClient = containerClient.getAppendBlobClient(blobName);
+     * await appendBlobClient.create();
+     * ```
+     */
+    async create(options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.appendBlobContext.create(0, {
+                abortSignal: options.abortSignal,
+                blobHttpHeaders: options.blobHTTPHeaders,
+                leaseAccessConditions: options.conditions,
+                metadata: options.metadata,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
+                immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
+                legalHold: options.legalHold,
+                blobTagsString: toBlobTagsString(options.tags),
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
-    switch (source[0]) {
-        case ' ':
-        case '\t':
-            return 'space';
-        case '#':
-            return 'comment';
-        case '%':
-            return 'directive-line';
-        case '*':
-            return 'alias';
-        case '&':
-            return 'anchor';
-        case '!':
-            return 'tag';
-        case "'":
-            return 'single-quoted-scalar';
-        case '"':
-            return 'double-quoted-scalar';
-        case '|':
-        case '>':
-            return 'block-scalar-header';
+    /**
+     * Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
+     * If the blob with the same name already exists, the content of the existing blob will remain unchanged.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
+     *
+     * @param options -
+     */
+    async createIfNotExists(options = {}) {
+        const conditions = { ifNoneMatch: ETagAny };
+        return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => {
+            try {
+                const res = utils_common_assertResponse(await this.create({
+                    ...updatedOptions,
+                    conditions,
+                }));
+                return {
+                    succeeded: true,
+                    ...res,
+                    _response: res._response, // _response is made non-enumerable
+                };
+            }
+            catch (e) {
+                if (e.details?.errorCode === "BlobAlreadyExists") {
+                    return {
+                        succeeded: false,
+                        ...e.response?.parsedHeaders,
+                        _response: e.response,
+                    };
+                }
+                throw e;
+            }
+        });
     }
-    return null;
-}
-
-exports.createScalarToken = cstScalar.createScalarToken;
-exports.resolveAsScalar = cstScalar.resolveAsScalar;
-exports.setScalarValue = cstScalar.setScalarValue;
-exports.stringify = cstStringify.stringify;
-exports.visit = cstVisit.visit;
-exports.BOM = BOM;
-exports.DOCUMENT = DOCUMENT;
-exports.FLOW_END = FLOW_END;
-exports.SCALAR = SCALAR;
-exports.isCollection = isCollection;
-exports.isScalar = isScalar;
-exports.prettyToken = prettyToken;
-exports.tokenType = tokenType;
-
-
-/***/ }),
-
-/***/ 40361:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var cst = __nccwpck_require__(3461);
-
-/*
-START -> stream
-
-stream
-  directive -> line-end -> stream
-  indent + line-end -> stream
-  [else] -> line-start
-
-line-end
-  comment -> line-end
-  newline -> .
-  input-end -> END
-
-line-start
-  doc-start -> doc
-  doc-end -> stream
-  [else] -> indent -> block-start
-
-block-start
-  seq-item-start -> block-start
-  explicit-key-start -> block-start
-  map-value-start -> block-start
-  [else] -> doc
-
-doc
-  line-end -> line-start
-  spaces -> doc
-  anchor -> doc
-  tag -> doc
-  flow-start -> flow -> doc
-  flow-end -> error -> doc
-  seq-item-start -> error -> doc
-  explicit-key-start -> error -> doc
-  map-value-start -> doc
-  alias -> doc
-  quote-start -> quoted-scalar -> doc
-  block-scalar-header -> line-end -> block-scalar(min) -> line-start
-  [else] -> plain-scalar(false, min) -> doc
-
-flow
-  line-end -> flow
-  spaces -> flow
-  anchor -> flow
-  tag -> flow
-  flow-start -> flow -> flow
-  flow-end -> .
-  seq-item-start -> error -> flow
-  explicit-key-start -> flow
-  map-value-start -> flow
-  alias -> flow
-  quote-start -> quoted-scalar -> flow
-  comma -> flow
-  [else] -> plain-scalar(true, 0) -> flow
-
-quoted-scalar
-  quote-end -> .
-  [else] -> quoted-scalar
-
-block-scalar(min)
-  newline + peek(indent < min) -> .
-  [else] -> block-scalar(min)
-
-plain-scalar(is-flow, min)
-  scalar-end(is-flow) -> .
-  peek(newline + (indent < min)) -> .
-  [else] -> plain-scalar(min)
-*/
-function isEmpty(ch) {
-    switch (ch) {
-        case undefined:
-        case ' ':
-        case '\n':
-        case '\r':
-        case '\t':
-            return true;
-        default:
-            return false;
+    /**
+     * Seals the append blob, making it read only.
+     *
+     * @param options -
+     */
+    async seal(options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.appendBlobContext.seal({
+                abortSignal: options.abortSignal,
+                appendPositionAccessConditions: options.conditions,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Commits a new block of data to the end of the existing append blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/append-block
+     *
+     * @param body - Data to be appended.
+     * @param contentLength - Length of the body in bytes.
+     * @param options - Options to the Append Block operation.
+     *
+     *
+     * Example usage:
+     *
+     * ```ts snippet:ClientsAppendBlock
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     *
+     * const content = "Hello World!";
+     *
+     * // Create a new append blob and append data to the blob.
+     * const newAppendBlobClient = containerClient.getAppendBlobClient(blobName);
+     * await newAppendBlobClient.create();
+     * await newAppendBlobClient.appendBlock(content, content.length);
+     *
+     * // Append data to an existing append blob.
+     * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName);
+     * await existingAppendBlobClient.appendBlock(content, content.length);
+     * ```
+     */
+    async appendBlock(body, contentLength, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => {
+            const parameters = {
+                abortSignal: options.abortSignal,
+                appendPositionAccessConditions: options.conditions,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                requestOptions: {
+                    onUploadProgress: options.onProgress,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                tracingOptions: updatedOptions.tracingOptions,
+            };
+            const uploadBodyParameters = await setUploadChecksumParameters(body, contentLength, parameters, options, this.blobClientConfig?.uploadContentChecksumAlgorithm);
+            return utils_common_assertResponse(await this.appendBlobContext.appendBlock(uploadBodyParameters.contentLength, uploadBodyParameters.body, parameters));
+        });
+    }
+    /**
+     * The Append Block operation commits a new block of data to the end of an existing append blob
+     * where the contents are read from a source url.
+     * @see https://learn.microsoft.com/rest/api/storageservices/append-block-from-url
+     *
+     * @param sourceURL -
+     *                 The url to the blob that will be the source of the copy. A source blob in the same storage account can
+     *                 be authenticated via Shared Key. However, if the source is a blob in another account, the source blob
+     *                 must either be public or must be authenticated via a shared access signature. If the source blob is
+     *                 public, no authentication is required to perform the operation.
+     * @param sourceOffset - Offset in source to be appended
+     * @param count - Number of bytes to be appended as a block
+     * @param options -
+     */
+    async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) {
+        options.conditions = options.conditions || {};
+        options.sourceConditions = options.sourceConditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, {
+                abortSignal: options.abortSignal,
+                sourceRange: rangeToString({ offset: sourceOffset, count }),
+                sourceContentMD5: options.sourceContentMD5,
+                sourceContentCrc64: options.sourceContentCrc64,
+                leaseAccessConditions: options.conditions,
+                appendPositionAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                sourceModifiedAccessConditions: {
+                    sourceIfMatch: options.sourceConditions?.ifMatch,
+                    sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
+                    sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
+                    sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
+                },
+                copySourceAuthorization: utils_common_httpAuthorizationToString(options.sourceAuthorization),
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                fileRequestIntent: options.sourceShareTokenIntent,
+                tracingOptions: updatedOptions.tracingOptions,
+                sourceCpkInfo: {
+                    sourceEncryptionKey: options.sourceCustomerProvidedKey?.encryptionKey,
+                    sourceEncryptionAlgorithm: options.sourceCustomerProvidedKey?.encryptionAlgorithm,
+                    sourceEncryptionKeySha256: options.sourceCustomerProvidedKey?.encryptionKeySha256,
+                },
+            }));
+        });
     }
 }
-const hexDigits = new Set('0123456789ABCDEFabcdef');
-const tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
-const flowIndicatorChars = new Set(',[]{}');
-const invalidAnchorChars = new Set(' ,[]{}\n\r\t');
-const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
 /**
- * Splits an input string into lexical tokens, i.e. smaller strings that are
- * easily identifiable by `tokens.tokenType()`.
- *
- * Lexing starts always in a "stream" context. Incomplete input may be buffered
- * until a complete token can be emitted.
- *
- * In addition to slices of the original input, the following control characters
- * may also be emitted:
- *
- * - `\x02` (Start of Text): A document starts with the next token
- * - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error)
- * - `\x1f` (Unit Separator): Next token is a scalar value
- * - `\u{FEFF}` (Byte order mark): Emitted separately outside documents
+ * BlockBlobClient defines a set of operations applicable to block blobs.
  */
-class Lexer {
-    constructor() {
-        /**
-         * Flag indicating whether the end of the current buffer marks the end of
-         * all input
-         */
-        this.atEnd = false;
-        /**
-         * Explicit indent set in block scalar header, as an offset from the current
-         * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not
-         * explicitly set.
-         */
-        this.blockScalarIndent = -1;
-        /**
-         * Block scalars that include a + (keep) chomping indicator in their header
-         * include trailing empty lines, which are otherwise excluded from the
-         * scalar's contents.
-         */
-        this.blockScalarKeep = false;
-        /** Current input */
-        this.buffer = '';
-        /**
-         * Flag noting whether the map value indicator : can immediately follow this
-         * node within a flow context.
-         */
-        this.flowKey = false;
-        /** Count of surrounding flow collection levels. */
-        this.flowLevel = 0;
-        /**
-         * Minimum level of indentation required for next lines to be parsed as a
-         * part of the current scalar value.
-         */
-        this.indentNext = 0;
-        /** Indentation level of the current line. */
-        this.indentValue = 0;
-        /** Position of the next \n character. */
-        this.lineEndPos = null;
-        /** Stores the state of the lexer if reaching the end of incpomplete input */
-        this.next = null;
-        /** A pointer to `buffer`; the current position of the lexer. */
-        this.pos = 0;
+class BlockBlobClient extends BlobClient {
+    /**
+     * blobContext provided by protocol layer.
+     *
+     * Note. Ideally BlobClient should set BlobClient.blobContext to protected. However, API
+     * extractor has issue blocking that. Here we redecelare _blobContext in BlockBlobClient.
+     */
+    _blobContext;
+    /**
+     * blockBlobContext provided by protocol layer.
+     */
+    blockBlobContext;
+    constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
+        //   super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
+        let pipeline;
+        let url;
+        options = options || {};
+        if (isPipelineLike(credentialOrPipelineOrContainerName)) {
+            // (url: string, pipeline: Pipeline)
+            url = urlOrConnectionString;
+            pipeline = credentialOrPipelineOrContainerName;
+            options = blobNameOrOptions;
+        }
+        else if ((esm_isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
+            credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
+            isTokenCredential(credentialOrPipelineOrContainerName)) {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            url = urlOrConnectionString;
+            options = blobNameOrOptions;
+            pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
+        }
+        else if (!credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName !== "string") {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            // The second parameter is undefined. Use anonymous credential.
+            url = urlOrConnectionString;
+            if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
+                options = blobNameOrOptions;
+            }
+            pipeline = newPipeline(new AnonymousCredential(), options);
+        }
+        else if (credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName === "string" &&
+            blobNameOrOptions &&
+            typeof blobNameOrOptions === "string") {
+            // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
+            const containerName = credentialOrPipelineOrContainerName;
+            const blobName = blobNameOrOptions;
+            const extractedCreds = utils_common_extractConnectionStringParts(urlOrConnectionString);
+            if (extractedCreds.kind === "AccountConnString") {
+                if (esm_isNodeLike) {
+                    const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
+                    url = utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
+                    if (!options.proxyOptions) {
+                        options.proxyOptions = proxyPolicy_getDefaultProxySettings(extractedCreds.proxyUri);
+                    }
+                    pipeline = newPipeline(sharedKeyCredential, options);
+                }
+                else {
+                    throw new Error("Account connection string is only supported in Node.js environment");
+                }
+            }
+            else if (extractedCreds.kind === "SASConnString") {
+                url =
+                    utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
+                        "?" +
+                        extractedCreds.accountSas;
+                pipeline = newPipeline(new AnonymousCredential(), options);
+            }
+            else {
+                throw new Error("Connection string must be either an Account connection string or a SAS connection string");
+            }
+        }
+        else {
+            throw new Error("Expecting non-empty strings for containerName and blobName parameters");
+        }
+        super(url, pipeline);
+        this.blockBlobContext = this.storageClientContext.blockBlob;
+        this._blobContext = this.storageClientContext.blob;
+        this.blobClientConfig = options;
     }
     /**
-     * Generate YAML tokens from the `source` string. If `incomplete`,
-     * a part of the last line may be left as a buffer for the next call.
+     * Creates a new BlockBlobClient object identical to the source but with the
+     * specified snapshot timestamp.
+     * Provide "" will remove the snapshot and return a URL to the base blob.
      *
-     * @returns A generator of lexical tokens
+     * @param snapshot - The snapshot timestamp.
+     * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp.
      */
-    *lex(source, incomplete = false) {
-        if (source) {
-            if (typeof source !== 'string')
-                throw TypeError('source is not a string');
-            this.buffer = this.buffer ? this.buffer + source : source;
-            this.lineEndPos = null;
+    withSnapshot(snapshot) {
+        return new BlockBlobClient(utils_common_setURLParameter(this.url, utils_constants_URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * ONLY AVAILABLE IN NODE.JS RUNTIME.
+     *
+     * Quick query for a JSON or CSV formatted blob.
+     *
+     * Example usage (Node.js):
+     *
+     * ```ts snippet:ClientsQuery
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blockBlobClient = containerClient.getBlockBlobClient(blobName);
+     *
+     * // Query and convert a blob to a string
+     * const queryBlockBlobResponse = await blockBlobClient.query("select from BlobStorage");
+     * if (queryBlockBlobResponse.readableStreamBody) {
+     *   const downloadedBuffer = await streamToBuffer(queryBlockBlobResponse.readableStreamBody);
+     *   const downloaded = downloadedBuffer.toString();
+     *   console.log(`Query blob content: ${downloaded}`);
+     * }
+     *
+     * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise {
+     *   return new Promise((resolve, reject) => {
+     *     const chunks: Buffer[] = [];
+     *     readableStream.on("data", (data) => {
+     *       chunks.push(data instanceof Buffer ? data : Buffer.from(data));
+     *     });
+     *     readableStream.on("end", () => {
+     *       resolve(Buffer.concat(chunks));
+     *     });
+     *     readableStream.on("error", reject);
+     *   });
+     * }
+     * ```
+     *
+     * @param query -
+     * @param options -
+     */
+    async query(query, options = {}) {
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        if (!esm_isNodeLike) {
+            throw new Error("This operation currently is only supported in Node.js.");
         }
-        this.atEnd = !incomplete;
-        let next = this.next ?? 'stream';
-        while (next && (incomplete || this.hasChars(1)))
-            next = yield* this.parseNext(next);
+        return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse((await this._blobContext.query({
+                abortSignal: options.abortSignal,
+                queryRequest: {
+                    queryType: "SQL",
+                    expression: query,
+                    inputSerialization: toQuerySerialization(options.inputTextConfiguration),
+                    outputSerialization: toQuerySerialization(options.outputTextConfiguration),
+                },
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                tracingOptions: updatedOptions.tracingOptions,
+            })));
+            return new BlobQueryResponse(response, {
+                abortSignal: options.abortSignal,
+                onProgress: options.onProgress,
+                onError: options.onError,
+            });
+        });
     }
-    atLineEnd() {
-        let i = this.pos;
-        let ch = this.buffer[i];
-        while (ch === ' ' || ch === '\t')
-            ch = this.buffer[++i];
-        if (!ch || ch === '#' || ch === '\n')
-            return true;
-        if (ch === '\r')
-            return this.buffer[i + 1] === '\n';
-        return false;
+    /**
+     * Creates a new block blob, or updates the content of an existing block blob.
+     * Updating an existing block blob overwrites any existing metadata on the blob.
+     * Partial updates are not supported; the content of the existing blob is
+     * overwritten with the new content. To perform a partial update of a block blob's,
+     * use {@link stageBlock} and {@link commitBlockList}.
+     *
+     * This is a non-parallel uploading method, please use {@link uploadFile},
+     * {@link uploadStream} or {@link uploadBrowserData} for better performance
+     * with concurrency uploading.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
+     *
+     * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function
+     *                               which returns a new Readable stream whose offset is from data source beginning.
+     * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
+     *                               string including non non-Base64/Hex-encoded characters.
+     * @param options - Options to the Block Blob Upload operation.
+     * @returns Response data for the Block Blob Upload operation.
+     *
+     * Example usage:
+     *
+     * ```ts snippet:ClientsUpload
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blockBlobClient = containerClient.getBlockBlobClient(blobName);
+     *
+     * const content = "Hello world!";
+     * const uploadBlobResponse = await blockBlobClient.upload(content, content.length);
+     * ```
+     */
+    async upload(body, contentLength, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => {
+            const parameters = {
+                abortSignal: options.abortSignal,
+                blobHttpHeaders: options.blobHTTPHeaders,
+                leaseAccessConditions: options.conditions,
+                metadata: options.metadata,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                requestOptions: {
+                    onUploadProgress: options.onProgress,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
+                immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
+                legalHold: options.legalHold,
+                tier: toAccessTier(options.tier),
+                blobTagsString: toBlobTagsString(options.tags),
+                tracingOptions: updatedOptions.tracingOptions,
+            };
+            const uploadBodyParameters = await setUploadChecksumParameters(body, contentLength, parameters, options, this.blobClientConfig?.uploadContentChecksumAlgorithm);
+            return utils_common_assertResponse(await this.blockBlobContext.upload(uploadBodyParameters.contentLength, uploadBodyParameters.body, parameters));
+        });
+    }
+    /**
+     * Creates a new Block Blob where the contents of the blob are read from a given URL.
+     * This API is supported beginning with the 2020-04-08 version. Partial updates
+     * are not supported with Put Blob from URL; the content of an existing blob is overwritten with
+     * the content of the new blob.  To perform partial updates to a block blob’s contents using a
+     * source URL, use {@link stageBlockFromURL} and {@link commitBlockList}.
+     *
+     * @param sourceURL - Specifies the URL of the blob. The value
+     *                           may be a URL of up to 2 KB in length that specifies a blob.
+     *                           The value should be URL-encoded as it would appear
+     *                           in a request URI. The source blob must either be public
+     *                           or must be authenticated via a shared access signature.
+     *                           If the source blob is public, no authentication is required
+     *                           to perform the operation. Here are some examples of source object URLs:
+     *                           - https://myaccount.blob.core.windows.net/mycontainer/myblob
+     *                           - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=
+     * @param options - Optional parameters.
+     */
+    async syncUploadFromURL(sourceURL, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, {
+                ...options,
+                blobHttpHeaders: options.blobHTTPHeaders,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                sourceModifiedAccessConditions: {
+                    sourceIfMatch: options.sourceConditions?.ifMatch,
+                    sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
+                    sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
+                    sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
+                    sourceIfTags: options.sourceConditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                copySourceAuthorization: utils_common_httpAuthorizationToString(options.sourceAuthorization),
+                tier: toAccessTier(options.tier),
+                blobTagsString: toBlobTagsString(options.tags),
+                copySourceTags: options.copySourceTags,
+                fileRequestIntent: options.sourceShareTokenIntent,
+                tracingOptions: updatedOptions.tracingOptions,
+                sourceCpkInfo: {
+                    sourceEncryptionKey: options.sourceCustomerProvidedKey?.encryptionKey,
+                    sourceEncryptionAlgorithm: options.sourceCustomerProvidedKey?.encryptionAlgorithm,
+                    sourceEncryptionKeySha256: options.sourceCustomerProvidedKey?.encryptionKeySha256,
+                },
+            }));
+        });
+    }
+    /**
+     * Uploads the specified block to the block blob's "staging area" to be later
+     * committed by a call to commitBlockList.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-block
+     *
+     * @param blockId - A 64-byte value that is base64-encoded
+     * @param body - Data to upload to the staging area.
+     * @param contentLength - Number of bytes to upload.
+     * @param options - Options to the Block Blob Stage Block operation.
+     * @returns Response data for the Block Blob Stage Block operation.
+     */
+    async stageBlock(blockId, body, contentLength, options = {}) {
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => {
+            const parameters = {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                requestOptions: {
+                    onUploadProgress: options.onProgress,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                tracingOptions: updatedOptions.tracingOptions,
+            };
+            const uploadBodyParameters = await setUploadChecksumParameters(body, contentLength, parameters, options, this.blobClientConfig?.uploadContentChecksumAlgorithm);
+            return utils_common_assertResponse(await this.blockBlobContext.stageBlock(blockId, uploadBodyParameters.contentLength, uploadBodyParameters.body, parameters));
+        });
+    }
+    /**
+     * The Stage Block From URL operation creates a new block to be committed as part
+     * of a blob where the contents are read from a URL.
+     * This API is available starting in version 2018-03-28.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-block-from-url
+     *
+     * @param blockId - A 64-byte value that is base64-encoded
+     * @param sourceURL - Specifies the URL of the blob. The value
+     *                           may be a URL of up to 2 KB in length that specifies a blob.
+     *                           The value should be URL-encoded as it would appear
+     *                           in a request URI. The source blob must either be public
+     *                           or must be authenticated via a shared access signature.
+     *                           If the source blob is public, no authentication is required
+     *                           to perform the operation. Here are some examples of source object URLs:
+     *                           - https://myaccount.blob.core.windows.net/mycontainer/myblob
+     *                           - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=
+     * @param offset - From which position of the blob to download, greater than or equal to 0
+     * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
+     * @param options - Options to the Block Blob Stage Block From URL operation.
+     * @returns Response data for the Block Blob Stage Block From URL operation.
+     */
+    async stageBlockFromURL(blockId, sourceURL, offset = 0, count, options = {}) {
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                sourceContentMD5: options.sourceContentMD5,
+                sourceContentCrc64: options.sourceContentCrc64,
+                sourceRange: offset === 0 && !count ? undefined : rangeToString({ offset, count }),
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                copySourceAuthorization: utils_common_httpAuthorizationToString(options.sourceAuthorization),
+                fileRequestIntent: options.sourceShareTokenIntent,
+                tracingOptions: updatedOptions.tracingOptions,
+                sourceCpkInfo: {
+                    sourceEncryptionKey: options.sourceCustomerProvidedKey?.encryptionKey,
+                    sourceEncryptionAlgorithm: options.sourceCustomerProvidedKey?.encryptionAlgorithm,
+                    sourceEncryptionKeySha256: options.sourceCustomerProvidedKey?.encryptionKeySha256,
+                },
+            }));
+        });
+    }
+    /**
+     * Writes a blob by specifying the list of block IDs that make up the blob.
+     * In order to be written as part of a blob, a block must have been successfully written
+     * to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to
+     * update a blob by uploading only those blocks that have changed, then committing the new and existing
+     * blocks together. Any blocks not specified in the block list and permanently deleted.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-block-list
+     *
+     * @param blocks -  Array of 64-byte value that is base64-encoded
+     * @param options - Options to the Block Blob Commit Block List operation.
+     * @returns Response data for the Block Blob Commit Block List operation.
+     */
+    async commitBlockList(blocks, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks }, {
+                abortSignal: options.abortSignal,
+                blobHttpHeaders: options.blobHTTPHeaders,
+                leaseAccessConditions: options.conditions,
+                metadata: options.metadata,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
+                immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
+                legalHold: options.legalHold,
+                tier: toAccessTier(options.tier),
+                blobTagsString: toBlobTagsString(options.tags),
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Returns the list of blocks that have been uploaded as part of a block blob
+     * using the specified block list filter.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-block-list
+     *
+     * @param listType - Specifies whether to return the list of committed blocks,
+     *                                        the list of uncommitted blocks, or both lists together.
+     * @param options - Options to the Block Blob Get Block List operation.
+     * @returns Response data for the Block Blob Get Block List operation.
+     */
+    async getBlockList(listType, options = {}) {
+        return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => {
+            const res = utils_common_assertResponse(await this.blockBlobContext.getBlockList(listType, {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            if (!res.committedBlocks) {
+                res.committedBlocks = [];
+            }
+            if (!res.uncommittedBlocks) {
+                res.uncommittedBlocks = [];
+            }
+            return res;
+        });
+    }
+    // High level functions
+    /**
+     * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob.
+     *
+     * When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
+     * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
+     * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
+     * to commit the block list.
+     *
+     * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is
+     * `blobContentType`, enabling the browser to provide
+     * functionality based on file type.
+     *
+     * @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView
+     * @param options -
+     */
+    async uploadData(data, options = {}) {
+        return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => {
+            if (esm_isNodeLike) {
+                let buffer;
+                if (data instanceof Buffer) {
+                    buffer = data;
+                }
+                else if (data instanceof ArrayBuffer) {
+                    buffer = Buffer.from(data);
+                }
+                else {
+                    data = data;
+                    buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
+                }
+                return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions);
+            }
+            else {
+                const browserBlob = new Blob([data]);
+                return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
+            }
+        });
     }
-    charAt(n) {
-        return this.buffer[this.pos + n];
+    /**
+     * ONLY AVAILABLE IN BROWSERS.
+     *
+     * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob.
+     *
+     * When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.
+     * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call
+     * {@link commitBlockList} to commit the block list.
+     *
+     * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is
+     * `blobContentType`, enabling the browser to provide
+     * functionality based on file type.
+     *
+     * @deprecated Use {@link uploadData} instead.
+     *
+     * @param browserData - Blob, File, ArrayBuffer or ArrayBufferView
+     * @param options - Options to upload browser data.
+     * @returns Response data for the Blob Upload operation.
+     */
+    async uploadBrowserData(browserData, options = {}) {
+        return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => {
+            const browserBlob = new Blob([browserData]);
+            return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
+        });
     }
-    continueScalar(offset) {
-        let ch = this.buffer[offset];
-        if (this.indentNext > 0) {
-            let indent = 0;
-            while (ch === ' ')
-                ch = this.buffer[++indent + offset];
-            if (ch === '\r') {
-                const next = this.buffer[indent + offset + 1];
-                if (next === '\n' || (!next && !this.atEnd))
-                    return offset + indent + 1;
-            }
-            return ch === '\n' || indent >= this.indentNext || (!ch && !this.atEnd)
-                ? offset + indent
-                : -1;
+    /**
+     *
+     * Uploads data to block blob. Requires a bodyFactory as the data source,
+     * which need to return a {@link HttpRequestBody} object with the offset and size provided.
+     *
+     * When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
+     * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
+     * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
+     * to commit the block list.
+     *
+     * @param bodyFactory -
+     * @param size - size of the data to upload.
+     * @param options - Options to Upload to Block Blob operation.
+     * @returns Response data for the Blob Upload operation.
+     */
+    async uploadSeekableInternal(bodyFactory, size, options = {}) {
+        let blockSize = options.blockSize ?? 0;
+        if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
+            throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`);
         }
-        if (ch === '-' || ch === '.') {
-            const dt = this.buffer.substr(offset, 3);
-            if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3]))
-                return -1;
+        const maxSingleShotSize = options.maxSingleShotSize ?? BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;
+        if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) {
+            throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`);
         }
-        return offset;
-    }
-    getLine() {
-        let end = this.lineEndPos;
-        if (typeof end !== 'number' || (end !== -1 && end < this.pos)) {
-            end = this.buffer.indexOf('\n', this.pos);
-            this.lineEndPos = end;
+        if (blockSize === 0) {
+            if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) {
+                throw new RangeError(`${size} is too larger to upload to a block blob.`);
+            }
+            if (size > maxSingleShotSize) {
+                blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS);
+                if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) {
+                    blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;
+                }
+            }
         }
-        if (end === -1)
-            return this.atEnd ? this.buffer.substring(this.pos) : null;
-        if (this.buffer[end - 1] === '\r')
-            end -= 1;
-        return this.buffer.substring(this.pos, end);
-    }
-    hasChars(n) {
-        return this.pos + n <= this.buffer.length;
-    }
-    setNext(state) {
-        this.buffer = this.buffer.substring(this.pos);
-        this.pos = 0;
-        this.lineEndPos = null;
-        this.next = state;
-        return null;
+        if (!options.blobHTTPHeaders) {
+            options.blobHTTPHeaders = {};
+        }
+        if (!options.conditions) {
+            options.conditions = {};
+        }
+        return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => {
+            if (size <= maxSingleShotSize) {
+                return utils_common_assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions));
+            }
+            const numBlocks = Math.floor((size - 1) / blockSize) + 1;
+            if (numBlocks > BLOCK_BLOB_MAX_BLOCKS) {
+                throw new RangeError(`The buffer's size is too big or the BlockSize is too small;` +
+                    `the number of blocks must be <= ${BLOCK_BLOB_MAX_BLOCKS}`);
+            }
+            const blockList = [];
+            const blockIDPrefix = esm_randomUUID();
+            let transferProgress = 0;
+            const batch = new Batch(options.concurrency);
+            for (let i = 0; i < numBlocks; i++) {
+                batch.addOperation(async () => {
+                    const blockID = utils_common_generateBlockID(blockIDPrefix, i);
+                    const start = blockSize * i;
+                    const end = i === numBlocks - 1 ? size : start + blockSize;
+                    const contentLength = end - start;
+                    blockList.push(blockID);
+                    await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, {
+                        abortSignal: options.abortSignal,
+                        conditions: options.conditions,
+                        encryptionScope: options.encryptionScope,
+                        tracingOptions: updatedOptions.tracingOptions,
+                        contentChecksumAlgorithm: options.contentChecksumAlgorithm,
+                    });
+                    // Update progress after block is successfully uploaded to server, in case of block trying
+                    // TODO: Hook with convenience layer progress event in finer level
+                    transferProgress += contentLength;
+                    if (options.onProgress) {
+                        options.onProgress({
+                            loadedBytes: transferProgress,
+                        });
+                    }
+                });
+            }
+            await batch.do();
+            return this.commitBlockList(blockList, updatedOptions);
+        });
     }
-    peek(n) {
-        return this.buffer.substr(this.pos, n);
+    /**
+     * ONLY AVAILABLE IN NODE.JS RUNTIME.
+     *
+     * Uploads a local file in blocks to a block blob.
+     *
+     * When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.
+     * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList
+     * to commit the block list.
+     *
+     * @param filePath - Full path of local file
+     * @param options - Options to Upload to Block Blob operation.
+     * @returns Response data for the Blob Upload operation.
+     */
+    async uploadFile(filePath, options = {}) {
+        return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => {
+            const size = (await fsStat(filePath)).size;
+            return this.uploadSeekableInternal((offset, count) => {
+                return () => fsCreateReadStream(filePath, {
+                    autoClose: true,
+                    end: count ? offset + count - 1 : Infinity,
+                    start: offset,
+                });
+            }, size, {
+                ...options,
+                tracingOptions: updatedOptions.tracingOptions,
+            });
+        });
     }
-    *parseNext(next) {
-        switch (next) {
-            case 'stream':
-                return yield* this.parseStream();
-            case 'line-start':
-                return yield* this.parseLineStart();
-            case 'block-start':
-                return yield* this.parseBlockStart();
-            case 'doc':
-                return yield* this.parseDocument();
-            case 'flow':
-                return yield* this.parseFlowCollection();
-            case 'quoted-scalar':
-                return yield* this.parseQuotedScalar();
-            case 'block-scalar':
-                return yield* this.parseBlockScalar();
-            case 'plain-scalar':
-                return yield* this.parsePlainScalar();
-        }
+    /**
+     * ONLY AVAILABLE IN NODE.JS RUNTIME.
+     *
+     * Uploads a Node.js Readable stream into block blob.
+     *
+     * PERFORMANCE IMPROVEMENT TIPS:
+     * * Input stream highWaterMark is better to set a same value with bufferSize
+     *    parameter, which will avoid Buffer.concat() operations.
+     *
+     * @param stream - Node.js Readable stream
+     * @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB
+     * @param maxConcurrency -  Max concurrency indicates the max number of buffers that can be allocated,
+     *                                 positive correlation with max uploading concurrency. Default value is 5
+     * @param options - Options to Upload Stream to Block Blob operation.
+     * @returns Response data for the Blob Upload operation.
+     */
+    async uploadStream(stream, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) {
+        if (!options.blobHTTPHeaders) {
+            options.blobHTTPHeaders = {};
+        }
+        if (!options.conditions) {
+            options.conditions = {};
+        }
+        return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => {
+            let blockNum = 0;
+            const blockIDPrefix = esm_randomUUID();
+            let transferProgress = 0;
+            const blockList = [];
+            const scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, async (body, length) => {
+                const blockID = utils_common_generateBlockID(blockIDPrefix, blockNum);
+                blockList.push(blockID);
+                blockNum++;
+                await this.stageBlock(blockID, body, length, {
+                    customerProvidedKey: options.customerProvidedKey,
+                    conditions: options.conditions,
+                    encryptionScope: options.encryptionScope,
+                    tracingOptions: updatedOptions.tracingOptions,
+                    contentChecksumAlgorithm: options.contentChecksumAlgorithm,
+                });
+                // Update progress after block is successfully uploaded to server, in case of block trying
+                transferProgress += length;
+                if (options.onProgress) {
+                    options.onProgress({ loadedBytes: transferProgress });
+                }
+            }, 
+            // concurrency should set a smaller value than maxConcurrency, which is helpful to
+            // reduce the possibility when a outgoing handler waits for stream data, in
+            // this situation, outgoing handlers are blocked.
+            // Outgoing queue shouldn't be empty.
+            Math.ceil((maxConcurrency / 4) * 3));
+            await scheduler.do();
+            return utils_common_assertResponse(await this.commitBlockList(blockList, {
+                ...options,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
-    *parseStream() {
-        let line = this.getLine();
-        if (line === null)
-            return this.setNext('stream');
-        if (line[0] === cst.BOM) {
-            yield* this.pushCount(1);
-            line = line.substring(1);
-        }
-        if (line[0] === '%') {
-            let dirEnd = line.length;
-            let cs = line.indexOf('#');
-            while (cs !== -1) {
-                const ch = line[cs - 1];
-                if (ch === ' ' || ch === '\t') {
-                    dirEnd = cs - 1;
-                    break;
+}
+/**
+ * PageBlobClient defines a set of operations applicable to page blobs.
+ */
+class PageBlobClient extends BlobClient {
+    /**
+     * pageBlobsContext provided by protocol layer.
+     */
+    pageBlobContext;
+    constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
+        //   super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
+        let pipeline;
+        let url;
+        options = options || {};
+        if (isPipelineLike(credentialOrPipelineOrContainerName)) {
+            // (url: string, pipeline: Pipeline)
+            url = urlOrConnectionString;
+            pipeline = credentialOrPipelineOrContainerName;
+            options = blobNameOrOptions;
+        }
+        else if ((esm_isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
+            credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
+            isTokenCredential(credentialOrPipelineOrContainerName)) {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            url = urlOrConnectionString;
+            options = blobNameOrOptions;
+            pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
+        }
+        else if (!credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName !== "string") {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            // The second parameter is undefined. Use anonymous credential.
+            url = urlOrConnectionString;
+            options = blobNameOrOptions;
+            pipeline = newPipeline(new AnonymousCredential(), options);
+        }
+        else if (credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName === "string" &&
+            blobNameOrOptions &&
+            typeof blobNameOrOptions === "string") {
+            // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
+            const containerName = credentialOrPipelineOrContainerName;
+            const blobName = blobNameOrOptions;
+            const extractedCreds = utils_common_extractConnectionStringParts(urlOrConnectionString);
+            if (extractedCreds.kind === "AccountConnString") {
+                if (esm_isNodeLike) {
+                    const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
+                    url = utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
+                    if (!options.proxyOptions) {
+                        options.proxyOptions = proxyPolicy_getDefaultProxySettings(extractedCreds.proxyUri);
+                    }
+                    pipeline = newPipeline(sharedKeyCredential, options);
                 }
                 else {
-                    cs = line.indexOf('#', cs + 1);
+                    throw new Error("Account connection string is only supported in Node.js environment");
                 }
             }
-            while (true) {
-                const ch = line[dirEnd - 1];
-                if (ch === ' ' || ch === '\t')
-                    dirEnd -= 1;
-                else
-                    break;
+            else if (extractedCreds.kind === "SASConnString") {
+                url =
+                    utils_common_appendToURLPath(utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
+                        "?" +
+                        extractedCreds.accountSas;
+                pipeline = newPipeline(new AnonymousCredential(), options);
+            }
+            else {
+                throw new Error("Connection string must be either an Account connection string or a SAS connection string");
             }
-            const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
-            yield* this.pushCount(line.length - n); // possible comment
-            this.pushNewline();
-            return 'stream';
         }
-        if (this.atLineEnd()) {
-            const sp = yield* this.pushSpaces(true);
-            yield* this.pushCount(line.length - sp);
-            yield* this.pushNewline();
-            return 'stream';
+        else {
+            throw new Error("Expecting non-empty strings for containerName and blobName parameters");
         }
-        yield cst.DOCUMENT;
-        return yield* this.parseLineStart();
+        super(url, pipeline);
+        this.pageBlobContext = this.storageClientContext.pageBlob;
+        this.blobClientConfig = options;
     }
-    *parseLineStart() {
-        const ch = this.charAt(0);
-        if (!ch && !this.atEnd)
-            return this.setNext('line-start');
-        if (ch === '-' || ch === '.') {
-            if (!this.atEnd && !this.hasChars(4))
-                return this.setNext('line-start');
-            const s = this.peek(3);
-            if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {
-                yield* this.pushCount(3);
-                this.indentValue = 0;
-                this.indentNext = 0;
-                return s === '---' ? 'doc' : 'stream';
+    /**
+     * Creates a new PageBlobClient object identical to the source but with the
+     * specified snapshot timestamp.
+     * Provide "" will remove the snapshot and return a Client to the base blob.
+     *
+     * @param snapshot - The snapshot timestamp.
+     * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp.
+     */
+    withSnapshot(snapshot) {
+        return new PageBlobClient(utils_common_setURLParameter(this.url, utils_constants_URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Creates a page blob of the specified length. Call uploadPages to upload data
+     * data to a page blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
+     *
+     * @param size - size of the page blob.
+     * @param options - Options to the Page Blob Create operation.
+     * @returns Response data for the Page Blob Create operation.
+     */
+    async create(size, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.create(0, size, {
+                abortSignal: options.abortSignal,
+                blobHttpHeaders: options.blobHTTPHeaders,
+                blobSequenceNumber: options.blobSequenceNumber,
+                leaseAccessConditions: options.conditions,
+                metadata: options.metadata,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
+                immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
+                legalHold: options.legalHold,
+                tier: toAccessTier(options.tier),
+                blobTagsString: toBlobTagsString(options.tags),
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Creates a page blob of the specified length. Call uploadPages to upload data
+     * data to a page blob. If the blob with the same name already exists, the content
+     * of the existing blob will remain unchanged.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
+     *
+     * @param size - size of the page blob.
+     * @param options -
+     */
+    async createIfNotExists(size, options = {}) {
+        return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => {
+            try {
+                const conditions = { ifNoneMatch: ETagAny };
+                const res = utils_common_assertResponse(await this.create(size, {
+                    ...options,
+                    conditions,
+                    tracingOptions: updatedOptions.tracingOptions,
+                }));
+                return {
+                    succeeded: true,
+                    ...res,
+                    _response: res._response, // _response is made non-enumerable
+                };
             }
-        }
-        this.indentValue = yield* this.pushSpaces(false);
-        if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))
-            this.indentNext = this.indentValue;
-        return yield* this.parseBlockStart();
+            catch (e) {
+                if (e.details?.errorCode === "BlobAlreadyExists") {
+                    return {
+                        succeeded: false,
+                        ...e.response?.parsedHeaders,
+                        _response: e.response,
+                    };
+                }
+                throw e;
+            }
+        });
     }
-    *parseBlockStart() {
-        const [ch0, ch1] = this.peek(2);
-        if (!ch1 && !this.atEnd)
-            return this.setNext('block-start');
-        if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) {
-            const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
-            this.indentNext = this.indentValue + 1;
-            this.indentValue += n;
-            return 'block-start';
+    /**
+     * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-page
+     *
+     * @param body - Data to upload
+     * @param offset - Offset of destination page blob
+     * @param count - Content length of the body, also number of bytes to be uploaded
+     * @param options - Options to the Page Blob Upload Pages operation.
+     * @returns Response data for the Page Blob Upload Pages operation.
+     */
+    async uploadPages(body, offset, count, options = {}) {
+        options.conditions = options.conditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => {
+            const parameters = {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                requestOptions: {
+                    onUploadProgress: options.onProgress,
+                },
+                range: rangeToString({ offset, count }),
+                sequenceNumberAccessConditions: options.conditions,
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                tracingOptions: updatedOptions.tracingOptions,
+            };
+            const uploadBodyParameters = await setUploadChecksumParameters(body, count, parameters, options, this.blobClientConfig?.uploadContentChecksumAlgorithm);
+            return utils_common_assertResponse(await this.pageBlobContext.uploadPages(uploadBodyParameters.contentLength, uploadBodyParameters.body, parameters));
+        });
+    }
+    /**
+     * The Upload Pages operation writes a range of pages to a page blob where the
+     * contents are read from a URL.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-page-from-url
+     *
+     * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication
+     * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob
+     * @param destOffset - Offset of destination page blob
+     * @param count - Number of bytes to be uploaded from source page blob
+     * @param options -
+     */
+    async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) {
+        options.conditions = options.conditions || {};
+        options.sourceConditions = options.sourceConditions || {};
+        ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
+        return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), {
+                abortSignal: options.abortSignal,
+                sourceContentMD5: options.sourceContentMD5,
+                sourceContentCrc64: options.sourceContentCrc64,
+                leaseAccessConditions: options.conditions,
+                sequenceNumberAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                sourceModifiedAccessConditions: {
+                    sourceIfMatch: options.sourceConditions?.ifMatch,
+                    sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
+                    sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
+                    sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
+                },
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                copySourceAuthorization: utils_common_httpAuthorizationToString(options.sourceAuthorization),
+                fileRequestIntent: options.sourceShareTokenIntent,
+                tracingOptions: updatedOptions.tracingOptions,
+                sourceCpkInfo: {
+                    sourceEncryptionKey: options.sourceCustomerProvidedKey?.encryptionKey,
+                    sourceEncryptionAlgorithm: options.sourceCustomerProvidedKey?.encryptionAlgorithm,
+                    sourceEncryptionKeySha256: options.sourceCustomerProvidedKey?.encryptionKeySha256,
+                },
+            }));
+        });
+    }
+    /**
+     * Frees the specified pages from the page blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-page
+     *
+     * @param offset - Starting byte position of the pages to clear.
+     * @param count - Number of bytes to clear.
+     * @param options - Options to the Page Blob Clear Pages operation.
+     * @returns Response data for the Page Blob Clear Pages operation.
+     */
+    async clearPages(offset = 0, count, options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.clearPages(0, {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                range: rangeToString({ offset, count }),
+                sequenceNumberAccessConditions: options.conditions,
+                cpkInfo: options.customerProvidedKey,
+                encryptionScope: options.encryptionScope,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Returns the list of valid page ranges for a page blob or snapshot of a page blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param options - Options to the Page Blob Get Ranges operation.
+     * @returns Response data for the Page Blob Get Ranges operation.
+     */
+    async getPageRanges(offset = 0, count, options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.pageBlobContext.getPageRanges({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                range: rangeToString({ offset, count }),
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            return rangeResponseFromModel(response);
+        });
+    }
+    /**
+     * getPageRangesSegment returns a single segment of page ranges starting from the
+     * specified Marker. Use an empty Marker to start enumeration from the beginning.
+     * After getting a segment, process it, and then call getPageRangesSegment again
+     * (passing the the previously-returned Marker) to get the next segment.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
+     * @param options - Options to PageBlob Get Page Ranges Segment operation.
+     */
+    async listPageRangesSegment(offset = 0, count, marker, options = {}) {
+        return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.getPageRanges({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                range: rangeToString({ offset, count }),
+                marker: marker,
+                maxPageSize: options.maxPageSize,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel}
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param marker - A string value that identifies the portion of
+     *                          the get of page ranges to be returned with the next getting operation. The
+     *                          operation returns the ContinuationToken value within the response body if the
+     *                          getting operation did not return all page ranges remaining within the current page.
+     *                          The ContinuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of get
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to List Page Ranges operation.
+     */
+    async *listPageRangeItemSegments(offset = 0, count, marker, options = {}) {
+        let getPageRangeItemSegmentsResponse;
+        if (!!marker || marker === undefined) {
+            do {
+                getPageRangeItemSegmentsResponse = await this.listPageRangesSegment(offset, count, marker, options);
+                marker = getPageRangeItemSegmentsResponse.continuationToken;
+                yield await getPageRangeItemSegmentsResponse;
+            } while (marker);
         }
-        return 'doc';
     }
-    *parseDocument() {
-        yield* this.pushSpaces(true);
-        const line = this.getLine();
-        if (line === null)
-            return this.setNext('doc');
-        let n = yield* this.pushIndicators();
-        switch (line[n]) {
-            case '#':
-                yield* this.pushCount(line.length - n);
-            // fallthrough
-            case undefined:
-                yield* this.pushNewline();
-                return yield* this.parseLineStart();
-            case '{':
-            case '[':
-                yield* this.pushCount(1);
-                this.flowKey = false;
-                this.flowLevel = 1;
-                return 'flow';
-            case '}':
-            case ']':
-                // this is an error
-                yield* this.pushCount(1);
-                return 'doc';
-            case '*':
-                yield* this.pushUntil(isNotAnchorChar);
-                return 'doc';
-            case '"':
-            case "'":
-                return yield* this.parseQuotedScalar();
-            case '|':
-            case '>':
-                n += yield* this.parseBlockScalarHeader();
-                n += yield* this.pushSpaces(true);
-                yield* this.pushCount(line.length - n);
-                yield* this.pushNewline();
-                return yield* this.parseBlockScalar();
-            default:
-                return yield* this.parsePlainScalar();
+    /**
+     * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param options - Options to List Page Ranges operation.
+     */
+    async *listPageRangeItems(offset = 0, count, options = {}) {
+        let marker;
+        for await (const getPageRangesSegment of this.listPageRangeItemSegments(offset, count, marker, options)) {
+            yield* ExtractPageRangeInfoItems(getPageRangesSegment);
         }
     }
-    *parseFlowCollection() {
-        let nl, sp;
-        let indent = -1;
-        do {
-            nl = yield* this.pushNewline();
-            if (nl > 0) {
-                sp = yield* this.pushSpaces(false);
-                this.indentValue = indent = sp;
-            }
-            else {
-                sp = 0;
-            }
-            sp += yield* this.pushSpaces(true);
-        } while (nl + sp > 0);
-        const line = this.getLine();
-        if (line === null)
-            return this.setNext('flow');
-        if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') ||
-            (indent === 0 &&
-                (line.startsWith('---') || line.startsWith('...')) &&
-                isEmpty(line[3]))) {
-            // Allowing for the terminal ] or } at the same (rather than greater)
-            // indent level as the initial [ or { is technically invalid, but
-            // failing here would be surprising to users.
-            const atFlowEndMarker = indent === this.indentNext - 1 &&
-                this.flowLevel === 1 &&
-                (line[0] === ']' || line[0] === '}');
-            if (!atFlowEndMarker) {
-                // this is an error
-                this.flowLevel = 0;
-                yield cst.FLOW_END;
-                return yield* this.parseLineStart();
-            }
+    /**
+     * Returns an async iterable iterator to list of page ranges for a page blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
+     *
+     *  .byPage() returns an async iterable iterator to list of page ranges for a page blob.
+     *
+     * ```ts snippet:ClientsListPageBlobs
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const pageBlobClient = containerClient.getPageBlobClient(blobName);
+     *
+     * // Example using `for await` syntax
+     * let i = 1;
+     * for await (const pageRange of pageBlobClient.listPageRanges()) {
+     *   console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     * }
+     *
+     * // Example using `iter.next()` syntax
+     * i = 1;
+     * const iter = pageBlobClient.listPageRanges();
+     * let { value, done } = await iter.next();
+     * while (!done) {
+     *   console.log(`Page range ${i++}: ${value.start} - ${value.end}`);
+     *   ({ value, done } = await iter.next());
+     * }
+     *
+     * // Example using `byPage()` syntax
+     * i = 1;
+     * for await (const page of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) {
+     *   for (const pageRange of page.pageRange || []) {
+     *     console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     *   }
+     * }
+     *
+     * // Example using paging with a marker
+     * i = 1;
+     * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 });
+     * let response = (await iterator.next()).value;
+     * // Prints 2 page ranges
+     * if (response.pageRange) {
+     *   for (const pageRange of response.pageRange) {
+     *     console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     *   }
+     * }
+     * // Gets next marker
+     * let marker = response.continuationToken;
+     * // Passing next marker as continuationToken
+     * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 });
+     * response = (await iterator.next()).value;
+     * // Prints 10 page ranges
+     * if (response.pageRange) {
+     *   for (const pageRange of response.pageRange) {
+     *     console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     *   }
+     * }
+     * ```
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param options - Options to the Page Blob Get Ranges operation.
+     * @returns An asyncIterableIterator that supports paging.
+     */
+    listPageRanges(offset = 0, count, options = {}) {
+        options.conditions = options.conditions || {};
+        // AsyncIterableIterator to iterate over blobs
+        const iter = this.listPageRangeItems(offset, count, options);
+        return {
+            /**
+             * The next method, part of the iteration protocol
+             */
+            next() {
+                return iter.next();
+            },
+            /**
+             * The connection to the async iterator, part of the iteration protocol
+             */
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            /**
+             * Return an AsyncIterableIterator that works a page at a time
+             */
+            byPage: (settings = {}) => {
+                return this.listPageRangeItemSegments(offset, count, settings.continuationToken, {
+                    maxPageSize: settings.maxPageSize,
+                    ...options,
+                });
+            },
+        };
+    }
+    /**
+     * Gets the collection of page ranges that differ between a specified snapshot and this page blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
+     *
+     * @param offset - Starting byte position of the page blob
+     * @param count - Number of bytes to get ranges diff.
+     * @param prevSnapshot - Timestamp of snapshot to retrieve the difference.
+     * @param options - Options to the Page Blob Get Page Ranges Diff operation.
+     * @returns Response data for the Page Blob Get Page Range Diff operation.
+     */
+    async getPageRangesDiff(offset, count, prevSnapshot, options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => {
+            const result = utils_common_assertResponse(await this.pageBlobContext.getPageRangesDiff({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                prevsnapshot: prevSnapshot,
+                range: rangeToString({ offset, count }),
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            return rangeResponseFromModel(result);
+        });
+    }
+    /**
+     * getPageRangesDiffSegment returns a single segment of page ranges starting from the
+     * specified Marker for difference between previous snapshot and the target page blob.
+     * Use an empty Marker to start enumeration from the beginning.
+     * After getting a segment, process it, and then call getPageRangesDiffSegment again
+     * (passing the the previously-returned Marker) to get the next segment.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
+     * @param marker - A string value that identifies the portion of the get to be returned with the next get operation.
+     * @param options - Options to the Page Blob Get Page Ranges Diff operation.
+     */
+    async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options = {}) {
+        return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.getPageRangesDiff({
+                abortSignal: options?.abortSignal,
+                leaseAccessConditions: options?.conditions,
+                modifiedAccessConditions: {
+                    ...options?.conditions,
+                    ifTags: options?.conditions?.tagConditions,
+                },
+                prevsnapshot: prevSnapshotOrUrl,
+                range: rangeToString({
+                    offset: offset,
+                    count: count,
+                }),
+                marker: marker,
+                maxPageSize: options?.maxPageSize,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel}
+     *
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
+     * @param marker - A string value that identifies the portion of
+     *                          the get of page ranges to be returned with the next getting operation. The
+     *                          operation returns the ContinuationToken value within the response body if the
+     *                          getting operation did not return all page ranges remaining within the current page.
+     *                          The ContinuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of get
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to the Page Blob Get Page Ranges Diff operation.
+     */
+    async *listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) {
+        let getPageRangeItemSegmentsResponse;
+        if (!!marker || marker === undefined) {
+            do {
+                getPageRangeItemSegmentsResponse = await this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options);
+                marker = getPageRangeItemSegmentsResponse.continuationToken;
+                yield await getPageRangeItemSegmentsResponse;
+            } while (marker);
         }
-        let n = 0;
-        while (line[n] === ',') {
-            n += yield* this.pushCount(1);
-            n += yield* this.pushSpaces(true);
-            this.flowKey = false;
+    }
+    /**
+     * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
+     * @param options - Options to the Page Blob Get Page Ranges Diff operation.
+     */
+    async *listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) {
+        let marker;
+        for await (const getPageRangesSegment of this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)) {
+            yield* ExtractPageRangeInfoItems(getPageRangesSegment);
         }
-        n += yield* this.pushIndicators();
-        switch (line[n]) {
-            case undefined:
-                return 'flow';
-            case '#':
-                yield* this.pushCount(line.length - n);
-                return 'flow';
-            case '{':
-            case '[':
-                yield* this.pushCount(1);
-                this.flowKey = false;
-                this.flowLevel += 1;
-                return 'flow';
-            case '}':
-            case ']':
-                yield* this.pushCount(1);
-                this.flowKey = true;
-                this.flowLevel -= 1;
-                return this.flowLevel ? 'flow' : 'doc';
-            case '*':
-                yield* this.pushUntil(isNotAnchorChar);
-                return 'flow';
-            case '"':
-            case "'":
-                this.flowKey = true;
-                return yield* this.parseQuotedScalar();
-            case ':': {
-                const next = this.charAt(1);
-                if (this.flowKey || isEmpty(next) || next === ',') {
-                    this.flowKey = false;
-                    yield* this.pushCount(1);
-                    yield* this.pushSpaces(true);
-                    return 'flow';
+    }
+    /**
+     * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
+     *
+     *  .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
+     *
+     * ```ts snippet:ClientsListPageBlobsDiff
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const pageBlobClient = containerClient.getPageBlobClient(blobName);
+     *
+     * const offset = 0;
+     * const count = 1024;
+     * const previousSnapshot = "";
+     * // Example using `for await` syntax
+     * let i = 1;
+     * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) {
+     *   console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     * }
+     *
+     * // Example using `iter.next()` syntax
+     * i = 1;
+     * const iter = pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot);
+     * let { value, done } = await iter.next();
+     * while (!done) {
+     *   console.log(`Page range ${i++}: ${value.start} - ${value.end}`);
+     *   ({ value, done } = await iter.next());
+     * }
+     *
+     * // Example using `byPage()` syntax
+     * i = 1;
+     * for await (const page of pageBlobClient
+     *   .listPageRangesDiff(offset, count, previousSnapshot)
+     *   .byPage({ maxPageSize: 20 })) {
+     *   for (const pageRange of page.pageRange || []) {
+     *     console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     *   }
+     * }
+     *
+     * // Example using paging with a marker
+     * i = 1;
+     * let iterator = pageBlobClient
+     *   .listPageRangesDiff(offset, count, previousSnapshot)
+     *   .byPage({ maxPageSize: 2 });
+     * let response = (await iterator.next()).value;
+     * // Prints 2 page ranges
+     * if (response.pageRange) {
+     *   for (const pageRange of response.pageRange) {
+     *     console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     *   }
+     * }
+     * // Gets next marker
+     * let marker = response.continuationToken;
+     * // Passing next marker as continuationToken
+     * iterator = pageBlobClient
+     *   .listPageRangesDiff(offset, count, previousSnapshot)
+     *   .byPage({ continuationToken: marker, maxPageSize: 10 });
+     * response = (await iterator.next()).value;
+     * // Prints 10 page ranges
+     * if (response.pageRange) {
+     *   for (const pageRange of response.pageRange) {
+     *     console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
+     *   }
+     * }
+     * ```
+     *
+     * @param offset - Starting byte position of the page ranges.
+     * @param count - Number of bytes to get.
+     * @param prevSnapshot - Timestamp of snapshot to retrieve the difference.
+     * @param options - Options to the Page Blob Get Ranges operation.
+     * @returns An asyncIterableIterator that supports paging.
+     */
+    listPageRangesDiff(offset, count, prevSnapshot, options = {}) {
+        options.conditions = options.conditions || {};
+        // AsyncIterableIterator to iterate over blobs
+        const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, {
+            ...options,
+        });
+        return {
+            /**
+             * The next method, part of the iteration protocol
+             */
+            next() {
+                return iter.next();
+            },
+            /**
+             * The connection to the async iterator, part of the iteration protocol
+             */
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            /**
+             * Return an AsyncIterableIterator that works a page at a time
+             */
+            byPage: (settings = {}) => {
+                return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, {
+                    maxPageSize: settings.maxPageSize,
+                    ...options,
+                });
+            },
+        };
+    }
+    /**
+     * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
+     *
+     * @param offset - Starting byte position of the page blob
+     * @param count - Number of bytes to get ranges diff.
+     * @param prevSnapshotUrl - URL of snapshot to retrieve the difference.
+     * @param options - Options to the Page Blob Get Page Ranges Diff operation.
+     * @returns Response data for the Page Blob Get Page Range Diff operation.
+     */
+    async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.pageBlobContext.getPageRangesDiff({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                prevSnapshotUrl,
+                range: rangeToString({ offset, count }),
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            return rangeResponseFromModel(response);
+        });
+    }
+    /**
+     * Resizes the page blob to the specified size (which must be a multiple of 512).
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
+     *
+     * @param size - Target size
+     * @param options - Options to the Page Blob Resize operation.
+     * @returns Response data for the Page Blob Resize operation.
+     */
+    async resize(size, options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.resize(size, {
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                encryptionScope: options.encryptionScope,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Sets a page blob's sequence number.
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
+     *
+     * @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number.
+     * @param sequenceNumber - Required if sequenceNumberAction is max or update
+     * @param options - Options to the Page Blob Update Sequence Number operation.
+     * @returns Response data for the Page Blob Update Sequence Number operation.
+     */
+    async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, {
+                abortSignal: options.abortSignal,
+                blobSequenceNumber: sequenceNumber,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob.
+     * The snapshot is copied such that only the differential changes between the previously
+     * copied snapshot are transferred to the destination.
+     * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual.
+     * @see https://learn.microsoft.com/rest/api/storageservices/incremental-copy-blob
+     * @see https://learn.microsoft.com/azure/virtual-machines/windows/incremental-snapshots
+     *
+     * @param copySource - Specifies the name of the source page blob snapshot. For example,
+     *                            https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=
+     * @param options - Options to the Page Blob Copy Incremental operation.
+     * @returns Response data for the Page Blob Copy Incremental operation.
+     */
+    async startCopyIncremental(copySource, options = {}) {
+        return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.pageBlobContext.copyIncremental(copySource, {
+                abortSignal: options.abortSignal,
+                modifiedAccessConditions: {
+                    ...options.conditions,
+                    ifTags: options.conditions?.tagConditions,
+                },
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+}
+//# sourceMappingURL=Clients.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BatchUtils.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+async function getBodyAsText(batchResponse) {
+    let buffer = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES);
+    const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer);
+    // Slice the buffer to trim the empty ending.
+    buffer = buffer.slice(0, responseLength);
+    return buffer.toString();
+}
+function utf8ByteLength(str) {
+    return Buffer.byteLength(str);
+}
+//# sourceMappingURL=BatchUtils.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BatchResponseParser.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+const HTTP_HEADER_DELIMITER = ": ";
+const SPACE_DELIMITER = " ";
+const NOT_FOUND = -1;
+/**
+ * Util class for parsing batch response.
+ */
+class BatchResponseParser {
+    batchResponse;
+    responseBatchBoundary;
+    perResponsePrefix;
+    batchResponseEnding;
+    subRequests;
+    constructor(batchResponse, subRequests) {
+        if (!batchResponse || !batchResponse.contentType) {
+            // In special case(reported), server may return invalid content-type which could not be parsed.
+            throw new RangeError("batchResponse is malformed or doesn't contain valid content-type.");
+        }
+        if (!subRequests || subRequests.size === 0) {
+            // This should be prevent during coding.
+            throw new RangeError("Invalid state: subRequests is not provided or size is 0.");
+        }
+        this.batchResponse = batchResponse;
+        this.subRequests = subRequests;
+        this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1];
+        this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`;
+        this.batchResponseEnding = `--${this.responseBatchBoundary}--`;
+    }
+    // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response
+    async parseBatchResponse() {
+        // When logic reach here, suppose batch request has already succeeded with 202, so we can further parse
+        // sub request's response.
+        if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) {
+            throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`);
+        }
+        const responseBodyAsText = await getBodyAsText(this.batchResponse);
+        const subResponses = responseBodyAsText
+            .split(this.batchResponseEnding)[0] // string after ending is useless
+            .split(this.perResponsePrefix)
+            .slice(1); // string before first response boundary is useless
+        const subResponseCount = subResponses.length;
+        // Defensive coding in case of potential error parsing.
+        // Note: subResponseCount == 1 is special case where sub request is invalid.
+        // We try to prevent such cases through early validation, e.g. validate sub request count >= 1.
+        // While in unexpected sub request invalid case, we allow sub response to be parsed and return to user.
+        if (subResponseCount !== this.subRequests.size && subResponseCount !== 1) {
+            throw new Error("Invalid state: sub responses' count is not equal to sub requests' count.");
+        }
+        const deserializedSubResponses = new Array(subResponseCount);
+        let subResponsesSucceededCount = 0;
+        let subResponsesFailedCount = 0;
+        // Parse sub subResponses.
+        for (let index = 0; index < subResponseCount; index++) {
+            const subResponse = subResponses[index];
+            const deserializedSubResponse = {};
+            deserializedSubResponse.headers = toHttpHeadersLike(esm_httpHeaders_createHttpHeaders());
+            const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`);
+            let subRespHeaderStartFound = false;
+            let subRespHeaderEndFound = false;
+            let subRespFailed = false;
+            let contentId = NOT_FOUND;
+            for (const responseLine of responseLines) {
+                if (!subRespHeaderStartFound) {
+                    // Convention line to indicate content ID
+                    if (responseLine.startsWith(utils_constants_HeaderConstants.CONTENT_ID)) {
+                        contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]);
+                    }
+                    // Http version line with status code indicates the start of sub request's response.
+                    // Example: HTTP/1.1 202 Accepted
+                    if (responseLine.startsWith(HTTP_VERSION_1_1)) {
+                        subRespHeaderStartFound = true;
+                        const tokens = responseLine.split(SPACE_DELIMITER);
+                        deserializedSubResponse.status = parseInt(tokens[1]);
+                        deserializedSubResponse.statusMessage = tokens.slice(2).join(SPACE_DELIMITER);
+                    }
+                    continue; // Skip convention headers not specifically for sub request i.e. Content-Type: application/http and Content-ID: *
+                }
+                if (responseLine.trim() === "") {
+                    // Sub response's header start line already found, and the first empty line indicates header end line found.
+                    if (!subRespHeaderEndFound) {
+                        subRespHeaderEndFound = true;
+                    }
+                    continue; // Skip empty line
                 }
+                // Note: when code reach here, it indicates subRespHeaderStartFound == true
+                if (!subRespHeaderEndFound) {
+                    if (responseLine.indexOf(HTTP_HEADER_DELIMITER) === -1) {
+                        // Defensive coding to prevent from missing valuable lines.
+                        throw new Error(`Invalid state: find non-empty line '${responseLine}' without HTTP header delimiter '${HTTP_HEADER_DELIMITER}'.`);
+                    }
+                    // Parse headers of sub response.
+                    const tokens = responseLine.split(HTTP_HEADER_DELIMITER);
+                    deserializedSubResponse.headers.set(tokens[0], tokens[1]);
+                    if (tokens[0] === utils_constants_HeaderConstants.X_MS_ERROR_CODE) {
+                        deserializedSubResponse.errorCode = tokens[1];
+                        subRespFailed = true;
+                    }
+                }
+                else {
+                    // Assemble body of sub response.
+                    if (!deserializedSubResponse.bodyAsText) {
+                        deserializedSubResponse.bodyAsText = "";
+                    }
+                    deserializedSubResponse.bodyAsText += responseLine;
+                }
+            } // Inner for end
+            // The response will contain the Content-ID header for each corresponding subrequest response to use for tracking.
+            // The Content-IDs are set to a valid index in the subrequests we sent. In the status code 202 path, we could expect it
+            // to be 1-1 mapping from the [0, subRequests.size) to the Content-IDs returned. If not, we simply don't return that
+            // unexpected subResponse in the parsed reponse and we can always look it up in the raw response for debugging purpose.
+            if (contentId !== NOT_FOUND &&
+                Number.isInteger(contentId) &&
+                contentId >= 0 &&
+                contentId < this.subRequests.size &&
+                deserializedSubResponses[contentId] === undefined) {
+                deserializedSubResponse._request = this.subRequests.get(contentId);
+                deserializedSubResponses[contentId] = deserializedSubResponse;
+            }
+            else {
+                storage_blob_dist_esm_log_logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`);
+            }
+            if (subRespFailed) {
+                subResponsesFailedCount++;
+            }
+            else {
+                subResponsesSucceededCount++;
             }
-            // fallthrough
-            default:
-                this.flowKey = false;
-                return yield* this.parsePlainScalar();
         }
+        return {
+            subResponses: deserializedSubResponses,
+            subResponsesSucceededCount: subResponsesSucceededCount,
+            subResponsesFailedCount: subResponsesFailedCount,
+        };
     }
-    *parseQuotedScalar() {
-        const quote = this.charAt(0);
-        let end = this.buffer.indexOf(quote, this.pos + 1);
-        if (quote === "'") {
-            while (end !== -1 && this.buffer[end + 1] === "'")
-                end = this.buffer.indexOf("'", end + 2);
-        }
-        else {
-            // double-quote
-            while (end !== -1) {
-                let n = 0;
-                while (this.buffer[end - 1 - n] === '\\')
-                    n += 1;
-                if (n % 2 === 0)
-                    break;
-                end = this.buffer.indexOf('"', end + 1);
+}
+//# sourceMappingURL=BatchResponseParser.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/utils/Mutex.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+var MutexLockStatus;
+(function (MutexLockStatus) {
+    MutexLockStatus[MutexLockStatus["LOCKED"] = 0] = "LOCKED";
+    MutexLockStatus[MutexLockStatus["UNLOCKED"] = 1] = "UNLOCKED";
+})(MutexLockStatus || (MutexLockStatus = {}));
+/**
+ * An async mutex lock.
+ */
+class Mutex {
+    /**
+     * Lock for a specific key. If the lock has been acquired by another customer, then
+     * will wait until getting the lock.
+     *
+     * @param key - lock key
+     */
+    static async lock(key) {
+        return new Promise((resolve) => {
+            if (this.keys[key] === undefined || this.keys[key] === MutexLockStatus.UNLOCKED) {
+                this.keys[key] = MutexLockStatus.LOCKED;
+                resolve();
             }
-        }
-        // Only looking for newlines within the quotes
-        const qb = this.buffer.substring(0, end);
-        let nl = qb.indexOf('\n', this.pos);
-        if (nl !== -1) {
-            while (nl !== -1) {
-                const cs = this.continueScalar(nl + 1);
-                if (cs === -1)
-                    break;
-                nl = qb.indexOf('\n', cs);
+            else {
+                this.onUnlockEvent(key, () => {
+                    this.keys[key] = MutexLockStatus.LOCKED;
+                    resolve();
+                });
             }
-            if (nl !== -1) {
-                // this is an error caused by an unexpected unindent
-                end = nl - (qb[nl - 1] === '\r' ? 2 : 1);
+        });
+    }
+    /**
+     * Unlock a key.
+     *
+     * @param key -
+     */
+    static async unlock(key) {
+        return new Promise((resolve) => {
+            if (this.keys[key] === MutexLockStatus.LOCKED) {
+                this.emitUnlockEvent(key);
             }
+            delete this.keys[key];
+            resolve();
+        });
+    }
+    static keys = {};
+    static listeners = {};
+    static onUnlockEvent(key, handler) {
+        if (this.listeners[key] === undefined) {
+            this.listeners[key] = [handler];
         }
-        if (end === -1) {
-            if (!this.atEnd)
-                return this.setNext('quoted-scalar');
-            end = this.buffer.length;
+        else {
+            this.listeners[key].push(handler);
         }
-        yield* this.pushToIndex(end + 1, false);
-        return this.flowLevel ? 'flow' : 'doc';
     }
-    *parseBlockScalarHeader() {
-        this.blockScalarIndent = -1;
-        this.blockScalarKeep = false;
-        let i = this.pos;
-        while (true) {
-            const ch = this.buffer[++i];
-            if (ch === '+')
-                this.blockScalarKeep = true;
-            else if (ch > '0' && ch <= '9')
-                this.blockScalarIndent = Number(ch) - 1;
-            else if (ch !== '-')
-                break;
+    static emitUnlockEvent(key) {
+        if (this.listeners[key] !== undefined && this.listeners[key].length > 0) {
+            const handler = this.listeners[key].shift();
+            setImmediate(() => {
+                handler.call(this);
+            });
         }
-        return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#');
     }
-    *parseBlockScalar() {
-        let nl = this.pos - 1; // may be -1 if this.pos === 0
-        let indent = 0;
-        let ch;
-        loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) {
-            switch (ch) {
-                case ' ':
-                    indent += 1;
-                    break;
-                case '\n':
-                    nl = i;
-                    indent = 0;
-                    break;
-                case '\r': {
-                    const next = this.buffer[i + 1];
-                    if (!next && !this.atEnd)
-                        return this.setNext('block-scalar');
-                    if (next === '\n')
-                        break;
-                } // fallthrough
-                default:
-                    break loop;
-            }
+}
+//# sourceMappingURL=Mutex.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BlobBatch.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+
+
+
+
+
+
+
+/**
+ * A BlobBatch represents an aggregated set of operations on blobs.
+ * Currently, only `delete` and `setAccessTier` are supported.
+ */
+class BlobBatch {
+    batchRequest;
+    batch = "batch";
+    batchType;
+    constructor() {
+        this.batchRequest = new InnerBatchRequest();
+    }
+    /**
+     * Get the value of Content-Type for a batch request.
+     * The value must be multipart/mixed with a batch boundary.
+     * Example: multipart/mixed; boundary=batch_a81786c8-e301-4e42-a729-a32ca24ae252
+     */
+    getMultiPartContentType() {
+        return this.batchRequest.getMultipartContentType();
+    }
+    /**
+     * Get assembled HTTP request body for sub requests.
+     */
+    getHttpRequestBody() {
+        return this.batchRequest.getHttpRequestBody();
+    }
+    /**
+     * Get sub requests that are added into the batch request.
+     */
+    getSubRequests() {
+        return this.batchRequest.getSubRequests();
+    }
+    async addSubRequestInternal(subRequest, assembleSubRequestFunc) {
+        await Mutex.lock(this.batch);
+        try {
+            this.batchRequest.preAddSubRequest(subRequest);
+            await assembleSubRequestFunc();
+            this.batchRequest.postAddSubRequest(subRequest);
         }
-        if (!ch && !this.atEnd)
-            return this.setNext('block-scalar');
-        if (indent >= this.indentNext) {
-            if (this.blockScalarIndent === -1)
-                this.indentNext = indent;
-            else {
-                this.indentNext =
-                    this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
-            }
-            do {
-                const cs = this.continueScalar(nl + 1);
-                if (cs === -1)
-                    break;
-                nl = this.buffer.indexOf('\n', cs);
-            } while (nl !== -1);
-            if (nl === -1) {
-                if (!this.atEnd)
-                    return this.setNext('block-scalar');
-                nl = this.buffer.length;
-            }
+        finally {
+            await Mutex.unlock(this.batch);
         }
-        // Trailing insufficiently indented tabs are invalid.
-        // To catch that during parsing, we include them in the block scalar value.
-        let i = nl + 1;
-        ch = this.buffer[i];
-        while (ch === ' ')
-            ch = this.buffer[++i];
-        if (ch === '\t') {
-            while (ch === '\t' || ch === ' ' || ch === '\r' || ch === '\n')
-                ch = this.buffer[++i];
-            nl = i - 1;
+    }
+    setBatchType(batchType) {
+        if (!this.batchType) {
+            this.batchType = batchType;
         }
-        else if (!this.blockScalarKeep) {
-            do {
-                let i = nl - 1;
-                let ch = this.buffer[i];
-                if (ch === '\r')
-                    ch = this.buffer[--i];
-                const lastChar = i; // Drop the line if last char not more indented
-                while (ch === ' ')
-                    ch = this.buffer[--i];
-                if (ch === '\n' && i >= this.pos && i + 1 + indent > lastChar)
-                    nl = i;
-                else
-                    break;
-            } while (true);
+        if (this.batchType !== batchType) {
+            throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`);
         }
-        yield cst.SCALAR;
-        yield* this.pushToIndex(nl + 1, true);
-        return yield* this.parseLineStart();
     }
-    *parsePlainScalar() {
-        const inFlow = this.flowLevel > 0;
-        let end = this.pos - 1;
-        let i = this.pos - 1;
-        let ch;
-        while ((ch = this.buffer[++i])) {
-            if (ch === ':') {
-                const next = this.buffer[i + 1];
-                if (isEmpty(next) || (inFlow && flowIndicatorChars.has(next)))
-                    break;
-                end = i;
-            }
-            else if (isEmpty(ch)) {
-                let next = this.buffer[i + 1];
-                if (ch === '\r') {
-                    if (next === '\n') {
-                        i += 1;
-                        ch = '\n';
-                        next = this.buffer[i + 1];
-                    }
-                    else
-                        end = i;
-                }
-                if (next === '#' || (inFlow && flowIndicatorChars.has(next)))
-                    break;
-                if (ch === '\n') {
-                    const cs = this.continueScalar(i + 1);
-                    if (cs === -1)
-                        break;
-                    i = Math.max(i, cs - 2); // to advance, but still account for ' #'
-                }
-            }
-            else {
-                if (inFlow && flowIndicatorChars.has(ch))
-                    break;
-                end = i;
-            }
+    async deleteBlob(urlOrBlobClient, credentialOrOptions, options) {
+        let url;
+        let credential;
+        if (typeof urlOrBlobClient === "string" &&
+            ((esm_isNodeLike && credentialOrOptions instanceof StorageSharedKeyCredential) ||
+                credentialOrOptions instanceof AnonymousCredential ||
+                isTokenCredential(credentialOrOptions))) {
+            // First overload
+            url = urlOrBlobClient;
+            credential = credentialOrOptions;
         }
-        if (!ch && !this.atEnd)
-            return this.setNext('plain-scalar');
-        yield cst.SCALAR;
-        yield* this.pushToIndex(end + 1, true);
-        return inFlow ? 'flow' : 'doc';
-    }
-    *pushCount(n) {
-        if (n > 0) {
-            yield this.buffer.substr(this.pos, n);
-            this.pos += n;
-            return n;
+        else if (urlOrBlobClient instanceof BlobClient) {
+            // Second overload
+            url = urlOrBlobClient.url;
+            credential = urlOrBlobClient.credential;
+            options = credentialOrOptions;
         }
-        return 0;
+        else {
+            throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided.");
+        }
+        if (!options) {
+            options = {};
+        }
+        return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => {
+            this.setBatchType("delete");
+            await this.addSubRequestInternal({
+                url: url,
+                credential: credential,
+            }, async () => {
+                await new BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions);
+            });
+        });
     }
-    *pushToIndex(i, allowEmpty) {
-        const s = this.buffer.slice(this.pos, i);
-        if (s) {
-            yield s;
-            this.pos += s.length;
-            return s.length;
+    async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) {
+        let url;
+        let credential;
+        let tier;
+        if (typeof urlOrBlobClient === "string" &&
+            ((esm_isNodeLike && credentialOrTier instanceof StorageSharedKeyCredential) ||
+                credentialOrTier instanceof AnonymousCredential ||
+                isTokenCredential(credentialOrTier))) {
+            // First overload
+            url = urlOrBlobClient;
+            credential = credentialOrTier;
+            tier = tierOrOptions;
+        }
+        else if (urlOrBlobClient instanceof BlobClient) {
+            // Second overload
+            url = urlOrBlobClient.url;
+            credential = urlOrBlobClient.credential;
+            tier = credentialOrTier;
+            options = tierOrOptions;
         }
-        else if (allowEmpty)
-            yield '';
-        return 0;
+        else {
+            throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided.");
+        }
+        if (!options) {
+            options = {};
+        }
+        return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => {
+            this.setBatchType("setAccessTier");
+            await this.addSubRequestInternal({
+                url: url,
+                credential: credential,
+            }, async () => {
+                await new BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions);
+            });
+        });
     }
-    *pushIndicators() {
-        let n = 0;
-        loop: while (true) {
-            switch (this.charAt(0)) {
-                case '!':
-                    n += yield* this.pushTag();
-                    n += yield* this.pushSpaces(true);
-                    continue loop;
-                case '&':
-                    n += yield* this.pushUntil(isNotAnchorChar);
-                    n += yield* this.pushSpaces(true);
-                    continue loop;
-                case '-': // this is an error
-                case '?': // this is an error outside flow collections
-                case ':': {
-                    const inFlow = this.flowLevel > 0;
-                    const ch1 = this.charAt(1);
-                    if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
-                        if (!inFlow)
-                            this.indentNext = this.indentValue + 1;
-                        else if (this.flowKey)
-                            this.flowKey = false;
-                        n += yield* this.pushCount(1);
-                        n += yield* this.pushSpaces(true);
-                        continue loop;
-                    }
+}
+/**
+ * Inner batch request class which is responsible for assembling and serializing sub requests.
+ * See https://learn.microsoft.com/rest/api/storageservices/blob-batch#request-body for how requests are assembled.
+ */
+class InnerBatchRequest {
+    operationCount;
+    body;
+    subRequests;
+    boundary;
+    subRequestPrefix;
+    multipartContentType;
+    batchRequestEnding;
+    constructor() {
+        this.operationCount = 0;
+        this.body = "";
+        const tempGuid = esm_randomUUID();
+        // batch_{batchid}
+        this.boundary = `batch_${tempGuid}`;
+        // --batch_{batchid}
+        // Content-Type: application/http
+        // Content-Transfer-Encoding: binary
+        this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${utils_constants_HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${utils_constants_HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`;
+        // multipart/mixed; boundary=batch_{batchid}
+        this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`;
+        // --batch_{batchid}--
+        this.batchRequestEnding = `--${this.boundary}--`;
+        this.subRequests = new Map();
+    }
+    /**
+     * Create pipeline to assemble sub requests. The idea here is to use existing
+     * credential and serialization/deserialization components, with additional policies to
+     * filter unnecessary headers, assemble sub requests into request's body
+     * and intercept request from going to wire.
+     * @param credential -  Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
+     */
+    createPipeline(credential) {
+        const corePipeline = esm_pipeline_createEmptyPipeline();
+        corePipeline.addPolicy(serializationPolicy({
+            stringifyXML: stringifyXML,
+            serializerOptions: {
+                xml: {
+                    xmlCharKey: "#",
+                },
+            },
+        }), { phase: "Serialize" });
+        // Use batch header filter policy to exclude unnecessary headers
+        corePipeline.addPolicy(batchHeaderFilterPolicy());
+        // Use batch assemble policy to assemble request and intercept request from going to wire
+        corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" });
+        if (isTokenCredential(credential)) {
+            corePipeline.addPolicy(bearerTokenAuthenticationPolicy({
+                credential,
+                scopes: StorageOAuthScopes,
+                challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },
+            }), { phase: "Sign" });
+        }
+        else if (credential instanceof StorageSharedKeyCredential) {
+            corePipeline.addPolicy(storageSharedKeyCredentialPolicy({
+                accountName: credential.accountName,
+                accountKey: credential.accountKey,
+            }), { phase: "Sign" });
+        }
+        const pipeline = new Pipeline([]);
+        // attach the v2 pipeline to this one
+        pipeline._credential = credential;
+        pipeline._corePipeline = corePipeline;
+        return pipeline;
+    }
+    appendSubRequestToBody(request) {
+        // Start to assemble sub request
+        this.body += [
+            this.subRequestPrefix, // sub request constant prefix
+            `${utils_constants_HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID
+            "", // empty line after sub request's content ID
+            `${request.method.toString()} ${utils_common_getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}`, // sub request start line with method
+        ].join(HTTP_LINE_ENDING);
+        for (const [name, value] of request.headers) {
+            this.body += `${name}: ${value}${HTTP_LINE_ENDING}`;
+        }
+        this.body += HTTP_LINE_ENDING; // sub request's headers need be ending with an empty line
+        // No body to assemble for current batch request support
+        // End to assemble sub request
+    }
+    preAddSubRequest(subRequest) {
+        if (this.operationCount >= BATCH_MAX_REQUEST) {
+            throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`);
+        }
+        // Fast fail if url for sub request is invalid
+        const path = utils_common_getURLPath(subRequest.url);
+        if (!path || path === "") {
+            throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`);
+        }
+    }
+    postAddSubRequest(subRequest) {
+        this.subRequests.set(this.operationCount, subRequest);
+        this.operationCount++;
+    }
+    // Return the http request body with assembling the ending line to the sub request body.
+    getHttpRequestBody() {
+        return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`;
+    }
+    getMultipartContentType() {
+        return this.multipartContentType;
+    }
+    getSubRequests() {
+        return this.subRequests;
+    }
+}
+function batchRequestAssemblePolicy(batchRequest) {
+    return {
+        name: "batchRequestAssemblePolicy",
+        async sendRequest(request) {
+            batchRequest.appendSubRequestToBody(request);
+            return {
+                request,
+                status: 200,
+                headers: esm_httpHeaders_createHttpHeaders(),
+            };
+        },
+    };
+}
+function batchHeaderFilterPolicy() {
+    return {
+        name: "batchHeaderFilterPolicy",
+        async sendRequest(request, next) {
+            let xMsHeaderName = "";
+            for (const [name] of request.headers) {
+                if (utils_common_iEqual(name, utils_constants_HeaderConstants.X_MS_VERSION)) {
+                    xMsHeaderName = name;
                 }
             }
-            break loop;
+            if (xMsHeaderName !== "") {
+                request.headers.delete(xMsHeaderName); // The subrequests should not have the x-ms-version header.
+            }
+            return next(request);
+        },
+    };
+}
+//# sourceMappingURL=BlobBatch.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BlobBatchClient.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+
+
+/**
+ * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.
+ *
+ * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
+ */
+class BlobBatchClient {
+    serviceOrContainerContext;
+    constructor(url, credentialOrPipeline, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        let pipeline;
+        if (isPipelineLike(credentialOrPipeline)) {
+            pipeline = credentialOrPipeline;
+        }
+        else if (!credentialOrPipeline) {
+            // no credential provided
+            pipeline = newPipeline(new AnonymousCredential(), options);
         }
-        return n;
-    }
-    *pushTag() {
-        if (this.charAt(1) === '<') {
-            let i = this.pos + 2;
-            let ch = this.buffer[i];
-            while (!isEmpty(ch) && ch !== '>')
-                ch = this.buffer[++i];
-            return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false);
+        else {
+            pipeline = newPipeline(credentialOrPipeline, options);
+        }
+        const storageClientContext = new StorageContextClient(url, getCoreClientOptions(pipeline));
+        const path = utils_common_getURLPath(url);
+        if (path && path !== "/") {
+            // Container scoped.
+            this.serviceOrContainerContext = storageClientContext.container;
         }
         else {
-            let i = this.pos + 1;
-            let ch = this.buffer[i];
-            while (ch) {
-                if (tagChars.has(ch))
-                    ch = this.buffer[++i];
-                else if (ch === '%' &&
-                    hexDigits.has(this.buffer[i + 1]) &&
-                    hexDigits.has(this.buffer[i + 2])) {
-                    ch = this.buffer[(i += 3)];
-                }
-                else
-                    break;
-            }
-            return yield* this.pushToIndex(i, false);
+            this.serviceOrContainerContext = storageClientContext.service;
         }
     }
-    *pushNewline() {
-        const ch = this.buffer[this.pos];
-        if (ch === '\n')
-            return yield* this.pushCount(1);
-        else if (ch === '\r' && this.charAt(1) === '\n')
-            return yield* this.pushCount(2);
-        else
-            return 0;
+    /**
+     * Creates a {@link BlobBatch}.
+     * A BlobBatch represents an aggregated set of operations on blobs.
+     */
+    createBatch() {
+        return new BlobBatch();
     }
-    *pushSpaces(allowTabs) {
-        let i = this.pos - 1;
-        let ch;
-        do {
-            ch = this.buffer[++i];
-        } while (ch === ' ' || (allowTabs && ch === '\t'));
-        const n = i - this.pos;
-        if (n > 0) {
-            yield this.buffer.substr(this.pos, n);
-            this.pos = i;
+    async deleteBlobs(urlsOrBlobClients, credentialOrOptions, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        const batch = new BlobBatch();
+        for (const urlOrBlobClient of urlsOrBlobClients) {
+            if (typeof urlOrBlobClient === "string") {
+                await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options);
+            }
+            else {
+                await batch.deleteBlob(urlOrBlobClient, credentialOrOptions);
+            }
         }
-        return n;
+        return this.submitBatch(batch);
     }
-    *pushUntil(test) {
-        let i = this.pos;
-        let ch = this.buffer[i];
-        while (!test(ch))
-            ch = this.buffer[++i];
-        return yield* this.pushToIndex(i, false);
+    async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        const batch = new BlobBatch();
+        for (const urlOrBlobClient of urlsOrBlobClients) {
+            if (typeof urlOrBlobClient === "string") {
+                await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options);
+            }
+            else {
+                await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions);
+            }
+        }
+        return this.submitBatch(batch);
+    }
+    /**
+     * Submit batch request which consists of multiple subrequests.
+     *
+     * Get `blobBatchClient` and other details before running the snippets.
+     * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient`
+     *
+     * Example usage:
+     *
+     * ```ts snippet:BlobBatchClientSubmitBatch
+     * import { DefaultAzureCredential } from "@azure/identity";
+     * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob";
+     *
+     * const account = "";
+     * const credential = new DefaultAzureCredential();
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   credential,
+     * );
+     *
+     * const containerName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blobBatchClient = containerClient.getBlobBatchClient();
+     *
+     * const batchRequest = new BlobBatch();
+     * await batchRequest.deleteBlob("", credential);
+     * await batchRequest.deleteBlob("", credential, {
+     *   deleteSnapshots: "include",
+     * });
+     * const batchResp = await blobBatchClient.submitBatch(batchRequest);
+     * console.log(batchResp.subResponsesSucceededCount);
+     * ```
+     *
+     * Example using a lease:
+     *
+     * ```ts snippet:BlobBatchClientSubmitBatchWithLease
+     * import { DefaultAzureCredential } from "@azure/identity";
+     * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob";
+     *
+     * const account = "";
+     * const credential = new DefaultAzureCredential();
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   credential,
+     * );
+     *
+     * const containerName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blobBatchClient = containerClient.getBlobBatchClient();
+     * const blobClient = containerClient.getBlobClient("");
+     *
+     * const batchRequest = new BlobBatch();
+     * await batchRequest.setBlobAccessTier(blobClient, "Cool");
+     * await batchRequest.setBlobAccessTier(blobClient, "Cool", {
+     *   conditions: { leaseId: "" },
+     * });
+     * const batchResp = await blobBatchClient.submitBatch(batchRequest);
+     * console.log(batchResp.subResponsesSucceededCount);
+     * ```
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
+     *
+     * @param batchRequest - A set of Delete or SetTier operations.
+     * @param options -
+     */
+    async submitBatch(batchRequest, options = {}) {
+        if (!batchRequest || batchRequest.getSubRequests().size === 0) {
+            throw new RangeError("Batch request should contain one or more sub requests.");
+        }
+        return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => {
+            const batchRequestBody = batchRequest.getHttpRequestBody();
+            // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.
+            const rawBatchResponse = utils_common_assertResponse((await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, {
+                ...updatedOptions,
+            })));
+            // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).
+            const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests());
+            const responseSummary = await batchResponseParser.parseBatchResponse();
+            const res = {
+                _response: rawBatchResponse._response,
+                contentType: rawBatchResponse.contentType,
+                errorCode: rawBatchResponse.errorCode,
+                requestId: rawBatchResponse.requestId,
+                clientRequestId: rawBatchResponse.clientRequestId,
+                version: rawBatchResponse.version,
+                subResponses: responseSummary.subResponses,
+                subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,
+                subResponsesFailedCount: responseSummary.subResponsesFailedCount,
+            };
+            return res;
+        });
     }
 }
+//# sourceMappingURL=BlobBatchClient.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/ContainerClient.js
+
+
+
+
+
 
-exports.Lexer = Lexer;
 
 
-/***/ }),
 
-/***/ 66628:
-/***/ ((__unused_webpack_module, exports) => {
 
-"use strict";
 
 
 /**
- * Tracks newlines during parsing in order to provide an efficient API for
- * determining the one-indexed `{ line, col }` position for any offset
- * within the input.
+ * A ContainerClient represents a URL to the Azure Storage container allowing you to manipulate its blobs.
  */
-class LineCounter {
-    constructor() {
-        this.lineStarts = [];
-        /**
-         * Should be called in ascending order. Otherwise, call
-         * `lineCounter.lineStarts.sort()` before calling `linePos()`.
-         */
-        this.addNewLine = (offset) => this.lineStarts.push(offset);
-        /**
-         * Performs a binary search and returns the 1-indexed { line, col }
-         * position of `offset`. If `line === 0`, `addNewLine` has never been
-         * called or `offset` is before the first known newline.
-         */
-        this.linePos = (offset) => {
-            let low = 0;
-            let high = this.lineStarts.length;
-            while (low < high) {
-                const mid = (low + high) >> 1; // Math.floor((low + high) / 2)
-                if (this.lineStarts[mid] < offset)
-                    low = mid + 1;
-                else
-                    high = mid;
+class ContainerClient extends StorageClient_StorageClient {
+    /**
+     * containerContext provided by protocol layer.
+     */
+    containerContext;
+    _containerName;
+    blobClientConfig;
+    /**
+     * The name of the container.
+     */
+    get containerName() {
+        return this._containerName;
+    }
+    constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        let pipeline;
+        let url;
+        options = options || {};
+        if (isPipelineLike(credentialOrPipelineOrContainerName)) {
+            // (url: string, pipeline: Pipeline, options?: BlobClientConfig)
+            url = urlOrConnectionString;
+            pipeline = credentialOrPipelineOrContainerName;
+        }
+        else if ((esm_isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
+            credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
+            isTokenCredential(credentialOrPipelineOrContainerName)) {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            url = urlOrConnectionString;
+            pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
+        }
+        else if (!credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName !== "string") {
+            // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
+            // The second parameter is undefined. Use anonymous credential.
+            url = urlOrConnectionString;
+            pipeline = newPipeline(new AnonymousCredential(), options);
+        }
+        else if (credentialOrPipelineOrContainerName &&
+            typeof credentialOrPipelineOrContainerName === "string") {
+            // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
+            const containerName = credentialOrPipelineOrContainerName;
+            const extractedCreds = utils_common_extractConnectionStringParts(urlOrConnectionString);
+            if (extractedCreds.kind === "AccountConnString") {
+                if (esm_isNodeLike) {
+                    const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
+                    url = utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName));
+                    if (!options.proxyOptions) {
+                        options.proxyOptions = proxyPolicy_getDefaultProxySettings(extractedCreds.proxyUri);
+                    }
+                    pipeline = newPipeline(sharedKeyCredential, options);
+                }
+                else {
+                    throw new Error("Account connection string is only supported in Node.js environment");
+                }
             }
-            if (this.lineStarts[low] === offset)
-                return { line: low + 1, col: 1 };
-            if (low === 0)
-                return { line: 0, col: offset };
-            const start = this.lineStarts[low - 1];
-            return { line: low, col: offset - start + 1 };
-        };
+            else if (extractedCreds.kind === "SASConnString") {
+                url =
+                    utils_common_appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) +
+                        "?" +
+                        extractedCreds.accountSas;
+                pipeline = newPipeline(new AnonymousCredential(), options);
+            }
+            else {
+                throw new Error("Connection string must be either an Account connection string or a SAS connection string");
+            }
+        }
+        else {
+            throw new Error("Expecting non-empty strings for containerName parameter");
+        }
+        super(url, pipeline);
+        this._containerName = this.getContainerNameFromUrl();
+        this.containerContext = this.storageClientContext.container;
+        this.blobClientConfig = options;
+    }
+    /**
+     * Creates a new container under the specified account. If the container with
+     * the same name already exists, the operation fails.
+     * @see https://learn.microsoft.com/rest/api/storageservices/create-container
+     * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
+     *
+     * @param options - Options to Container Create operation.
+     *
+     *
+     * Example usage:
+     *
+     * ```ts snippet:ContainerClientCreate
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const createContainerResponse = await containerClient.create();
+     * console.log("Container was created successfully", createContainerResponse.requestId);
+     * ```
+     */
+    async create(options = {}) {
+        return tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.containerContext.create(updatedOptions));
+        });
+    }
+    /**
+     * Creates a new container under the specified account. If the container with
+     * the same name already exists, it is not changed.
+     * @see https://learn.microsoft.com/rest/api/storageservices/create-container
+     * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
+     *
+     * @param options -
+     */
+    async createIfNotExists(options = {}) {
+        return tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => {
+            try {
+                const res = await this.create(updatedOptions);
+                return {
+                    succeeded: true,
+                    ...res,
+                    _response: res._response, // _response is made non-enumerable
+                };
+            }
+            catch (e) {
+                if (e.details?.errorCode === "ContainerAlreadyExists") {
+                    return {
+                        succeeded: false,
+                        ...e.response?.parsedHeaders,
+                        _response: e.response,
+                    };
+                }
+                else {
+                    throw e;
+                }
+            }
+        });
+    }
+    /**
+     * Returns true if the Azure container resource represented by this client exists; false otherwise.
+     *
+     * NOTE: use this function with care since an existing container might be deleted by other clients or
+     * applications. Vice versa new containers with the same name might be added by other clients or
+     * applications after this function completes.
+     *
+     * @param options -
+     */
+    async exists(options = {}) {
+        return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => {
+            try {
+                await this.getProperties({
+                    abortSignal: options.abortSignal,
+                    tracingOptions: updatedOptions.tracingOptions,
+                });
+                return true;
+            }
+            catch (e) {
+                if (e.statusCode === 404) {
+                    return false;
+                }
+                throw e;
+            }
+        });
+    }
+    /**
+     * Creates a {@link BlobClient}
+     *
+     * @param blobName - A blob name
+     * @returns A new BlobClient object for the given blob name.
+     */
+    getBlobClient(blobName) {
+        return new BlobClient(utils_common_appendToURLPath(this.url, utils_common_EscapePath(blobName)), this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Creates an {@link AppendBlobClient}
+     *
+     * @param blobName - An append blob name
+     */
+    getAppendBlobClient(blobName) {
+        return new AppendBlobClient(utils_common_appendToURLPath(this.url, utils_common_EscapePath(blobName)), this.pipeline, this.blobClientConfig);
     }
-}
-
-exports.LineCounter = LineCounter;
-
-
-/***/ }),
-
-/***/ 3456:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var node_process = __nccwpck_require__(932);
-var cst = __nccwpck_require__(3461);
-var lexer = __nccwpck_require__(40361);
-
-function includesToken(list, type) {
-    for (let i = 0; i < list.length; ++i)
-        if (list[i].type === type)
-            return true;
-    return false;
-}
-function findNonEmptyIndex(list) {
-    for (let i = 0; i < list.length; ++i) {
-        switch (list[i].type) {
-            case 'space':
-            case 'comment':
-            case 'newline':
-                break;
-            default:
-                return i;
-        }
+    /**
+     * Creates a {@link BlockBlobClient}
+     *
+     * @param blobName - A block blob name
+     *
+     *
+     * Example usage:
+     *
+     * ```ts snippet:ClientsUpload
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const blobName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     * const blockBlobClient = containerClient.getBlockBlobClient(blobName);
+     *
+     * const content = "Hello world!";
+     * const uploadBlobResponse = await blockBlobClient.upload(content, content.length);
+     * ```
+     */
+    getBlockBlobClient(blobName) {
+        return new BlockBlobClient(utils_common_appendToURLPath(this.url, utils_common_EscapePath(blobName)), this.pipeline, this.blobClientConfig);
     }
-    return -1;
-}
-function isFlowToken(token) {
-    switch (token?.type) {
-        case 'alias':
-        case 'scalar':
-        case 'single-quoted-scalar':
-        case 'double-quoted-scalar':
-        case 'flow-collection':
-            return true;
-        default:
-            return false;
+    /**
+     * Creates a {@link PageBlobClient}
+     *
+     * @param blobName - A page blob name
+     */
+    getPageBlobClient(blobName) {
+        return new PageBlobClient(utils_common_appendToURLPath(this.url, utils_common_EscapePath(blobName)), this.pipeline, this.blobClientConfig);
     }
-}
-function getPrevProps(parent) {
-    switch (parent.type) {
-        case 'document':
-            return parent.start;
-        case 'block-map': {
-            const it = parent.items[parent.items.length - 1];
-            return it.sep ?? it.start;
+    /**
+     * Returns all user-defined metadata and system properties for the specified
+     * container. The data returned does not include the container's list of blobs.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-container-properties
+     *
+     * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
+     * they originally contained uppercase characters. This differs from the metadata keys returned by
+     * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which
+     * will retain their original casing.
+     *
+     * @param options - Options to Container Get Properties operation.
+     */
+    async getProperties(options = {}) {
+        if (!options.conditions) {
+            options.conditions = {};
         }
-        case 'block-seq':
-            return parent.items[parent.items.length - 1].start;
-        /* istanbul ignore next should not happen */
-        default:
-            return [];
+        return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.containerContext.getProperties({
+                abortSignal: options.abortSignal,
+                ...options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
-}
-/** Note: May modify input array */
-function getFirstKeyStartProps(prev) {
-    if (prev.length === 0)
-        return [];
-    let i = prev.length;
-    loop: while (--i >= 0) {
-        switch (prev[i].type) {
-            case 'doc-start':
-            case 'explicit-key-ind':
-            case 'map-value-ind':
-            case 'seq-item-ind':
-            case 'newline':
-                break loop;
+    /**
+     * Marks the specified container for deletion. The container and any blobs
+     * contained within it are later deleted during garbage collection.
+     * @see https://learn.microsoft.com/rest/api/storageservices/delete-container
+     *
+     * @param options - Options to Container Delete operation.
+     */
+    async delete(options = {}) {
+        if (!options.conditions) {
+            options.conditions = {};
         }
+        return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.containerContext.delete({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
-    while (prev[++i]?.type === 'space') {
-        /* loop */
-    }
-    return prev.splice(i, prev.length);
-}
-function arrayPushArray(target, source) {
-    // May exhaust call stack with large `source` array
-    if (source.length < 1e5)
-        Array.prototype.push.apply(target, source);
-    else
-        for (let i = 0; i < source.length; ++i)
-            target.push(source[i]);
-}
-function fixFlowSeqItems(fc) {
-    if (fc.start.type === 'flow-seq-start') {
-        for (const it of fc.items) {
-            if (it.sep &&
-                !it.value &&
-                !includesToken(it.start, 'explicit-key-ind') &&
-                !includesToken(it.sep, 'map-value-ind')) {
-                if (it.key)
-                    it.value = it.key;
-                delete it.key;
-                if (isFlowToken(it.value)) {
-                    if (it.value.end)
-                        arrayPushArray(it.value.end, it.sep);
-                    else
-                        it.value.end = it.sep;
+    /**
+     * Marks the specified container for deletion if it exists. The container and any blobs
+     * contained within it are later deleted during garbage collection.
+     * @see https://learn.microsoft.com/rest/api/storageservices/delete-container
+     *
+     * @param options - Options to Container Delete operation.
+     */
+    async deleteIfExists(options = {}) {
+        return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => {
+            try {
+                const res = await this.delete(updatedOptions);
+                return {
+                    succeeded: true,
+                    ...res,
+                    _response: res._response,
+                };
+            }
+            catch (e) {
+                if (e.details?.errorCode === "ContainerNotFound") {
+                    return {
+                        succeeded: false,
+                        ...e.response?.parsedHeaders,
+                        _response: e.response,
+                    };
                 }
-                else
-                    arrayPushArray(it.start, it.sep);
-                delete it.sep;
+                throw e;
             }
+        });
+    }
+    /**
+     * Sets one or more user-defined name-value pairs for the specified container.
+     *
+     * If no option provided, or no metadata defined in the parameter, the container
+     * metadata will be removed.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata
+     *
+     * @param metadata - Replace existing metadata with this value.
+     *                            If no value provided the existing metadata will be removed.
+     * @param options - Options to Container Set Metadata operation.
+     */
+    async setMetadata(metadata, options = {}) {
+        if (!options.conditions) {
+            options.conditions = {};
+        }
+        if (options.conditions.ifUnmodifiedSince) {
+            throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service");
         }
+        return tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.containerContext.setMetadata({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                metadata,
+                modifiedAccessConditions: options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
-}
-/**
- * A YAML concrete syntax tree (CST) parser
- *
- * ```ts
- * const src: string = ...
- * for (const token of new Parser().parse(src)) {
- *   // token: Token
- * }
- * ```
- *
- * To use the parser with a user-provided lexer:
- *
- * ```ts
- * function* parse(source: string, lexer: Lexer) {
- *   const parser = new Parser()
- *   for (const lexeme of lexer.lex(source))
- *     yield* parser.next(lexeme)
- *   yield* parser.end()
- * }
- *
- * const src: string = ...
- * const lexer = new Lexer()
- * for (const token of parse(src, lexer)) {
- *   // token: Token
- * }
- * ```
- */
-class Parser {
     /**
-     * @param onNewLine - If defined, called separately with the start position of
-     *   each new line (in `parse()`, including the start of input).
+     * Gets the permissions for the specified container. The permissions indicate
+     * whether container data may be accessed publicly.
+     *
+     * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings.
+     * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl
+     *
+     * @param options - Options to Container Get Access Policy operation.
      */
-    constructor(onNewLine) {
-        /** If true, space and sequence indicators count as indentation */
-        this.atNewLine = true;
-        /** If true, next token is a scalar value */
-        this.atScalar = false;
-        /** Current indentation level */
-        this.indent = 0;
-        /** Current offset since the start of parsing */
-        this.offset = 0;
-        /** On the same line with a block map key */
-        this.onKeyLine = false;
-        /** Top indicates the node that's currently being built */
-        this.stack = [];
-        /** The source of the current token, set in parse() */
-        this.source = '';
-        /** The type of the current token, set in parse() */
-        this.type = '';
-        // Must be defined after `next()`
-        this.lexer = new lexer.Lexer();
-        this.onNewLine = onNewLine;
+    async getAccessPolicy(options = {}) {
+        if (!options.conditions) {
+            options.conditions = {};
+        }
+        return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.containerContext.getAccessPolicy({
+                abortSignal: options.abortSignal,
+                leaseAccessConditions: options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            const res = {
+                _response: response._response,
+                blobPublicAccess: response.blobPublicAccess,
+                date: response.date,
+                etag: response.etag,
+                errorCode: response.errorCode,
+                lastModified: response.lastModified,
+                requestId: response.requestId,
+                clientRequestId: response.clientRequestId,
+                signedIdentifiers: [],
+                version: response.version,
+            };
+            for (const identifier of response) {
+                let accessPolicy = undefined;
+                if (identifier.accessPolicy) {
+                    accessPolicy = {
+                        permissions: identifier.accessPolicy.permissions,
+                    };
+                    if (identifier.accessPolicy.expiresOn) {
+                        accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);
+                    }
+                    if (identifier.accessPolicy.startsOn) {
+                        accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);
+                    }
+                }
+                res.signedIdentifiers.push({
+                    accessPolicy,
+                    id: identifier.id,
+                });
+            }
+            return res;
+        });
     }
     /**
-     * Parse `source` as a YAML stream.
-     * If `incomplete`, a part of the last line may be left as a buffer for the next call.
+     * Sets the permissions for the specified container. The permissions indicate
+     * whether blobs in a container may be accessed publicly.
      *
-     * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.
+     * When you set permissions for a container, the existing permissions are replaced.
+     * If no access or containerAcl provided, the existing container ACL will be
+     * removed.
      *
-     * @returns A generator of tokens representing each directive, document, and other structure.
+     * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect.
+     * During this interval, a shared access signature that is associated with the stored access policy will
+     * fail with status code 403 (Forbidden), until the access policy becomes active.
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-container-acl
+     *
+     * @param access - The level of public access to data in the container.
+     * @param containerAcl - Array of elements each having a unique Id and details of the access policy.
+     * @param options - Options to Container Set Access Policy operation.
      */
-    *parse(source, incomplete = false) {
-        if (this.onNewLine && this.offset === 0)
-            this.onNewLine(0);
-        for (const lexeme of this.lexer.lex(source, incomplete))
-            yield* this.next(lexeme);
-        if (!incomplete)
-            yield* this.end();
+    async setAccessPolicy(access, containerAcl, options = {}) {
+        options.conditions = options.conditions || {};
+        return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => {
+            const acl = [];
+            for (const identifier of containerAcl || []) {
+                acl.push({
+                    accessPolicy: {
+                        expiresOn: identifier.accessPolicy.expiresOn
+                            ? utils_common_truncatedISO8061Date(identifier.accessPolicy.expiresOn)
+                            : "",
+                        permissions: identifier.accessPolicy.permissions,
+                        startsOn: identifier.accessPolicy.startsOn
+                            ? utils_common_truncatedISO8061Date(identifier.accessPolicy.startsOn)
+                            : "",
+                    },
+                    id: identifier.id,
+                });
+            }
+            return utils_common_assertResponse(await this.containerContext.setAccessPolicy({
+                abortSignal: options.abortSignal,
+                access,
+                containerAcl: acl,
+                leaseAccessConditions: options.conditions,
+                modifiedAccessConditions: options.conditions,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
     /**
-     * Advance the parser by the `source` of one lexical token.
+     * Get a {@link BlobLeaseClient} that manages leases on the container.
+     *
+     * @param proposeLeaseId - Initial proposed lease Id.
+     * @returns A new BlobLeaseClient object for managing leases on the container.
      */
-    *next(source) {
-        this.source = source;
-        if (node_process.env.LOG_TOKENS)
-            console.log('|', cst.prettyToken(source));
-        if (this.atScalar) {
-            this.atScalar = false;
-            yield* this.step();
-            this.offset += source.length;
-            return;
+    getBlobLeaseClient(proposeLeaseId) {
+        return new BlobLeaseClient(this, proposeLeaseId);
+    }
+    /**
+     * Creates a new block blob, or updates the content of an existing block blob.
+     *
+     * Updating an existing block blob overwrites any existing metadata on the blob.
+     * Partial updates are not supported; the content of the existing blob is
+     * overwritten with the new content. To perform a partial update of a block blob's,
+     * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}.
+     *
+     * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile},
+     * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better
+     * performance with concurrency uploading.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
+     *
+     * @param blobName - Name of the block blob to create or update.
+     * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function
+     *                               which returns a new Readable stream whose offset is from data source beginning.
+     * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
+     *                               string including non non-Base64/Hex-encoded characters.
+     * @param options - Options to configure the Block Blob Upload operation.
+     * @returns Block Blob upload response data and the corresponding BlockBlobClient instance.
+     */
+    async uploadBlockBlob(blobName, body, contentLength, options = {}) {
+        return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => {
+            const blockBlobClient = this.getBlockBlobClient(blobName);
+            const response = await blockBlobClient.upload(body, contentLength, updatedOptions);
+            return {
+                blockBlobClient,
+                response,
+            };
+        });
+    }
+    /**
+     * Marks the specified blob or snapshot for deletion. The blob is later deleted
+     * during garbage collection. Note that in order to delete a blob, you must delete
+     * all of its snapshots. You can delete both at the same time with the Delete
+     * Blob operation.
+     * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob
+     *
+     * @param blobName -
+     * @param options - Options to Blob Delete operation.
+     * @returns Block blob deletion response data.
+     */
+    async deleteBlob(blobName, options = {}) {
+        return tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => {
+            let blobClient = this.getBlobClient(blobName);
+            if (options.versionId) {
+                blobClient = blobClient.withVersion(options.versionId);
+            }
+            return blobClient.delete(updatedOptions);
+        });
+    }
+    /**
+     * listBlobFlatSegment returns a single segment of blobs starting from the
+     * specified Marker. Use an empty Marker to start enumeration from the beginning.
+     * After getting a segment, process it, and then call listBlobsFlatSegment again
+     * (passing the the previously-returned Marker) to get the next segment.
+     * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs
+     *
+     * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
+     * @param options - Options to Container List Blob Flat Segment operation.
+     */
+    async listBlobFlatSegment(marker, options = {}) {
+        return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.containerContext.listBlobFlatSegment({
+                marker,
+                ...options,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            const wrappedResponse = {
+                ...response,
+                _response: {
+                    ...response._response,
+                    parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody),
+                }, // _response is made non-enumerable
+                segment: {
+                    ...response.segment,
+                    blobItems: response.segment.blobItems.map((blobItemInternal) => {
+                        const blobItem = {
+                            ...blobItemInternal,
+                            name: BlobNameToString(blobItemInternal.name),
+                            tags: toTags(blobItemInternal.blobTags),
+                            objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata),
+                        };
+                        return blobItem;
+                    }),
+                },
+            };
+            return wrappedResponse;
+        });
+    }
+    /**
+     * listBlobHierarchySegment returns a single segment of blobs starting from
+     * the specified Marker. Use an empty Marker to start enumeration from the
+     * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment
+     * again (passing the the previously-returned Marker) to get the next segment.
+     * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs
+     *
+     * @param delimiter - The character or string used to define the virtual hierarchy
+     * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
+     * @param options - Options to Container List Blob Hierarchy Segment operation.
+     */
+    async listBlobHierarchySegment(delimiter, marker, options = {}) {
+        return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter, {
+                marker,
+                ...options,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            const wrappedResponse = {
+                ...response,
+                _response: {
+                    ...response._response,
+                    parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody),
+                }, // _response is made non-enumerable
+                segment: {
+                    ...response.segment,
+                    blobItems: response.segment.blobItems.map((blobItemInternal) => {
+                        const blobItem = {
+                            ...blobItemInternal,
+                            name: BlobNameToString(blobItemInternal.name),
+                            tags: toTags(blobItemInternal.blobTags),
+                            objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata),
+                        };
+                        return blobItem;
+                    }),
+                    blobPrefixes: response.segment.blobPrefixes?.map((blobPrefixInternal) => {
+                        const blobPrefix = {
+                            ...blobPrefixInternal,
+                            name: BlobNameToString(blobPrefixInternal.name),
+                        };
+                        return blobPrefix;
+                    }),
+                },
+            };
+            return wrappedResponse;
+        });
+    }
+    /**
+     * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse
+     *
+     * @param marker - A string value that identifies the portion of
+     *                          the list of blobs to be returned with the next listing operation. The
+     *                          operation returns the ContinuationToken value within the response body if the
+     *                          listing operation did not return all blobs remaining to be listed
+     *                          with the current page. The ContinuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of list
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to list blobs operation.
+     */
+    async *listSegments(marker, options = {}) {
+        let listBlobsFlatSegmentResponse;
+        if (!!marker || marker === undefined) {
+            do {
+                listBlobsFlatSegmentResponse = await this.listBlobFlatSegment(marker, options);
+                marker = listBlobsFlatSegmentResponse.continuationToken;
+                yield await listBlobsFlatSegmentResponse;
+            } while (marker);
         }
-        const type = cst.tokenType(source);
-        if (!type) {
-            const message = `Not a YAML token: ${source}`;
-            yield* this.pop({ type: 'error', offset: this.offset, message, source });
-            this.offset += source.length;
+    }
+    /**
+     * Returns an AsyncIterableIterator of {@link BlobItem} objects
+     *
+     * @param options - Options to list blobs operation.
+     */
+    async *listItems(options = {}) {
+        let marker;
+        for await (const listBlobsFlatSegmentResponse of this.listSegments(marker, options)) {
+            yield* listBlobsFlatSegmentResponse.segment.blobItems;
         }
-        else if (type === 'scalar') {
-            this.atNewLine = false;
-            this.atScalar = true;
-            this.type = 'scalar';
+    }
+    /**
+     * Returns an async iterable iterator to list all the blobs
+     * under the specified account.
+     *
+     * .byPage() returns an async iterable iterator to list the blobs in pages.
+     *
+     * ```ts snippet:ReadmeSampleListBlobs_Multiple
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     *
+     * // Example using `for await` syntax
+     * let i = 1;
+     * const blobs = containerClient.listBlobsFlat();
+     * for await (const blob of blobs) {
+     *   console.log(`Blob ${i++}: ${blob.name}`);
+     * }
+     *
+     * // Example using `iter.next()` syntax
+     * i = 1;
+     * const iter = containerClient.listBlobsFlat();
+     * let { value, done } = await iter.next();
+     * while (!done) {
+     *   console.log(`Blob ${i++}: ${value.name}`);
+     *   ({ value, done } = await iter.next());
+     * }
+     *
+     * // Example using `byPage()` syntax
+     * i = 1;
+     * for await (const page of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) {
+     *   for (const blob of page.segment.blobItems) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     *
+     * // Example using paging with a marker
+     * i = 1;
+     * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 });
+     * let response = (await iterator.next()).value;
+     * // Prints 2 blob names
+     * if (response.segment.blobItems) {
+     *   for (const blob of response.segment.blobItems) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     * // Gets next marker
+     * let marker = response.continuationToken;
+     * // Passing next marker as continuationToken
+     * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 });
+     * response = (await iterator.next()).value;
+     * // Prints 10 blob names
+     * if (response.segment.blobItems) {
+     *   for (const blob of response.segment.blobItems) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     * ```
+     *
+     * @param options - Options to list blobs.
+     * @returns An asyncIterableIterator that supports paging.
+     */
+    listBlobsFlat(options = {}) {
+        const include = [];
+        if (options.includeCopy) {
+            include.push("copy");
         }
-        else {
-            this.type = type;
-            yield* this.step();
-            switch (type) {
-                case 'newline':
-                    this.atNewLine = true;
-                    this.indent = 0;
-                    if (this.onNewLine)
-                        this.onNewLine(this.offset + source.length);
-                    break;
-                case 'space':
-                    if (this.atNewLine && source[0] === ' ')
-                        this.indent += source.length;
-                    break;
-                case 'explicit-key-ind':
-                case 'map-value-ind':
-                case 'seq-item-ind':
-                    if (this.atNewLine)
-                        this.indent += source.length;
-                    break;
-                case 'doc-mode':
-                case 'flow-error-end':
-                    return;
-                default:
-                    this.atNewLine = false;
-            }
-            this.offset += source.length;
+        if (options.includeDeleted) {
+            include.push("deleted");
+        }
+        if (options.includeMetadata) {
+            include.push("metadata");
+        }
+        if (options.includeSnapshots) {
+            include.push("snapshots");
+        }
+        if (options.includeVersions) {
+            include.push("versions");
         }
+        if (options.includeUncommitedBlobs) {
+            include.push("uncommittedblobs");
+        }
+        if (options.includeTags) {
+            include.push("tags");
+        }
+        if (options.includeDeletedWithVersions) {
+            include.push("deletedwithversions");
+        }
+        if (options.includeImmutabilityPolicy) {
+            include.push("immutabilitypolicy");
+        }
+        if (options.includeLegalHold) {
+            include.push("legalhold");
+        }
+        if (options.prefix === "") {
+            options.prefix = undefined;
+        }
+        const updatedOptions = {
+            ...options,
+            ...(include.length > 0 ? { include: include } : {}),
+        };
+        // AsyncIterableIterator to iterate over blobs
+        const iter = this.listItems(updatedOptions);
+        return {
+            /**
+             * The next method, part of the iteration protocol
+             */
+            next() {
+                return iter.next();
+            },
+            /**
+             * The connection to the async iterator, part of the iteration protocol
+             */
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            /**
+             * Return an AsyncIterableIterator that works a page at a time
+             */
+            byPage: (settings = {}) => {
+                return this.listSegments(settings.continuationToken, {
+                    maxPageSize: settings.maxPageSize,
+                    ...updatedOptions,
+                });
+            },
+        };
     }
-    /** Call at end of input to push out any remaining constructions */
-    *end() {
-        while (this.stack.length > 0)
-            yield* this.pop();
+    /**
+     * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse
+     *
+     * @param delimiter - The character or string used to define the virtual hierarchy
+     * @param marker - A string value that identifies the portion of
+     *                          the list of blobs to be returned with the next listing operation. The
+     *                          operation returns the ContinuationToken value within the response body if the
+     *                          listing operation did not return all blobs remaining to be listed
+     *                          with the current page. The ContinuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of list
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to list blobs operation.
+     */
+    async *listHierarchySegments(delimiter, marker, options = {}) {
+        let listBlobsHierarchySegmentResponse;
+        if (!!marker || marker === undefined) {
+            do {
+                listBlobsHierarchySegmentResponse = await this.listBlobHierarchySegment(delimiter, marker, options);
+                marker = listBlobsHierarchySegmentResponse.continuationToken;
+                yield await listBlobsHierarchySegmentResponse;
+            } while (marker);
+        }
     }
-    get sourceToken() {
-        const st = {
-            type: this.type,
-            offset: this.offset,
-            indent: this.indent,
-            source: this.source
+    /**
+     * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects.
+     *
+     * @param delimiter - The character or string used to define the virtual hierarchy
+     * @param options - Options to list blobs operation.
+     */
+    async *listItemsByHierarchy(delimiter, options = {}) {
+        let marker;
+        for await (const listBlobsHierarchySegmentResponse of this.listHierarchySegments(delimiter, marker, options)) {
+            const segment = listBlobsHierarchySegmentResponse.segment;
+            if (segment.blobPrefixes) {
+                for (const prefix of segment.blobPrefixes) {
+                    yield {
+                        kind: "prefix",
+                        ...prefix,
+                    };
+                }
+            }
+            for (const blob of segment.blobItems) {
+                yield { kind: "blob", ...blob };
+            }
+        }
+    }
+    /**
+     * Returns an async iterable iterator to list all the blobs by hierarchy.
+     * under the specified account.
+     *
+     * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages.
+     *
+     * ```ts snippet:ReadmeSampleListBlobsByHierarchy
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     *
+     * // Example using `for await` syntax
+     * let i = 1;
+     * const blobs = containerClient.listBlobsByHierarchy("/");
+     * for await (const blob of blobs) {
+     *   if (blob.kind === "prefix") {
+     *     console.log(`\tBlobPrefix: ${blob.name}`);
+     *   } else {
+     *     console.log(`\tBlobItem: name - ${blob.name}`);
+     *   }
+     * }
+     *
+     * // Example using `iter.next()` syntax
+     * i = 1;
+     * const iter = containerClient.listBlobsByHierarchy("/");
+     * let { value, done } = await iter.next();
+     * while (!done) {
+     *   if (value.kind === "prefix") {
+     *     console.log(`\tBlobPrefix: ${value.name}`);
+     *   } else {
+     *     console.log(`\tBlobItem: name - ${value.name}`);
+     *   }
+     *   ({ value, done } = await iter.next());
+     * }
+     *
+     * // Example using `byPage()` syntax
+     * i = 1;
+     * for await (const page of containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 20 })) {
+     *   const segment = page.segment;
+     *   if (segment.blobPrefixes) {
+     *     for (const prefix of segment.blobPrefixes) {
+     *       console.log(`\tBlobPrefix: ${prefix.name}`);
+     *     }
+     *   }
+     *   for (const blob of page.segment.blobItems) {
+     *     console.log(`\tBlobItem: name - ${blob.name}`);
+     *   }
+     * }
+     *
+     * // Example using paging with a marker
+     * i = 1;
+     * let iterator = containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 2 });
+     * let response = (await iterator.next()).value;
+     * // Prints 2 blob names
+     * if (response.blobPrefixes) {
+     *   for (const prefix of response.blobPrefixes) {
+     *     console.log(`\tBlobPrefix: ${prefix.name}`);
+     *   }
+     * }
+     * if (response.segment.blobItems) {
+     *   for (const blob of response.segment.blobItems) {
+     *     console.log(`\tBlobItem: name - ${blob.name}`);
+     *   }
+     * }
+     * // Gets next marker
+     * let marker = response.continuationToken;
+     * // Passing next marker as continuationToken
+     * iterator = containerClient
+     *   .listBlobsByHierarchy("/")
+     *   .byPage({ continuationToken: marker, maxPageSize: 10 });
+     * response = (await iterator.next()).value;
+     * // Prints 10 blob names
+     * if (response.blobPrefixes) {
+     *   for (const prefix of response.blobPrefixes) {
+     *     console.log(`\tBlobPrefix: ${prefix.name}`);
+     *   }
+     * }
+     * if (response.segment.blobItems) {
+     *   for (const blob of response.segment.blobItems) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     * ```
+     *
+     * @param delimiter - The character or string used to define the virtual hierarchy
+     * @param options - Options to list blobs operation.
+     */
+    listBlobsByHierarchy(delimiter, options = {}) {
+        if (delimiter === "") {
+            throw new RangeError("delimiter should contain one or more characters");
+        }
+        const include = [];
+        if (options.includeCopy) {
+            include.push("copy");
+        }
+        if (options.includeDeleted) {
+            include.push("deleted");
+        }
+        if (options.includeMetadata) {
+            include.push("metadata");
+        }
+        if (options.includeSnapshots) {
+            include.push("snapshots");
+        }
+        if (options.includeVersions) {
+            include.push("versions");
+        }
+        if (options.includeUncommitedBlobs) {
+            include.push("uncommittedblobs");
+        }
+        if (options.includeTags) {
+            include.push("tags");
+        }
+        if (options.includeDeletedWithVersions) {
+            include.push("deletedwithversions");
+        }
+        if (options.includeImmutabilityPolicy) {
+            include.push("immutabilitypolicy");
+        }
+        if (options.includeLegalHold) {
+            include.push("legalhold");
+        }
+        if (options.prefix === "") {
+            options.prefix = undefined;
+        }
+        const updatedOptions = {
+            ...options,
+            ...(include.length > 0 ? { include: include } : {}),
+        };
+        // AsyncIterableIterator to iterate over blob prefixes and blobs
+        const iter = this.listItemsByHierarchy(delimiter, updatedOptions);
+        return {
+            /**
+             * The next method, part of the iteration protocol
+             */
+            async next() {
+                return iter.next();
+            },
+            /**
+             * The connection to the async iterator, part of the iteration protocol
+             */
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            /**
+             * Return an AsyncIterableIterator that works a page at a time
+             */
+            byPage: (settings = {}) => {
+                return this.listHierarchySegments(delimiter, settings.continuationToken, {
+                    maxPageSize: settings.maxPageSize,
+                    ...updatedOptions,
+                });
+            },
         };
-        return st;
     }
-    *step() {
-        const top = this.peek(1);
-        if (this.type === 'doc-end' && top?.type !== 'doc-end') {
-            while (this.stack.length > 0)
-                yield* this.pop();
-            this.stack.push({
-                type: 'doc-end',
-                offset: this.offset,
-                source: this.source
-            });
-            return;
+    /**
+     * The Filter Blobs operation enables callers to list blobs in the container whose tags
+     * match a given search expression.
+     *
+     * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                        The given expression must evaluate to true for a blob to be returned in the results.
+     *                                        The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                        however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param marker - A string value that identifies the portion of
+     *                          the list of blobs to be returned with the next listing operation. The
+     *                          operation returns the continuationToken value within the response body if the
+     *                          listing operation did not return all blobs remaining to be listed
+     *                          with the current page. The continuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of list
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to find blobs by tags.
+     */
+    async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
+        return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.containerContext.filterBlobs({
+                abortSignal: options.abortSignal,
+                where: tagFilterSqlExpression,
+                marker,
+                maxPageSize: options.maxPageSize,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            const wrappedResponse = {
+                ...response,
+                _response: response._response, // _response is made non-enumerable
+                blobs: response.blobs.map((blob) => {
+                    let tagValue = "";
+                    if (blob.tags?.blobTagSet.length === 1) {
+                        tagValue = blob.tags.blobTagSet[0].value;
+                    }
+                    return { ...blob, tags: toTags(blob.tags), tagValue };
+                }),
+            };
+            return wrappedResponse;
+        });
+    }
+    /**
+     * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.
+     *
+     * @param tagFilterSqlExpression -  The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                         The given expression must evaluate to true for a blob to be returned in the results.
+     *                                         The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                         however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param marker - A string value that identifies the portion of
+     *                          the list of blobs to be returned with the next listing operation. The
+     *                          operation returns the continuationToken value within the response body if the
+     *                          listing operation did not return all blobs remaining to be listed
+     *                          with the current page. The continuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of list
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to find blobs by tags.
+     */
+    async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
+        let response;
+        if (!!marker || marker === undefined) {
+            do {
+                response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
+                response.blobs = response.blobs || [];
+                marker = response.continuationToken;
+                yield response;
+            } while (marker);
         }
-        if (!top)
-            return yield* this.stream();
-        switch (top.type) {
-            case 'document':
-                return yield* this.document(top);
-            case 'alias':
-            case 'scalar':
-            case 'single-quoted-scalar':
-            case 'double-quoted-scalar':
-                return yield* this.scalar(top);
-            case 'block-scalar':
-                return yield* this.blockScalar(top);
-            case 'block-map':
-                return yield* this.blockMap(top);
-            case 'block-seq':
-                return yield* this.blockSequence(top);
-            case 'flow-collection':
-                return yield* this.flowCollection(top);
-            case 'doc-end':
-                return yield* this.documentEnd(top);
+    }
+    /**
+     * Returns an AsyncIterableIterator for blobs.
+     *
+     * @param tagFilterSqlExpression -  The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                         The given expression must evaluate to true for a blob to be returned in the results.
+     *                                         The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                         however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param options - Options to findBlobsByTagsItems.
+     */
+    async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
+        let marker;
+        for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) {
+            yield* segment.blobs;
         }
-        /* istanbul ignore next should not happen */
-        yield* this.pop();
     }
-    peek(n) {
-        return this.stack[this.stack.length - n];
+    /**
+     * Returns an async iterable iterator to find all blobs with specified tag
+     * under the specified container.
+     *
+     * .byPage() returns an async iterable iterator to list the blobs in pages.
+     *
+     * Example using `for await` syntax:
+     *
+     * ```ts snippet:ReadmeSampleFindBlobsByTags
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerName = "";
+     * const containerClient = blobServiceClient.getContainerClient(containerName);
+     *
+     * // Example using `for await` syntax
+     * let i = 1;
+     * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) {
+     *   console.log(`Blob ${i++}: ${blob.name}`);
+     * }
+     *
+     * // Example using `iter.next()` syntax
+     * i = 1;
+     * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'");
+     * let { value, done } = await iter.next();
+     * while (!done) {
+     *   console.log(`Blob ${i++}: ${value.name}`);
+     *   ({ value, done } = await iter.next());
+     * }
+     *
+     * // Example using `byPage()` syntax
+     * i = 1;
+     * for await (const page of containerClient
+     *   .findBlobsByTags("tagkey='tagvalue'")
+     *   .byPage({ maxPageSize: 20 })) {
+     *   for (const blob of page.blobs) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     *
+     * // Example using paging with a marker
+     * i = 1;
+     * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
+     * let response = (await iterator.next()).value;
+     * // Prints 2 blob names
+     * if (response.blobs) {
+     *   for (const blob of response.blobs) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     * // Gets next marker
+     * let marker = response.continuationToken;
+     * // Passing next marker as continuationToken
+     * iterator = containerClient
+     *   .findBlobsByTags("tagkey='tagvalue'")
+     *   .byPage({ continuationToken: marker, maxPageSize: 10 });
+     * response = (await iterator.next()).value;
+     * // Prints 10 blob names
+     * if (response.blobs) {
+     *   for (const blob of response.blobs) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     * ```
+     *
+     * @param tagFilterSqlExpression -  The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                         The given expression must evaluate to true for a blob to be returned in the results.
+     *                                         The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                         however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param options - Options to find blobs by tags.
+     */
+    findBlobsByTags(tagFilterSqlExpression, options = {}) {
+        // AsyncIterableIterator to iterate over blobs
+        const listSegmentOptions = {
+            ...options,
+        };
+        const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
+        return {
+            /**
+             * The next method, part of the iteration protocol
+             */
+            next() {
+                return iter.next();
+            },
+            /**
+             * The connection to the async iterator, part of the iteration protocol
+             */
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            /**
+             * Return an AsyncIterableIterator that works a page at a time
+             */
+            byPage: (settings = {}) => {
+                return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
+                    maxPageSize: settings.maxPageSize,
+                    ...listSegmentOptions,
+                });
+            },
+        };
+    }
+    /**
+     * The Get Account Information operation returns the sku name and account kind
+     * for the specified account.
+     * The Get Account Information operation is available on service versions beginning
+     * with version 2018-03-28.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
+     *
+     * @param options - Options to the Service Get Account Info operation.
+     * @returns Response data for the Service Get Account Info operation.
+     */
+    async getAccountInfo(options = {}) {
+        return tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.containerContext.getAccountInfo({
+                abortSignal: options.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
     }
-    *pop(error) {
-        const token = error ?? this.stack.pop();
-        /* istanbul ignore if should not happen */
-        if (!token) {
-            const message = 'Tried to pop an empty stack';
-            yield { type: 'error', offset: this.offset, source: '', message };
+    getContainerNameFromUrl() {
+        let containerName;
+        try {
+            //  URL may look like the following
+            // "https://myaccount.blob.core.windows.net/mycontainer?sasString";
+            // "https://myaccount.blob.core.windows.net/mycontainer";
+            // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername`
+            // http://localhost:10001/devstoreaccount1/containername
+            const parsedUrl = new URL(this.url);
+            if (parsedUrl.hostname.split(".")[1] === "blob") {
+                // "https://myaccount.blob.core.windows.net/containername".
+                // "https://customdomain.com/containername".
+                // .getPath() -> /containername
+                containerName = parsedUrl.pathname.split("/")[1];
+            }
+            else if (utils_common_isIpEndpointStyle(parsedUrl)) {
+                // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername
+                // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername
+                // .getPath() -> /devstoreaccount1/containername
+                containerName = parsedUrl.pathname.split("/")[2];
+            }
+            else {
+                // "https://customdomain.com/containername".
+                // .getPath() -> /containername
+                containerName = parsedUrl.pathname.split("/")[1];
+            }
+            // decode the encoded containerName - to get all the special characters that might be present in it
+            containerName = decodeURIComponent(containerName);
+            if (!containerName) {
+                throw new Error("Provided containerName is invalid.");
+            }
+            return containerName;
         }
-        else if (this.stack.length === 0) {
-            yield token;
+        catch (error) {
+            throw new Error("Unable to extract containerName with provided information.");
         }
-        else {
-            const top = this.peek(1);
-            if (token.type === 'block-scalar') {
-                // Block scalars use their parent rather than header indent
-                token.indent = 'indent' in top ? top.indent : 0;
-            }
-            else if (token.type === 'flow-collection' && top.type === 'document') {
-                // Ignore all indent for top-level flow collections
-                token.indent = 0;
+    }
+    /**
+     * Only available for ContainerClient constructed with a shared key credential.
+     *
+     * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties
+     * and parameters passed in. The SAS is signed by the shared key credential of the client.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateSasUrl(options) {
+        return new Promise((resolve) => {
+            if (!(this.credential instanceof StorageSharedKeyCredential)) {
+                throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
             }
-            if (token.type === 'flow-collection')
-                fixFlowSeqItems(token);
-            switch (top.type) {
-                case 'document':
-                    top.value = token;
+            const sas = generateBlobSASQueryParameters({
+                containerName: this._containerName,
+                ...options,
+            }, this.credential).toString();
+            resolve(utils_common_appendToURLQuery(this.url, sas));
+        });
+    }
+    /**
+     * Only available for ContainerClient constructed with a shared key credential.
+     *
+     * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI
+     * based on the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    generateSasStringToSign(options) {
+        if (!(this.credential instanceof StorageSharedKeyCredential)) {
+            throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
+        }
+        return generateBlobSASQueryParametersInternal({
+            containerName: this._containerName,
+            ...options,
+        }, this.credential).stringToSign;
+    }
+    /**
+     * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties
+     * and parameters passed in. The SAS is signed by the input user delegation key.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @param userDelegationKey -  Return value of `blobServiceClient.getUserDelegationKey()`
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateUserDelegationSasUrl(options, userDelegationKey) {
+        return new Promise((resolve) => {
+            const sas = generateBlobSASQueryParameters({
+                containerName: this._containerName,
+                ...options,
+            }, userDelegationKey, this.accountName).toString();
+            resolve(utils_common_appendToURLQuery(this.url, sas));
+        });
+    }
+    /**
+     * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI
+     * based on the client properties and parameters passed in. The SAS is signed by the input user delegation key.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
+     *
+     * @param options - Optional parameters.
+     * @param userDelegationKey -  Return value of `blobServiceClient.getUserDelegationKey()`
+     * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateUserDelegationSasStringToSign(options, userDelegationKey) {
+        return generateBlobSASQueryParametersInternal({
+            containerName: this._containerName,
+            ...options,
+        }, userDelegationKey, this.accountName).stringToSign;
+    }
+    /**
+     * Creates a BlobBatchClient object to conduct batch operations.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
+     *
+     * @returns A new BlobBatchClient object for this container.
+     */
+    getBlobBatchClient() {
+        return new BlobBatchClient(this.url, this.pipeline);
+    }
+}
+//# sourceMappingURL=ContainerClient.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/AccountSASPermissions.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value
+ * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the
+ * values are set, this should be serialized with toString and set as the permissions field on an
+ * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but
+ * the order of the permissions is particular and this class guarantees correctness.
+ */
+class AccountSASPermissions {
+    /**
+     * Parse initializes the AccountSASPermissions fields from a string.
+     *
+     * @param permissions -
+     */
+    static parse(permissions) {
+        const accountSASPermissions = new AccountSASPermissions();
+        for (const c of permissions) {
+            switch (c) {
+                case "r":
+                    accountSASPermissions.read = true;
                     break;
-                case 'block-scalar':
-                    top.props.push(token); // error
+                case "w":
+                    accountSASPermissions.write = true;
                     break;
-                case 'block-map': {
-                    const it = top.items[top.items.length - 1];
-                    if (it.value) {
-                        top.items.push({ start: [], key: token, sep: [] });
-                        this.onKeyLine = true;
-                        return;
-                    }
-                    else if (it.sep) {
-                        it.value = token;
-                    }
-                    else {
-                        Object.assign(it, { key: token, sep: [] });
-                        this.onKeyLine = !it.explicitKey;
-                        return;
-                    }
+                case "d":
+                    accountSASPermissions.delete = true;
                     break;
-                }
-                case 'block-seq': {
-                    const it = top.items[top.items.length - 1];
-                    if (it.value)
-                        top.items.push({ start: [], value: token });
-                    else
-                        it.value = token;
+                case "x":
+                    accountSASPermissions.deleteVersion = true;
+                    break;
+                case "l":
+                    accountSASPermissions.list = true;
+                    break;
+                case "a":
+                    accountSASPermissions.add = true;
+                    break;
+                case "c":
+                    accountSASPermissions.create = true;
+                    break;
+                case "u":
+                    accountSASPermissions.update = true;
+                    break;
+                case "p":
+                    accountSASPermissions.process = true;
+                    break;
+                case "t":
+                    accountSASPermissions.tag = true;
+                    break;
+                case "f":
+                    accountSASPermissions.filter = true;
+                    break;
+                case "i":
+                    accountSASPermissions.setImmutabilityPolicy = true;
+                    break;
+                case "y":
+                    accountSASPermissions.permanentDelete = true;
                     break;
-                }
-                case 'flow-collection': {
-                    const it = top.items[top.items.length - 1];
-                    if (!it || it.value)
-                        top.items.push({ start: [], key: token, sep: [] });
-                    else if (it.sep)
-                        it.value = token;
-                    else
-                        Object.assign(it, { key: token, sep: [] });
-                    return;
-                }
-                /* istanbul ignore next should not happen */
                 default:
-                    yield* this.pop();
-                    yield* this.pop(token);
-            }
-            if ((top.type === 'document' ||
-                top.type === 'block-map' ||
-                top.type === 'block-seq') &&
-                (token.type === 'block-map' || token.type === 'block-seq')) {
-                const last = token.items[token.items.length - 1];
-                if (last &&
-                    !last.sep &&
-                    !last.value &&
-                    last.start.length > 0 &&
-                    findNonEmptyIndex(last.start) === -1 &&
-                    (token.indent === 0 ||
-                        last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) {
-                    if (top.type === 'document')
-                        top.end = last.start;
-                    else
-                        top.items.push({ start: last.start });
-                    token.items.splice(-1, 1);
-                }
+                    throw new RangeError(`Invalid permission character: ${c}`);
             }
         }
+        return accountSASPermissions;
     }
-    *stream() {
-        switch (this.type) {
-            case 'directive-line':
-                yield { type: 'directive', offset: this.offset, source: this.source };
-                return;
-            case 'byte-order-mark':
-            case 'space':
-            case 'comment':
-            case 'newline':
-                yield this.sourceToken;
-                return;
-            case 'doc-mode':
-            case 'doc-start': {
-                const doc = {
-                    type: 'document',
-                    offset: this.offset,
-                    start: []
-                };
-                if (this.type === 'doc-start')
-                    doc.start.push(this.sourceToken);
-                this.stack.push(doc);
-                return;
-            }
+    /**
+     * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it
+     * and boolean values for them.
+     *
+     * @param permissionLike -
+     */
+    static from(permissionLike) {
+        const accountSASPermissions = new AccountSASPermissions();
+        if (permissionLike.read) {
+            accountSASPermissions.read = true;
         }
-        yield {
-            type: 'error',
-            offset: this.offset,
-            message: `Unexpected ${this.type} token in YAML stream`,
-            source: this.source
-        };
-    }
-    *document(doc) {
-        if (doc.value)
-            return yield* this.lineEnd(doc);
-        switch (this.type) {
-            case 'doc-start': {
-                if (findNonEmptyIndex(doc.start) !== -1) {
-                    yield* this.pop();
-                    yield* this.step();
-                }
-                else
-                    doc.start.push(this.sourceToken);
-                return;
-            }
-            case 'anchor':
-            case 'tag':
-            case 'space':
-            case 'comment':
-            case 'newline':
-                doc.start.push(this.sourceToken);
-                return;
+        if (permissionLike.write) {
+            accountSASPermissions.write = true;
         }
-        const bv = this.startBlockValue(doc);
-        if (bv)
-            this.stack.push(bv);
-        else {
-            yield {
-                type: 'error',
-                offset: this.offset,
-                message: `Unexpected ${this.type} token in YAML document`,
-                source: this.source
-            };
+        if (permissionLike.delete) {
+            accountSASPermissions.delete = true;
         }
-    }
-    *scalar(scalar) {
-        if (this.type === 'map-value-ind') {
-            const prev = getPrevProps(this.peek(2));
-            const start = getFirstKeyStartProps(prev);
-            let sep;
-            if (scalar.end) {
-                sep = scalar.end;
-                sep.push(this.sourceToken);
-                delete scalar.end;
-            }
-            else
-                sep = [this.sourceToken];
-            const map = {
-                type: 'block-map',
-                offset: scalar.offset,
-                indent: scalar.indent,
-                items: [{ start, key: scalar, sep }]
-            };
-            this.onKeyLine = true;
-            this.stack[this.stack.length - 1] = map;
+        if (permissionLike.deleteVersion) {
+            accountSASPermissions.deleteVersion = true;
         }
-        else
-            yield* this.lineEnd(scalar);
-    }
-    *blockScalar(scalar) {
-        switch (this.type) {
-            case 'space':
-            case 'comment':
-            case 'newline':
-                scalar.props.push(this.sourceToken);
-                return;
-            case 'scalar':
-                scalar.source = this.source;
-                // block-scalar source includes trailing newline
-                this.atNewLine = true;
-                this.indent = 0;
-                if (this.onNewLine) {
-                    let nl = this.source.indexOf('\n') + 1;
-                    while (nl !== 0) {
-                        this.onNewLine(this.offset + nl);
-                        nl = this.source.indexOf('\n', nl) + 1;
-                    }
-                }
-                yield* this.pop();
-                break;
-            /* istanbul ignore next should not happen */
-            default:
-                yield* this.pop();
-                yield* this.step();
+        if (permissionLike.filter) {
+            accountSASPermissions.filter = true;
         }
-    }
-    *blockMap(map) {
-        const it = map.items[map.items.length - 1];
-        // it.sep is true-ish if pair already has key or : separator
-        switch (this.type) {
-            case 'newline':
-                this.onKeyLine = false;
-                if (it.value) {
-                    const end = 'end' in it.value ? it.value.end : undefined;
-                    const last = Array.isArray(end) ? end[end.length - 1] : undefined;
-                    if (last?.type === 'comment')
-                        end?.push(this.sourceToken);
-                    else
-                        map.items.push({ start: [this.sourceToken] });
-                }
-                else if (it.sep) {
-                    it.sep.push(this.sourceToken);
-                }
-                else {
-                    it.start.push(this.sourceToken);
-                }
-                return;
-            case 'space':
-            case 'comment':
-                if (it.value) {
-                    map.items.push({ start: [this.sourceToken] });
-                }
-                else if (it.sep) {
-                    it.sep.push(this.sourceToken);
-                }
-                else {
-                    if (this.atIndentedComment(it.start, map.indent)) {
-                        const prev = map.items[map.items.length - 2];
-                        const end = prev?.value?.end;
-                        if (Array.isArray(end)) {
-                            arrayPushArray(end, it.start);
-                            end.push(this.sourceToken);
-                            map.items.pop();
-                            return;
-                        }
-                    }
-                    it.start.push(this.sourceToken);
-                }
-                return;
+        if (permissionLike.tag) {
+            accountSASPermissions.tag = true;
         }
-        if (this.indent >= map.indent) {
-            const atMapIndent = !this.onKeyLine && this.indent === map.indent;
-            const atNextItem = atMapIndent &&
-                (it.sep || it.explicitKey) &&
-                this.type !== 'seq-item-ind';
-            // For empty nodes, assign newline-separated not indented empty tokens to following node
-            let start = [];
-            if (atNextItem && it.sep && !it.value) {
-                const nl = [];
-                for (let i = 0; i < it.sep.length; ++i) {
-                    const st = it.sep[i];
-                    switch (st.type) {
-                        case 'newline':
-                            nl.push(i);
-                            break;
-                        case 'space':
-                            break;
-                        case 'comment':
-                            if (st.indent > map.indent)
-                                nl.length = 0;
-                            break;
-                        default:
-                            nl.length = 0;
-                    }
-                }
-                if (nl.length >= 2)
-                    start = it.sep.splice(nl[1]);
-            }
-            switch (this.type) {
-                case 'anchor':
-                case 'tag':
-                    if (atNextItem || it.value) {
-                        start.push(this.sourceToken);
-                        map.items.push({ start });
-                        this.onKeyLine = true;
-                    }
-                    else if (it.sep) {
-                        it.sep.push(this.sourceToken);
-                    }
-                    else {
-                        it.start.push(this.sourceToken);
-                    }
-                    return;
-                case 'explicit-key-ind':
-                    if (!it.sep && !it.explicitKey) {
-                        it.start.push(this.sourceToken);
-                        it.explicitKey = true;
-                    }
-                    else if (atNextItem || it.value) {
-                        start.push(this.sourceToken);
-                        map.items.push({ start, explicitKey: true });
-                    }
-                    else {
-                        this.stack.push({
-                            type: 'block-map',
-                            offset: this.offset,
-                            indent: this.indent,
-                            items: [{ start: [this.sourceToken], explicitKey: true }]
-                        });
-                    }
-                    this.onKeyLine = true;
-                    return;
-                case 'map-value-ind':
-                    if (it.explicitKey) {
-                        if (!it.sep) {
-                            if (includesToken(it.start, 'newline')) {
-                                Object.assign(it, { key: null, sep: [this.sourceToken] });
-                            }
-                            else {
-                                const start = getFirstKeyStartProps(it.start);
-                                this.stack.push({
-                                    type: 'block-map',
-                                    offset: this.offset,
-                                    indent: this.indent,
-                                    items: [{ start, key: null, sep: [this.sourceToken] }]
-                                });
-                            }
-                        }
-                        else if (it.value) {
-                            map.items.push({ start: [], key: null, sep: [this.sourceToken] });
-                        }
-                        else if (includesToken(it.sep, 'map-value-ind')) {
-                            this.stack.push({
-                                type: 'block-map',
-                                offset: this.offset,
-                                indent: this.indent,
-                                items: [{ start, key: null, sep: [this.sourceToken] }]
-                            });
-                        }
-                        else if (isFlowToken(it.key) &&
-                            !includesToken(it.sep, 'newline')) {
-                            const start = getFirstKeyStartProps(it.start);
-                            const key = it.key;
-                            const sep = it.sep;
-                            sep.push(this.sourceToken);
-                            // @ts-expect-error type guard is wrong here
-                            delete it.key;
-                            // @ts-expect-error type guard is wrong here
-                            delete it.sep;
-                            this.stack.push({
-                                type: 'block-map',
-                                offset: this.offset,
-                                indent: this.indent,
-                                items: [{ start, key, sep }]
-                            });
-                        }
-                        else if (start.length > 0) {
-                            // Not actually at next item
-                            it.sep = it.sep.concat(start, this.sourceToken);
-                        }
-                        else {
-                            it.sep.push(this.sourceToken);
-                        }
-                    }
-                    else {
-                        if (!it.sep) {
-                            Object.assign(it, { key: null, sep: [this.sourceToken] });
-                        }
-                        else if (it.value || atNextItem) {
-                            map.items.push({ start, key: null, sep: [this.sourceToken] });
-                        }
-                        else if (includesToken(it.sep, 'map-value-ind')) {
-                            this.stack.push({
-                                type: 'block-map',
-                                offset: this.offset,
-                                indent: this.indent,
-                                items: [{ start: [], key: null, sep: [this.sourceToken] }]
-                            });
-                        }
-                        else {
-                            it.sep.push(this.sourceToken);
-                        }
-                    }
-                    this.onKeyLine = true;
-                    return;
-                case 'alias':
-                case 'scalar':
-                case 'single-quoted-scalar':
-                case 'double-quoted-scalar': {
-                    const fs = this.flowScalar(this.type);
-                    if (atNextItem || it.value) {
-                        map.items.push({ start, key: fs, sep: [] });
-                        this.onKeyLine = true;
-                    }
-                    else if (it.sep) {
-                        this.stack.push(fs);
-                    }
-                    else {
-                        Object.assign(it, { key: fs, sep: [] });
-                        this.onKeyLine = true;
-                    }
-                    return;
-                }
-                default: {
-                    const bv = this.startBlockValue(map);
-                    if (bv) {
-                        if (bv.type === 'block-seq') {
-                            if (!it.explicitKey &&
-                                it.sep &&
-                                !includesToken(it.sep, 'newline')) {
-                                yield* this.pop({
-                                    type: 'error',
-                                    offset: this.offset,
-                                    message: 'Unexpected block-seq-ind on same line with key',
-                                    source: this.source
-                                });
-                                return;
-                            }
-                        }
-                        else if (atMapIndent) {
-                            map.items.push({ start });
-                        }
-                        this.stack.push(bv);
-                        return;
-                    }
-                }
-            }
+        if (permissionLike.list) {
+            accountSASPermissions.list = true;
+        }
+        if (permissionLike.add) {
+            accountSASPermissions.add = true;
+        }
+        if (permissionLike.create) {
+            accountSASPermissions.create = true;
+        }
+        if (permissionLike.update) {
+            accountSASPermissions.update = true;
+        }
+        if (permissionLike.process) {
+            accountSASPermissions.process = true;
+        }
+        if (permissionLike.setImmutabilityPolicy) {
+            accountSASPermissions.setImmutabilityPolicy = true;
+        }
+        if (permissionLike.permanentDelete) {
+            accountSASPermissions.permanentDelete = true;
+        }
+        return accountSASPermissions;
+    }
+    /**
+     * Permission to read resources and list queues and tables granted.
+     */
+    read = false;
+    /**
+     * Permission to write resources granted.
+     */
+    write = false;
+    /**
+     * Permission to delete blobs and files granted.
+     */
+    delete = false;
+    /**
+     * Permission to delete versions granted.
+     */
+    deleteVersion = false;
+    /**
+     * Permission to list blob containers, blobs, shares, directories, and files granted.
+     */
+    list = false;
+    /**
+     * Permission to add messages, table entities, and append to blobs granted.
+     */
+    add = false;
+    /**
+     * Permission to create blobs and files granted.
+     */
+    create = false;
+    /**
+     * Permissions to update messages and table entities granted.
+     */
+    update = false;
+    /**
+     * Permission to get and delete messages granted.
+     */
+    process = false;
+    /**
+     * Specfies Tag access granted.
+     */
+    tag = false;
+    /**
+     * Permission to filter blobs.
+     */
+    filter = false;
+    /**
+     * Permission to set immutability policy.
+     */
+    setImmutabilityPolicy = false;
+    /**
+     * Specifies that Permanent Delete is permitted.
+     */
+    permanentDelete = false;
+    /**
+     * Produces the SAS permissions string for an Azure Storage account.
+     * Call this method to set AccountSASSignatureValues Permissions field.
+     *
+     * Using this method will guarantee the resource types are in
+     * an order accepted by the service.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas
+     *
+     */
+    toString() {
+        // The order of the characters should be as specified here to ensure correctness:
+        // https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas
+        // Use a string array instead of string concatenating += operator for performance
+        const permissions = [];
+        if (this.read) {
+            permissions.push("r");
         }
-        yield* this.pop();
-        yield* this.step();
+        if (this.write) {
+            permissions.push("w");
+        }
+        if (this.delete) {
+            permissions.push("d");
+        }
+        if (this.deleteVersion) {
+            permissions.push("x");
+        }
+        if (this.filter) {
+            permissions.push("f");
+        }
+        if (this.tag) {
+            permissions.push("t");
+        }
+        if (this.list) {
+            permissions.push("l");
+        }
+        if (this.add) {
+            permissions.push("a");
+        }
+        if (this.create) {
+            permissions.push("c");
+        }
+        if (this.update) {
+            permissions.push("u");
+        }
+        if (this.process) {
+            permissions.push("p");
+        }
+        if (this.setImmutabilityPolicy) {
+            permissions.push("i");
+        }
+        if (this.permanentDelete) {
+            permissions.push("y");
+        }
+        return permissions.join("");
     }
-    *blockSequence(seq) {
-        const it = seq.items[seq.items.length - 1];
-        switch (this.type) {
-            case 'newline':
-                if (it.value) {
-                    const end = 'end' in it.value ? it.value.end : undefined;
-                    const last = Array.isArray(end) ? end[end.length - 1] : undefined;
-                    if (last?.type === 'comment')
-                        end?.push(this.sourceToken);
-                    else
-                        seq.items.push({ start: [this.sourceToken] });
-                }
-                else
-                    it.start.push(this.sourceToken);
-                return;
-            case 'space':
-            case 'comment':
-                if (it.value)
-                    seq.items.push({ start: [this.sourceToken] });
-                else {
-                    if (this.atIndentedComment(it.start, seq.indent)) {
-                        const prev = seq.items[seq.items.length - 2];
-                        const end = prev?.value?.end;
-                        if (Array.isArray(end)) {
-                            arrayPushArray(end, it.start);
-                            end.push(this.sourceToken);
-                            seq.items.pop();
-                            return;
-                        }
-                    }
-                    it.start.push(this.sourceToken);
-                }
-                return;
-            case 'anchor':
-            case 'tag':
-                if (it.value || this.indent <= seq.indent)
+}
+//# sourceMappingURL=AccountSASPermissions.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/AccountSASResourceTypes.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value
+ * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the
+ * values are set, this should be serialized with toString and set as the resources field on an
+ * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but
+ * the order of the resources is particular and this class guarantees correctness.
+ */
+class AccountSASResourceTypes {
+    /**
+     * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an
+     * Error if it encounters a character that does not correspond to a valid resource type.
+     *
+     * @param resourceTypes -
+     */
+    static parse(resourceTypes) {
+        const accountSASResourceTypes = new AccountSASResourceTypes();
+        for (const c of resourceTypes) {
+            switch (c) {
+                case "s":
+                    accountSASResourceTypes.service = true;
                     break;
-                it.start.push(this.sourceToken);
-                return;
-            case 'seq-item-ind':
-                if (this.indent !== seq.indent)
+                case "c":
+                    accountSASResourceTypes.container = true;
                     break;
-                if (it.value || includesToken(it.start, 'seq-item-ind'))
-                    seq.items.push({ start: [this.sourceToken] });
-                else
-                    it.start.push(this.sourceToken);
-                return;
+                case "o":
+                    accountSASResourceTypes.object = true;
+                    break;
+                default:
+                    throw new RangeError(`Invalid resource type: ${c}`);
+            }
         }
-        if (this.indent > seq.indent) {
-            const bv = this.startBlockValue(seq);
-            if (bv) {
-                this.stack.push(bv);
-                return;
+        return accountSASResourceTypes;
+    }
+    /**
+     * Permission to access service level APIs granted.
+     */
+    service = false;
+    /**
+     * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.
+     */
+    container = false;
+    /**
+     * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.
+     */
+    object = false;
+    /**
+     * Converts the given resource types to a string.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas
+     *
+     */
+    toString() {
+        const resourceTypes = [];
+        if (this.service) {
+            resourceTypes.push("s");
+        }
+        if (this.container) {
+            resourceTypes.push("c");
+        }
+        if (this.object) {
+            resourceTypes.push("o");
+        }
+        return resourceTypes.join("");
+    }
+}
+//# sourceMappingURL=AccountSASResourceTypes.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/AccountSASServices.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value
+ * to true means that any SAS which uses these permissions will grant access to that service. Once all the
+ * values are set, this should be serialized with toString and set as the services field on an
+ * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but
+ * the order of the services is particular and this class guarantees correctness.
+ */
+class AccountSASServices {
+    /**
+     * Creates an {@link AccountSASServices} from the specified services string. This method will throw an
+     * Error if it encounters a character that does not correspond to a valid service.
+     *
+     * @param services -
+     */
+    static parse(services) {
+        const accountSASServices = new AccountSASServices();
+        for (const c of services) {
+            switch (c) {
+                case "b":
+                    accountSASServices.blob = true;
+                    break;
+                case "f":
+                    accountSASServices.file = true;
+                    break;
+                case "q":
+                    accountSASServices.queue = true;
+                    break;
+                case "t":
+                    accountSASServices.table = true;
+                    break;
+                default:
+                    throw new RangeError(`Invalid service character: ${c}`);
             }
         }
-        yield* this.pop();
-        yield* this.step();
+        return accountSASServices;
     }
-    *flowCollection(fc) {
-        const it = fc.items[fc.items.length - 1];
-        if (this.type === 'flow-error-end') {
-            let top;
-            do {
-                yield* this.pop();
-                top = this.peek(1);
-            } while (top?.type === 'flow-collection');
+    /**
+     * Permission to access blob resources granted.
+     */
+    blob = false;
+    /**
+     * Permission to access file resources granted.
+     */
+    file = false;
+    /**
+     * Permission to access queue resources granted.
+     */
+    queue = false;
+    /**
+     * Permission to access table resources granted.
+     */
+    table = false;
+    /**
+     * Converts the given services to a string.
+     *
+     */
+    toString() {
+        const services = [];
+        if (this.blob) {
+            services.push("b");
         }
-        else if (fc.end.length === 0) {
-            switch (this.type) {
-                case 'comma':
-                case 'explicit-key-ind':
-                    if (!it || it.sep)
-                        fc.items.push({ start: [this.sourceToken] });
-                    else
-                        it.start.push(this.sourceToken);
-                    return;
-                case 'map-value-ind':
-                    if (!it || it.value)
-                        fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
-                    else if (it.sep)
-                        it.sep.push(this.sourceToken);
-                    else
-                        Object.assign(it, { key: null, sep: [this.sourceToken] });
-                    return;
-                case 'space':
-                case 'comment':
-                case 'newline':
-                case 'anchor':
-                case 'tag':
-                    if (!it || it.value)
-                        fc.items.push({ start: [this.sourceToken] });
-                    else if (it.sep)
-                        it.sep.push(this.sourceToken);
-                    else
-                        it.start.push(this.sourceToken);
-                    return;
-                case 'alias':
-                case 'scalar':
-                case 'single-quoted-scalar':
-                case 'double-quoted-scalar': {
-                    const fs = this.flowScalar(this.type);
-                    if (!it || it.value)
-                        fc.items.push({ start: [], key: fs, sep: [] });
-                    else if (it.sep)
-                        this.stack.push(fs);
-                    else
-                        Object.assign(it, { key: fs, sep: [] });
-                    return;
+        if (this.table) {
+            services.push("t");
+        }
+        if (this.queue) {
+            services.push("q");
+        }
+        if (this.file) {
+            services.push("f");
+        }
+        return services.join("");
+    }
+}
+//# sourceMappingURL=AccountSASServices.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/sas/AccountSASSignatureValues.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+
+
+
+
+
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * Generates a {@link SASQueryParameters} object which contains all SAS query parameters needed to make an actual
+ * REST request.
+ *
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas
+ *
+ * @param accountSASSignatureValues -
+ * @param sharedKeyCredential -
+ */
+function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) {
+    return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential)
+        .sasQueryParameters;
+}
+function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) {
+    const version = accountSASSignatureValues.version
+        ? accountSASSignatureValues.version
+        : SERVICE_VERSION;
+    if (accountSASSignatureValues.permissions &&
+        accountSASSignatureValues.permissions.setImmutabilityPolicy &&
+        version < "2020-08-04") {
+        throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.");
+    }
+    if (accountSASSignatureValues.permissions &&
+        accountSASSignatureValues.permissions.deleteVersion &&
+        version < "2019-10-10") {
+        throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
+    }
+    if (accountSASSignatureValues.permissions &&
+        accountSASSignatureValues.permissions.permanentDelete &&
+        version < "2019-10-10") {
+        throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission.");
+    }
+    if (accountSASSignatureValues.permissions &&
+        accountSASSignatureValues.permissions.tag &&
+        version < "2019-12-12") {
+        throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.");
+    }
+    if (accountSASSignatureValues.permissions &&
+        accountSASSignatureValues.permissions.filter &&
+        version < "2019-12-12") {
+        throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission.");
+    }
+    if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") {
+        throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
+    }
+    const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString());
+    const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();
+    const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString();
+    let stringToSign;
+    if (version >= "2020-12-06") {
+        stringToSign = [
+            sharedKeyCredential.accountName,
+            parsedPermissions,
+            parsedServices,
+            parsedResourceTypes,
+            accountSASSignatureValues.startsOn
+                ? utils_common_truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
+                : "",
+            utils_common_truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
+            accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
+            accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
+            version,
+            accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "",
+            "", // Account SAS requires an additional newline character
+        ].join("\n");
+    }
+    else {
+        stringToSign = [
+            sharedKeyCredential.accountName,
+            parsedPermissions,
+            parsedServices,
+            parsedResourceTypes,
+            accountSASSignatureValues.startsOn
+                ? utils_common_truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
+                : "",
+            utils_common_truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
+            accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
+            accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
+            version,
+            "", // Account SAS requires an additional newline character
+        ].join("\n");
+    }
+    const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
+    return {
+        sasQueryParameters: new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, accountSASSignatureValues.encryptionScope),
+        stringToSign: stringToSign,
+    };
+}
+//# sourceMappingURL=AccountSASSignatureValues.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/BlobServiceClient.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+function isBlobGetUserDelegationKeyParameters(parameter) {
+    if (!parameter || typeof parameter !== "object") {
+        return false;
+    }
+    const castParameter = parameter;
+    return castParameter.expiresOn instanceof Date;
+}
+/**
+ * A BlobServiceClient represents a Client to the Azure Storage Blob service allowing you
+ * to manipulate blob containers.
+ */
+class BlobServiceClient extends StorageClient_StorageClient {
+    /**
+     * serviceContext provided by protocol layer.
+     */
+    serviceContext;
+    blobClientConfig;
+    /**
+     *
+     * Creates an instance of BlobServiceClient from connection string.
+     *
+     * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
+     *                                  [ Note - Account connection string can only be used in NODE.JS runtime. ]
+     *                                  Account connection string example -
+     *                                  `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
+     *                                  SAS connection string example -
+     *                                  `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
+     * @param options - Optional. Options to configure the HTTP pipeline.
+     */
+    static fromConnectionString(connectionString, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        options = options || {};
+        const extractedCreds = utils_common_extractConnectionStringParts(connectionString);
+        if (extractedCreds.kind === "AccountConnString") {
+            if (esm_isNodeLike) {
+                const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
+                if (!options.proxyOptions) {
+                    options.proxyOptions = proxyPolicy_getDefaultProxySettings(extractedCreds.proxyUri);
                 }
-                case 'flow-map-end':
-                case 'flow-seq-end':
-                    fc.end.push(this.sourceToken);
-                    return;
+                const pipeline = newPipeline(sharedKeyCredential, options);
+                return new BlobServiceClient(extractedCreds.url, pipeline);
             }
-            const bv = this.startBlockValue(fc);
-            /* istanbul ignore else should not happen */
-            if (bv)
-                this.stack.push(bv);
             else {
-                yield* this.pop();
-                yield* this.step();
+                throw new Error("Account connection string is only supported in Node.js environment");
             }
         }
+        else if (extractedCreds.kind === "SASConnString") {
+            const pipeline = newPipeline(new AnonymousCredential(), options);
+            return new BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline, options);
+        }
         else {
-            const parent = this.peek(2);
-            if (parent.type === 'block-map' &&
-                ((this.type === 'map-value-ind' && parent.indent === fc.indent) ||
-                    (this.type === 'newline' &&
-                        !parent.items[parent.items.length - 1].sep))) {
-                yield* this.pop();
-                yield* this.step();
-            }
-            else if (this.type === 'map-value-ind' &&
-                parent.type !== 'flow-collection') {
-                const prev = getPrevProps(parent);
-                const start = getFirstKeyStartProps(prev);
-                fixFlowSeqItems(fc);
-                const sep = fc.end.splice(1, fc.end.length);
-                sep.push(this.sourceToken);
-                const map = {
-                    type: 'block-map',
-                    offset: fc.offset,
-                    indent: fc.indent,
-                    items: [{ start, key: fc, sep }]
-                };
-                this.onKeyLine = true;
-                this.stack[this.stack.length - 1] = map;
-            }
-            else {
-                yield* this.lineEnd(fc);
-            }
+            throw new Error("Connection string must be either an Account connection string or a SAS connection string");
         }
     }
-    flowScalar(type) {
-        if (this.onNewLine) {
-            let nl = this.source.indexOf('\n') + 1;
-            while (nl !== 0) {
-                this.onNewLine(this.offset + nl);
-                nl = this.source.indexOf('\n', nl) + 1;
-            }
+    constructor(url, credentialOrPipeline, 
+    // Legacy, no fix for eslint error without breaking. Disable it for this interface.
+    /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
+    options) {
+        options = options ?? {};
+        let pipeline;
+        if (isPipelineLike(credentialOrPipeline)) {
+            pipeline = credentialOrPipeline;
+        }
+        else if ((esm_isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential) ||
+            credentialOrPipeline instanceof AnonymousCredential ||
+            isTokenCredential(credentialOrPipeline)) {
+            pipeline = newPipeline(credentialOrPipeline, options);
+        }
+        else {
+            // The second parameter is undefined. Use anonymous credential
+            pipeline = newPipeline(new AnonymousCredential(), options);
+        }
+        super(url, pipeline);
+        this.serviceContext = this.storageClientContext.service;
+        this.blobClientConfig = options;
+    }
+    /**
+     * Creates a {@link ContainerClient} object
+     *
+     * @param containerName - A container name
+     * @returns A new ContainerClient object for the given container name.
+     *
+     * Example usage:
+     *
+     * ```ts snippet:BlobServiceClientGetContainerClient
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * const containerClient = blobServiceClient.getContainerClient("");
+     * ```
+     */
+    getContainerClient(containerName) {
+        return new ContainerClient(utils_common_appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline, this.blobClientConfig);
+    }
+    /**
+     * Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container
+     *
+     * @param containerName - Name of the container to create.
+     * @param options - Options to configure Container Create operation.
+     * @returns Container creation response and the corresponding container client.
+     */
+    async createContainer(containerName, options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => {
+            const containerClient = this.getContainerClient(containerName);
+            const containerCreateResponse = await containerClient.create(updatedOptions);
+            return {
+                containerClient,
+                containerCreateResponse,
+            };
+        });
+    }
+    /**
+     * Deletes a Blob container.
+     *
+     * @param containerName - Name of the container to delete.
+     * @param options - Options to configure Container Delete operation.
+     * @returns Container deletion response.
+     */
+    async deleteContainer(containerName, options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => {
+            const containerClient = this.getContainerClient(containerName);
+            return containerClient.delete(updatedOptions);
+        });
+    }
+    /**
+     * Restore a previously deleted Blob container.
+     * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container.
+     *
+     * @param deletedContainerName - Name of the previously deleted container.
+     * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container.
+     * @param options - Options to configure Container Restore operation.
+     * @returns Container deletion response.
+     */
+    async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => {
+            const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName);
+            // Hack to access a protected member.
+            const containerContext = containerClient["storageClientContext"].container;
+            const containerUndeleteResponse = utils_common_assertResponse(await containerContext.restore({
+                deletedContainerName,
+                deletedContainerVersion,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            return { containerClient, containerUndeleteResponse };
+        });
+    }
+    /**
+     * Gets the properties of a storage account’s Blob service, including properties
+     * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
+     *
+     * @param options - Options to the Service Get Properties operation.
+     * @returns Response data for the Service Get Properties operation.
+     */
+    async getProperties(options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.serviceContext.getProperties({
+                abortSignal: options.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Sets properties for a storage account’s Blob service endpoint, including properties
+     * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
+     * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-service-properties
+     *
+     * @param properties -
+     * @param options - Options to the Service Set Properties operation.
+     * @returns Response data for the Service Set Properties operation.
+     */
+    async setProperties(properties, options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.serviceContext.setProperties(properties, {
+                abortSignal: options.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Retrieves statistics related to replication for the Blob service. It is only
+     * available on the secondary location endpoint when read-access geo-redundant
+     * replication is enabled for the storage account.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats
+     *
+     * @param options - Options to the Service Get Statistics operation.
+     * @returns Response data for the Service Get Statistics operation.
+     */
+    async getStatistics(options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.serviceContext.getStatistics({
+                abortSignal: options.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * The Get Account Information operation returns the sku name and account kind
+     * for the specified account.
+     * The Get Account Information operation is available on service versions beginning
+     * with version 2018-03-28.
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
+     *
+     * @param options - Options to the Service Get Account Info operation.
+     * @returns Response data for the Service Get Account Info operation.
+     */
+    async getAccountInfo(options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.serviceContext.getAccountInfo({
+                abortSignal: options.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * Returns a list of the containers under the specified account.
+     * @see https://learn.microsoft.com/rest/api/storageservices/list-containers2
+     *
+     * @param marker - A string value that identifies the portion of
+     *                        the list of containers to be returned with the next listing operation. The
+     *                        operation returns the continuationToken value within the response body if the
+     *                        listing operation did not return all containers remaining to be listed
+     *                        with the current page. The continuationToken value can be used as the value for
+     *                        the marker parameter in a subsequent call to request the next page of list
+     *                        items. The marker value is opaque to the client.
+     * @param options - Options to the Service List Container Segment operation.
+     * @returns Response data for the Service List Container Segment operation.
+     */
+    async listContainersSegment(marker, options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => {
+            return utils_common_assertResponse(await this.serviceContext.listContainersSegment({
+                abortSignal: options.abortSignal,
+                marker,
+                ...options,
+                include: typeof options.include === "string" ? [options.include] : options.include,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+        });
+    }
+    /**
+     * The Filter Blobs operation enables callers to list blobs across all containers whose tags
+     * match a given search expression. Filter blobs searches across all containers within a
+     * storage account but can be scoped within the expression to a single container.
+     *
+     * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                        The given expression must evaluate to true for a blob to be returned in the results.
+     *                                        The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                        however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param marker - A string value that identifies the portion of
+     *                          the list of blobs to be returned with the next listing operation. The
+     *                          operation returns the continuationToken value within the response body if the
+     *                          listing operation did not return all blobs remaining to be listed
+     *                          with the current page. The continuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of list
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to find blobs by tags.
+     */
+    async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
+        return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.serviceContext.filterBlobs({
+                abortSignal: options.abortSignal,
+                where: tagFilterSqlExpression,
+                marker,
+                maxPageSize: options.maxPageSize,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            const wrappedResponse = {
+                ...response,
+                _response: response._response, // _response is made non-enumerable
+                blobs: response.blobs.map((blob) => {
+                    let tagValue = "";
+                    if (blob.tags?.blobTagSet.length === 1) {
+                        tagValue = blob.tags.blobTagSet[0].value;
+                    }
+                    return { ...blob, tags: toTags(blob.tags), tagValue };
+                }),
+            };
+            return wrappedResponse;
+        });
+    }
+    /**
+     * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse.
+     *
+     * @param tagFilterSqlExpression -  The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                         The given expression must evaluate to true for a blob to be returned in the results.
+     *                                         The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                         however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param marker - A string value that identifies the portion of
+     *                          the list of blobs to be returned with the next listing operation. The
+     *                          operation returns the continuationToken value within the response body if the
+     *                          listing operation did not return all blobs remaining to be listed
+     *                          with the current page. The continuationToken value can be used as the value for
+     *                          the marker parameter in a subsequent call to request the next page of list
+     *                          items. The marker value is opaque to the client.
+     * @param options - Options to find blobs by tags.
+     */
+    async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
+        let response;
+        if (!!marker || marker === undefined) {
+            do {
+                response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
+                response.blobs = response.blobs || [];
+                marker = response.continuationToken;
+                yield response;
+            } while (marker);
+        }
+    }
+    /**
+     * Returns an AsyncIterableIterator for blobs.
+     *
+     * @param tagFilterSqlExpression -  The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                         The given expression must evaluate to true for a blob to be returned in the results.
+     *                                         The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                         however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param options - Options to findBlobsByTagsItems.
+     */
+    async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
+        let marker;
+        for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) {
+            yield* segment.blobs;
         }
+    }
+    /**
+     * Returns an async iterable iterator to find all blobs with specified tag
+     * under the specified account.
+     *
+     * .byPage() returns an async iterable iterator to list the blobs in pages.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
+     *
+     * ```ts snippet:BlobServiceClientFindBlobsByTags
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * // Use for await to iterate the blobs
+     * let i = 1;
+     * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) {
+     *   console.log(`Blob ${i++}: ${blob.name}`);
+     * }
+     *
+     * // Use iter.next() to iterate the blobs
+     * i = 1;
+     * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'");
+     * let { value, done } = await iter.next();
+     * while (!done) {
+     *   console.log(`Blob ${i++}: ${value.name}`);
+     *   ({ value, done } = await iter.next());
+     * }
+     *
+     * // Use byPage() to iterate the blobs
+     * i = 1;
+     * for await (const page of blobServiceClient
+     *   .findBlobsByTags("tagkey='tagvalue'")
+     *   .byPage({ maxPageSize: 20 })) {
+     *   for (const blob of page.blobs) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     *
+     * // Use paging with a marker
+     * i = 1;
+     * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
+     * let response = (await iterator.next()).value;
+     * // Prints 2 blob names
+     * if (response.blobs) {
+     *   for (const blob of response.blobs) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     * // Gets next marker
+     * let marker = response.continuationToken;
+     * // Passing next marker as continuationToken
+     * iterator = blobServiceClient
+     *   .findBlobsByTags("tagkey='tagvalue'")
+     *   .byPage({ continuationToken: marker, maxPageSize: 10 });
+     * response = (await iterator.next()).value;
+     *
+     * // Prints blob names
+     * if (response.blobs) {
+     *   for (const blob of response.blobs) {
+     *     console.log(`Blob ${i++}: ${blob.name}`);
+     *   }
+     * }
+     * ```
+     *
+     * @param tagFilterSqlExpression -  The where parameter enables the caller to query blobs whose tags match a given expression.
+     *                                         The given expression must evaluate to true for a blob to be returned in the results.
+     *                                         The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
+     *                                         however, only a subset of the OData filter syntax is supported in the Blob service.
+     * @param options - Options to find blobs by tags.
+     */
+    findBlobsByTags(tagFilterSqlExpression, options = {}) {
+        // AsyncIterableIterator to iterate over blobs
+        const listSegmentOptions = {
+            ...options,
+        };
+        const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
         return {
-            type,
-            offset: this.offset,
-            indent: this.indent,
-            source: this.source
+            /**
+             * The next method, part of the iteration protocol
+             */
+            next() {
+                return iter.next();
+            },
+            /**
+             * The connection to the async iterator, part of the iteration protocol
+             */
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            /**
+             * Return an AsyncIterableIterator that works a page at a time
+             */
+            byPage: (settings = {}) => {
+                return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
+                    maxPageSize: settings.maxPageSize,
+                    ...listSegmentOptions,
+                });
+            },
         };
     }
-    startBlockValue(parent) {
-        switch (this.type) {
-            case 'alias':
-            case 'scalar':
-            case 'single-quoted-scalar':
-            case 'double-quoted-scalar':
-                return this.flowScalar(this.type);
-            case 'block-scalar-header':
-                return {
-                    type: 'block-scalar',
-                    offset: this.offset,
-                    indent: this.indent,
-                    props: [this.sourceToken],
-                    source: ''
-                };
-            case 'flow-map-start':
-            case 'flow-seq-start':
-                return {
-                    type: 'flow-collection',
-                    offset: this.offset,
-                    indent: this.indent,
-                    start: this.sourceToken,
-                    items: [],
-                    end: []
-                };
-            case 'seq-item-ind':
-                return {
-                    type: 'block-seq',
-                    offset: this.offset,
-                    indent: this.indent,
-                    items: [{ start: [this.sourceToken] }]
-                };
-            case 'explicit-key-ind': {
-                this.onKeyLine = true;
-                const prev = getPrevProps(parent);
-                const start = getFirstKeyStartProps(prev);
-                start.push(this.sourceToken);
-                return {
-                    type: 'block-map',
-                    offset: this.offset,
-                    indent: this.indent,
-                    items: [{ start, explicitKey: true }]
-                };
-            }
-            case 'map-value-ind': {
-                this.onKeyLine = true;
-                const prev = getPrevProps(parent);
-                const start = getFirstKeyStartProps(prev);
-                return {
-                    type: 'block-map',
-                    offset: this.offset,
-                    indent: this.indent,
-                    items: [{ start, key: null, sep: [this.sourceToken] }]
-                };
-            }
+    /**
+     * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses
+     *
+     * @param marker - A string value that identifies the portion of
+     *                        the list of containers to be returned with the next listing operation. The
+     *                        operation returns the continuationToken value within the response body if the
+     *                        listing operation did not return all containers remaining to be listed
+     *                        with the current page. The continuationToken value can be used as the value for
+     *                        the marker parameter in a subsequent call to request the next page of list
+     *                        items. The marker value is opaque to the client.
+     * @param options - Options to list containers operation.
+     */
+    async *listSegments(marker, options = {}) {
+        let listContainersSegmentResponse;
+        if (!!marker || marker === undefined) {
+            do {
+                listContainersSegmentResponse = await this.listContainersSegment(marker, options);
+                listContainersSegmentResponse.containerItems =
+                    listContainersSegmentResponse.containerItems || [];
+                marker = listContainersSegmentResponse.continuationToken;
+                yield await listContainersSegmentResponse;
+            } while (marker);
         }
-        return null;
     }
-    atIndentedComment(start, indent) {
-        if (this.type !== 'comment')
-            return false;
-        if (this.indent <= indent)
-            return false;
-        return start.every(st => st.type === 'newline' || st.type === 'space');
+    /**
+     * Returns an AsyncIterableIterator for Container Items
+     *
+     * @param options - Options to list containers operation.
+     */
+    async *listItems(options = {}) {
+        let marker;
+        for await (const segment of this.listSegments(marker, options)) {
+            yield* segment.containerItems;
+        }
+    }
+    /**
+     * Returns an async iterable iterator to list all the containers
+     * under the specified account.
+     *
+     * .byPage() returns an async iterable iterator to list the containers in pages.
+     *
+     * ```ts snippet:BlobServiceClientListContainers
+     * import { BlobServiceClient } from "@azure/storage-blob";
+     * import { DefaultAzureCredential } from "@azure/identity";
+     *
+     * const account = "";
+     * const blobServiceClient = new BlobServiceClient(
+     *   `https://${account}.blob.core.windows.net`,
+     *   new DefaultAzureCredential(),
+     * );
+     *
+     * // Use for await to iterate the containers
+     * let i = 1;
+     * for await (const container of blobServiceClient.listContainers()) {
+     *   console.log(`Container ${i++}: ${container.name}`);
+     * }
+     *
+     * // Use iter.next() to iterate the containers
+     * i = 1;
+     * const iter = blobServiceClient.listContainers();
+     * let { value, done } = await iter.next();
+     * while (!done) {
+     *   console.log(`Container ${i++}: ${value.name}`);
+     *   ({ value, done } = await iter.next());
+     * }
+     *
+     * // Use byPage() to iterate the containers
+     * i = 1;
+     * for await (const page of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) {
+     *   for (const container of page.containerItems) {
+     *     console.log(`Container ${i++}: ${container.name}`);
+     *   }
+     * }
+     *
+     * // Use paging with a marker
+     * i = 1;
+     * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 });
+     * let response = (await iterator.next()).value;
+     *
+     * // Prints 2 container names
+     * if (response.containerItems) {
+     *   for (const container of response.containerItems) {
+     *     console.log(`Container ${i++}: ${container.name}`);
+     *   }
+     * }
+     *
+     * // Gets next marker
+     * let marker = response.continuationToken;
+     * // Passing next marker as continuationToken
+     * iterator = blobServiceClient
+     *   .listContainers()
+     *   .byPage({ continuationToken: marker, maxPageSize: 10 });
+     * response = (await iterator.next()).value;
+     *
+     * // Prints 10 container names
+     * if (response.containerItems) {
+     *   for (const container of response.containerItems) {
+     *     console.log(`Container ${i++}: ${container.name}`);
+     *   }
+     * }
+     * ```
+     *
+     * @param options - Options to list containers.
+     * @returns An asyncIterableIterator that supports paging.
+     */
+    listContainers(options = {}) {
+        if (options.prefix === "") {
+            options.prefix = undefined;
+        }
+        const include = [];
+        if (options.includeDeleted) {
+            include.push("deleted");
+        }
+        if (options.includeMetadata) {
+            include.push("metadata");
+        }
+        if (options.includeSystem) {
+            include.push("system");
+        }
+        // AsyncIterableIterator to iterate over containers
+        const listSegmentOptions = {
+            ...options,
+            ...(include.length > 0 ? { include } : {}),
+        };
+        const iter = this.listItems(listSegmentOptions);
+        return {
+            /**
+             * The next method, part of the iteration protocol
+             */
+            next() {
+                return iter.next();
+            },
+            /**
+             * The connection to the async iterator, part of the iteration protocol
+             */
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            /**
+             * Return an AsyncIterableIterator that works a page at a time
+             */
+            byPage: (settings = {}) => {
+                return this.listSegments(settings.continuationToken, {
+                    maxPageSize: settings.maxPageSize,
+                    ...listSegmentOptions,
+                });
+            },
+        };
+    }
+    async getUserDelegationKey(startsOnOrParam, expiresOnOrOption, options = {}) {
+        let startsOn = startsOnOrParam;
+        let expiresOn = expiresOnOrOption;
+        let userDelegationTid = undefined;
+        let getUserDelegationKeyOptions = options;
+        if (isBlobGetUserDelegationKeyParameters(startsOnOrParam)) {
+            startsOn = startsOnOrParam.startsOn;
+            expiresOn = startsOnOrParam.expiresOn;
+            userDelegationTid = startsOnOrParam.delegatedUserTenantId;
+            getUserDelegationKeyOptions = expiresOnOrOption;
+            getUserDelegationKeyOptions = getUserDelegationKeyOptions ?? {};
+        }
+        return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", getUserDelegationKeyOptions, async (updatedOptions) => {
+            const response = utils_common_assertResponse(await this.serviceContext.getUserDelegationKey({
+                startsOn: utils_common_truncatedISO8061Date(startsOn, false),
+                expiresOn: utils_common_truncatedISO8061Date(expiresOn, false),
+                delegatedUserTid: userDelegationTid,
+            }, {
+                abortSignal: getUserDelegationKeyOptions.abortSignal,
+                tracingOptions: updatedOptions.tracingOptions,
+            }));
+            const userDelegationKey = {
+                signedObjectId: response.signedObjectId,
+                signedTenantId: response.signedTenantId,
+                signedStartsOn: new Date(response.signedStartsOn),
+                signedExpiresOn: new Date(response.signedExpiresOn),
+                signedService: response.signedService,
+                signedVersion: response.signedVersion,
+                signedDelegatedUserTenantId: response.signedDelegatedUserTenantId,
+                value: response.value,
+            };
+            const res = {
+                _response: response._response,
+                requestId: response.requestId,
+                clientRequestId: response.clientRequestId,
+                version: response.version,
+                date: response.date,
+                errorCode: response.errorCode,
+                ...userDelegationKey,
+            };
+            return res;
+        });
+    }
+    /**
+     * Creates a BlobBatchClient object to conduct batch operations.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
+     *
+     * @returns A new BlobBatchClient object for this service.
+     */
+    getBlobBatchClient() {
+        return new BlobBatchClient(this.url, this.pipeline);
     }
-    *documentEnd(docEnd) {
-        if (this.type !== 'doc-mode') {
-            if (docEnd.end)
-                docEnd.end.push(this.sourceToken);
-            else
-                docEnd.end = [this.sourceToken];
-            if (this.type === 'newline')
-                yield* this.pop();
+    /**
+     * Only available for BlobServiceClient constructed with a shared key credential.
+     *
+     * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties
+     * and parameters passed in. The SAS is signed by the shared key credential of the client.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
+     *
+     * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
+     * @param permissions - Specifies the list of permissions to be associated with the SAS.
+     * @param resourceTypes - Specifies the resource types associated with the shared access signature.
+     * @param options - Optional parameters.
+     * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
+        if (!(this.credential instanceof StorageSharedKeyCredential)) {
+            throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
+        }
+        if (expiresOn === undefined) {
+            const now = new Date();
+            expiresOn = new Date(now.getTime() + 3600 * 1000);
         }
+        const sas = generateAccountSASQueryParameters({
+            permissions,
+            expiresOn,
+            resourceTypes,
+            services: AccountSASServices.parse("b").toString(),
+            ...options,
+        }, this.credential).toString();
+        return utils_common_appendToURLQuery(this.url, sas);
     }
-    *lineEnd(token) {
-        switch (this.type) {
-            case 'comma':
-            case 'doc-start':
-            case 'doc-end':
-            case 'flow-seq-end':
-            case 'flow-map-end':
-            case 'map-value-ind':
-                yield* this.pop();
-                yield* this.step();
-                break;
-            case 'newline':
-                this.onKeyLine = false;
-            // fallthrough
-            case 'space':
-            case 'comment':
-            default:
-                // all other values are errors
-                if (token.end)
-                    token.end.push(this.sourceToken);
-                else
-                    token.end = [this.sourceToken];
-                if (this.type === 'newline')
-                    yield* this.pop();
+    /**
+     * Only available for BlobServiceClient constructed with a shared key credential.
+     *
+     * Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on
+     * the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
+     *
+     * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
+     *
+     * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
+     * @param permissions - Specifies the list of permissions to be associated with the SAS.
+     * @param resourceTypes - Specifies the resource types associated with the shared access signature.
+     * @param options - Optional parameters.
+     * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
+     */
+    generateSasStringToSign(expiresOn, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
+        if (!(this.credential instanceof StorageSharedKeyCredential)) {
+            throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
         }
+        if (expiresOn === undefined) {
+            const now = new Date();
+            expiresOn = new Date(now.getTime() + 3600 * 1000);
+        }
+        return generateAccountSASQueryParametersInternal({
+            permissions,
+            expiresOn,
+            resourceTypes,
+            services: AccountSASServices.parse("b").toString(),
+            ...options,
+        }, this.credential).stringToSign;
     }
 }
+//# sourceMappingURL=BlobServiceClient.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/generatedModels.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+/** Known values of {@link EncryptionAlgorithmType} that the service accepts. */
+var generatedModels_KnownEncryptionAlgorithmType;
+(function (KnownEncryptionAlgorithmType) {
+    KnownEncryptionAlgorithmType["AES256"] = "AES256";
+})(generatedModels_KnownEncryptionAlgorithmType || (generatedModels_KnownEncryptionAlgorithmType = {}));
+//# sourceMappingURL=generatedModels.js.map
+;// CONCATENATED MODULE: ./node_modules/@azure/storage-blob/dist/esm/index.js
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
 
-exports.Parser = Parser;
 
 
-/***/ }),
 
-/***/ 84047:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
 
-var composer = __nccwpck_require__(89984);
-var Document = __nccwpck_require__(3021);
-var errors = __nccwpck_require__(91464);
-var log = __nccwpck_require__(57249);
-var identity = __nccwpck_require__(41127);
-var lineCounter = __nccwpck_require__(66628);
-var parser = __nccwpck_require__(3456);
 
-function parseOptions(options) {
-    const prettyErrors = options.prettyErrors !== false;
-    const lineCounter$1 = options.lineCounter || (prettyErrors && new lineCounter.LineCounter()) || null;
-    return { lineCounter: lineCounter$1, prettyErrors };
-}
-/**
- * Parse the input as a stream of YAML documents.
- *
- * Documents should be separated from each other by `...` or `---` marker lines.
- *
- * @returns If an empty `docs` array is returned, it will be of type
- *   EmptyStream and contain additional stream information. In
- *   TypeScript, you should use `'empty' in docs` as a type guard for it.
- */
-function parseAllDocuments(source, options = {}) {
-    const { lineCounter, prettyErrors } = parseOptions(options);
-    const parser$1 = new parser.Parser(lineCounter?.addNewLine);
-    const composer$1 = new composer.Composer(options);
-    const docs = Array.from(composer$1.compose(parser$1.parse(source)));
-    if (prettyErrors && lineCounter)
-        for (const doc of docs) {
-            doc.errors.forEach(errors.prettifyError(source, lineCounter));
-            doc.warnings.forEach(errors.prettifyError(source, lineCounter));
-        }
-    if (docs.length > 0)
-        return docs;
-    return Object.assign([], { empty: true }, composer$1.streamInfo());
-}
-/** Parse an input string into a single YAML.Document */
-function parseDocument(source, options = {}) {
-    const { lineCounter, prettyErrors } = parseOptions(options);
-    const parser$1 = new parser.Parser(lineCounter?.addNewLine);
-    const composer$1 = new composer.Composer(options);
-    // `doc` is always set by compose.end(true) at the very latest
-    let doc = null;
-    for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
-        if (!doc)
-            doc = _doc;
-        else if (doc.options.logLevel !== 'silent') {
-            doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()'));
-            break;
-        }
-    }
-    if (prettyErrors && lineCounter) {
-        doc.errors.forEach(errors.prettifyError(source, lineCounter));
-        doc.warnings.forEach(errors.prettifyError(source, lineCounter));
-    }
-    return doc;
-}
-function parse(src, reviver, options) {
-    let _reviver = undefined;
-    if (typeof reviver === 'function') {
-        _reviver = reviver;
-    }
-    else if (options === undefined && reviver && typeof reviver === 'object') {
-        options = reviver;
-    }
-    const doc = parseDocument(src, options);
-    if (!doc)
-        return null;
-    doc.warnings.forEach(warning => log.warn(doc.options.logLevel, warning));
-    if (doc.errors.length > 0) {
-        if (doc.options.logLevel !== 'silent')
-            throw doc.errors[0];
-        else
-            doc.errors = [];
-    }
-    return doc.toJS(Object.assign({ reviver: _reviver }, options));
-}
-function stringify(value, replacer, options) {
-    let _replacer = null;
-    if (typeof replacer === 'function' || Array.isArray(replacer)) {
-        _replacer = replacer;
-    }
-    else if (options === undefined && replacer) {
-        options = replacer;
-    }
-    if (typeof options === 'string')
-        options = options.length;
-    if (typeof options === 'number') {
-        const indent = Math.round(options);
-        options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent };
-    }
-    if (value === undefined) {
-        const { keepUndefined } = options ?? replacer ?? {};
-        if (!keepUndefined)
-            return undefined;
-    }
-    if (identity.isDocument(value) && !_replacer)
-        return value.toString(options);
-    return new Document.Document(value, _replacer, options).toString(options);
-}
 
-exports.parse = parse;
-exports.parseAllDocuments = parseAllDocuments;
-exports.parseDocument = parseDocument;
-exports.stringify = stringify;
 
 
-/***/ }),
 
-/***/ 45840:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
 
-var identity = __nccwpck_require__(41127);
-var map = __nccwpck_require__(47451);
-var seq = __nccwpck_require__(1706);
-var string = __nccwpck_require__(66464);
-var tags = __nccwpck_require__(90018);
 
-const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
-class Schema {
-    constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
-        this.compat = Array.isArray(compat)
-            ? tags.getTags(compat, 'compat')
-            : compat
-                ? tags.getTags(null, compat)
-                : null;
-        this.name = (typeof schema === 'string' && schema) || 'core';
-        this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
-        this.tags = tags.getTags(customTags, this.name, merge);
-        this.toStringOptions = toStringDefaults ?? null;
-        Object.defineProperty(this, identity.MAP, { value: map.map });
-        Object.defineProperty(this, identity.SCALAR, { value: string.string });
-        Object.defineProperty(this, identity.SEQ, { value: seq.seq });
-        // Used by createMap()
-        this.sortMapEntries =
-            typeof sortMapEntries === 'function'
-                ? sortMapEntries
-                : sortMapEntries === true
-                    ? sortMapEntriesByKey
-                    : null;
-    }
-    clone() {
-        const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this));
-        copy.tags = this.tags.slice();
-        return copy;
-    }
-}
 
-exports.Schema = Schema;
 
 
-/***/ }),
 
-/***/ 47451:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/upload/blob-upload.js
+var blob_upload_awaiter = (undefined && undefined.__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 identity = __nccwpck_require__(41127);
-var YAMLMap = __nccwpck_require__(84454);
 
-const map = {
-    collection: 'map',
-    default: true,
-    nodeClass: YAMLMap.YAMLMap,
-    tag: 'tag:yaml.org,2002:map',
-    resolve(map, onError) {
-        if (!identity.isMap(map))
-            onError('Expected a mapping for this tag');
-        return map;
-    },
-    createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
+
+
+
+function uploadToBlobStorage(authenticatedUploadURL, uploadStream, contentType) {
+    return blob_upload_awaiter(this, void 0, void 0, function* () {
+        let uploadByteCount = 0;
+        let lastProgressTime = Date.now();
+        const abortController = new AbortController();
+        const chunkTimer = (interval) => blob_upload_awaiter(this, void 0, void 0, function* () {
+            return new Promise((resolve, reject) => {
+                const timer = setInterval(() => {
+                    if (Date.now() - lastProgressTime > interval) {
+                        reject(new Error('Upload progress stalled.'));
+                    }
+                }, interval);
+                abortController.signal.addEventListener('abort', () => {
+                    clearInterval(timer);
+                    resolve();
+                });
+            });
+        });
+        const maxConcurrency = getConcurrency();
+        const bufferSize = getUploadChunkSize();
+        const blobClient = new BlobClient(authenticatedUploadURL);
+        const blockBlobClient = blobClient.getBlockBlobClient();
+        core_debug(`Uploading artifact to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}, contentType: ${contentType}`);
+        const uploadCallback = (progress) => {
+            info(`Uploaded bytes ${progress.loadedBytes}`);
+            uploadByteCount = progress.loadedBytes;
+            lastProgressTime = Date.now();
+        };
+        const options = {
+            blobHTTPHeaders: { blobContentType: contentType },
+            onProgress: uploadCallback,
+            abortSignal: abortController.signal
+        };
+        let sha256Hash = undefined;
+        const blobUploadStream = new external_stream_.PassThrough();
+        const hashStream = external_crypto_.createHash('sha256');
+        uploadStream.pipe(blobUploadStream); // This stream is used for the upload
+        uploadStream.pipe(hashStream).setEncoding('hex'); // This stream is used to compute a hash of the content for integrity check
+        info('Beginning upload of artifact content to blob storage');
+        try {
+            yield Promise.race([
+                blockBlobClient.uploadStream(blobUploadStream, bufferSize, maxConcurrency, options),
+                chunkTimer(getUploadChunkTimeout())
+            ]);
+        }
+        catch (error) {
+            if (NetworkError.isNetworkErrorCode(error === null || error === void 0 ? void 0 : error.code)) {
+                throw new NetworkError(error === null || error === void 0 ? void 0 : error.code);
+            }
+            throw error;
+        }
+        finally {
+            abortController.abort();
+        }
+        info('Finished uploading artifact content to blob storage!');
+        hashStream.end();
+        sha256Hash = hashStream.read();
+        info(`SHA256 digest of uploaded artifact is ${sha256Hash}`);
+        if (uploadByteCount === 0) {
+            warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`);
+        }
+        return {
+            uploadSize: uploadByteCount,
+            sha256Hash
+        };
+    });
+}
+//# sourceMappingURL=blob-upload.js.map
+;// CONCATENATED MODULE: external "fs/promises"
+const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs/promises");
+// EXTERNAL MODULE: ./node_modules/archiver/index.js
+var archiver = __nccwpck_require__(99392);
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/upload/stream.js
+var stream_awaiter = (undefined && undefined.__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());
+    });
 };
 
-exports.map = map;
 
 
-/***/ }),
 
-/***/ 73632:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
+// Custom stream transformer so we can set the highWaterMark property
+// See https://github.com/nodejs/node/issues/8855
+class WaterMarkedUploadStream extends external_stream_.Transform {
+    constructor(bufferSize) {
+        super({
+            highWaterMark: bufferSize
+        });
+    }
+    // eslint-disable-next-line @typescript-eslint/no-explicit-any
+    _transform(chunk, enc, cb) {
+        cb(null, chunk);
+    }
+}
+function createRawFileUploadStream(filePath) {
+    return stream_awaiter(this, void 0, void 0, function* () {
+        core_debug(`Creating raw file upload stream for: ${filePath}`);
+        const bufferSize = getUploadChunkSize();
+        const uploadStream = new WaterMarkedUploadStream(bufferSize);
+        // Check if symlink and resolve the source path
+        let sourcePath = filePath;
+        const stats = yield external_fs_.promises.lstat(filePath);
+        if (stats.isSymbolicLink()) {
+            sourcePath = yield (0,promises_namespaceObject.realpath)(filePath);
+        }
+        // Create a read stream from the file and pipe it to the upload stream
+        const fileStream = external_fs_.createReadStream(sourcePath, {
+            highWaterMark: bufferSize
+        });
+        fileStream.on('error', error => {
+            core_error('An error has occurred while reading the file for upload');
+            core_error(String(error));
+            uploadStream.destroy(new Error('An error has occurred during file read for the artifact'));
+        });
+        fileStream.pipe(uploadStream);
+        return uploadStream;
+    });
+}
+//# sourceMappingURL=stream.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/upload/zip.js
+var zip_awaiter = (undefined && undefined.__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 Scalar = __nccwpck_require__(63301);
 
-const nullTag = {
-    identify: value => value == null,
-    createNode: () => new Scalar.Scalar(null),
-    default: true,
-    tag: 'tag:yaml.org,2002:null',
-    test: /^(?:~|[Nn]ull|NULL)?$/,
-    resolve: () => new Scalar.Scalar(null),
-    stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)
-        ? source
-        : ctx.options.nullStr
+
+const DEFAULT_COMPRESSION_LEVEL = 6;
+function createZipUploadStream(uploadSpecification_1) {
+    return zip_awaiter(this, arguments, void 0, function* (uploadSpecification, compressionLevel = DEFAULT_COMPRESSION_LEVEL) {
+        core_debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`);
+        const zip = archiver.create('zip', {
+            highWaterMark: getUploadChunkSize(),
+            zlib: { level: compressionLevel }
+        });
+        // register callbacks for various events during the zip lifecycle
+        zip.on('error', zipErrorCallback);
+        zip.on('warning', zipWarningCallback);
+        zip.on('finish', zipFinishCallback);
+        zip.on('end', zipEndCallback);
+        for (const file of uploadSpecification) {
+            if (file.sourcePath !== null) {
+                // Check if symlink and resolve the source path
+                let sourcePath = file.sourcePath;
+                if (file.stats.isSymbolicLink()) {
+                    sourcePath = yield (0,promises_namespaceObject.realpath)(file.sourcePath);
+                }
+                // Add the file to the zip
+                zip.file(sourcePath, {
+                    name: file.destinationPath
+                });
+            }
+            else {
+                // Add a directory to the zip
+                zip.append('', { name: file.destinationPath });
+            }
+        }
+        const bufferSize = getUploadChunkSize();
+        const zipUploadStream = new WaterMarkedUploadStream(bufferSize);
+        core_debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`);
+        core_debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`);
+        zip.pipe(zipUploadStream);
+        zip.finalize();
+        return zipUploadStream;
+    });
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+const zipErrorCallback = (error) => {
+    core_error('An error has occurred while creating the zip file for upload');
+    info(error);
+    throw new Error('An error has occurred during zip creation for the artifact');
+};
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+const zipWarningCallback = (error) => {
+    if (error.code === 'ENOENT') {
+        warning('ENOENT warning during artifact zip creation. No such file or directory');
+        info(error);
+    }
+    else {
+        warning(`A non-blocking warning has occurred during artifact zip creation: ${error.code}`);
+        info(error);
+    }
+};
+const zipFinishCallback = () => {
+    core_debug('Zip stream for upload has finished.');
+};
+const zipEndCallback = () => {
+    core_debug('Zip stream for upload has ended.');
+};
+//# sourceMappingURL=zip.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/upload/types.js
+
+/**
+ * Maps file extensions to MIME types
+ */
+const types_mimeTypes = {
+    // Text
+    '.txt': 'text/plain',
+    '.html': 'text/html',
+    '.htm': 'text/html',
+    '.css': 'text/css',
+    '.csv': 'text/csv',
+    '.xml': 'text/xml',
+    '.md': 'text/markdown',
+    // JavaScript/JSON
+    '.js': 'application/javascript',
+    '.mjs': 'application/javascript',
+    '.json': 'application/json',
+    // Images
+    '.png': 'image/png',
+    '.jpg': 'image/jpeg',
+    '.jpeg': 'image/jpeg',
+    '.gif': 'image/gif',
+    '.svg': 'image/svg+xml',
+    '.webp': 'image/webp',
+    '.ico': 'image/x-icon',
+    '.bmp': 'image/bmp',
+    '.tiff': 'image/tiff',
+    '.tif': 'image/tiff',
+    // Audio
+    '.mp3': 'audio/mpeg',
+    '.wav': 'audio/wav',
+    '.ogg': 'audio/ogg',
+    '.flac': 'audio/flac',
+    // Video
+    '.mp4': 'video/mp4',
+    '.webm': 'video/webm',
+    '.avi': 'video/x-msvideo',
+    '.mov': 'video/quicktime',
+    // Documents
+    '.pdf': 'application/pdf',
+    '.doc': 'application/msword',
+    '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+    '.xls': 'application/vnd.ms-excel',
+    '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+    '.ppt': 'application/vnd.ms-powerpoint',
+    '.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+    // Archives
+    '.zip': 'application/zip',
+    '.tar': 'application/x-tar',
+    '.gz': 'application/gzip',
+    '.rar': 'application/vnd.rar',
+    '.7z': 'application/x-7z-compressed',
+    // Code/Data
+    '.wasm': 'application/wasm',
+    '.yaml': 'application/x-yaml',
+    '.yml': 'application/x-yaml',
+    // Fonts
+    '.woff': 'font/woff',
+    '.woff2': 'font/woff2',
+    '.ttf': 'font/ttf',
+    '.otf': 'font/otf',
+    '.eot': 'application/vnd.ms-fontobject'
+};
+/**
+ * Gets the MIME type for a file based on its extension
+ */
+function getMimeType(filePath) {
+    const ext = external_path_.extname(filePath).toLowerCase();
+    return types_mimeTypes[ext] || 'application/octet-stream';
+}
+//# sourceMappingURL=types.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/upload/upload-artifact.js
+var upload_artifact_awaiter = (undefined && undefined.__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());
+    });
 };
 
-exports.nullTag = nullTag;
 
 
-/***/ }),
 
-/***/ 1706:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
 
-var identity = __nccwpck_require__(41127);
-var YAMLSeq = __nccwpck_require__(92223);
 
-const seq = {
-    collection: 'seq',
-    default: true,
-    nodeClass: YAMLSeq.YAMLSeq,
-    tag: 'tag:yaml.org,2002:seq',
-    resolve(seq, onError) {
-        if (!identity.isSeq(seq))
-            onError('Expected a sequence for this tag');
-        return seq;
-    },
-    createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
-};
 
-exports.seq = seq;
 
 
-/***/ }),
 
-/***/ 66464:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
+function uploadArtifact(name, files, rootDirectory, options) {
+    return upload_artifact_awaiter(this, void 0, void 0, function* () {
+        let artifactFileName = `${name}.zip`;
+        if (options === null || options === void 0 ? void 0 : options.skipArchive) {
+            if (files.length === 0) {
+                throw new FilesNotFoundError([]);
+            }
+            if (files.length > 1) {
+                throw new Error('skipArchive option is only supported when uploading a single file');
+            }
+            if (!external_fs_.existsSync(files[0])) {
+                throw new FilesNotFoundError(files);
+            }
+            artifactFileName = external_path_.basename(files[0]);
+            name = artifactFileName;
+        }
+        validateArtifactName(name);
+        validateRootDirectory(rootDirectory);
+        let zipSpecification = [];
+        if (!(options === null || options === void 0 ? void 0 : options.skipArchive)) {
+            zipSpecification = getUploadZipSpecification(files, rootDirectory);
+            if (zipSpecification.length === 0) {
+                throw new FilesNotFoundError(zipSpecification.flatMap(s => (s.sourcePath ? [s.sourcePath] : [])));
+            }
+        }
+        const contentType = getMimeType(artifactFileName);
+        // get the IDs needed for the artifact creation
+        const backendIds = getBackendIdsFromToken();
+        // create the artifact client
+        const artifactClient = internalArtifactTwirpClient();
+        // create the artifact
+        const createArtifactReq = {
+            workflowRunBackendId: backendIds.workflowRunBackendId,
+            workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
+            name,
+            mimeType: StringValue.create({ value: contentType }),
+            version: 7
+        };
+        // if there is a retention period, add it to the request
+        const expiresAt = getExpiration(options === null || options === void 0 ? void 0 : options.retentionDays);
+        if (expiresAt) {
+            createArtifactReq.expiresAt = expiresAt;
+        }
+        const createArtifactResp = yield artifactClient.CreateArtifact(createArtifactReq);
+        if (!createArtifactResp.ok) {
+            throw new InvalidResponseError('CreateArtifact: response from backend was not ok');
+        }
+        let stream;
+        if (options === null || options === void 0 ? void 0 : options.skipArchive) {
+            // Upload raw file without archiving
+            stream = yield createRawFileUploadStream(files[0]);
+        }
+        else {
+            // Create and upload zip archive
+            stream = yield createZipUploadStream(zipSpecification, options === null || options === void 0 ? void 0 : options.compressionLevel);
+        }
+        info(`Uploading artifact: ${artifactFileName}`);
+        const uploadResult = yield uploadToBlobStorage(createArtifactResp.signedUploadUrl, stream, contentType);
+        // finalize the artifact
+        const finalizeArtifactReq = {
+            workflowRunBackendId: backendIds.workflowRunBackendId,
+            workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
+            name,
+            size: uploadResult.uploadSize ? uploadResult.uploadSize.toString() : '0'
+        };
+        if (uploadResult.sha256Hash) {
+            finalizeArtifactReq.hash = StringValue.create({
+                value: `sha256:${uploadResult.sha256Hash}`
+            });
+        }
+        info(`Finalizing artifact upload`);
+        const finalizeArtifactResp = yield artifactClient.FinalizeArtifact(finalizeArtifactReq);
+        if (!finalizeArtifactResp.ok) {
+            throw new InvalidResponseError('FinalizeArtifact: response from backend was not ok');
+        }
+        const artifactId = BigInt(finalizeArtifactResp.artifactId);
+        info(`Artifact ${name} successfully finalized. Artifact ID ${artifactId}`);
+        return {
+            size: uploadResult.uploadSize,
+            digest: uploadResult.sha256Hash,
+            id: Number(artifactId)
+        };
+    });
+}
+//# sourceMappingURL=upload-artifact.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/context.js
 
-var stringifyString = __nccwpck_require__(83069);
 
-const string = {
-    identify: value => typeof value === 'string',
-    default: true,
-    tag: 'tag:yaml.org,2002:str',
-    resolve: str => str,
-    stringify(item, ctx, onComment, onChompKeep) {
-        ctx = Object.assign({ actualString: true }, ctx);
-        return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);
+class Context {
+    /**
+     * Hydrate the context from the environment
+     */
+    constructor() {
+        var _a, _b, _c;
+        this.payload = {};
+        if (process.env.GITHUB_EVENT_PATH) {
+            if ((0,external_fs_.existsSync)(process.env.GITHUB_EVENT_PATH)) {
+                this.payload = JSON.parse((0,external_fs_.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
+            }
+            else {
+                const path = process.env.GITHUB_EVENT_PATH;
+                process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${external_os_.EOL}`);
+            }
+        }
+        this.eventName = process.env.GITHUB_EVENT_NAME;
+        this.sha = process.env.GITHUB_SHA;
+        this.ref = process.env.GITHUB_REF;
+        this.workflow = process.env.GITHUB_WORKFLOW;
+        this.action = process.env.GITHUB_ACTION;
+        this.actor = process.env.GITHUB_ACTOR;
+        this.job = process.env.GITHUB_JOB;
+        this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10);
+        this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
+        this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
+        this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
+        this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
+        this.graphqlUrl =
+            (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
+    }
+    get issue() {
+        const payload = this.payload;
+        return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
+    }
+    get repo() {
+        if (process.env.GITHUB_REPOSITORY) {
+            const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
+            return { owner, repo };
+        }
+        if (this.payload.repository) {
+            return {
+                owner: this.payload.repository.owner.login,
+                repo: this.payload.repository.name
+            };
+        }
+        throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
     }
+}
+//# sourceMappingURL=context.js.map
+// EXTERNAL MODULE: ./node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js
+var lib = __nccwpck_require__(89659);
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/internal/utils.js
+var utils_awaiter = (undefined && undefined.__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());
+    });
 };
 
-exports.string = string;
-
-
-/***/ }),
-
-/***/ 73959:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
+function getAuthString(token, options) {
+    if (!token && !options.auth) {
+        throw new Error('Parameter token or opts.auth is required');
+    }
+    else if (token && options.auth) {
+        throw new Error('Parameters token and opts.auth may not both be specified');
+    }
+    return typeof options.auth === 'string' ? options.auth : `token ${token}`;
+}
+function getProxyAgent(destinationUrl) {
+    const hc = new lib.HttpClient();
+    return hc.getAgent(destinationUrl);
+}
+function getProxyAgentDispatcher(destinationUrl) {
+    const hc = new lib.HttpClient();
+    return hc.getAgentDispatcher(destinationUrl);
+}
+function getProxyFetch(destinationUrl) {
+    const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
+    const proxyFetch = (url, opts) => utils_awaiter(this, void 0, void 0, function* () {
+        return (0,undici.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
+    });
+    return proxyFetch;
+}
+function getApiBaseUrl() {
+    return process.env['GITHUB_API_URL'] || 'https://api.github.com';
+}
+function getUserAgentWithOrchestrationId(baseUserAgent) {
+    var _a;
+    const orchId = (_a = process.env['ACTIONS_ORCHESTRATION_ID']) === null || _a === void 0 ? void 0 : _a.trim();
+    if (orchId) {
+        const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
+        const tag = `actions_orchestration_id/${sanitizedId}`;
+        if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag))
+            return baseUserAgent;
+        const ua = baseUserAgent ? `${baseUserAgent} ` : '';
+        return `${ua}${tag}`;
+    }
+    return baseUserAgent;
+}
+//# sourceMappingURL=utils.js.map
+;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js
+function getUserAgent() {
+  if (typeof navigator === "object" && "userAgent" in navigator) {
+    return navigator.userAgent;
+  }
 
+  if (typeof process === "object" && process.version !== undefined) {
+    return `Node.js/${process.version.substr(1)} (${process.platform}; ${
+      process.arch
+    })`;
+  }
 
-var Scalar = __nccwpck_require__(63301);
+  return "";
+}
 
-const boolTag = {
-    identify: value => typeof value === 'boolean',
-    default: true,
-    tag: 'tag:yaml.org,2002:bool',
-    test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
-    resolve: str => new Scalar.Scalar(str[0] === 't' || str[0] === 'T'),
-    stringify({ source, value }, ctx) {
-        if (source && boolTag.test.test(source)) {
-            const sv = source[0] === 't' || source[0] === 'T';
-            if (value === sv)
-                return source;
-        }
-        return value ? ctx.options.trueStr : ctx.options.falseStr;
-    }
-};
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/register.js
+// @ts-check
 
-exports.boolTag = boolTag;
+function register(state, name, method, options) {
+  if (typeof method !== "function") {
+    throw new Error("method for before hook must be a function");
+  }
 
+  if (!options) {
+    options = {};
+  }
 
-/***/ }),
+  if (Array.isArray(name)) {
+    return name.reverse().reduce((callback, name) => {
+      return register.bind(null, state, name, callback, options);
+    }, method)();
+  }
 
-/***/ 38405:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+  return Promise.resolve().then(() => {
+    if (!state.registry[name]) {
+      return method(options);
+    }
 
-"use strict";
+    return state.registry[name].reduce((method, registered) => {
+      return registered.hook.bind(null, method, options);
+    }, method)();
+  });
+}
 
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/add.js
+// @ts-check
 
-var Scalar = __nccwpck_require__(63301);
-var stringifyNumber = __nccwpck_require__(28689);
+function addHook(state, kind, name, hook) {
+  const orig = hook;
+  if (!state.registry[name]) {
+    state.registry[name] = [];
+  }
 
-const floatNaN = {
-    identify: value => typeof value === 'number',
-    default: true,
-    tag: 'tag:yaml.org,2002:float',
-    test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
-    resolve: str => str.slice(-3).toLowerCase() === 'nan'
-        ? NaN
-        : str[0] === '-'
-            ? Number.NEGATIVE_INFINITY
-            : Number.POSITIVE_INFINITY,
-    stringify: stringifyNumber.stringifyNumber
-};
-const floatExp = {
-    identify: value => typeof value === 'number',
-    default: true,
-    tag: 'tag:yaml.org,2002:float',
-    format: 'EXP',
-    test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
-    resolve: str => parseFloat(str),
-    stringify(node) {
-        const num = Number(node.value);
-        return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
-    }
-};
-const float = {
-    identify: value => typeof value === 'number',
-    default: true,
-    tag: 'tag:yaml.org,2002:float',
-    test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
-    resolve(str) {
-        const node = new Scalar.Scalar(parseFloat(str));
-        const dot = str.indexOf('.');
-        if (dot !== -1 && str[str.length - 1] === '0')
-            node.minFractionDigits = str.length - dot - 1;
-        return node;
-    },
-    stringify: stringifyNumber.stringifyNumber
-};
+  if (kind === "before") {
+    hook = (method, options) => {
+      return Promise.resolve()
+        .then(orig.bind(null, options))
+        .then(method.bind(null, options));
+    };
+  }
 
-exports.float = float;
-exports.floatExp = floatExp;
-exports.floatNaN = floatNaN;
+  if (kind === "after") {
+    hook = (method, options) => {
+      let result;
+      return Promise.resolve()
+        .then(method.bind(null, options))
+        .then((result_) => {
+          result = result_;
+          return orig(result, options);
+        })
+        .then(() => {
+          return result;
+        });
+    };
+  }
 
+  if (kind === "error") {
+    hook = (method, options) => {
+      return Promise.resolve()
+        .then(method.bind(null, options))
+        .catch((error) => {
+          return orig(error, options);
+        });
+    };
+  }
 
-/***/ }),
+  state.registry[name].push({
+    hook: hook,
+    orig: orig,
+  });
+}
 
-/***/ 59874:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/remove.js
+// @ts-check
 
-"use strict";
+function removeHook(state, name, method) {
+  if (!state.registry[name]) {
+    return;
+  }
 
+  const index = state.registry[name]
+    .map((registered) => {
+      return registered.orig;
+    })
+    .indexOf(method);
 
-var stringifyNumber = __nccwpck_require__(28689);
+  if (index === -1) {
+    return;
+  }
 
-const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);
-const intResolve = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix));
-function intStringify(node, radix, prefix) {
-    const { value } = node;
-    if (intIdentify(value) && value >= 0)
-        return prefix + value.toString(radix);
-    return stringifyNumber.stringifyNumber(node);
+  state.registry[name].splice(index, 1);
 }
-const intOct = {
-    identify: value => intIdentify(value) && value >= 0,
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    format: 'OCT',
-    test: /^0o[0-7]+$/,
-    resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),
-    stringify: node => intStringify(node, 8, '0o')
-};
-const int = {
-    identify: intIdentify,
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    test: /^[-+]?[0-9]+$/,
-    resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
-    stringify: stringifyNumber.stringifyNumber
-};
-const intHex = {
-    identify: value => intIdentify(value) && value >= 0,
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    format: 'HEX',
-    test: /^0x[0-9a-fA-F]+$/,
-    resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
-    stringify: node => intStringify(node, 16, '0x')
-};
 
-exports.int = int;
-exports.intHex = intHex;
-exports.intOct = intOct;
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/index.js
+// @ts-check
 
 
-/***/ }),
 
-/***/ 70896:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
+// bind with array of arguments: https://stackoverflow.com/a/21792913
+const bind = Function.bind;
+const bindable = bind.bind(bind);
 
-var map = __nccwpck_require__(47451);
-var _null = __nccwpck_require__(73632);
-var seq = __nccwpck_require__(1706);
-var string = __nccwpck_require__(66464);
-var bool = __nccwpck_require__(73959);
-var float = __nccwpck_require__(38405);
-var int = __nccwpck_require__(59874);
+function bindApi(hook, state, name) {
+  const removeHookRef = bindable(removeHook, null).apply(
+    null,
+    name ? [state, name] : [state]
+  );
+  hook.api = { remove: removeHookRef };
+  hook.remove = removeHookRef;
+  ["before", "error", "after", "wrap"].forEach((kind) => {
+    const args = name ? [state, kind, name] : [state, kind];
+    hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
+  });
+}
 
-const schema = [
-    map.map,
-    seq.seq,
-    string.string,
-    _null.nullTag,
-    bool.boolTag,
-    int.intOct,
-    int.int,
-    int.intHex,
-    float.floatNaN,
-    float.floatExp,
-    float.float
-];
+function Singular() {
+  const singularHookName = Symbol("Singular");
+  const singularHookState = {
+    registry: {},
+  };
+  const singularHook = register.bind(null, singularHookState, singularHookName);
+  bindApi(singularHook, singularHookState, singularHookName);
+  return singularHook;
+}
 
-exports.schema = schema;
+function Collection() {
+  const state = {
+    registry: {},
+  };
 
+  const hook = register.bind(null, state);
+  bindApi(hook, state);
 
-/***/ }),
+  return hook;
+}
 
-/***/ 33559:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/* harmony default export */ const before_after_hook = ({ Singular, Collection });
 
-"use strict";
+;// CONCATENATED MODULE: ./node_modules/@octokit/endpoint/dist-bundle/index.js
+// pkg/dist-src/defaults.js
 
 
-var Scalar = __nccwpck_require__(63301);
-var map = __nccwpck_require__(47451);
-var seq = __nccwpck_require__(1706);
+// pkg/dist-src/version.js
+var VERSION = "0.0.0-development";
 
-function intIdentify(value) {
-    return typeof value === 'bigint' || Number.isInteger(value);
-}
-const stringifyJSON = ({ value }) => JSON.stringify(value);
-const jsonScalars = [
-    {
-        identify: value => typeof value === 'string',
-        default: true,
-        tag: 'tag:yaml.org,2002:str',
-        resolve: str => str,
-        stringify: stringifyJSON
-    },
-    {
-        identify: value => value == null,
-        createNode: () => new Scalar.Scalar(null),
-        default: true,
-        tag: 'tag:yaml.org,2002:null',
-        test: /^null$/,
-        resolve: () => null,
-        stringify: stringifyJSON
-    },
-    {
-        identify: value => typeof value === 'boolean',
-        default: true,
-        tag: 'tag:yaml.org,2002:bool',
-        test: /^true$|^false$/,
-        resolve: str => str === 'true',
-        stringify: stringifyJSON
-    },
-    {
-        identify: intIdentify,
-        default: true,
-        tag: 'tag:yaml.org,2002:int',
-        test: /^-?(?:0|[1-9][0-9]*)$/,
-        resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
-        stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
-    },
-    {
-        identify: value => typeof value === 'number',
-        default: true,
-        tag: 'tag:yaml.org,2002:float',
-        test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
-        resolve: str => parseFloat(str),
-        stringify: stringifyJSON
-    }
-];
-const jsonError = {
-    default: true,
-    tag: '',
-    test: /^/,
-    resolve(str, onError) {
-        onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
-        return str;
-    }
+// pkg/dist-src/defaults.js
+var userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
+var DEFAULTS = {
+  method: "GET",
+  baseUrl: "https://api.github.com",
+  headers: {
+    accept: "application/vnd.github.v3+json",
+    "user-agent": userAgent
+  },
+  mediaType: {
+    format: ""
+  }
 };
-const schema = [map.map, seq.seq].concat(jsonScalars, jsonError);
 
-exports.schema = schema;
+// pkg/dist-src/util/lowercase-keys.js
+function dist_bundle_lowercaseKeys(object) {
+  if (!object) {
+    return {};
+  }
+  return Object.keys(object).reduce((newObj, key) => {
+    newObj[key.toLowerCase()] = object[key];
+    return newObj;
+  }, {});
+}
 
+// pkg/dist-src/util/is-plain-object.js
+function isPlainObject(value) {
+  if (typeof value !== "object" || value === null) return false;
+  if (Object.prototype.toString.call(value) !== "[object Object]") return false;
+  const proto = Object.getPrototypeOf(value);
+  if (proto === null) return true;
+  const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
+  return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
+}
 
-/***/ }),
+// pkg/dist-src/util/merge-deep.js
+function mergeDeep(defaults, options) {
+  const result = Object.assign({}, defaults);
+  Object.keys(options).forEach((key) => {
+    if (isPlainObject(options[key])) {
+      if (!(key in defaults)) Object.assign(result, { [key]: options[key] });
+      else result[key] = mergeDeep(defaults[key], options[key]);
+    } else {
+      Object.assign(result, { [key]: options[key] });
+    }
+  });
+  return result;
+}
 
-/***/ 90018:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+// pkg/dist-src/util/remove-undefined-properties.js
+function removeUndefinedProperties(obj) {
+  for (const key in obj) {
+    if (obj[key] === void 0) {
+      delete obj[key];
+    }
+  }
+  return obj;
+}
 
-"use strict";
+// pkg/dist-src/merge.js
+function merge(defaults, route, options) {
+  if (typeof route === "string") {
+    let [method, url] = route.split(" ");
+    options = Object.assign(url ? { method, url } : { url: method }, options);
+  } else {
+    options = Object.assign({}, route);
+  }
+  options.headers = dist_bundle_lowercaseKeys(options.headers);
+  removeUndefinedProperties(options);
+  removeUndefinedProperties(options.headers);
+  const mergedOptions = mergeDeep(defaults || {}, options);
+  if (options.url === "/graphql") {
+    if (defaults && defaults.mediaType.previews?.length) {
+      mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
+        (preview) => !mergedOptions.mediaType.previews.includes(preview)
+      ).concat(mergedOptions.mediaType.previews);
+    }
+    mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
+  }
+  return mergedOptions;
+}
 
+// pkg/dist-src/util/add-query-parameters.js
+function addQueryParameters(url, parameters) {
+  const separator = /\?/.test(url) ? "&" : "?";
+  const names = Object.keys(parameters);
+  if (names.length === 0) {
+    return url;
+  }
+  return url + separator + names.map((name) => {
+    if (name === "q") {
+      return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
+    }
+    return `${name}=${encodeURIComponent(parameters[name])}`;
+  }).join("&");
+}
 
-var map = __nccwpck_require__(47451);
-var _null = __nccwpck_require__(73632);
-var seq = __nccwpck_require__(1706);
-var string = __nccwpck_require__(66464);
-var bool = __nccwpck_require__(73959);
-var float = __nccwpck_require__(38405);
-var int = __nccwpck_require__(59874);
-var schema = __nccwpck_require__(70896);
-var schema$1 = __nccwpck_require__(33559);
-var binary = __nccwpck_require__(56083);
-var merge = __nccwpck_require__(90452);
-var omap = __nccwpck_require__(50303);
-var pairs = __nccwpck_require__(18385);
-var schema$2 = __nccwpck_require__(35913);
-var set = __nccwpck_require__(81528);
-var timestamp = __nccwpck_require__(46752);
+// pkg/dist-src/util/extract-url-variable-names.js
+var urlVariableRegex = /\{[^{}}]+\}/g;
+function removeNonChars(variableName) {
+  return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []);
+}
 
-const schemas = new Map([
-    ['core', schema.schema],
-    ['failsafe', [map.map, seq.seq, string.string]],
-    ['json', schema$1.schema],
-    ['yaml11', schema$2.schema],
-    ['yaml-1.1', schema$2.schema]
-]);
-const tagsByName = {
-    binary: binary.binary,
-    bool: bool.boolTag,
-    float: float.float,
-    floatExp: float.floatExp,
-    floatNaN: float.floatNaN,
-    floatTime: timestamp.floatTime,
-    int: int.int,
-    intHex: int.intHex,
-    intOct: int.intOct,
-    intTime: timestamp.intTime,
-    map: map.map,
-    merge: merge.merge,
-    null: _null.nullTag,
-    omap: omap.omap,
-    pairs: pairs.pairs,
-    seq: seq.seq,
-    set: set.set,
-    timestamp: timestamp.timestamp
-};
-const coreKnownTags = {
-    'tag:yaml.org,2002:binary': binary.binary,
-    'tag:yaml.org,2002:merge': merge.merge,
-    'tag:yaml.org,2002:omap': omap.omap,
-    'tag:yaml.org,2002:pairs': pairs.pairs,
-    'tag:yaml.org,2002:set': set.set,
-    'tag:yaml.org,2002:timestamp': timestamp.timestamp
-};
-function getTags(customTags, schemaName, addMergeTag) {
-    const schemaTags = schemas.get(schemaName);
-    if (schemaTags && !customTags) {
-        return addMergeTag && !schemaTags.includes(merge.merge)
-            ? schemaTags.concat(merge.merge)
-            : schemaTags.slice();
+// pkg/dist-src/util/omit.js
+function omit(object, keysToOmit) {
+  const result = { __proto__: null };
+  for (const key of Object.keys(object)) {
+    if (keysToOmit.indexOf(key) === -1) {
+      result[key] = object[key];
     }
-    let tags = schemaTags;
-    if (!tags) {
-        if (Array.isArray(customTags))
-            tags = [];
-        else {
-            const keys = Array.from(schemas.keys())
-                .filter(key => key !== 'yaml11')
-                .map(key => JSON.stringify(key))
-                .join(', ');
-            throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
-        }
+  }
+  return result;
+}
+
+// pkg/dist-src/util/url-template.js
+function encodeReserved(str) {
+  return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
+    if (!/%[0-9A-Fa-f]/.test(part)) {
+      part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
     }
-    if (Array.isArray(customTags)) {
-        for (const tag of customTags)
-            tags = tags.concat(tag);
+    return part;
+  }).join("");
+}
+function encodeUnreserved(str) {
+  return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
+    return "%" + c.charCodeAt(0).toString(16).toUpperCase();
+  });
+}
+function encodeValue(operator, value, key) {
+  value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
+  if (key) {
+    return encodeUnreserved(key) + "=" + value;
+  } else {
+    return value;
+  }
+}
+function isDefined(value) {
+  return value !== void 0 && value !== null;
+}
+function isKeyOperator(operator) {
+  return operator === ";" || operator === "&" || operator === "?";
+}
+function getValues(context, operator, key, modifier) {
+  var value = context[key], result = [];
+  if (isDefined(value) && value !== "") {
+    if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") {
+      value = value.toString();
+      if (modifier && modifier !== "*") {
+        value = value.substring(0, parseInt(modifier, 10));
+      }
+      result.push(
+        encodeValue(operator, value, isKeyOperator(operator) ? key : "")
+      );
+    } else {
+      if (modifier === "*") {
+        if (Array.isArray(value)) {
+          value.filter(isDefined).forEach(function(value2) {
+            result.push(
+              encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
+            );
+          });
+        } else {
+          Object.keys(value).forEach(function(k) {
+            if (isDefined(value[k])) {
+              result.push(encodeValue(operator, value[k], k));
+            }
+          });
+        }
+      } else {
+        const tmp = [];
+        if (Array.isArray(value)) {
+          value.filter(isDefined).forEach(function(value2) {
+            tmp.push(encodeValue(operator, value2));
+          });
+        } else {
+          Object.keys(value).forEach(function(k) {
+            if (isDefined(value[k])) {
+              tmp.push(encodeUnreserved(k));
+              tmp.push(encodeValue(operator, value[k].toString()));
+            }
+          });
+        }
+        if (isKeyOperator(operator)) {
+          result.push(encodeUnreserved(key) + "=" + tmp.join(","));
+        } else if (tmp.length !== 0) {
+          result.push(tmp.join(","));
+        }
+      }
     }
-    else if (typeof customTags === 'function') {
-        tags = customTags(tags.slice());
+  } else {
+    if (operator === ";") {
+      if (isDefined(value)) {
+        result.push(encodeUnreserved(key));
+      }
+    } else if (value === "" && (operator === "&" || operator === "?")) {
+      result.push(encodeUnreserved(key) + "=");
+    } else if (value === "") {
+      result.push("");
     }
-    if (addMergeTag)
-        tags = tags.concat(merge.merge);
-    return tags.reduce((tags, tag) => {
-        const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
-        if (!tagObj) {
-            const tagName = JSON.stringify(tag);
-            const keys = Object.keys(tagsByName)
-                .map(key => JSON.stringify(key))
-                .join(', ');
-            throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
+  }
+  return result;
+}
+function parseUrl(template) {
+  return {
+    expand: expand.bind(null, template)
+  };
+}
+function expand(template, context) {
+  var operators = ["+", "#", ".", "/", ";", "?", "&"];
+  template = template.replace(
+    /\{([^\{\}]+)\}|([^\{\}]+)/g,
+    function(_, expression, literal) {
+      if (expression) {
+        let operator = "";
+        const values = [];
+        if (operators.indexOf(expression.charAt(0)) !== -1) {
+          operator = expression.charAt(0);
+          expression = expression.substr(1);
+        }
+        expression.split(/,/g).forEach(function(variable) {
+          var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
+          values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
+        });
+        if (operator && operator !== "+") {
+          var separator = ",";
+          if (operator === "?") {
+            separator = "&";
+          } else if (operator !== "#") {
+            separator = operator;
+          }
+          return (values.length !== 0 ? operator : "") + values.join(separator);
+        } else {
+          return values.join(",");
         }
-        if (!tags.includes(tagObj))
-            tags.push(tagObj);
-        return tags;
-    }, []);
+      } else {
+        return encodeReserved(literal);
+      }
+    }
+  );
+  if (template === "/") {
+    return template;
+  } else {
+    return template.replace(/\/$/, "");
+  }
 }
 
-exports.coreKnownTags = coreKnownTags;
-exports.getTags = getTags;
-
-
-/***/ }),
-
-/***/ 56083:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
+// pkg/dist-src/parse.js
+function dist_bundle_parse(options) {
+  let method = options.method.toUpperCase();
+  let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
+  let headers = Object.assign({}, options.headers);
+  let body;
+  let parameters = omit(options, [
+    "method",
+    "baseUrl",
+    "url",
+    "headers",
+    "request",
+    "mediaType"
+  ]);
+  const urlVariableNames = extractUrlVariableNames(url);
+  url = parseUrl(url).expand(parameters);
+  if (!/^http/.test(url)) {
+    url = options.baseUrl + url;
+  }
+  const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
+  const remainingParameters = omit(parameters, omittedParameters);
+  const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
+  if (!isBinaryRequest) {
+    if (options.mediaType.format) {
+      headers.accept = headers.accept.split(/,/).map(
+        (format) => format.replace(
+          /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
+          `application/vnd$1$2.${options.mediaType.format}`
+        )
+      ).join(",");
+    }
+    if (url.endsWith("/graphql")) {
+      if (options.mediaType.previews?.length) {
+        const previewsFromAcceptHeader = headers.accept.match(/(? {
+          const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
+          return `application/vnd.github.${preview}-preview${format}`;
+        }).join(",");
+      }
+    }
+  }
+  if (["GET", "HEAD"].includes(method)) {
+    url = addQueryParameters(url, remainingParameters);
+  } else {
+    if ("data" in remainingParameters) {
+      body = remainingParameters.data;
+    } else {
+      if (Object.keys(remainingParameters).length) {
+        body = remainingParameters;
+      }
+    }
+  }
+  if (!headers["content-type"] && typeof body !== "undefined") {
+    headers["content-type"] = "application/json; charset=utf-8";
+  }
+  if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
+    body = "";
+  }
+  return Object.assign(
+    { method, url, headers },
+    typeof body !== "undefined" ? { body } : null,
+    options.request ? { request: options.request } : null
+  );
+}
 
-var node_buffer = __nccwpck_require__(20181);
-var Scalar = __nccwpck_require__(63301);
-var stringifyString = __nccwpck_require__(83069);
+// pkg/dist-src/endpoint-with-defaults.js
+function endpointWithDefaults(defaults, route, options) {
+  return dist_bundle_parse(merge(defaults, route, options));
+}
 
-const binary = {
-    identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array
-    default: false,
-    tag: 'tag:yaml.org,2002:binary',
-    /**
-     * Returns a Buffer in node and an Uint8Array in browsers
-     *
-     * To use the resulting buffer as an image, you'll want to do something like:
-     *
-     *   const blob = new Blob([buffer], { type: 'image/jpeg' })
-     *   document.querySelector('#photo').src = URL.createObjectURL(blob)
-     */
-    resolve(src, onError) {
-        if (typeof node_buffer.Buffer === 'function') {
-            return node_buffer.Buffer.from(src, 'base64');
-        }
-        else if (typeof atob === 'function') {
-            // On IE 11, atob() can't handle newlines
-            const str = atob(src.replace(/[\n\r]/g, ''));
-            const buffer = new Uint8Array(str.length);
-            for (let i = 0; i < str.length; ++i)
-                buffer[i] = str.charCodeAt(i);
-            return buffer;
-        }
-        else {
-            onError('This environment does not support reading binary tags; either Buffer or atob is required');
-            return src;
-        }
-    },
-    stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
-        if (!value)
-            return '';
-        const buf = value; // checked earlier by binary.identify()
-        let str;
-        if (typeof node_buffer.Buffer === 'function') {
-            str =
-                buf instanceof node_buffer.Buffer
-                    ? buf.toString('base64')
-                    : node_buffer.Buffer.from(buf.buffer).toString('base64');
-        }
-        else if (typeof btoa === 'function') {
-            let s = '';
-            for (let i = 0; i < buf.length; ++i)
-                s += String.fromCharCode(buf[i]);
-            str = btoa(s);
-        }
-        else {
-            throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
-        }
-        type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
-        if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
-            const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
-            const n = Math.ceil(str.length / lineWidth);
-            const lines = new Array(n);
-            for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
-                lines[i] = str.substr(o, lineWidth);
-            }
-            str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? '\n' : ' ');
-        }
-        return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
-    }
-};
+// pkg/dist-src/with-defaults.js
+function withDefaults(oldDefaults, newDefaults) {
+  const DEFAULTS2 = merge(oldDefaults, newDefaults);
+  const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
+  return Object.assign(endpoint2, {
+    DEFAULTS: DEFAULTS2,
+    defaults: withDefaults.bind(null, DEFAULTS2),
+    merge: merge.bind(null, DEFAULTS2),
+    parse: dist_bundle_parse
+  });
+}
 
-exports.binary = binary;
+// pkg/dist-src/index.js
+var endpoint = withDefaults(null, DEFAULTS);
 
 
-/***/ }),
+// EXTERNAL MODULE: ./node_modules/content-type/dist/index.js
+var content_type_dist = __nccwpck_require__(47030);
+;// CONCATENATED MODULE: ./node_modules/json-with-bigint/json-with-bigint.js
+const intRegex = /^-?\d+$/;
+const noiseValue = /^-?\d+n+$/; // Noise - strings that match the custom format before being converted to it
+const originalStringify = JSON.stringify;
+const originalParse = JSON.parse;
+const customFormat = /^-?\d+n$/;
 
-/***/ 88398:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+const bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
+const noiseStringify =
+  /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
 
-"use strict";
+/**
+ * @typedef {(this: any, key: string | number | undefined, value: any) => any} Replacer
+ * @typedef {(key: string | number | undefined, value: any, context?: { source: string }) => any} Reviver
+ */
 
+/**
+ * Converts a JavaScript value to a JSON string.
+ *
+ * Supports serialization of BigInt values using two strategies:
+ * 1. Custom format "123n" → "123" (universal fallback)
+ * 2. Native JSON.rawJSON() (Node.js 22+, fastest) when available
+ *
+ * All other values are serialized exactly like native JSON.stringify().
+ *
+ * @param {*} value The value to convert to a JSON string.
+ * @param {Replacer | Array | null} [replacer]
+ *   A function that alters the behavior of the stringification process,
+ *   or an array of strings/numbers to indicate properties to exclude.
+ * @param {string | number} [space]
+ *   A string or number to specify indentation or pretty-printing.
+ * @returns {string} The JSON string representation.
+ */
+const JSONStringify = (value, replacer, space) => {
+  if ("rawJSON" in JSON) {
+    return originalStringify(
+      value,
+      (key, value) => {
+        if (typeof value === "bigint") return JSON.rawJSON(value.toString());
 
-var Scalar = __nccwpck_require__(63301);
+        if (typeof replacer === "function") return replacer(key, value);
 
-function boolStringify({ value, source }, ctx) {
-    const boolObj = value ? trueTag : falseTag;
-    if (source && boolObj.test.test(source))
-        return source;
-    return value ? ctx.options.trueStr : ctx.options.falseStr;
-}
-const trueTag = {
-    identify: value => value === true,
-    default: true,
-    tag: 'tag:yaml.org,2002:bool',
-    test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
-    resolve: () => new Scalar.Scalar(true),
-    stringify: boolStringify
-};
-const falseTag = {
-    identify: value => value === false,
-    default: true,
-    tag: 'tag:yaml.org,2002:bool',
-    test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
-    resolve: () => new Scalar.Scalar(false),
-    stringify: boolStringify
-};
+        if (Array.isArray(replacer) && replacer.includes(key)) return value;
 
-exports.falseTag = falseTag;
-exports.trueTag = trueTag;
+        return value;
+      },
+      space,
+    );
+  }
 
+  if (!value) return originalStringify(value, replacer, space);
 
-/***/ }),
+  const convertedToCustomJSON = originalStringify(
+    value,
+    (key, value) => {
+      const isNoise = typeof value === "string" && noiseValue.test(value);
 
-/***/ 35782:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+      if (isNoise) return value.toString() + "n"; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing
 
-"use strict";
+      if (typeof value === "bigint") return value.toString() + "n";
 
+      if (typeof replacer === "function") return replacer(key, value);
 
-var Scalar = __nccwpck_require__(63301);
-var stringifyNumber = __nccwpck_require__(28689);
+      if (Array.isArray(replacer) && replacer.includes(key)) return value;
 
-const floatNaN = {
-    identify: value => typeof value === 'number',
-    default: true,
-    tag: 'tag:yaml.org,2002:float',
-    test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
-    resolve: (str) => str.slice(-3).toLowerCase() === 'nan'
-        ? NaN
-        : str[0] === '-'
-            ? Number.NEGATIVE_INFINITY
-            : Number.POSITIVE_INFINITY,
-    stringify: stringifyNumber.stringifyNumber
-};
-const floatExp = {
-    identify: value => typeof value === 'number',
-    default: true,
-    tag: 'tag:yaml.org,2002:float',
-    format: 'EXP',
-    test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
-    resolve: (str) => parseFloat(str.replace(/_/g, '')),
-    stringify(node) {
-        const num = Number(node.value);
-        return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
-    }
-};
-const float = {
-    identify: value => typeof value === 'number',
-    default: true,
-    tag: 'tag:yaml.org,2002:float',
-    test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
-    resolve(str) {
-        const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, '')));
-        const dot = str.indexOf('.');
-        if (dot !== -1) {
-            const f = str.substring(dot + 1).replace(/_/g, '');
-            if (f[f.length - 1] === '0')
-                node.minFractionDigits = f.length;
-        }
-        return node;
+      return value;
     },
-    stringify: stringifyNumber.stringifyNumber
-};
-
-exports.float = float;
-exports.floatExp = floatExp;
-exports.floatNaN = floatNaN;
+    space,
+  );
+  const processedJSON = convertedToCustomJSON.replace(
+    bigIntsStringify,
+    "$1$2$3",
+  ); // Delete one "n" off the end of every BigInt value
+  const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3"); // Remove one "n" off the end of every noisy string
 
+  return denoisedJSON;
+};
 
-/***/ }),
+const featureCache = new Map();
 
-/***/ 10873:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/**
+ * Detects if the current JSON.parse implementation supports the context.source feature.
+ *
+ * Uses toString() fingerprinting to cache results and automatically detect runtime
+ * replacements of JSON.parse (polyfills, mocks, etc.).
+ *
+ * @returns {boolean} true if context.source is supported, false otherwise.
+ */
+const isContextSourceSupported = () => {
+  const parseFingerprint = JSON.parse.toString();
 
-"use strict";
+  if (featureCache.has(parseFingerprint)) {
+    return featureCache.get(parseFingerprint);
+  }
 
+  try {
+    const result = JSON.parse(
+      "1",
+      (_, __, context) => !!context?.source && context.source === "1",
+    );
+    featureCache.set(parseFingerprint, result);
 
-var stringifyNumber = __nccwpck_require__(28689);
+    return result;
+  } catch {
+    featureCache.set(parseFingerprint, false);
 
-const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);
-function intResolve(str, offset, radix, { intAsBigInt }) {
-    const sign = str[0];
-    if (sign === '-' || sign === '+')
-        offset += 1;
-    str = str.substring(offset).replace(/_/g, '');
-    if (intAsBigInt) {
-        switch (radix) {
-            case 2:
-                str = `0b${str}`;
-                break;
-            case 8:
-                str = `0o${str}`;
-                break;
-            case 16:
-                str = `0x${str}`;
-                break;
-        }
-        const n = BigInt(str);
-        return sign === '-' ? BigInt(-1) * n : n;
-    }
-    const n = parseInt(str, radix);
-    return sign === '-' ? -1 * n : n;
-}
-function intStringify(node, radix, prefix) {
-    const { value } = node;
-    if (intIdentify(value)) {
-        const str = value.toString(radix);
-        return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;
-    }
-    return stringifyNumber.stringifyNumber(node);
-}
-const intBin = {
-    identify: intIdentify,
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    format: 'BIN',
-    test: /^[-+]?0b[0-1_]+$/,
-    resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),
-    stringify: node => intStringify(node, 2, '0b')
-};
-const intOct = {
-    identify: intIdentify,
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    format: 'OCT',
-    test: /^[-+]?0[0-7_]+$/,
-    resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),
-    stringify: node => intStringify(node, 8, '0')
-};
-const int = {
-    identify: intIdentify,
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    test: /^[-+]?[0-9][0-9_]*$/,
-    resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
-    stringify: stringifyNumber.stringifyNumber
-};
-const intHex = {
-    identify: intIdentify,
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    format: 'HEX',
-    test: /^[-+]?0x[0-9a-fA-F_]+$/,
-    resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
-    stringify: node => intStringify(node, 16, '0x')
+    return false;
+  }
 };
 
-exports.int = int;
-exports.intBin = intBin;
-exports.intHex = intHex;
-exports.intOct = intOct;
+/**
+ * Reviver function that converts custom-format BigInt strings back to BigInt values.
+ * Also handles "noise" strings that accidentally match the BigInt format.
+ *
+ * @param {string | number | undefined} key The object key.
+ * @param {*} value The value being parsed.
+ * @param {object} [context] Parse context (if supported by JSON.parse).
+ * @param {Reviver} [userReviver] User's custom reviver function.
+ * @returns {any} The transformed value.
+ */
+const convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
+  const isCustomFormatBigInt =
+    typeof value === "string" && customFormat.test(value);
+  if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
 
+  const isNoiseValue = typeof value === "string" && noiseValue.test(value);
+  if (isNoiseValue) return value.slice(0, -1);
 
-/***/ }),
+  if (typeof userReviver !== "function") return value;
 
-/***/ 90452:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+  return userReviver(key, value, context);
+};
 
-"use strict";
+/**
+ * Fast JSON.parse implementation (~2x faster than classic fallback).
+ * Uses JSON.parse's context.source feature to detect integers and convert
+ * large numbers directly to BigInt without string manipulation.
+ *
+ * Does not support legacy custom format from v1 of this library.
+ *
+ * @param {string} text JSON string to parse.
+ * @param {Reviver} [reviver] Transform function to apply to each value.
+ * @returns {any} Parsed JavaScript value.
+ */
+const JSONParseV2 = (text, reviver) => {
+  return JSON.parse(text, (key, value, context) => {
+    const isBigNumber =
+      typeof value === "number" &&
+      (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
+    const isInt = context && intRegex.test(context.source);
+    const isBigInt = isBigNumber && isInt;
 
+    if (isBigInt) return BigInt(context.source);
 
-var identity = __nccwpck_require__(41127);
-var Scalar = __nccwpck_require__(63301);
+    if (typeof reviver !== "function") return value;
 
-// If the value associated with a merge key is a single mapping node, each of
-// its key/value pairs is inserted into the current mapping, unless the key
-// already exists in it. If the value associated with the merge key is a
-// sequence, then this sequence is expected to contain mapping nodes and each
-// of these nodes is merged in turn according to its order in the sequence.
-// Keys in mapping nodes earlier in the sequence override keys specified in
-// later mapping nodes. -- http://yaml.org/type/merge.html
-const MERGE_KEY = '<<';
-const merge = {
-    identify: value => value === MERGE_KEY ||
-        (typeof value === 'symbol' && value.description === MERGE_KEY),
-    default: 'key',
-    tag: 'tag:yaml.org,2002:merge',
-    test: /^<<$/,
-    resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
-        addToJSMap: addMergeToJSMap
-    }),
-    stringify: () => MERGE_KEY
+    return reviver(key, value, context);
+  });
 };
-const isMergeKey = (ctx, key) => (merge.identify(key) ||
-    (identity.isScalar(key) &&
-        (!key.type || key.type === Scalar.Scalar.PLAIN) &&
-        merge.identify(key.value))) &&
-    ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
-function addMergeToJSMap(ctx, map, value) {
-    const source = resolveAliasValue(ctx, value);
-    if (identity.isSeq(source))
-        for (const it of source.items)
-            mergeValue(ctx, map, it);
-    else if (Array.isArray(source))
-        for (const it of source)
-            mergeValue(ctx, map, it);
-    else
-        mergeValue(ctx, map, source);
-}
-function mergeValue(ctx, map, value) {
-    const source = resolveAliasValue(ctx, value);
-    if (!identity.isMap(source))
-        throw new Error('Merge sources must be maps or map aliases');
-    const srcMap = source.toJSON(null, ctx, Map);
-    for (const [key, value] of srcMap) {
-        if (map instanceof Map) {
-            if (!map.has(key))
-                map.set(key, value);
-        }
-        else if (map instanceof Set) {
-            map.add(key);
-        }
-        else if (!Object.prototype.hasOwnProperty.call(map, key)) {
-            Object.defineProperty(map, key, {
-                value,
-                writable: true,
-                enumerable: true,
-                configurable: true
-            });
-        }
-    }
-    return map;
-}
-function resolveAliasValue(ctx, value) {
-    return ctx && identity.isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
-}
 
-exports.addMergeToJSMap = addMergeToJSMap;
-exports.isMergeKey = isMergeKey;
-exports.merge = merge;
+const MAX_INT = Number.MAX_SAFE_INTEGER.toString();
+const MAX_DIGITS = MAX_INT.length;
+const stringsOrLargeNumbers =
+  /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
+const noiseValueWithQuotes = /^"-?\d+n+"$/; // Noise - strings that match the custom format before being converted to it
 
+/**
+ * Converts a JSON string into a JavaScript value.
+ *
+ * Supports parsing of large integers using two strategies:
+ * 1. Classic fallback: Marks large numbers with "123n" format, then converts to BigInt
+ * 2. Fast path (JSONParseV2): Uses context.source feature (~2x faster) when available
+ *
+ * All other JSON values are parsed exactly like native JSON.parse().
+ *
+ * @param {string} text A valid JSON string.
+ * @param {Reviver} [reviver]
+ *   A function that transforms the results. This function is called for each member
+ *   of the object. If a member contains nested objects, the nested objects are
+ *   transformed before the parent object is.
+ * @returns {any} The parsed JavaScript value.
+ * @throws {SyntaxError} If text is not valid JSON.
+ */
+const JSONParse = (text, reviver) => {
+  if (!text) return originalParse(text, reviver);
 
-/***/ }),
+  if (isContextSourceSupported()) return JSONParseV2(text, reviver); // Shortcut to a faster (2x) and simpler version
 
-/***/ 50303:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+  // Find and mark big numbers with "n"
+  const serializedData = text.replace(
+    stringsOrLargeNumbers,
+    (text, digits, fractional, exponential) => {
+      const isString = text[0] === '"';
+      const isNoise = isString && noiseValueWithQuotes.test(text);
 
-"use strict";
+      if (isNoise) return text.substring(0, text.length - 1) + 'n"'; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing
 
+      const isFractionalOrExponential = fractional || exponential;
+      const isLessThanMaxSafeInt =
+        digits &&
+        (digits.length < MAX_DIGITS ||
+          (digits.length === MAX_DIGITS && digits <= MAX_INT)); // With a fixed number of digits, we can correctly use lexicographical comparison to do a numeric comparison
 
-var identity = __nccwpck_require__(41127);
-var toJS = __nccwpck_require__(74043);
-var YAMLMap = __nccwpck_require__(84454);
-var YAMLSeq = __nccwpck_require__(92223);
-var pairs = __nccwpck_require__(18385);
+      if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
+        return text;
 
-class YAMLOMap extends YAMLSeq.YAMLSeq {
-    constructor() {
-        super();
-        this.add = YAMLMap.YAMLMap.prototype.add.bind(this);
-        this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this);
-        this.get = YAMLMap.YAMLMap.prototype.get.bind(this);
-        this.has = YAMLMap.YAMLMap.prototype.has.bind(this);
-        this.set = YAMLMap.YAMLMap.prototype.set.bind(this);
-        this.tag = YAMLOMap.tag;
-    }
-    /**
-     * If `ctx` is given, the return type is actually `Map`,
-     * but TypeScript won't allow widening the signature of a child method.
-     */
-    toJSON(_, ctx) {
-        if (!ctx)
-            return super.toJSON(_);
-        const map = new Map();
-        if (ctx?.onCreate)
-            ctx.onCreate(map);
-        for (const pair of this.items) {
-            let key, value;
-            if (identity.isPair(pair)) {
-                key = toJS.toJS(pair.key, '', ctx);
-                value = toJS.toJS(pair.value, key, ctx);
-            }
-            else {
-                key = toJS.toJS(pair, '', ctx);
-            }
-            if (map.has(key))
-                throw new Error('Ordered maps must not include duplicate keys');
-            map.set(key, value);
-        }
-        return map;
-    }
-    static from(schema, iterable, ctx) {
-        const pairs$1 = pairs.createPairs(schema, iterable, ctx);
-        const omap = new this();
-        omap.items = pairs$1.items;
-        return omap;
-    }
-}
-YAMLOMap.tag = 'tag:yaml.org,2002:omap';
-const omap = {
-    collection: 'seq',
-    identify: value => value instanceof Map,
-    nodeClass: YAMLOMap,
-    default: false,
-    tag: 'tag:yaml.org,2002:omap',
-    resolve(seq, onError) {
-        const pairs$1 = pairs.resolvePairs(seq, onError);
-        const seenKeys = [];
-        for (const { key } of pairs$1.items) {
-            if (identity.isScalar(key)) {
-                if (seenKeys.includes(key.value)) {
-                    onError(`Ordered maps must not include duplicate keys: ${key.value}`);
-                }
-                else {
-                    seenKeys.push(key.value);
-                }
-            }
-        }
-        return Object.assign(new YAMLOMap(), pairs$1);
+      return '"' + text + 'n"';
     },
-    createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
+  );
+
+  return originalParse(serializedData, (key, value, context) =>
+    convertMarkedBigIntsReviver(key, value, context, reviver),
+  );
 };
 
-exports.YAMLOMap = YAMLOMap;
-exports.omap = omap;
 
 
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/@octokit/request-error/dist-src/index.js
+class RequestError extends Error {
+  name;
+  /**
+   * http status code
+   */
+  status;
+  /**
+   * Request options that lead to the error.
+   */
+  request;
+  /**
+   * Response object if a response was received
+   */
+  response;
+  constructor(message, statusCode, options) {
+    super(message, { cause: options.cause });
+    this.name = "HttpError";
+    this.status = Number.parseInt(statusCode);
+    if (Number.isNaN(this.status)) {
+      this.status = 0;
+    }
+    /* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */
+    if ("response" in options) {
+      this.response = options.response;
+    }
+    const requestCopy = Object.assign({}, options.request);
+    if (options.request.headers.authorization) {
+      requestCopy.headers = Object.assign({}, options.request.headers, {
+        authorization: options.request.headers.authorization.replace(
+          /(? {
 
-"use strict";
+// pkg/dist-src/defaults.js
 
 
-var identity = __nccwpck_require__(41127);
-var Pair = __nccwpck_require__(57165);
-var Scalar = __nccwpck_require__(63301);
-var YAMLSeq = __nccwpck_require__(92223);
+// pkg/dist-src/version.js
+var dist_bundle_VERSION = "10.0.10";
 
-function resolvePairs(seq, onError) {
-    if (identity.isSeq(seq)) {
-        for (let i = 0; i < seq.items.length; ++i) {
-            let item = seq.items[i];
-            if (identity.isPair(item))
-                continue;
-            else if (identity.isMap(item)) {
-                if (item.items.length > 1)
-                    onError('Each pair must have its own sequence indicator');
-                const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
-                if (item.commentBefore)
-                    pair.key.commentBefore = pair.key.commentBefore
-                        ? `${item.commentBefore}\n${pair.key.commentBefore}`
-                        : item.commentBefore;
-                if (item.comment) {
-                    const cn = pair.value ?? pair.key;
-                    cn.comment = cn.comment
-                        ? `${item.comment}\n${cn.comment}`
-                        : item.comment;
-                }
-                item = pair;
-            }
-            seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);
-        }
-    }
-    else
-        onError('Expected a sequence for this tag');
-    return seq;
-}
-function createPairs(schema, iterable, ctx) {
-    const { replacer } = ctx;
-    const pairs = new YAMLSeq.YAMLSeq(schema);
-    pairs.tag = 'tag:yaml.org,2002:pairs';
-    let i = 0;
-    if (iterable && Symbol.iterator in Object(iterable))
-        for (let it of iterable) {
-            if (typeof replacer === 'function')
-                it = replacer.call(iterable, String(i++), it);
-            let key, value;
-            if (Array.isArray(it)) {
-                if (it.length === 2) {
-                    key = it[0];
-                    value = it[1];
-                }
-                else
-                    throw new TypeError(`Expected [key, value] tuple: ${it}`);
-            }
-            else if (it && it instanceof Object) {
-                const keys = Object.keys(it);
-                if (keys.length === 1) {
-                    key = keys[0];
-                    value = it[key];
-                }
-                else {
-                    throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
-                }
-            }
-            else {
-                key = it;
-            }
-            pairs.items.push(Pair.createPair(key, value, ctx));
-        }
-    return pairs;
-}
-const pairs = {
-    collection: 'seq',
-    default: false,
-    tag: 'tag:yaml.org,2002:pairs',
-    resolve: resolvePairs,
-    createNode: createPairs
+// pkg/dist-src/defaults.js
+var defaults_default = {
+  headers: {
+    "user-agent": `octokit-request.js/${dist_bundle_VERSION} ${getUserAgent()}`
+  }
 };
 
-exports.createPairs = createPairs;
-exports.pairs = pairs;
-exports.resolvePairs = resolvePairs;
+// pkg/dist-src/fetch-wrapper.js
 
 
-/***/ }),
 
-/***/ 35913:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+// pkg/dist-src/is-plain-object.js
+function dist_bundle_isPlainObject(value) {
+  if (typeof value !== "object" || value === null) return false;
+  if (Object.prototype.toString.call(value) !== "[object Object]") return false;
+  const proto = Object.getPrototypeOf(value);
+  if (proto === null) return true;
+  const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
+  return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
+}
+
+// pkg/dist-src/fetch-wrapper.js
+
+var noop = () => "";
+async function fetchWrapper(requestOptions) {
+  const fetch = requestOptions.request?.fetch || globalThis.fetch;
+  if (!fetch) {
+    throw new Error(
+      "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
+    );
+  }
+  const log = requestOptions.request?.log || console;
+  const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
+  const body = dist_bundle_isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
+  const requestHeaders = Object.fromEntries(
+    Object.entries(requestOptions.headers).map(([name, value]) => [
+      name,
+      String(value)
+    ])
+  );
+  let fetchResponse;
+  try {
+    fetchResponse = await fetch(requestOptions.url, {
+      method: requestOptions.method,
+      body,
+      redirect: requestOptions.request?.redirect,
+      headers: requestHeaders,
+      signal: requestOptions.request?.signal,
+      // duplex must be set if request.body is ReadableStream or Async Iterables.
+      // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
+      ...requestOptions.body && { duplex: "half" }
+    });
+  } catch (error) {
+    let message = "Unknown Error";
+    if (error instanceof Error) {
+      if (error.name === "AbortError") {
+        error.status = 500;
+        throw error;
+      }
+      message = error.message;
+      if (error.name === "TypeError" && "cause" in error) {
+        if (error.cause instanceof Error) {
+          message = error.cause.message;
+        } else if (typeof error.cause === "string") {
+          message = error.cause;
+        }
+      }
+    }
+    const requestError = new RequestError(message, 500, {
+      request: requestOptions
+    });
+    requestError.cause = error;
+    throw requestError;
+  }
+  const status = fetchResponse.status;
+  const url = fetchResponse.url;
+  const responseHeaders = {};
+  for (const [key, value] of fetchResponse.headers) {
+    responseHeaders[key] = value;
+  }
+  const octokitResponse = {
+    url,
+    status,
+    headers: responseHeaders,
+    data: ""
+  };
+  if ("deprecation" in responseHeaders) {
+    const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
+    const deprecationLink = matches && matches.pop();
+    log.warn(
+      `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
+    );
+  }
+  if (status === 204 || status === 205) {
+    return octokitResponse;
+  }
+  if (requestOptions.method === "HEAD") {
+    if (status < 400) {
+      return octokitResponse;
+    }
+    throw new RequestError(fetchResponse.statusText, status, {
+      response: octokitResponse,
+      request: requestOptions
+    });
+  }
+  if (status === 304) {
+    octokitResponse.data = await getResponseData(fetchResponse);
+    throw new RequestError("Not modified", status, {
+      response: octokitResponse,
+      request: requestOptions
+    });
+  }
+  if (status >= 400) {
+    octokitResponse.data = await getResponseData(fetchResponse);
+    throw new RequestError(toErrorMessage(octokitResponse.data), status, {
+      response: octokitResponse,
+      request: requestOptions
+    });
+  }
+  octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
+  return octokitResponse;
+}
+async function getResponseData(response) {
+  const contentType = response.headers.get("content-type");
+  if (!contentType) {
+    return response.text().catch(noop);
+  }
+  const mimetype = (0,content_type_dist/* parse */.qg)(contentType);
+  if (isJSONResponse(mimetype)) {
+    let text = "";
+    try {
+      text = await response.text();
+      return JSONParse(text);
+    } catch (err) {
+      return text;
+    }
+  } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
+    return response.text().catch(noop);
+  } else {
+    return response.arrayBuffer().catch(
+      /* v8 ignore next -- @preserve */
+      () => new ArrayBuffer(0)
+    );
+  }
+}
+function isJSONResponse(mimetype) {
+  return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
+}
+function toErrorMessage(data) {
+  if (typeof data === "string") {
+    return data;
+  }
+  if (data instanceof ArrayBuffer) {
+    return "Unknown error";
+  }
+  if ("message" in data) {
+    const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : "";
+    return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`;
+  }
+  return `Unknown error: ${JSON.stringify(data)}`;
+}
 
-"use strict";
+// pkg/dist-src/with-defaults.js
+function dist_bundle_withDefaults(oldEndpoint, newDefaults) {
+  const endpoint2 = oldEndpoint.defaults(newDefaults);
+  const newApi = function(route, parameters) {
+    const endpointOptions = endpoint2.merge(route, parameters);
+    if (!endpointOptions.request || !endpointOptions.request.hook) {
+      return fetchWrapper(endpoint2.parse(endpointOptions));
+    }
+    const request2 = (route2, parameters2) => {
+      return fetchWrapper(
+        endpoint2.parse(endpoint2.merge(route2, parameters2))
+      );
+    };
+    Object.assign(request2, {
+      endpoint: endpoint2,
+      defaults: dist_bundle_withDefaults.bind(null, endpoint2)
+    });
+    return endpointOptions.request.hook(request2, endpointOptions);
+  };
+  return Object.assign(newApi, {
+    endpoint: endpoint2,
+    defaults: dist_bundle_withDefaults.bind(null, endpoint2)
+  });
+}
 
+// pkg/dist-src/index.js
+var request = dist_bundle_withDefaults(endpoint, defaults_default);
 
-var map = __nccwpck_require__(47451);
-var _null = __nccwpck_require__(73632);
-var seq = __nccwpck_require__(1706);
-var string = __nccwpck_require__(66464);
-var binary = __nccwpck_require__(56083);
-var bool = __nccwpck_require__(88398);
-var float = __nccwpck_require__(35782);
-var int = __nccwpck_require__(10873);
-var merge = __nccwpck_require__(90452);
-var omap = __nccwpck_require__(50303);
-var pairs = __nccwpck_require__(18385);
-var set = __nccwpck_require__(81528);
-var timestamp = __nccwpck_require__(46752);
+/* v8 ignore next -- @preserve */
+/* v8 ignore else -- @preserve */
 
-const schema = [
-    map.map,
-    seq.seq,
-    string.string,
-    _null.nullTag,
-    bool.trueTag,
-    bool.falseTag,
-    int.intBin,
-    int.intOct,
-    int.int,
-    int.intHex,
-    float.floatNaN,
-    float.floatExp,
-    float.float,
-    binary.binary,
-    merge.merge,
-    omap.omap,
-    pairs.pairs,
-    set.set,
-    timestamp.intTime,
-    timestamp.floatTime,
-    timestamp.timestamp
-];
+;// CONCATENATED MODULE: ./node_modules/@octokit/graphql/dist-bundle/index.js
+// pkg/dist-src/index.js
 
-exports.schema = schema;
 
 
-/***/ }),
+// pkg/dist-src/version.js
+var graphql_dist_bundle_VERSION = "0.0.0-development";
 
-/***/ 81528:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+// pkg/dist-src/with-defaults.js
 
-"use strict";
 
+// pkg/dist-src/graphql.js
 
-var identity = __nccwpck_require__(41127);
-var Pair = __nccwpck_require__(57165);
-var YAMLMap = __nccwpck_require__(84454);
 
-class YAMLSet extends YAMLMap.YAMLMap {
-    constructor(schema) {
-        super(schema);
-        this.tag = YAMLSet.tag;
-    }
-    add(key) {
-        let pair;
-        if (identity.isPair(key))
-            pair = key;
-        else if (key &&
-            typeof key === 'object' &&
-            'key' in key &&
-            'value' in key &&
-            key.value === null)
-            pair = new Pair.Pair(key.key, null);
-        else
-            pair = new Pair.Pair(key, null);
-        const prev = YAMLMap.findPair(this.items, pair.key);
-        if (!prev)
-            this.items.push(pair);
+// pkg/dist-src/error.js
+function _buildMessageForResponseErrors(data) {
+  return `Request failed due to following response errors:
+` + data.errors.map((e) => ` - ${e.message}`).join("\n");
+}
+var GraphqlResponseError = class extends Error {
+  constructor(request2, headers, response) {
+    super(_buildMessageForResponseErrors(response));
+    this.request = request2;
+    this.headers = headers;
+    this.response = response;
+    this.errors = response.errors;
+    this.data = response.data;
+    if (Error.captureStackTrace) {
+      Error.captureStackTrace(this, this.constructor);
     }
-    /**
-     * If `keepPair` is `true`, returns the Pair matching `key`.
-     * Otherwise, returns the value of that Pair's key.
-     */
-    get(key, keepPair) {
-        const pair = YAMLMap.findPair(this.items, key);
-        return !keepPair && identity.isPair(pair)
-            ? identity.isScalar(pair.key)
-                ? pair.key.value
-                : pair.key
-            : pair;
+  }
+  name = "GraphqlResponseError";
+  errors;
+  data;
+};
+
+// pkg/dist-src/graphql.js
+var NON_VARIABLE_OPTIONS = [
+  "method",
+  "baseUrl",
+  "url",
+  "headers",
+  "request",
+  "query",
+  "mediaType",
+  "operationName"
+];
+var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
+var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
+function graphql(request2, query, options) {
+  if (options) {
+    if (typeof query === "string" && "query" in options) {
+      return Promise.reject(
+        new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
+      );
     }
-    set(key, value) {
-        if (typeof value !== 'boolean')
-            throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
-        const prev = YAMLMap.findPair(this.items, key);
-        if (prev && !value) {
-            this.items.splice(this.items.indexOf(prev), 1);
-        }
-        else if (!prev && value) {
-            this.items.push(new Pair.Pair(key));
-        }
+    for (const key in options) {
+      if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
+      return Promise.reject(
+        new Error(
+          `[@octokit/graphql] "${key}" cannot be used as variable name`
+        )
+      );
     }
-    toJSON(_, ctx) {
-        return super.toJSON(_, ctx, Set);
+  }
+  const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
+  const requestOptions = Object.keys(
+    parsedOptions
+  ).reduce((result, key) => {
+    if (NON_VARIABLE_OPTIONS.includes(key)) {
+      result[key] = parsedOptions[key];
+      return result;
     }
-    toString(ctx, onComment, onChompKeep) {
-        if (!ctx)
-            return JSON.stringify(this);
-        if (this.hasAllNullValues(true))
-            return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);
-        else
-            throw new Error('Set items must all have null values');
+    if (!result.variables) {
+      result.variables = {};
     }
-    static from(schema, iterable, ctx) {
-        const { replacer } = ctx;
-        const set = new this(schema);
-        if (iterable && Symbol.iterator in Object(iterable))
-            for (let value of iterable) {
-                if (typeof replacer === 'function')
-                    value = replacer.call(iterable, value, value);
-                set.items.push(Pair.createPair(value, null, ctx));
-            }
-        return set;
+    result.variables[key] = parsedOptions[key];
+    return result;
+  }, {});
+  const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
+  if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
+    requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
+  }
+  return request2(requestOptions).then((response) => {
+    if (response.data.errors) {
+      const headers = {};
+      for (const key of Object.keys(response.headers)) {
+        headers[key] = response.headers[key];
+      }
+      throw new GraphqlResponseError(
+        requestOptions,
+        headers,
+        response.data
+      );
     }
+    return response.data.data;
+  });
 }
-YAMLSet.tag = 'tag:yaml.org,2002:set';
-const set = {
-    collection: 'map',
-    identify: value => value instanceof Set,
-    nodeClass: YAMLSet,
-    default: false,
-    tag: 'tag:yaml.org,2002:set',
-    createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
-    resolve(map, onError) {
-        if (identity.isMap(map)) {
-            if (map.hasAllNullValues(true))
-                return Object.assign(new YAMLSet(), map);
-            else
-                onError('Set items must all have null values');
-        }
-        else
-            onError('Expected a mapping for this tag');
-        return map;
-    }
-};
-
-exports.YAMLSet = YAMLSet;
-exports.set = set;
 
+// pkg/dist-src/with-defaults.js
+function graphql_dist_bundle_withDefaults(request2, newDefaults) {
+  const newRequest = request2.defaults(newDefaults);
+  const newApi = (query, options) => {
+    return graphql(newRequest, query, options);
+  };
+  return Object.assign(newApi, {
+    defaults: graphql_dist_bundle_withDefaults.bind(null, newRequest),
+    endpoint: newRequest.endpoint
+  });
+}
 
-/***/ }),
+// pkg/dist-src/index.js
+var graphql2 = graphql_dist_bundle_withDefaults(request, {
+  headers: {
+    "user-agent": `octokit-graphql.js/${graphql_dist_bundle_VERSION} ${getUserAgent()}`
+  },
+  method: "POST",
+  url: "/graphql"
+});
+function withCustomRequest(customRequest) {
+  return graphql_dist_bundle_withDefaults(customRequest, {
+    method: "POST",
+    url: "/graphql"
+  });
+}
 
-/***/ 46752:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
+;// CONCATENATED MODULE: ./node_modules/@octokit/auth-token/dist-bundle/index.js
+// pkg/dist-src/is-jwt.js
+var b64url = "(?:[a-zA-Z0-9_-]+)";
+var dist_bundle_sep = "\\.";
+var jwtRE = new RegExp(`^${b64url}${dist_bundle_sep}${b64url}${dist_bundle_sep}${b64url}$`);
+var isJWT = jwtRE.test.bind(jwtRE);
 
+// pkg/dist-src/auth.js
+async function auth(token) {
+  const isApp = isJWT(token);
+  const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_");
+  const isUserToServer = token.startsWith("ghu_");
+  const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
+  return {
+    type: "token",
+    token,
+    tokenType
+  };
+}
 
-var stringifyNumber = __nccwpck_require__(28689);
+// pkg/dist-src/with-authorization-prefix.js
+function withAuthorizationPrefix(token) {
+  if (token.split(/\./).length === 3) {
+    return `bearer ${token}`;
+  }
+  return `token ${token}`;
+}
 
-/** Internal types handle bigint as number, because TS can't figure it out. */
-function parseSexagesimal(str, asBigInt) {
-    const sign = str[0];
-    const parts = sign === '-' || sign === '+' ? str.substring(1) : str;
-    const num = (n) => asBigInt ? BigInt(n) : Number(n);
-    const res = parts
-        .replace(/_/g, '')
-        .split(':')
-        .reduce((res, p) => res * num(60) + num(p), num(0));
-    return (sign === '-' ? num(-1) * res : res);
+// pkg/dist-src/hook.js
+async function hook(token, request, route, parameters) {
+  const endpoint = request.endpoint.merge(
+    route,
+    parameters
+  );
+  endpoint.headers.authorization = withAuthorizationPrefix(token);
+  return request(endpoint);
 }
-/**
- * hhhh:mm:ss.sss
- *
- * Internal types handle bigint as number, because TS can't figure it out.
- */
-function stringifySexagesimal(node) {
-    let { value } = node;
-    let num = (n) => n;
-    if (typeof value === 'bigint')
-        num = n => BigInt(n);
-    else if (isNaN(value) || !isFinite(value))
-        return stringifyNumber.stringifyNumber(node);
-    let sign = '';
-    if (value < 0) {
-        sign = '-';
-        value *= num(-1);
-    }
-    const _60 = num(60);
-    const parts = [value % _60]; // seconds, including ms
-    if (value < 60) {
-        parts.unshift(0); // at least one : is required
-    }
-    else {
-        value = (value - parts[0]) / _60;
-        parts.unshift(value % _60); // minutes
-        if (value >= 60) {
-            value = (value - parts[0]) / _60;
-            parts.unshift(value); // hours
-        }
-    }
-    return (sign +
-        parts
-            .map(n => String(n).padStart(2, '0'))
-            .join(':')
-            .replace(/000000\d*$/, '') // % 60 may introduce error
+
+// pkg/dist-src/index.js
+var createTokenAuth = function createTokenAuth2(token) {
+  if (!token) {
+    throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
+  }
+  if (typeof token !== "string") {
+    throw new Error(
+      "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
     );
-}
-const intTime = {
-    identify: value => typeof value === 'bigint' || Number.isInteger(value),
-    default: true,
-    tag: 'tag:yaml.org,2002:int',
-    format: 'TIME',
-    test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
-    resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),
-    stringify: stringifySexagesimal
-};
-const floatTime = {
-    identify: value => typeof value === 'number',
-    default: true,
-    tag: 'tag:yaml.org,2002:float',
-    format: 'TIME',
-    test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
-    resolve: str => parseSexagesimal(str, false),
-    stringify: stringifySexagesimal
-};
-const timestamp = {
-    identify: value => value instanceof Date,
-    default: true,
-    tag: 'tag:yaml.org,2002:timestamp',
-    // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
-    // may be omitted altogether, resulting in a date format. In such a case, the time part is
-    // assumed to be 00:00:00Z (start of day, UTC).
-    test: RegExp('^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd
-        '(?:' + // time is optional
-        '(?:t|T|[ \\t]+)' + // t | T | whitespace
-        '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?
-        '(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30
-        ')?$'),
-    resolve(str) {
-        const match = str.match(timestamp.test);
-        if (!match)
-            throw new Error('!!timestamp expects a date, starting with yyyy-mm-dd');
-        const [, year, month, day, hour, minute, second] = match.map(Number);
-        const millisec = match[7] ? Number((match[7] + '00').substr(1, 3)) : 0;
-        let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
-        const tz = match[8];
-        if (tz && tz !== 'Z') {
-            let d = parseSexagesimal(tz, false);
-            if (Math.abs(d) < 30)
-                d *= 60;
-            date -= 60000 * d;
-        }
-        return new Date(date);
-    },
-    stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
+  }
+  token = token.replace(/^(token|bearer) +/i, "");
+  return Object.assign(auth.bind(null, token), {
+    hook: hook.bind(null, token)
+  });
 };
 
-exports.floatTime = floatTime;
-exports.intTime = intTime;
-exports.timestamp = timestamp;
 
+;// CONCATENATED MODULE: ./node_modules/@octokit/core/dist-src/version.js
+const version_VERSION = "7.0.6";
 
-/***/ }),
 
-/***/ 34475:
-/***/ ((__unused_webpack_module, exports) => {
+;// CONCATENATED MODULE: ./node_modules/@octokit/core/dist-src/index.js
 
-"use strict";
 
 
-const FOLD_FLOW = 'flow';
-const FOLD_BLOCK = 'block';
-const FOLD_QUOTED = 'quoted';
-/**
- * Tries to keep input at up to `lineWidth` characters, splitting only on spaces
- * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are
- * terminated with `\n` and started with `indent`.
- */
-function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
-    if (!lineWidth || lineWidth < 0)
-        return text;
-    if (lineWidth < minContentWidth)
-        minContentWidth = 0;
-    const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
-    if (text.length <= endStep)
-        return text;
-    const folds = [];
-    const escapedFolds = {};
-    let end = lineWidth - indent.length;
-    if (typeof indentAtStart === 'number') {
-        if (indentAtStart > lineWidth - Math.max(2, minContentWidth))
-            folds.push(0);
-        else
-            end = lineWidth - indentAtStart;
+
+
+
+const dist_src_noop = () => {
+};
+const consoleWarn = console.warn.bind(console);
+const consoleError = console.error.bind(console);
+function createLogger(logger = {}) {
+  if (typeof logger.debug !== "function") {
+    logger.debug = dist_src_noop;
+  }
+  if (typeof logger.info !== "function") {
+    logger.info = dist_src_noop;
+  }
+  if (typeof logger.warn !== "function") {
+    logger.warn = consoleWarn;
+  }
+  if (typeof logger.error !== "function") {
+    logger.error = consoleError;
+  }
+  return logger;
+}
+const userAgentTrail = `octokit-core.js/${version_VERSION} ${getUserAgent()}`;
+class Octokit {
+  static VERSION = version_VERSION;
+  static defaults(defaults) {
+    const OctokitWithDefaults = class extends this {
+      constructor(...args) {
+        const options = args[0] || {};
+        if (typeof defaults === "function") {
+          super(defaults(options));
+          return;
+        }
+        super(
+          Object.assign(
+            {},
+            defaults,
+            options,
+            options.userAgent && defaults.userAgent ? {
+              userAgent: `${options.userAgent} ${defaults.userAgent}`
+            } : null
+          )
+        );
+      }
+    };
+    return OctokitWithDefaults;
+  }
+  static plugins = [];
+  /**
+   * Attach a plugin (or many) to your Octokit instance.
+   *
+   * @example
+   * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
+   */
+  static plugin(...newPlugins) {
+    const currentPlugins = this.plugins;
+    const NewOctokit = class extends this {
+      static plugins = currentPlugins.concat(
+        newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
+      );
+    };
+    return NewOctokit;
+  }
+  constructor(options = {}) {
+    const hook = new before_after_hook.Collection();
+    const requestDefaults = {
+      baseUrl: request.endpoint.DEFAULTS.baseUrl,
+      headers: {},
+      request: Object.assign({}, options.request, {
+        // @ts-ignore internal usage only, no need to type
+        hook: hook.bind(null, "request")
+      }),
+      mediaType: {
+        previews: [],
+        format: ""
+      }
+    };
+    requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
+    if (options.baseUrl) {
+      requestDefaults.baseUrl = options.baseUrl;
     }
-    let split = undefined;
-    let prev = undefined;
-    let overflow = false;
-    let i = -1;
-    let escStart = -1;
-    let escEnd = -1;
-    if (mode === FOLD_BLOCK) {
-        i = consumeMoreIndentedLines(text, i, indent.length);
-        if (i !== -1)
-            end = i + endStep;
+    if (options.previews) {
+      requestDefaults.mediaType.previews = options.previews;
     }
-    for (let ch; (ch = text[(i += 1)]);) {
-        if (mode === FOLD_QUOTED && ch === '\\') {
-            escStart = i;
-            switch (text[i + 1]) {
-                case 'x':
-                    i += 3;
-                    break;
-                case 'u':
-                    i += 5;
-                    break;
-                case 'U':
-                    i += 9;
-                    break;
-                default:
-                    i += 1;
-            }
-            escEnd = i;
-        }
-        if (ch === '\n') {
-            if (mode === FOLD_BLOCK)
-                i = consumeMoreIndentedLines(text, i, indent.length);
-            end = i + indent.length + endStep;
-            split = undefined;
-        }
-        else {
-            if (ch === ' ' &&
-                prev &&
-                prev !== ' ' &&
-                prev !== '\n' &&
-                prev !== '\t') {
-                // space surrounded by non-space can be replaced with newline + indent
-                const next = text[i + 1];
-                if (next && next !== ' ' && next !== '\n' && next !== '\t')
-                    split = i;
-            }
-            if (i >= end) {
-                if (split) {
-                    folds.push(split);
-                    end = split + endStep;
-                    split = undefined;
-                }
-                else if (mode === FOLD_QUOTED) {
-                    // white-space collected at end may stretch past lineWidth
-                    while (prev === ' ' || prev === '\t') {
-                        prev = ch;
-                        ch = text[(i += 1)];
-                        overflow = true;
-                    }
-                    // Account for newline escape, but don't break preceding escape
-                    const j = i > escEnd + 1 ? i - 2 : escStart - 1;
-                    // Bail out if lineWidth & minContentWidth are shorter than an escape string
-                    if (escapedFolds[j])
-                        return text;
-                    folds.push(j);
-                    escapedFolds[j] = true;
-                    end = j + endStep;
-                    split = undefined;
-                }
-                else {
-                    overflow = true;
-                }
-            }
-        }
-        prev = ch;
+    if (options.timeZone) {
+      requestDefaults.headers["time-zone"] = options.timeZone;
     }
-    if (overflow && onOverflow)
-        onOverflow();
-    if (folds.length === 0)
-        return text;
-    if (onFold)
-        onFold();
-    let res = text.slice(0, folds[0]);
-    for (let i = 0; i < folds.length; ++i) {
-        const fold = folds[i];
-        const end = folds[i + 1] || text.length;
-        if (fold === 0)
-            res = `\n${indent}${text.slice(0, end)}`;
-        else {
-            if (mode === FOLD_QUOTED && escapedFolds[fold])
-                res += `${text[fold]}\\`;
-            res += `\n${indent}${text.slice(fold + 1, end)}`;
-        }
+    this.request = request.defaults(requestDefaults);
+    this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
+    this.log = createLogger(options.log);
+    this.hook = hook;
+    if (!options.authStrategy) {
+      if (!options.auth) {
+        this.auth = async () => ({
+          type: "unauthenticated"
+        });
+      } else {
+        const auth = createTokenAuth(options.auth);
+        hook.wrap("request", auth.hook);
+        this.auth = auth;
+      }
+    } else {
+      const { authStrategy, ...otherOptions } = options;
+      const auth = authStrategy(
+        Object.assign(
+          {
+            request: this.request,
+            log: this.log,
+            // we pass the current octokit instance as well as its constructor options
+            // to allow for authentication strategies that return a new octokit instance
+            // that shares the same internal state as the current one. The original
+            // requirement for this was the "event-octokit" authentication strategy
+            // of https://github.com/probot/octokit-auth-probot.
+            octokit: this,
+            octokitOptions: otherOptions
+          },
+          options.auth
+        )
+      );
+      hook.wrap("request", auth.hook);
+      this.auth = auth;
     }
-    return res;
-}
-/**
- * Presumes `i + 1` is at the start of a line
- * @returns index of last newline in more-indented block
- */
-function consumeMoreIndentedLines(text, i, indent) {
-    let end = i;
-    let start = i + 1;
-    let ch = text[start];
-    while (ch === ' ' || ch === '\t') {
-        if (i < start + indent) {
-            ch = text[++i];
-        }
-        else {
-            do {
-                ch = text[++i];
-            } while (ch && ch !== '\n');
-            end = i;
-            start = i + 1;
-            ch = text[start];
-        }
+    const classConstructor = this.constructor;
+    for (let i = 0; i < classConstructor.plugins.length; ++i) {
+      Object.assign(this, classConstructor.plugins[i](this, options));
     }
-    return end;
+  }
+  // assigned during constructor
+  request;
+  graphql;
+  log;
+  hook;
+  // TODO: type `octokit.auth` based on passed options.authStrategy
+  auth;
 }
 
-exports.FOLD_BLOCK = FOLD_BLOCK;
-exports.FOLD_FLOW = FOLD_FLOW;
-exports.FOLD_QUOTED = FOLD_QUOTED;
-exports.foldFlowLines = foldFlowLines;
-
 
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
+const dist_src_version_VERSION = "17.0.0";
 
-/***/ 2148:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+//# sourceMappingURL=version.js.map
 
-"use strict";
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
+const Endpoints = {
+  actions: {
+    addCustomLabelsToSelfHostedRunnerForOrg: [
+      "POST /orgs/{org}/actions/runners/{runner_id}/labels"
+    ],
+    addCustomLabelsToSelfHostedRunnerForRepo: [
+      "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+    ],
+    addRepoAccessToSelfHostedRunnerGroupInOrg: [
+      "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"
+    ],
+    addSelectedRepoToOrgSecret: [
+      "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    addSelectedRepoToOrgVariable: [
+      "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
+    ],
+    approveWorkflowRun: [
+      "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
+    ],
+    cancelWorkflowRun: [
+      "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
+    ],
+    createEnvironmentVariable: [
+      "POST /repos/{owner}/{repo}/environments/{environment_name}/variables"
+    ],
+    createHostedRunnerForOrg: ["POST /orgs/{org}/actions/hosted-runners"],
+    createOrUpdateEnvironmentSecret: [
+      "PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
+    ],
+    createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
+    createOrUpdateRepoSecret: [
+      "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
+    ],
+    createOrgVariable: ["POST /orgs/{org}/actions/variables"],
+    createRegistrationTokenForOrg: [
+      "POST /orgs/{org}/actions/runners/registration-token"
+    ],
+    createRegistrationTokenForRepo: [
+      "POST /repos/{owner}/{repo}/actions/runners/registration-token"
+    ],
+    createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
+    createRemoveTokenForRepo: [
+      "POST /repos/{owner}/{repo}/actions/runners/remove-token"
+    ],
+    createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
+    createWorkflowDispatch: [
+      "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
+    ],
+    deleteActionsCacheById: [
+      "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
+    ],
+    deleteActionsCacheByKey: [
+      "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
+    ],
+    deleteArtifact: [
+      "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
+    ],
+    deleteCustomImageFromOrg: [
+      "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
+    ],
+    deleteCustomImageVersionFromOrg: [
+      "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
+    ],
+    deleteEnvironmentSecret: [
+      "DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
+    ],
+    deleteEnvironmentVariable: [
+      "DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
+    ],
+    deleteHostedRunnerForOrg: [
+      "DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
+    ],
+    deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
+    deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
+    deleteRepoSecret: [
+      "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
+    ],
+    deleteRepoVariable: [
+      "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
+    ],
+    deleteSelfHostedRunnerFromOrg: [
+      "DELETE /orgs/{org}/actions/runners/{runner_id}"
+    ],
+    deleteSelfHostedRunnerFromRepo: [
+      "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
+    ],
+    deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
+    deleteWorkflowRunLogs: [
+      "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
+    ],
+    disableSelectedRepositoryGithubActionsOrganization: [
+      "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
+    ],
+    disableWorkflow: [
+      "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
+    ],
+    downloadArtifact: [
+      "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
+    ],
+    downloadJobLogsForWorkflowRun: [
+      "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
+    ],
+    downloadWorkflowRunAttemptLogs: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
+    ],
+    downloadWorkflowRunLogs: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
+    ],
+    enableSelectedRepositoryGithubActionsOrganization: [
+      "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
+    ],
+    enableWorkflow: [
+      "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
+    ],
+    forceCancelWorkflowRun: [
+      "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
+    ],
+    generateRunnerJitconfigForOrg: [
+      "POST /orgs/{org}/actions/runners/generate-jitconfig"
+    ],
+    generateRunnerJitconfigForRepo: [
+      "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
+    ],
+    getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
+    getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
+    getActionsCacheUsageByRepoForOrg: [
+      "GET /orgs/{org}/actions/cache/usage-by-repository"
+    ],
+    getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
+    getAllowedActionsOrganization: [
+      "GET /orgs/{org}/actions/permissions/selected-actions"
+    ],
+    getAllowedActionsRepository: [
+      "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
+    ],
+    getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
+    getCustomImageForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
+    ],
+    getCustomImageVersionForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
+    ],
+    getCustomOidcSubClaimForRepo: [
+      "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
+    ],
+    getEnvironmentPublicKey: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"
+    ],
+    getEnvironmentSecret: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
+    ],
+    getEnvironmentVariable: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
+    ],
+    getGithubActionsDefaultWorkflowPermissionsOrganization: [
+      "GET /orgs/{org}/actions/permissions/workflow"
+    ],
+    getGithubActionsDefaultWorkflowPermissionsRepository: [
+      "GET /repos/{owner}/{repo}/actions/permissions/workflow"
+    ],
+    getGithubActionsPermissionsOrganization: [
+      "GET /orgs/{org}/actions/permissions"
+    ],
+    getGithubActionsPermissionsRepository: [
+      "GET /repos/{owner}/{repo}/actions/permissions"
+    ],
+    getHostedRunnerForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
+    ],
+    getHostedRunnersGithubOwnedImagesForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/images/github-owned"
+    ],
+    getHostedRunnersLimitsForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/limits"
+    ],
+    getHostedRunnersMachineSpecsForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/machine-sizes"
+    ],
+    getHostedRunnersPartnerImagesForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/images/partner"
+    ],
+    getHostedRunnersPlatformsForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/platforms"
+    ],
+    getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
+    getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
+    getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
+    getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
+    getPendingDeploymentsForRun: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
+    ],
+    getRepoPermissions: [
+      "GET /repos/{owner}/{repo}/actions/permissions",
+      {},
+      { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
+    ],
+    getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
+    getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
+    getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
+    getReviewsForRun: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
+    ],
+    getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
+    getSelfHostedRunnerForRepo: [
+      "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
+    ],
+    getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
+    getWorkflowAccessToRepository: [
+      "GET /repos/{owner}/{repo}/actions/permissions/access"
+    ],
+    getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
+    getWorkflowRunAttempt: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
+    ],
+    getWorkflowRunUsage: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
+    ],
+    getWorkflowUsage: [
+      "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
+    ],
+    listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
+    listCustomImageVersionsForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"
+    ],
+    listCustomImagesForOrg: [
+      "GET /orgs/{org}/actions/hosted-runners/images/custom"
+    ],
+    listEnvironmentSecrets: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"
+    ],
+    listEnvironmentVariables: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/variables"
+    ],
+    listGithubHostedRunnersInGroupForOrg: [
+      "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"
+    ],
+    listHostedRunnersForOrg: ["GET /orgs/{org}/actions/hosted-runners"],
+    listJobsForWorkflowRun: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
+    ],
+    listJobsForWorkflowRunAttempt: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
+    ],
+    listLabelsForSelfHostedRunnerForOrg: [
+      "GET /orgs/{org}/actions/runners/{runner_id}/labels"
+    ],
+    listLabelsForSelfHostedRunnerForRepo: [
+      "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+    ],
+    listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
+    listOrgVariables: ["GET /orgs/{org}/actions/variables"],
+    listRepoOrganizationSecrets: [
+      "GET /repos/{owner}/{repo}/actions/organization-secrets"
+    ],
+    listRepoOrganizationVariables: [
+      "GET /repos/{owner}/{repo}/actions/organization-variables"
+    ],
+    listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
+    listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
+    listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
+    listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
+    listRunnerApplicationsForRepo: [
+      "GET /repos/{owner}/{repo}/actions/runners/downloads"
+    ],
+    listSelectedReposForOrgSecret: [
+      "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
+    ],
+    listSelectedReposForOrgVariable: [
+      "GET /orgs/{org}/actions/variables/{name}/repositories"
+    ],
+    listSelectedRepositoriesEnabledGithubActionsOrganization: [
+      "GET /orgs/{org}/actions/permissions/repositories"
+    ],
+    listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
+    listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
+    listWorkflowRunArtifacts: [
+      "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
+    ],
+    listWorkflowRuns: [
+      "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
+    ],
+    listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
+    reRunJobForWorkflowRun: [
+      "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
+    ],
+    reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
+    reRunWorkflowFailedJobs: [
+      "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
+    ],
+    removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
+      "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
+    ],
+    removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
+      "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+    ],
+    removeCustomLabelFromSelfHostedRunnerForOrg: [
+      "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
+    ],
+    removeCustomLabelFromSelfHostedRunnerForRepo: [
+      "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
+    ],
+    removeSelectedRepoFromOrgSecret: [
+      "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    removeSelectedRepoFromOrgVariable: [
+      "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
+    ],
+    reviewCustomGatesForRun: [
+      "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
+    ],
+    reviewPendingDeploymentsForRun: [
+      "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
+    ],
+    setAllowedActionsOrganization: [
+      "PUT /orgs/{org}/actions/permissions/selected-actions"
+    ],
+    setAllowedActionsRepository: [
+      "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
+    ],
+    setCustomLabelsForSelfHostedRunnerForOrg: [
+      "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
+    ],
+    setCustomLabelsForSelfHostedRunnerForRepo: [
+      "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+    ],
+    setCustomOidcSubClaimForRepo: [
+      "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
+    ],
+    setGithubActionsDefaultWorkflowPermissionsOrganization: [
+      "PUT /orgs/{org}/actions/permissions/workflow"
+    ],
+    setGithubActionsDefaultWorkflowPermissionsRepository: [
+      "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
+    ],
+    setGithubActionsPermissionsOrganization: [
+      "PUT /orgs/{org}/actions/permissions"
+    ],
+    setGithubActionsPermissionsRepository: [
+      "PUT /repos/{owner}/{repo}/actions/permissions"
+    ],
+    setSelectedReposForOrgSecret: [
+      "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
+    ],
+    setSelectedReposForOrgVariable: [
+      "PUT /orgs/{org}/actions/variables/{name}/repositories"
+    ],
+    setSelectedRepositoriesEnabledGithubActionsOrganization: [
+      "PUT /orgs/{org}/actions/permissions/repositories"
+    ],
+    setWorkflowAccessToRepository: [
+      "PUT /repos/{owner}/{repo}/actions/permissions/access"
+    ],
+    updateEnvironmentVariable: [
+      "PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
+    ],
+    updateHostedRunnerForOrg: [
+      "PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
+    ],
+    updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
+    updateRepoVariable: [
+      "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
+    ]
+  },
+  activity: {
+    checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
+    deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
+    deleteThreadSubscription: [
+      "DELETE /notifications/threads/{thread_id}/subscription"
+    ],
+    getFeeds: ["GET /feeds"],
+    getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
+    getThread: ["GET /notifications/threads/{thread_id}"],
+    getThreadSubscriptionForAuthenticatedUser: [
+      "GET /notifications/threads/{thread_id}/subscription"
+    ],
+    listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
+    listNotificationsForAuthenticatedUser: ["GET /notifications"],
+    listOrgEventsForAuthenticatedUser: [
+      "GET /users/{username}/events/orgs/{org}"
+    ],
+    listPublicEvents: ["GET /events"],
+    listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
+    listPublicEventsForUser: ["GET /users/{username}/events/public"],
+    listPublicOrgEvents: ["GET /orgs/{org}/events"],
+    listReceivedEventsForUser: ["GET /users/{username}/received_events"],
+    listReceivedPublicEventsForUser: [
+      "GET /users/{username}/received_events/public"
+    ],
+    listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
+    listRepoNotificationsForAuthenticatedUser: [
+      "GET /repos/{owner}/{repo}/notifications"
+    ],
+    listReposStarredByAuthenticatedUser: ["GET /user/starred"],
+    listReposStarredByUser: ["GET /users/{username}/starred"],
+    listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
+    listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
+    listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
+    listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
+    markNotificationsAsRead: ["PUT /notifications"],
+    markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
+    markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
+    markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
+    setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
+    setThreadSubscription: [
+      "PUT /notifications/threads/{thread_id}/subscription"
+    ],
+    starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
+    unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
+  },
+  apps: {
+    addRepoToInstallation: [
+      "PUT /user/installations/{installation_id}/repositories/{repository_id}",
+      {},
+      { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
+    ],
+    addRepoToInstallationForAuthenticatedUser: [
+      "PUT /user/installations/{installation_id}/repositories/{repository_id}"
+    ],
+    checkToken: ["POST /applications/{client_id}/token"],
+    createFromManifest: ["POST /app-manifests/{code}/conversions"],
+    createInstallationAccessToken: [
+      "POST /app/installations/{installation_id}/access_tokens"
+    ],
+    deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
+    deleteInstallation: ["DELETE /app/installations/{installation_id}"],
+    deleteToken: ["DELETE /applications/{client_id}/token"],
+    getAuthenticated: ["GET /app"],
+    getBySlug: ["GET /apps/{app_slug}"],
+    getInstallation: ["GET /app/installations/{installation_id}"],
+    getOrgInstallation: ["GET /orgs/{org}/installation"],
+    getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
+    getSubscriptionPlanForAccount: [
+      "GET /marketplace_listing/accounts/{account_id}"
+    ],
+    getSubscriptionPlanForAccountStubbed: [
+      "GET /marketplace_listing/stubbed/accounts/{account_id}"
+    ],
+    getUserInstallation: ["GET /users/{username}/installation"],
+    getWebhookConfigForApp: ["GET /app/hook/config"],
+    getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
+    listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
+    listAccountsForPlanStubbed: [
+      "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
+    ],
+    listInstallationReposForAuthenticatedUser: [
+      "GET /user/installations/{installation_id}/repositories"
+    ],
+    listInstallationRequestsForAuthenticatedApp: [
+      "GET /app/installation-requests"
+    ],
+    listInstallations: ["GET /app/installations"],
+    listInstallationsForAuthenticatedUser: ["GET /user/installations"],
+    listPlans: ["GET /marketplace_listing/plans"],
+    listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
+    listReposAccessibleToInstallation: ["GET /installation/repositories"],
+    listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
+    listSubscriptionsForAuthenticatedUserStubbed: [
+      "GET /user/marketplace_purchases/stubbed"
+    ],
+    listWebhookDeliveries: ["GET /app/hook/deliveries"],
+    redeliverWebhookDelivery: [
+      "POST /app/hook/deliveries/{delivery_id}/attempts"
+    ],
+    removeRepoFromInstallation: [
+      "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
+      {},
+      { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
+    ],
+    removeRepoFromInstallationForAuthenticatedUser: [
+      "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
+    ],
+    resetToken: ["PATCH /applications/{client_id}/token"],
+    revokeInstallationAccessToken: ["DELETE /installation/token"],
+    scopeToken: ["POST /applications/{client_id}/token/scoped"],
+    suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
+    unsuspendInstallation: [
+      "DELETE /app/installations/{installation_id}/suspended"
+    ],
+    updateWebhookConfigForApp: ["PATCH /app/hook/config"]
+  },
+  billing: {
+    getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
+    getGithubActionsBillingUser: [
+      "GET /users/{username}/settings/billing/actions"
+    ],
+    getGithubBillingPremiumRequestUsageReportOrg: [
+      "GET /organizations/{org}/settings/billing/premium_request/usage"
+    ],
+    getGithubBillingPremiumRequestUsageReportUser: [
+      "GET /users/{username}/settings/billing/premium_request/usage"
+    ],
+    getGithubBillingUsageReportOrg: [
+      "GET /organizations/{org}/settings/billing/usage"
+    ],
+    getGithubBillingUsageReportUser: [
+      "GET /users/{username}/settings/billing/usage"
+    ],
+    getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
+    getGithubPackagesBillingUser: [
+      "GET /users/{username}/settings/billing/packages"
+    ],
+    getSharedStorageBillingOrg: [
+      "GET /orgs/{org}/settings/billing/shared-storage"
+    ],
+    getSharedStorageBillingUser: [
+      "GET /users/{username}/settings/billing/shared-storage"
+    ]
+  },
+  campaigns: {
+    createCampaign: ["POST /orgs/{org}/campaigns"],
+    deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"],
+    getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"],
+    listOrgCampaigns: ["GET /orgs/{org}/campaigns"],
+    updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"]
+  },
+  checks: {
+    create: ["POST /repos/{owner}/{repo}/check-runs"],
+    createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
+    get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
+    getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
+    listAnnotations: [
+      "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
+    ],
+    listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
+    listForSuite: [
+      "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
+    ],
+    listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
+    rerequestRun: [
+      "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
+    ],
+    rerequestSuite: [
+      "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
+    ],
+    setSuitesPreferences: [
+      "PATCH /repos/{owner}/{repo}/check-suites/preferences"
+    ],
+    update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
+  },
+  codeScanning: {
+    commitAutofix: [
+      "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"
+    ],
+    createAutofix: [
+      "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"
+    ],
+    createVariantAnalysis: [
+      "POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"
+    ],
+    deleteAnalysis: [
+      "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
+    ],
+    deleteCodeqlDatabase: [
+      "DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
+    ],
+    getAlert: [
+      "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
+      {},
+      { renamedParameters: { alert_id: "alert_number" } }
+    ],
+    getAnalysis: [
+      "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
+    ],
+    getAutofix: [
+      "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"
+    ],
+    getCodeqlDatabase: [
+      "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
+    ],
+    getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
+    getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
+    getVariantAnalysis: [
+      "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"
+    ],
+    getVariantAnalysisRepoTask: [
+      "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"
+    ],
+    listAlertInstances: [
+      "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
+    ],
+    listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
+    listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
+    listAlertsInstances: [
+      "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
+      {},
+      { renamed: ["codeScanning", "listAlertInstances"] }
+    ],
+    listCodeqlDatabases: [
+      "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
+    ],
+    listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
+    updateAlert: [
+      "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
+    ],
+    updateDefaultSetup: [
+      "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
+    ],
+    uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
+  },
+  codeSecurity: {
+    attachConfiguration: [
+      "POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"
+    ],
+    attachEnterpriseConfiguration: [
+      "POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"
+    ],
+    createConfiguration: ["POST /orgs/{org}/code-security/configurations"],
+    createConfigurationForEnterprise: [
+      "POST /enterprises/{enterprise}/code-security/configurations"
+    ],
+    deleteConfiguration: [
+      "DELETE /orgs/{org}/code-security/configurations/{configuration_id}"
+    ],
+    deleteConfigurationForEnterprise: [
+      "DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"
+    ],
+    detachConfiguration: [
+      "DELETE /orgs/{org}/code-security/configurations/detach"
+    ],
+    getConfiguration: [
+      "GET /orgs/{org}/code-security/configurations/{configuration_id}"
+    ],
+    getConfigurationForRepository: [
+      "GET /repos/{owner}/{repo}/code-security-configuration"
+    ],
+    getConfigurationsForEnterprise: [
+      "GET /enterprises/{enterprise}/code-security/configurations"
+    ],
+    getConfigurationsForOrg: ["GET /orgs/{org}/code-security/configurations"],
+    getDefaultConfigurations: [
+      "GET /orgs/{org}/code-security/configurations/defaults"
+    ],
+    getDefaultConfigurationsForEnterprise: [
+      "GET /enterprises/{enterprise}/code-security/configurations/defaults"
+    ],
+    getRepositoriesForConfiguration: [
+      "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"
+    ],
+    getRepositoriesForEnterpriseConfiguration: [
+      "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"
+    ],
+    getSingleConfigurationForEnterprise: [
+      "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"
+    ],
+    setConfigurationAsDefault: [
+      "PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"
+    ],
+    setConfigurationAsDefaultForEnterprise: [
+      "PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"
+    ],
+    updateConfiguration: [
+      "PATCH /orgs/{org}/code-security/configurations/{configuration_id}"
+    ],
+    updateEnterpriseConfiguration: [
+      "PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"
+    ]
+  },
+  codesOfConduct: {
+    getAllCodesOfConduct: ["GET /codes_of_conduct"],
+    getConductCode: ["GET /codes_of_conduct/{key}"]
+  },
+  codespaces: {
+    addRepositoryForSecretForAuthenticatedUser: [
+      "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    addSelectedRepoToOrgSecret: [
+      "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    checkPermissionsForDevcontainer: [
+      "GET /repos/{owner}/{repo}/codespaces/permissions_check"
+    ],
+    codespaceMachinesForAuthenticatedUser: [
+      "GET /user/codespaces/{codespace_name}/machines"
+    ],
+    createForAuthenticatedUser: ["POST /user/codespaces"],
+    createOrUpdateOrgSecret: [
+      "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
+    ],
+    createOrUpdateRepoSecret: [
+      "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
+    ],
+    createOrUpdateSecretForAuthenticatedUser: [
+      "PUT /user/codespaces/secrets/{secret_name}"
+    ],
+    createWithPrForAuthenticatedUser: [
+      "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
+    ],
+    createWithRepoForAuthenticatedUser: [
+      "POST /repos/{owner}/{repo}/codespaces"
+    ],
+    deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
+    deleteFromOrganization: [
+      "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
+    ],
+    deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
+    deleteRepoSecret: [
+      "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
+    ],
+    deleteSecretForAuthenticatedUser: [
+      "DELETE /user/codespaces/secrets/{secret_name}"
+    ],
+    exportForAuthenticatedUser: [
+      "POST /user/codespaces/{codespace_name}/exports"
+    ],
+    getCodespacesForUserInOrg: [
+      "GET /orgs/{org}/members/{username}/codespaces"
+    ],
+    getExportDetailsForAuthenticatedUser: [
+      "GET /user/codespaces/{codespace_name}/exports/{export_id}"
+    ],
+    getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
+    getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
+    getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
+    getPublicKeyForAuthenticatedUser: [
+      "GET /user/codespaces/secrets/public-key"
+    ],
+    getRepoPublicKey: [
+      "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
+    ],
+    getRepoSecret: [
+      "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
+    ],
+    getSecretForAuthenticatedUser: [
+      "GET /user/codespaces/secrets/{secret_name}"
+    ],
+    listDevcontainersInRepositoryForAuthenticatedUser: [
+      "GET /repos/{owner}/{repo}/codespaces/devcontainers"
+    ],
+    listForAuthenticatedUser: ["GET /user/codespaces"],
+    listInOrganization: [
+      "GET /orgs/{org}/codespaces",
+      {},
+      { renamedParameters: { org_id: "org" } }
+    ],
+    listInRepositoryForAuthenticatedUser: [
+      "GET /repos/{owner}/{repo}/codespaces"
+    ],
+    listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
+    listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
+    listRepositoriesForSecretForAuthenticatedUser: [
+      "GET /user/codespaces/secrets/{secret_name}/repositories"
+    ],
+    listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
+    listSelectedReposForOrgSecret: [
+      "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
+    ],
+    preFlightWithRepoForAuthenticatedUser: [
+      "GET /repos/{owner}/{repo}/codespaces/new"
+    ],
+    publishForAuthenticatedUser: [
+      "POST /user/codespaces/{codespace_name}/publish"
+    ],
+    removeRepositoryForSecretForAuthenticatedUser: [
+      "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    removeSelectedRepoFromOrgSecret: [
+      "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    repoMachinesForAuthenticatedUser: [
+      "GET /repos/{owner}/{repo}/codespaces/machines"
+    ],
+    setRepositoriesForSecretForAuthenticatedUser: [
+      "PUT /user/codespaces/secrets/{secret_name}/repositories"
+    ],
+    setSelectedReposForOrgSecret: [
+      "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
+    ],
+    startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
+    stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
+    stopInOrganization: [
+      "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
+    ],
+    updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
+  },
+  copilot: {
+    addCopilotSeatsForTeams: [
+      "POST /orgs/{org}/copilot/billing/selected_teams"
+    ],
+    addCopilotSeatsForUsers: [
+      "POST /orgs/{org}/copilot/billing/selected_users"
+    ],
+    cancelCopilotSeatAssignmentForTeams: [
+      "DELETE /orgs/{org}/copilot/billing/selected_teams"
+    ],
+    cancelCopilotSeatAssignmentForUsers: [
+      "DELETE /orgs/{org}/copilot/billing/selected_users"
+    ],
+    copilotMetricsForOrganization: ["GET /orgs/{org}/copilot/metrics"],
+    copilotMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],
+    getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
+    getCopilotSeatDetailsForUser: [
+      "GET /orgs/{org}/members/{username}/copilot"
+    ],
+    listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
+  },
+  credentials: { revoke: ["POST /credentials/revoke"] },
+  dependabot: {
+    addSelectedRepoToOrgSecret: [
+      "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    createOrUpdateOrgSecret: [
+      "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
+    ],
+    createOrUpdateRepoSecret: [
+      "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
+    ],
+    deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
+    deleteRepoSecret: [
+      "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
+    ],
+    getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
+    getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
+    getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
+    getRepoPublicKey: [
+      "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
+    ],
+    getRepoSecret: [
+      "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
+    ],
+    listAlertsForEnterprise: [
+      "GET /enterprises/{enterprise}/dependabot/alerts"
+    ],
+    listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
+    listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
+    listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
+    listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
+    listSelectedReposForOrgSecret: [
+      "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
+    ],
+    removeSelectedRepoFromOrgSecret: [
+      "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
+    ],
+    repositoryAccessForOrg: [
+      "GET /organizations/{org}/dependabot/repository-access"
+    ],
+    setRepositoryAccessDefaultLevel: [
+      "PUT /organizations/{org}/dependabot/repository-access/default-level"
+    ],
+    setSelectedReposForOrgSecret: [
+      "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
+    ],
+    updateAlert: [
+      "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
+    ],
+    updateRepositoryAccessForOrg: [
+      "PATCH /organizations/{org}/dependabot/repository-access"
+    ]
+  },
+  dependencyGraph: {
+    createRepositorySnapshot: [
+      "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
+    ],
+    diffRange: [
+      "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
+    ],
+    exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
+  },
+  emojis: { get: ["GET /emojis"] },
+  enterpriseTeamMemberships: {
+    add: [
+      "PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
+    ],
+    bulkAdd: [
+      "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"
+    ],
+    bulkRemove: [
+      "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"
+    ],
+    get: [
+      "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
+    ],
+    list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],
+    remove: [
+      "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
+    ]
+  },
+  enterpriseTeamOrganizations: {
+    add: [
+      "PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
+    ],
+    bulkAdd: [
+      "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"
+    ],
+    bulkRemove: [
+      "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"
+    ],
+    delete: [
+      "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
+    ],
+    getAssignment: [
+      "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
+    ],
+    getAssignments: [
+      "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"
+    ]
+  },
+  enterpriseTeams: {
+    create: ["POST /enterprises/{enterprise}/teams"],
+    delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"],
+    get: ["GET /enterprises/{enterprise}/teams/{team_slug}"],
+    list: ["GET /enterprises/{enterprise}/teams"],
+    update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"]
+  },
+  gists: {
+    checkIsStarred: ["GET /gists/{gist_id}/star"],
+    create: ["POST /gists"],
+    createComment: ["POST /gists/{gist_id}/comments"],
+    delete: ["DELETE /gists/{gist_id}"],
+    deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
+    fork: ["POST /gists/{gist_id}/forks"],
+    get: ["GET /gists/{gist_id}"],
+    getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
+    getRevision: ["GET /gists/{gist_id}/{sha}"],
+    list: ["GET /gists"],
+    listComments: ["GET /gists/{gist_id}/comments"],
+    listCommits: ["GET /gists/{gist_id}/commits"],
+    listForUser: ["GET /users/{username}/gists"],
+    listForks: ["GET /gists/{gist_id}/forks"],
+    listPublic: ["GET /gists/public"],
+    listStarred: ["GET /gists/starred"],
+    star: ["PUT /gists/{gist_id}/star"],
+    unstar: ["DELETE /gists/{gist_id}/star"],
+    update: ["PATCH /gists/{gist_id}"],
+    updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
+  },
+  git: {
+    createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
+    createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
+    createRef: ["POST /repos/{owner}/{repo}/git/refs"],
+    createTag: ["POST /repos/{owner}/{repo}/git/tags"],
+    createTree: ["POST /repos/{owner}/{repo}/git/trees"],
+    deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
+    getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
+    getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
+    getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
+    getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
+    getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
+    listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
+    updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
+  },
+  gitignore: {
+    getAllTemplates: ["GET /gitignore/templates"],
+    getTemplate: ["GET /gitignore/templates/{name}"]
+  },
+  hostedCompute: {
+    createNetworkConfigurationForOrg: [
+      "POST /orgs/{org}/settings/network-configurations"
+    ],
+    deleteNetworkConfigurationFromOrg: [
+      "DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"
+    ],
+    getNetworkConfigurationForOrg: [
+      "GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"
+    ],
+    getNetworkSettingsForOrg: [
+      "GET /orgs/{org}/settings/network-settings/{network_settings_id}"
+    ],
+    listNetworkConfigurationsForOrg: [
+      "GET /orgs/{org}/settings/network-configurations"
+    ],
+    updateNetworkConfigurationForOrg: [
+      "PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"
+    ]
+  },
+  interactions: {
+    getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
+    getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
+    getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
+    getRestrictionsForYourPublicRepos: [
+      "GET /user/interaction-limits",
+      {},
+      { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
+    ],
+    removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
+    removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
+    removeRestrictionsForRepo: [
+      "DELETE /repos/{owner}/{repo}/interaction-limits"
+    ],
+    removeRestrictionsForYourPublicRepos: [
+      "DELETE /user/interaction-limits",
+      {},
+      { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
+    ],
+    setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
+    setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
+    setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
+    setRestrictionsForYourPublicRepos: [
+      "PUT /user/interaction-limits",
+      {},
+      { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
+    ]
+  },
+  issues: {
+    addAssignees: [
+      "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
+    ],
+    addBlockedByDependency: [
+      "POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
+    ],
+    addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
+    addSubIssue: [
+      "POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
+    ],
+    checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
+    checkUserCanBeAssignedToIssue: [
+      "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
+    ],
+    create: ["POST /repos/{owner}/{repo}/issues"],
+    createComment: [
+      "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
+    ],
+    createLabel: ["POST /repos/{owner}/{repo}/labels"],
+    createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
+    deleteComment: [
+      "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
+    ],
+    deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
+    deleteMilestone: [
+      "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
+    ],
+    get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
+    getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
+    getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
+    getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
+    getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
+    getParent: ["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],
+    list: ["GET /issues"],
+    listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
+    listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
+    listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
+    listDependenciesBlockedBy: [
+      "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
+    ],
+    listDependenciesBlocking: [
+      "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"
+    ],
+    listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
+    listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
+    listEventsForTimeline: [
+      "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
+    ],
+    listForAuthenticatedUser: ["GET /user/issues"],
+    listForOrg: ["GET /orgs/{org}/issues"],
+    listForRepo: ["GET /repos/{owner}/{repo}/issues"],
+    listLabelsForMilestone: [
+      "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
+    ],
+    listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
+    listLabelsOnIssue: [
+      "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
+    ],
+    listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
+    listSubIssues: [
+      "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
+    ],
+    lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
+    removeAllLabels: [
+      "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
+    ],
+    removeAssignees: [
+      "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
+    ],
+    removeDependencyBlockedBy: [
+      "DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"
+    ],
+    removeLabel: [
+      "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
+    ],
+    removeSubIssue: [
+      "DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"
+    ],
+    reprioritizeSubIssue: [
+      "PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"
+    ],
+    setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
+    unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
+    update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
+    updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
+    updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
+    updateMilestone: [
+      "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
+    ]
+  },
+  licenses: {
+    get: ["GET /licenses/{license}"],
+    getAllCommonlyUsed: ["GET /licenses"],
+    getForRepo: ["GET /repos/{owner}/{repo}/license"]
+  },
+  markdown: {
+    render: ["POST /markdown"],
+    renderRaw: [
+      "POST /markdown/raw",
+      { headers: { "content-type": "text/plain; charset=utf-8" } }
+    ]
+  },
+  meta: {
+    get: ["GET /meta"],
+    getAllVersions: ["GET /versions"],
+    getOctocat: ["GET /octocat"],
+    getZen: ["GET /zen"],
+    root: ["GET /"]
+  },
+  migrations: {
+    deleteArchiveForAuthenticatedUser: [
+      "DELETE /user/migrations/{migration_id}/archive"
+    ],
+    deleteArchiveForOrg: [
+      "DELETE /orgs/{org}/migrations/{migration_id}/archive"
+    ],
+    downloadArchiveForOrg: [
+      "GET /orgs/{org}/migrations/{migration_id}/archive"
+    ],
+    getArchiveForAuthenticatedUser: [
+      "GET /user/migrations/{migration_id}/archive"
+    ],
+    getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
+    getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
+    listForAuthenticatedUser: ["GET /user/migrations"],
+    listForOrg: ["GET /orgs/{org}/migrations"],
+    listReposForAuthenticatedUser: [
+      "GET /user/migrations/{migration_id}/repositories"
+    ],
+    listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
+    listReposForUser: [
+      "GET /user/migrations/{migration_id}/repositories",
+      {},
+      { renamed: ["migrations", "listReposForAuthenticatedUser"] }
+    ],
+    startForAuthenticatedUser: ["POST /user/migrations"],
+    startForOrg: ["POST /orgs/{org}/migrations"],
+    unlockRepoForAuthenticatedUser: [
+      "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
+    ],
+    unlockRepoForOrg: [
+      "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
+    ]
+  },
+  oidc: {
+    getOidcCustomSubTemplateForOrg: [
+      "GET /orgs/{org}/actions/oidc/customization/sub"
+    ],
+    updateOidcCustomSubTemplateForOrg: [
+      "PUT /orgs/{org}/actions/oidc/customization/sub"
+    ]
+  },
+  orgs: {
+    addSecurityManagerTeam: [
+      "PUT /orgs/{org}/security-managers/teams/{team_slug}",
+      {},
+      {
+        deprecated: "octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"
+      }
+    ],
+    assignTeamToOrgRole: [
+      "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
+    ],
+    assignUserToOrgRole: [
+      "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
+    ],
+    blockUser: ["PUT /orgs/{org}/blocks/{username}"],
+    cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
+    checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
+    checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
+    checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
+    convertMemberToOutsideCollaborator: [
+      "PUT /orgs/{org}/outside_collaborators/{username}"
+    ],
+    createArtifactStorageRecord: [
+      "POST /orgs/{org}/artifacts/metadata/storage-record"
+    ],
+    createInvitation: ["POST /orgs/{org}/invitations"],
+    createIssueType: ["POST /orgs/{org}/issue-types"],
+    createWebhook: ["POST /orgs/{org}/hooks"],
+    customPropertiesForOrgsCreateOrUpdateOrganizationValues: [
+      "PATCH /organizations/{org}/org-properties/values"
+    ],
+    customPropertiesForOrgsGetOrganizationValues: [
+      "GET /organizations/{org}/org-properties/values"
+    ],
+    customPropertiesForReposCreateOrUpdateOrganizationDefinition: [
+      "PUT /orgs/{org}/properties/schema/{custom_property_name}"
+    ],
+    customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [
+      "PATCH /orgs/{org}/properties/schema"
+    ],
+    customPropertiesForReposCreateOrUpdateOrganizationValues: [
+      "PATCH /orgs/{org}/properties/values"
+    ],
+    customPropertiesForReposDeleteOrganizationDefinition: [
+      "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
+    ],
+    customPropertiesForReposGetOrganizationDefinition: [
+      "GET /orgs/{org}/properties/schema/{custom_property_name}"
+    ],
+    customPropertiesForReposGetOrganizationDefinitions: [
+      "GET /orgs/{org}/properties/schema"
+    ],
+    customPropertiesForReposGetOrganizationValues: [
+      "GET /orgs/{org}/properties/values"
+    ],
+    delete: ["DELETE /orgs/{org}"],
+    deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"],
+    deleteAttestationsById: [
+      "DELETE /orgs/{org}/attestations/{attestation_id}"
+    ],
+    deleteAttestationsBySubjectDigest: [
+      "DELETE /orgs/{org}/attestations/digest/{subject_digest}"
+    ],
+    deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"],
+    deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
+    disableSelectedRepositoryImmutableReleasesOrganization: [
+      "DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
+    ],
+    enableSelectedRepositoryImmutableReleasesOrganization: [
+      "PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
+    ],
+    get: ["GET /orgs/{org}"],
+    getImmutableReleasesSettings: [
+      "GET /orgs/{org}/settings/immutable-releases"
+    ],
+    getImmutableReleasesSettingsRepositories: [
+      "GET /orgs/{org}/settings/immutable-releases/repositories"
+    ],
+    getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
+    getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
+    getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
+    getOrgRulesetHistory: ["GET /orgs/{org}/rulesets/{ruleset_id}/history"],
+    getOrgRulesetVersion: [
+      "GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"
+    ],
+    getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
+    getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
+    getWebhookDelivery: [
+      "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
+    ],
+    list: ["GET /organizations"],
+    listAppInstallations: ["GET /orgs/{org}/installations"],
+    listArtifactStorageRecords: [
+      "GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"
+    ],
+    listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"],
+    listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"],
+    listAttestationsBulk: [
+      "POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"
+    ],
+    listBlockedUsers: ["GET /orgs/{org}/blocks"],
+    listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
+    listForAuthenticatedUser: ["GET /user/orgs"],
+    listForUser: ["GET /users/{username}/orgs"],
+    listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
+    listIssueTypes: ["GET /orgs/{org}/issue-types"],
+    listMembers: ["GET /orgs/{org}/members"],
+    listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
+    listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
+    listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
+    listOrgRoles: ["GET /orgs/{org}/organization-roles"],
+    listOrganizationFineGrainedPermissions: [
+      "GET /orgs/{org}/organization-fine-grained-permissions"
+    ],
+    listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
+    listPatGrantRepositories: [
+      "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
+    ],
+    listPatGrantRequestRepositories: [
+      "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
+    ],
+    listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
+    listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
+    listPendingInvitations: ["GET /orgs/{org}/invitations"],
+    listPublicMembers: ["GET /orgs/{org}/public_members"],
+    listSecurityManagerTeams: [
+      "GET /orgs/{org}/security-managers",
+      {},
+      {
+        deprecated: "octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"
+      }
+    ],
+    listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
+    listWebhooks: ["GET /orgs/{org}/hooks"],
+    pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
+    redeliverWebhookDelivery: [
+      "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
+    ],
+    removeMember: ["DELETE /orgs/{org}/members/{username}"],
+    removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
+    removeOutsideCollaborator: [
+      "DELETE /orgs/{org}/outside_collaborators/{username}"
+    ],
+    removePublicMembershipForAuthenticatedUser: [
+      "DELETE /orgs/{org}/public_members/{username}"
+    ],
+    removeSecurityManagerTeam: [
+      "DELETE /orgs/{org}/security-managers/teams/{team_slug}",
+      {},
+      {
+        deprecated: "octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"
+      }
+    ],
+    reviewPatGrantRequest: [
+      "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
+    ],
+    reviewPatGrantRequestsInBulk: [
+      "POST /orgs/{org}/personal-access-token-requests"
+    ],
+    revokeAllOrgRolesTeam: [
+      "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
+    ],
+    revokeAllOrgRolesUser: [
+      "DELETE /orgs/{org}/organization-roles/users/{username}"
+    ],
+    revokeOrgRoleTeam: [
+      "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
+    ],
+    revokeOrgRoleUser: [
+      "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
+    ],
+    setImmutableReleasesSettings: [
+      "PUT /orgs/{org}/settings/immutable-releases"
+    ],
+    setImmutableReleasesSettingsRepositories: [
+      "PUT /orgs/{org}/settings/immutable-releases/repositories"
+    ],
+    setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
+    setPublicMembershipForAuthenticatedUser: [
+      "PUT /orgs/{org}/public_members/{username}"
+    ],
+    unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
+    update: ["PATCH /orgs/{org}"],
+    updateIssueType: ["PUT /orgs/{org}/issue-types/{issue_type_id}"],
+    updateMembershipForAuthenticatedUser: [
+      "PATCH /user/memberships/orgs/{org}"
+    ],
+    updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
+    updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
+    updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
+    updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
+  },
+  packages: {
+    deletePackageForAuthenticatedUser: [
+      "DELETE /user/packages/{package_type}/{package_name}"
+    ],
+    deletePackageForOrg: [
+      "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
+    ],
+    deletePackageForUser: [
+      "DELETE /users/{username}/packages/{package_type}/{package_name}"
+    ],
+    deletePackageVersionForAuthenticatedUser: [
+      "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
+    ],
+    deletePackageVersionForOrg: [
+      "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+    ],
+    deletePackageVersionForUser: [
+      "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+    ],
+    getAllPackageVersionsForAPackageOwnedByAnOrg: [
+      "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
+      {},
+      { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
+    ],
+    getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
+      "GET /user/packages/{package_type}/{package_name}/versions",
+      {},
+      {
+        renamed: [
+          "packages",
+          "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
+        ]
+      }
+    ],
+    getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
+      "GET /user/packages/{package_type}/{package_name}/versions"
+    ],
+    getAllPackageVersionsForPackageOwnedByOrg: [
+      "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
+    ],
+    getAllPackageVersionsForPackageOwnedByUser: [
+      "GET /users/{username}/packages/{package_type}/{package_name}/versions"
+    ],
+    getPackageForAuthenticatedUser: [
+      "GET /user/packages/{package_type}/{package_name}"
+    ],
+    getPackageForOrganization: [
+      "GET /orgs/{org}/packages/{package_type}/{package_name}"
+    ],
+    getPackageForUser: [
+      "GET /users/{username}/packages/{package_type}/{package_name}"
+    ],
+    getPackageVersionForAuthenticatedUser: [
+      "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
+    ],
+    getPackageVersionForOrganization: [
+      "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+    ],
+    getPackageVersionForUser: [
+      "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+    ],
+    listDockerMigrationConflictingPackagesForAuthenticatedUser: [
+      "GET /user/docker/conflicts"
+    ],
+    listDockerMigrationConflictingPackagesForOrganization: [
+      "GET /orgs/{org}/docker/conflicts"
+    ],
+    listDockerMigrationConflictingPackagesForUser: [
+      "GET /users/{username}/docker/conflicts"
+    ],
+    listPackagesForAuthenticatedUser: ["GET /user/packages"],
+    listPackagesForOrganization: ["GET /orgs/{org}/packages"],
+    listPackagesForUser: ["GET /users/{username}/packages"],
+    restorePackageForAuthenticatedUser: [
+      "POST /user/packages/{package_type}/{package_name}/restore{?token}"
+    ],
+    restorePackageForOrg: [
+      "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
+    ],
+    restorePackageForUser: [
+      "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
+    ],
+    restorePackageVersionForAuthenticatedUser: [
+      "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
+    ],
+    restorePackageVersionForOrg: [
+      "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
+    ],
+    restorePackageVersionForUser: [
+      "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
+    ]
+  },
+  privateRegistries: {
+    createOrgPrivateRegistry: ["POST /orgs/{org}/private-registries"],
+    deleteOrgPrivateRegistry: [
+      "DELETE /orgs/{org}/private-registries/{secret_name}"
+    ],
+    getOrgPrivateRegistry: ["GET /orgs/{org}/private-registries/{secret_name}"],
+    getOrgPublicKey: ["GET /orgs/{org}/private-registries/public-key"],
+    listOrgPrivateRegistries: ["GET /orgs/{org}/private-registries"],
+    updateOrgPrivateRegistry: [
+      "PATCH /orgs/{org}/private-registries/{secret_name}"
+    ]
+  },
+  projects: {
+    addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"],
+    addItemForUser: [
+      "POST /users/{username}/projectsV2/{project_number}/items"
+    ],
+    deleteItemForOrg: [
+      "DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
+    ],
+    deleteItemForUser: [
+      "DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"
+    ],
+    getFieldForOrg: [
+      "GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"
+    ],
+    getFieldForUser: [
+      "GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"
+    ],
+    getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"],
+    getForUser: ["GET /users/{username}/projectsV2/{project_number}"],
+    getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],
+    getUserItem: [
+      "GET /users/{username}/projectsV2/{project_number}/items/{item_id}"
+    ],
+    listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"],
+    listFieldsForUser: [
+      "GET /users/{username}/projectsV2/{project_number}/fields"
+    ],
+    listForOrg: ["GET /orgs/{org}/projectsV2"],
+    listForUser: ["GET /users/{username}/projectsV2"],
+    listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"],
+    listItemsForUser: [
+      "GET /users/{username}/projectsV2/{project_number}/items"
+    ],
+    updateItemForOrg: [
+      "PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
+    ],
+    updateItemForUser: [
+      "PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"
+    ]
+  },
+  pulls: {
+    checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
+    create: ["POST /repos/{owner}/{repo}/pulls"],
+    createReplyForReviewComment: [
+      "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
+    ],
+    createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
+    createReviewComment: [
+      "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
+    ],
+    deletePendingReview: [
+      "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
+    ],
+    deleteReviewComment: [
+      "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
+    ],
+    dismissReview: [
+      "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
+    ],
+    get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
+    getReview: [
+      "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
+    ],
+    getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
+    list: ["GET /repos/{owner}/{repo}/pulls"],
+    listCommentsForReview: [
+      "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
+    ],
+    listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
+    listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
+    listRequestedReviewers: [
+      "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
+    ],
+    listReviewComments: [
+      "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
+    ],
+    listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
+    listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
+    merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
+    removeRequestedReviewers: [
+      "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
+    ],
+    requestReviewers: [
+      "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
+    ],
+    submitReview: [
+      "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
+    ],
+    update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
+    updateBranch: [
+      "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
+    ],
+    updateReview: [
+      "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
+    ],
+    updateReviewComment: [
+      "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
+    ]
+  },
+  rateLimit: { get: ["GET /rate_limit"] },
+  reactions: {
+    createForCommitComment: [
+      "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
+    ],
+    createForIssue: [
+      "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
+    ],
+    createForIssueComment: [
+      "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
+    ],
+    createForPullRequestReviewComment: [
+      "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
+    ],
+    createForRelease: [
+      "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
+    ],
+    createForTeamDiscussionCommentInOrg: [
+      "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
+    ],
+    createForTeamDiscussionInOrg: [
+      "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
+    ],
+    deleteForCommitComment: [
+      "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
+    ],
+    deleteForIssue: [
+      "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
+    ],
+    deleteForIssueComment: [
+      "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
+    ],
+    deleteForPullRequestComment: [
+      "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
+    ],
+    deleteForRelease: [
+      "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
+    ],
+    deleteForTeamDiscussion: [
+      "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
+    ],
+    deleteForTeamDiscussionComment: [
+      "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
+    ],
+    listForCommitComment: [
+      "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
+    ],
+    listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
+    listForIssueComment: [
+      "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
+    ],
+    listForPullRequestReviewComment: [
+      "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
+    ],
+    listForRelease: [
+      "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
+    ],
+    listForTeamDiscussionCommentInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
+    ],
+    listForTeamDiscussionInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
+    ]
+  },
+  repos: {
+    acceptInvitation: [
+      "PATCH /user/repository_invitations/{invitation_id}",
+      {},
+      { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
+    ],
+    acceptInvitationForAuthenticatedUser: [
+      "PATCH /user/repository_invitations/{invitation_id}"
+    ],
+    addAppAccessRestrictions: [
+      "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
+      {},
+      { mapToData: "apps" }
+    ],
+    addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
+    addStatusCheckContexts: [
+      "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
+      {},
+      { mapToData: "contexts" }
+    ],
+    addTeamAccessRestrictions: [
+      "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
+      {},
+      { mapToData: "teams" }
+    ],
+    addUserAccessRestrictions: [
+      "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
+      {},
+      { mapToData: "users" }
+    ],
+    cancelPagesDeployment: [
+      "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
+    ],
+    checkAutomatedSecurityFixes: [
+      "GET /repos/{owner}/{repo}/automated-security-fixes"
+    ],
+    checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
+    checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"],
+    checkPrivateVulnerabilityReporting: [
+      "GET /repos/{owner}/{repo}/private-vulnerability-reporting"
+    ],
+    checkVulnerabilityAlerts: [
+      "GET /repos/{owner}/{repo}/vulnerability-alerts"
+    ],
+    codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
+    compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
+    compareCommitsWithBasehead: [
+      "GET /repos/{owner}/{repo}/compare/{basehead}"
+    ],
+    createAttestation: ["POST /repos/{owner}/{repo}/attestations"],
+    createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
+    createCommitComment: [
+      "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
+    ],
+    createCommitSignatureProtection: [
+      "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
+    ],
+    createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
+    createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
+    createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
+    createDeploymentBranchPolicy: [
+      "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
+    ],
+    createDeploymentProtectionRule: [
+      "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
+    ],
+    createDeploymentStatus: [
+      "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
+    ],
+    createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
+    createForAuthenticatedUser: ["POST /user/repos"],
+    createFork: ["POST /repos/{owner}/{repo}/forks"],
+    createInOrg: ["POST /orgs/{org}/repos"],
+    createOrUpdateEnvironment: [
+      "PUT /repos/{owner}/{repo}/environments/{environment_name}"
+    ],
+    createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
+    createOrgRuleset: ["POST /orgs/{org}/rulesets"],
+    createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
+    createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
+    createRelease: ["POST /repos/{owner}/{repo}/releases"],
+    createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
+    createUsingTemplate: [
+      "POST /repos/{template_owner}/{template_repo}/generate"
+    ],
+    createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
+    customPropertiesForReposCreateOrUpdateRepositoryValues: [
+      "PATCH /repos/{owner}/{repo}/properties/values"
+    ],
+    customPropertiesForReposGetRepositoryValues: [
+      "GET /repos/{owner}/{repo}/properties/values"
+    ],
+    declineInvitation: [
+      "DELETE /user/repository_invitations/{invitation_id}",
+      {},
+      { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
+    ],
+    declineInvitationForAuthenticatedUser: [
+      "DELETE /user/repository_invitations/{invitation_id}"
+    ],
+    delete: ["DELETE /repos/{owner}/{repo}"],
+    deleteAccessRestrictions: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
+    ],
+    deleteAdminBranchProtection: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
+    ],
+    deleteAnEnvironment: [
+      "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
+    ],
+    deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
+    deleteBranchProtection: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
+    ],
+    deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
+    deleteCommitSignatureProtection: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
+    ],
+    deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
+    deleteDeployment: [
+      "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
+    ],
+    deleteDeploymentBranchPolicy: [
+      "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
+    ],
+    deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
+    deleteInvitation: [
+      "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
+    ],
+    deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
+    deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
+    deletePullRequestReviewProtection: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
+    ],
+    deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
+    deleteReleaseAsset: [
+      "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
+    ],
+    deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
+    deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
+    disableAutomatedSecurityFixes: [
+      "DELETE /repos/{owner}/{repo}/automated-security-fixes"
+    ],
+    disableDeploymentProtectionRule: [
+      "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
+    ],
+    disableImmutableReleases: [
+      "DELETE /repos/{owner}/{repo}/immutable-releases"
+    ],
+    disablePrivateVulnerabilityReporting: [
+      "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
+    ],
+    disableVulnerabilityAlerts: [
+      "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
+    ],
+    downloadArchive: [
+      "GET /repos/{owner}/{repo}/zipball/{ref}",
+      {},
+      { renamed: ["repos", "downloadZipballArchive"] }
+    ],
+    downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
+    downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
+    enableAutomatedSecurityFixes: [
+      "PUT /repos/{owner}/{repo}/automated-security-fixes"
+    ],
+    enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"],
+    enablePrivateVulnerabilityReporting: [
+      "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
+    ],
+    enableVulnerabilityAlerts: [
+      "PUT /repos/{owner}/{repo}/vulnerability-alerts"
+    ],
+    generateReleaseNotes: [
+      "POST /repos/{owner}/{repo}/releases/generate-notes"
+    ],
+    get: ["GET /repos/{owner}/{repo}"],
+    getAccessRestrictions: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
+    ],
+    getAdminBranchProtection: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
+    ],
+    getAllDeploymentProtectionRules: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
+    ],
+    getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
+    getAllStatusCheckContexts: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
+    ],
+    getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
+    getAppsWithAccessToProtectedBranch: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
+    ],
+    getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
+    getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
+    getBranchProtection: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection"
+    ],
+    getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
+    getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
+    getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
+    getCollaboratorPermissionLevel: [
+      "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
+    ],
+    getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
+    getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
+    getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
+    getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
+    getCommitSignatureProtection: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
+    ],
+    getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
+    getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
+    getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
+    getCustomDeploymentProtectionRule: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
+    ],
+    getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
+    getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
+    getDeploymentBranchPolicy: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
+    ],
+    getDeploymentStatus: [
+      "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
+    ],
+    getEnvironment: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}"
+    ],
+    getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
+    getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
+    getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
+    getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
+    getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
+    getOrgRulesets: ["GET /orgs/{org}/rulesets"],
+    getPages: ["GET /repos/{owner}/{repo}/pages"],
+    getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
+    getPagesDeployment: [
+      "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
+    ],
+    getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
+    getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
+    getPullRequestReviewProtection: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
+    ],
+    getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
+    getReadme: ["GET /repos/{owner}/{repo}/readme"],
+    getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
+    getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
+    getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
+    getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
+    getRepoRuleSuite: [
+      "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
+    ],
+    getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
+    getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
+    getRepoRulesetHistory: [
+      "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"
+    ],
+    getRepoRulesetVersion: [
+      "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"
+    ],
+    getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
+    getStatusChecksProtection: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
+    ],
+    getTeamsWithAccessToProtectedBranch: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
+    ],
+    getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
+    getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
+    getUsersWithAccessToProtectedBranch: [
+      "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
+    ],
+    getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
+    getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
+    getWebhookConfigForRepo: [
+      "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
+    ],
+    getWebhookDelivery: [
+      "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
+    ],
+    listActivities: ["GET /repos/{owner}/{repo}/activity"],
+    listAttestations: [
+      "GET /repos/{owner}/{repo}/attestations/{subject_digest}"
+    ],
+    listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
+    listBranches: ["GET /repos/{owner}/{repo}/branches"],
+    listBranchesForHeadCommit: [
+      "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
+    ],
+    listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
+    listCommentsForCommit: [
+      "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
+    ],
+    listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
+    listCommitStatusesForRef: [
+      "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
+    ],
+    listCommits: ["GET /repos/{owner}/{repo}/commits"],
+    listContributors: ["GET /repos/{owner}/{repo}/contributors"],
+    listCustomDeploymentRuleIntegrations: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
+    ],
+    listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
+    listDeploymentBranchPolicies: [
+      "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
+    ],
+    listDeploymentStatuses: [
+      "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
+    ],
+    listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
+    listForAuthenticatedUser: ["GET /user/repos"],
+    listForOrg: ["GET /orgs/{org}/repos"],
+    listForUser: ["GET /users/{username}/repos"],
+    listForks: ["GET /repos/{owner}/{repo}/forks"],
+    listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
+    listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
+    listLanguages: ["GET /repos/{owner}/{repo}/languages"],
+    listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
+    listPublic: ["GET /repositories"],
+    listPullRequestsAssociatedWithCommit: [
+      "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
+    ],
+    listReleaseAssets: [
+      "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
+    ],
+    listReleases: ["GET /repos/{owner}/{repo}/releases"],
+    listTags: ["GET /repos/{owner}/{repo}/tags"],
+    listTeams: ["GET /repos/{owner}/{repo}/teams"],
+    listWebhookDeliveries: [
+      "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
+    ],
+    listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
+    merge: ["POST /repos/{owner}/{repo}/merges"],
+    mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
+    pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
+    redeliverWebhookDelivery: [
+      "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
+    ],
+    removeAppAccessRestrictions: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
+      {},
+      { mapToData: "apps" }
+    ],
+    removeCollaborator: [
+      "DELETE /repos/{owner}/{repo}/collaborators/{username}"
+    ],
+    removeStatusCheckContexts: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
+      {},
+      { mapToData: "contexts" }
+    ],
+    removeStatusCheckProtection: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
+    ],
+    removeTeamAccessRestrictions: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
+      {},
+      { mapToData: "teams" }
+    ],
+    removeUserAccessRestrictions: [
+      "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
+      {},
+      { mapToData: "users" }
+    ],
+    renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
+    replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
+    requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
+    setAdminBranchProtection: [
+      "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
+    ],
+    setAppAccessRestrictions: [
+      "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
+      {},
+      { mapToData: "apps" }
+    ],
+    setStatusCheckContexts: [
+      "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
+      {},
+      { mapToData: "contexts" }
+    ],
+    setTeamAccessRestrictions: [
+      "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
+      {},
+      { mapToData: "teams" }
+    ],
+    setUserAccessRestrictions: [
+      "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
+      {},
+      { mapToData: "users" }
+    ],
+    testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
+    transfer: ["POST /repos/{owner}/{repo}/transfer"],
+    update: ["PATCH /repos/{owner}/{repo}"],
+    updateBranchProtection: [
+      "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
+    ],
+    updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
+    updateDeploymentBranchPolicy: [
+      "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
+    ],
+    updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
+    updateInvitation: [
+      "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
+    ],
+    updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
+    updatePullRequestReviewProtection: [
+      "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
+    ],
+    updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
+    updateReleaseAsset: [
+      "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
+    ],
+    updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
+    updateStatusCheckPotection: [
+      "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
+      {},
+      { renamed: ["repos", "updateStatusCheckProtection"] }
+    ],
+    updateStatusCheckProtection: [
+      "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
+    ],
+    updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
+    updateWebhookConfigForRepo: [
+      "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
+    ],
+    uploadReleaseAsset: [
+      "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
+      { baseUrl: "https://uploads.github.com" }
+    ]
+  },
+  search: {
+    code: ["GET /search/code"],
+    commits: ["GET /search/commits"],
+    issuesAndPullRequests: ["GET /search/issues"],
+    labels: ["GET /search/labels"],
+    repos: ["GET /search/repositories"],
+    topics: ["GET /search/topics"],
+    users: ["GET /search/users"]
+  },
+  secretScanning: {
+    createPushProtectionBypass: [
+      "POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"
+    ],
+    getAlert: [
+      "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
+    ],
+    getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],
+    listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
+    listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
+    listLocationsForAlert: [
+      "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
+    ],
+    listOrgPatternConfigs: [
+      "GET /orgs/{org}/secret-scanning/pattern-configurations"
+    ],
+    updateAlert: [
+      "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
+    ],
+    updateOrgPatternConfigs: [
+      "PATCH /orgs/{org}/secret-scanning/pattern-configurations"
+    ]
+  },
+  securityAdvisories: {
+    createFork: [
+      "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
+    ],
+    createPrivateVulnerabilityReport: [
+      "POST /repos/{owner}/{repo}/security-advisories/reports"
+    ],
+    createRepositoryAdvisory: [
+      "POST /repos/{owner}/{repo}/security-advisories"
+    ],
+    createRepositoryAdvisoryCveRequest: [
+      "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
+    ],
+    getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
+    getRepositoryAdvisory: [
+      "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
+    ],
+    listGlobalAdvisories: ["GET /advisories"],
+    listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
+    listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
+    updateRepositoryAdvisory: [
+      "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
+    ]
+  },
+  teams: {
+    addOrUpdateMembershipForUserInOrg: [
+      "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
+    ],
+    addOrUpdateRepoPermissionsInOrg: [
+      "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
+    ],
+    checkPermissionsForRepoInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
+    ],
+    create: ["POST /orgs/{org}/teams"],
+    createDiscussionCommentInOrg: [
+      "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
+    ],
+    createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
+    deleteDiscussionCommentInOrg: [
+      "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
+    ],
+    deleteDiscussionInOrg: [
+      "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
+    ],
+    deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
+    getByName: ["GET /orgs/{org}/teams/{team_slug}"],
+    getDiscussionCommentInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
+    ],
+    getDiscussionInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
+    ],
+    getMembershipForUserInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
+    ],
+    list: ["GET /orgs/{org}/teams"],
+    listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
+    listDiscussionCommentsInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
+    ],
+    listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
+    listForAuthenticatedUser: ["GET /user/teams"],
+    listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
+    listPendingInvitationsInOrg: [
+      "GET /orgs/{org}/teams/{team_slug}/invitations"
+    ],
+    listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
+    removeMembershipForUserInOrg: [
+      "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
+    ],
+    removeRepoInOrg: [
+      "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
+    ],
+    updateDiscussionCommentInOrg: [
+      "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
+    ],
+    updateDiscussionInOrg: [
+      "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
+    ],
+    updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
+  },
+  users: {
+    addEmailForAuthenticated: [
+      "POST /user/emails",
+      {},
+      { renamed: ["users", "addEmailForAuthenticatedUser"] }
+    ],
+    addEmailForAuthenticatedUser: ["POST /user/emails"],
+    addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
+    block: ["PUT /user/blocks/{username}"],
+    checkBlocked: ["GET /user/blocks/{username}"],
+    checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
+    checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
+    createGpgKeyForAuthenticated: [
+      "POST /user/gpg_keys",
+      {},
+      { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
+    ],
+    createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
+    createPublicSshKeyForAuthenticated: [
+      "POST /user/keys",
+      {},
+      { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
+    ],
+    createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
+    createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
+    deleteAttestationsBulk: [
+      "POST /users/{username}/attestations/delete-request"
+    ],
+    deleteAttestationsById: [
+      "DELETE /users/{username}/attestations/{attestation_id}"
+    ],
+    deleteAttestationsBySubjectDigest: [
+      "DELETE /users/{username}/attestations/digest/{subject_digest}"
+    ],
+    deleteEmailForAuthenticated: [
+      "DELETE /user/emails",
+      {},
+      { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
+    ],
+    deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
+    deleteGpgKeyForAuthenticated: [
+      "DELETE /user/gpg_keys/{gpg_key_id}",
+      {},
+      { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
+    ],
+    deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
+    deletePublicSshKeyForAuthenticated: [
+      "DELETE /user/keys/{key_id}",
+      {},
+      { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
+    ],
+    deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
+    deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
+    deleteSshSigningKeyForAuthenticatedUser: [
+      "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
+    ],
+    follow: ["PUT /user/following/{username}"],
+    getAuthenticated: ["GET /user"],
+    getById: ["GET /user/{account_id}"],
+    getByUsername: ["GET /users/{username}"],
+    getContextForUser: ["GET /users/{username}/hovercard"],
+    getGpgKeyForAuthenticated: [
+      "GET /user/gpg_keys/{gpg_key_id}",
+      {},
+      { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
+    ],
+    getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
+    getPublicSshKeyForAuthenticated: [
+      "GET /user/keys/{key_id}",
+      {},
+      { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
+    ],
+    getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
+    getSshSigningKeyForAuthenticatedUser: [
+      "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
+    ],
+    list: ["GET /users"],
+    listAttestations: ["GET /users/{username}/attestations/{subject_digest}"],
+    listAttestationsBulk: [
+      "POST /users/{username}/attestations/bulk-list{?per_page,before,after}"
+    ],
+    listBlockedByAuthenticated: [
+      "GET /user/blocks",
+      {},
+      { renamed: ["users", "listBlockedByAuthenticatedUser"] }
+    ],
+    listBlockedByAuthenticatedUser: ["GET /user/blocks"],
+    listEmailsForAuthenticated: [
+      "GET /user/emails",
+      {},
+      { renamed: ["users", "listEmailsForAuthenticatedUser"] }
+    ],
+    listEmailsForAuthenticatedUser: ["GET /user/emails"],
+    listFollowedByAuthenticated: [
+      "GET /user/following",
+      {},
+      { renamed: ["users", "listFollowedByAuthenticatedUser"] }
+    ],
+    listFollowedByAuthenticatedUser: ["GET /user/following"],
+    listFollowersForAuthenticatedUser: ["GET /user/followers"],
+    listFollowersForUser: ["GET /users/{username}/followers"],
+    listFollowingForUser: ["GET /users/{username}/following"],
+    listGpgKeysForAuthenticated: [
+      "GET /user/gpg_keys",
+      {},
+      { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
+    ],
+    listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
+    listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
+    listPublicEmailsForAuthenticated: [
+      "GET /user/public_emails",
+      {},
+      { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
+    ],
+    listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
+    listPublicKeysForUser: ["GET /users/{username}/keys"],
+    listPublicSshKeysForAuthenticated: [
+      "GET /user/keys",
+      {},
+      { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
+    ],
+    listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
+    listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
+    listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
+    listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
+    listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
+    setPrimaryEmailVisibilityForAuthenticated: [
+      "PATCH /user/email/visibility",
+      {},
+      { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
+    ],
+    setPrimaryEmailVisibilityForAuthenticatedUser: [
+      "PATCH /user/email/visibility"
+    ],
+    unblock: ["DELETE /user/blocks/{username}"],
+    unfollow: ["DELETE /user/following/{username}"],
+    updateAuthenticated: ["PATCH /user"]
+  }
+};
+var endpoints_default = Endpoints;
 
+//# sourceMappingURL=endpoints.js.map
 
-var anchors = __nccwpck_require__(71596);
-var identity = __nccwpck_require__(41127);
-var stringifyComment = __nccwpck_require__(59799);
-var stringifyString = __nccwpck_require__(83069);
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
 
-function createStringifyContext(doc, options) {
-    const opt = Object.assign({
-        blockQuote: true,
-        commentString: stringifyComment.stringifyComment,
-        defaultKeyType: null,
-        defaultStringType: 'PLAIN',
-        directives: null,
-        doubleQuotedAsJSON: false,
-        doubleQuotedMinMultiLineLength: 40,
-        falseStr: 'false',
-        flowCollectionPadding: true,
-        indentSeq: true,
-        lineWidth: 80,
-        minContentWidth: 20,
-        nullStr: 'null',
-        simpleKeys: false,
-        singleQuote: null,
-        trailingComma: false,
-        trueStr: 'true',
-        verifyAliasOrder: true
-    }, doc.schema.toStringOptions, options);
-    let inFlow;
-    switch (opt.collectionStyle) {
-        case 'block':
-            inFlow = false;
-            break;
-        case 'flow':
-            inFlow = true;
-            break;
-        default:
-            inFlow = null;
-    }
+const endpointMethodsMap = /* @__PURE__ */ new Map();
+for (const [scope, endpoints] of Object.entries(endpoints_default)) {
+  for (const [methodName, endpoint] of Object.entries(endpoints)) {
+    const [route, defaults, decorations] = endpoint;
+    const [method, url] = route.split(/ /);
+    const endpointDefaults = Object.assign(
+      {
+        method,
+        url
+      },
+      defaults
+    );
+    if (!endpointMethodsMap.has(scope)) {
+      endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
+    }
+    endpointMethodsMap.get(scope).set(methodName, {
+      scope,
+      methodName,
+      endpointDefaults,
+      decorations
+    });
+  }
+}
+const handler = {
+  has({ scope }, methodName) {
+    return endpointMethodsMap.get(scope).has(methodName);
+  },
+  getOwnPropertyDescriptor(target, methodName) {
     return {
-        anchors: new Set(),
-        doc,
-        flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '',
-        indent: '',
-        indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : '  ',
-        inFlow,
-        options: opt
+      value: this.get(target, methodName),
+      // ensures method is in the cache
+      configurable: true,
+      writable: true,
+      enumerable: true
     };
-}
-function getTagObject(tags, item) {
-    if (item.tag) {
-        const match = tags.filter(t => t.tag === item.tag);
-        if (match.length > 0)
-            return match.find(t => t.format === item.format) ?? match[0];
-    }
-    let tagObj = undefined;
-    let obj;
-    if (identity.isScalar(item)) {
-        obj = item.value;
-        let match = tags.filter(t => t.identify?.(obj));
-        if (match.length > 1) {
-            const testMatch = match.filter(t => t.test);
-            if (testMatch.length > 0)
-                match = testMatch;
-        }
-        tagObj =
-            match.find(t => t.format === item.format) ?? match.find(t => !t.format);
+  },
+  defineProperty(target, methodName, descriptor) {
+    Object.defineProperty(target.cache, methodName, descriptor);
+    return true;
+  },
+  deleteProperty(target, methodName) {
+    delete target.cache[methodName];
+    return true;
+  },
+  ownKeys({ scope }) {
+    return [...endpointMethodsMap.get(scope).keys()];
+  },
+  set(target, methodName, value) {
+    return target.cache[methodName] = value;
+  },
+  get({ octokit, scope, cache }, methodName) {
+    if (cache[methodName]) {
+      return cache[methodName];
     }
-    else {
-        obj = item;
-        tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
+    const method = endpointMethodsMap.get(scope).get(methodName);
+    if (!method) {
+      return void 0;
     }
-    if (!tagObj) {
-        const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);
-        throw new Error(`Tag not resolved for ${name} value`);
+    const { endpointDefaults, decorations } = method;
+    if (decorations) {
+      cache[methodName] = decorate(
+        octokit,
+        scope,
+        methodName,
+        endpointDefaults,
+        decorations
+      );
+    } else {
+      cache[methodName] = octokit.request.defaults(endpointDefaults);
     }
-    return tagObj;
+    return cache[methodName];
+  }
+};
+function endpointsToMethods(octokit) {
+  const newMethods = {};
+  for (const scope of endpointMethodsMap.keys()) {
+    newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
+  }
+  return newMethods;
 }
-// needs to be called before value stringifier to allow for circular anchor refs
-function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {
-    if (!doc.directives)
-        return '';
-    const props = [];
-    const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;
-    if (anchor && anchors.anchorIsValid(anchor)) {
-        anchors$1.add(anchor);
-        props.push(`&${anchor}`);
+function decorate(octokit, scope, methodName, defaults, decorations) {
+  const requestWithDefaults = octokit.request.defaults(defaults);
+  function withDecorations(...args) {
+    let options = requestWithDefaults.endpoint.merge(...args);
+    if (decorations.mapToData) {
+      options = Object.assign({}, options, {
+        data: options[decorations.mapToData],
+        [decorations.mapToData]: void 0
+      });
+      return requestWithDefaults(options);
     }
-    const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
-    if (tag)
-        props.push(doc.directives.tagString(tag));
-    return props.join(' ');
-}
-function stringify(item, ctx, onComment, onChompKeep) {
-    if (identity.isPair(item))
-        return item.toString(ctx, onComment, onChompKeep);
-    if (identity.isAlias(item)) {
-        if (ctx.doc.directives)
-            return item.toString(ctx);
-        if (ctx.resolvedAliases?.has(item)) {
-            throw new TypeError(`Cannot stringify circular structure without alias nodes`);
-        }
-        else {
-            if (ctx.resolvedAliases)
-                ctx.resolvedAliases.add(item);
-            else
-                ctx.resolvedAliases = new Set([item]);
-            item = item.resolve(ctx.doc);
+    if (decorations.renamed) {
+      const [newScope, newMethodName] = decorations.renamed;
+      octokit.log.warn(
+        `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
+      );
+    }
+    if (decorations.deprecated) {
+      octokit.log.warn(decorations.deprecated);
+    }
+    if (decorations.renamedParameters) {
+      const options2 = requestWithDefaults.endpoint.merge(...args);
+      for (const [name, alias] of Object.entries(
+        decorations.renamedParameters
+      )) {
+        if (name in options2) {
+          octokit.log.warn(
+            `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
+          );
+          if (!(alias in options2)) {
+            options2[alias] = options2[name];
+          }
+          delete options2[name];
         }
+      }
+      return requestWithDefaults(options2);
     }
-    let tagObj = undefined;
-    const node = identity.isNode(item)
-        ? item
-        : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
-    tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
-    const props = stringifyProps(node, tagObj, ctx);
-    if (props.length > 0)
-        ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
-    const str = typeof tagObj.stringify === 'function'
-        ? tagObj.stringify(node, ctx, onComment, onChompKeep)
-        : identity.isScalar(node)
-            ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep)
-            : node.toString(ctx, onComment, onChompKeep);
-    if (!props)
-        return str;
-    return identity.isScalar(node) || str[0] === '{' || str[0] === '['
-        ? `${props} ${str}`
-        : `${props}\n${ctx.indent}${str}`;
+    return requestWithDefaults(...args);
+  }
+  return Object.assign(withDecorations, requestWithDefaults);
 }
 
-exports.createStringifyContext = createStringifyContext;
-exports.stringify = stringify;
-
+//# sourceMappingURL=endpoints-to-methods.js.map
 
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
 
-/***/ 61212:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
+function restEndpointMethods(octokit) {
+  const api = endpointsToMethods(octokit);
+  return {
+    rest: api
+  };
+}
+restEndpointMethods.VERSION = dist_src_version_VERSION;
+function legacyRestEndpointMethods(octokit) {
+  const api = endpointsToMethods(octokit);
+  return {
+    ...api,
+    rest: api
+  };
+}
+legacyRestEndpointMethods.VERSION = dist_src_version_VERSION;
 
+//# sourceMappingURL=index.js.map
 
-var identity = __nccwpck_require__(41127);
-var stringify = __nccwpck_require__(2148);
-var stringifyComment = __nccwpck_require__(59799);
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js
+// pkg/dist-src/version.js
+var plugin_paginate_rest_dist_bundle_VERSION = "0.0.0-development";
 
-function stringifyCollection(collection, ctx, options) {
-    const flow = ctx.inFlow ?? collection.flow;
-    const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
-    return stringify(collection, ctx, options);
-}
-function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
-    const { indent, options: { commentString } } = ctx;
-    const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
-    let chompKeep = false; // flag for the preceding node's status
-    const lines = [];
-    for (let i = 0; i < items.length; ++i) {
-        const item = items[i];
-        let comment = null;
-        if (identity.isNode(item)) {
-            if (!chompKeep && item.spaceBefore)
-                lines.push('');
-            addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
-            if (item.comment)
-                comment = item.comment;
-        }
-        else if (identity.isPair(item)) {
-            const ik = identity.isNode(item.key) ? item.key : null;
-            if (ik) {
-                if (!chompKeep && ik.spaceBefore)
-                    lines.push('');
-                addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);
-            }
-        }
-        chompKeep = false;
-        let str = stringify.stringify(item, itemCtx, () => (comment = null), () => (chompKeep = true));
-        if (comment)
-            str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
-        if (chompKeep && comment)
-            chompKeep = false;
-        lines.push(blockItemPrefix + str);
-    }
-    let str;
-    if (lines.length === 0) {
-        str = flowChars.start + flowChars.end;
-    }
-    else {
-        str = lines[0];
-        for (let i = 1; i < lines.length; ++i) {
-            const line = lines[i];
-            str += line ? `\n${indent}${line}` : '\n';
-        }
-    }
-    if (comment) {
-        str += '\n' + stringifyComment.indentComment(commentString(comment), indent);
-        if (onComment)
-            onComment();
-    }
-    else if (chompKeep && onChompKeep)
-        onChompKeep();
-    return str;
+// pkg/dist-src/normalize-paginated-list-response.js
+function normalizePaginatedListResponse(response) {
+  if (!response.data) {
+    return {
+      ...response,
+      data: []
+    };
+  }
+  const responseNeedsNormalization = ("total_count" in response.data || "total_commits" in response.data) && !("url" in response.data);
+  if (!responseNeedsNormalization) return response;
+  const incompleteResults = response.data.incomplete_results;
+  const repositorySelection = response.data.repository_selection;
+  const totalCount = response.data.total_count;
+  const totalCommits = response.data.total_commits;
+  delete response.data.incomplete_results;
+  delete response.data.repository_selection;
+  delete response.data.total_count;
+  delete response.data.total_commits;
+  const namespaceKey = Object.keys(response.data)[0];
+  const data = response.data[namespaceKey];
+  response.data = data;
+  if (typeof incompleteResults !== "undefined") {
+    response.data.incomplete_results = incompleteResults;
+  }
+  if (typeof repositorySelection !== "undefined") {
+    response.data.repository_selection = repositorySelection;
+  }
+  response.data.total_count = totalCount;
+  response.data.total_commits = totalCommits;
+  return response;
 }
-function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
-    const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
-    itemIndent += indentStep;
-    const itemCtx = Object.assign({}, ctx, {
-        indent: itemIndent,
-        inFlow: true,
-        type: null
-    });
-    let reqNewline = false;
-    let linesAtValue = 0;
-    const lines = [];
-    for (let i = 0; i < items.length; ++i) {
-        const item = items[i];
-        let comment = null;
-        if (identity.isNode(item)) {
-            if (item.spaceBefore)
-                lines.push('');
-            addCommentBefore(ctx, lines, item.commentBefore, false);
-            if (item.comment)
-                comment = item.comment;
-        }
-        else if (identity.isPair(item)) {
-            const ik = identity.isNode(item.key) ? item.key : null;
-            if (ik) {
-                if (ik.spaceBefore)
-                    lines.push('');
-                addCommentBefore(ctx, lines, ik.commentBefore, false);
-                if (ik.comment)
-                    reqNewline = true;
-            }
-            const iv = identity.isNode(item.value) ? item.value : null;
-            if (iv) {
-                if (iv.comment)
-                    comment = iv.comment;
-                if (iv.commentBefore)
-                    reqNewline = true;
-            }
-            else if (item.value == null && ik?.comment) {
-                comment = ik.comment;
-            }
-        }
-        if (comment)
-            reqNewline = true;
-        let str = stringify.stringify(item, itemCtx, () => (comment = null));
-        reqNewline || (reqNewline = lines.length > linesAtValue || str.includes('\n'));
-        if (i < items.length - 1) {
-            str += ',';
-        }
-        else if (ctx.options.trailingComma) {
-            if (ctx.options.lineWidth > 0) {
-                reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) +
-                    (str.length + 2) >
-                    ctx.options.lineWidth);
+
+// pkg/dist-src/iterator.js
+function iterator(octokit, route, parameters) {
+  const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
+  const requestMethod = typeof route === "function" ? route : octokit.request;
+  const method = options.method;
+  const headers = options.headers;
+  let url = options.url;
+  return {
+    [Symbol.asyncIterator]: () => ({
+      async next() {
+        if (!url) return { done: true };
+        try {
+          const response = await requestMethod({ method, url, headers });
+          const normalizedResponse = normalizePaginatedListResponse(response);
+          url = ((normalizedResponse.headers.link || "").match(
+            /<([^<>]+)>;\s*rel="next"/
+          ) || [])[1];
+          if (!url && "total_commits" in normalizedResponse.data) {
+            const parsedUrl = new URL(normalizedResponse.url);
+            const params = parsedUrl.searchParams;
+            const page = parseInt(params.get("page") || "1", 10);
+            const per_page = parseInt(params.get("per_page") || "250", 10);
+            if (page * per_page < normalizedResponse.data.total_commits) {
+              params.set("page", String(page + 1));
+              url = parsedUrl.toString();
             }
-            if (reqNewline) {
-                str += ',';
+          }
+          return { value: normalizedResponse };
+        } catch (error) {
+          if (error.status !== 409) throw error;
+          url = "";
+          return {
+            value: {
+              status: 200,
+              headers: {},
+              data: []
             }
+          };
         }
-        if (comment)
-            str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
-        lines.push(str);
-        linesAtValue = lines.length;
+      }
+    })
+  };
+}
+
+// pkg/dist-src/paginate.js
+function paginate(octokit, route, parameters, mapFn) {
+  if (typeof parameters === "function") {
+    mapFn = parameters;
+    parameters = void 0;
+  }
+  return gather(
+    octokit,
+    [],
+    iterator(octokit, route, parameters)[Symbol.asyncIterator](),
+    mapFn
+  );
+}
+function gather(octokit, results, iterator2, mapFn) {
+  return iterator2.next().then((result) => {
+    if (result.done) {
+      return results;
     }
-    const { start, end } = flowChars;
-    if (lines.length === 0) {
-        return start + end;
+    let earlyExit = false;
+    function done() {
+      earlyExit = true;
     }
-    else {
-        if (!reqNewline) {
-            const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
-            reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
-        }
-        if (reqNewline) {
-            let str = start;
-            for (const line of lines)
-                str += line ? `\n${indentStep}${indent}${line}` : '\n';
-            return `${str}\n${indent}${end}`;
-        }
-        else {
-            return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
-        }
+    results = results.concat(
+      mapFn ? mapFn(result.value, done) : result.value.data
+    );
+    if (earlyExit) {
+      return results;
     }
+    return gather(octokit, results, iterator2, mapFn);
+  });
 }
-function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
-    if (comment && chompKeep)
-        comment = comment.replace(/^\n+/, '');
-    if (comment) {
-        const ic = stringifyComment.indentComment(commentString(comment), indent);
-        lines.push(ic.trimStart()); // Avoid double indent on first line
-    }
+
+// pkg/dist-src/compose-paginate.js
+var composePaginateRest = Object.assign(paginate, {
+  iterator
+});
+
+// pkg/dist-src/generated/paginating-endpoints.js
+var paginatingEndpoints = (/* unused pure expression or super */ null && ([
+  "GET /advisories",
+  "GET /app/hook/deliveries",
+  "GET /app/installation-requests",
+  "GET /app/installations",
+  "GET /assignments/{assignment_id}/accepted_assignments",
+  "GET /classrooms",
+  "GET /classrooms/{classroom_id}/assignments",
+  "GET /enterprises/{enterprise}/code-security/configurations",
+  "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories",
+  "GET /enterprises/{enterprise}/dependabot/alerts",
+  "GET /enterprises/{enterprise}/teams",
+  "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships",
+  "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations",
+  "GET /events",
+  "GET /gists",
+  "GET /gists/public",
+  "GET /gists/starred",
+  "GET /gists/{gist_id}/comments",
+  "GET /gists/{gist_id}/commits",
+  "GET /gists/{gist_id}/forks",
+  "GET /installation/repositories",
+  "GET /issues",
+  "GET /licenses",
+  "GET /marketplace_listing/plans",
+  "GET /marketplace_listing/plans/{plan_id}/accounts",
+  "GET /marketplace_listing/stubbed/plans",
+  "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
+  "GET /networks/{owner}/{repo}/events",
+  "GET /notifications",
+  "GET /organizations",
+  "GET /organizations/{org}/dependabot/repository-access",
+  "GET /orgs/{org}/actions/cache/usage-by-repository",
+  "GET /orgs/{org}/actions/hosted-runners",
+  "GET /orgs/{org}/actions/permissions/repositories",
+  "GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories",
+  "GET /orgs/{org}/actions/runner-groups",
+  "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners",
+  "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories",
+  "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners",
+  "GET /orgs/{org}/actions/runners",
+  "GET /orgs/{org}/actions/secrets",
+  "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
+  "GET /orgs/{org}/actions/variables",
+  "GET /orgs/{org}/actions/variables/{name}/repositories",
+  "GET /orgs/{org}/attestations/repositories",
+  "GET /orgs/{org}/attestations/{subject_digest}",
+  "GET /orgs/{org}/blocks",
+  "GET /orgs/{org}/campaigns",
+  "GET /orgs/{org}/code-scanning/alerts",
+  "GET /orgs/{org}/code-security/configurations",
+  "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories",
+  "GET /orgs/{org}/codespaces",
+  "GET /orgs/{org}/codespaces/secrets",
+  "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
+  "GET /orgs/{org}/copilot/billing/seats",
+  "GET /orgs/{org}/copilot/metrics",
+  "GET /orgs/{org}/dependabot/alerts",
+  "GET /orgs/{org}/dependabot/secrets",
+  "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
+  "GET /orgs/{org}/events",
+  "GET /orgs/{org}/failed_invitations",
+  "GET /orgs/{org}/hooks",
+  "GET /orgs/{org}/hooks/{hook_id}/deliveries",
+  "GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}",
+  "GET /orgs/{org}/insights/api/subject-stats",
+  "GET /orgs/{org}/insights/api/user-stats/{user_id}",
+  "GET /orgs/{org}/installations",
+  "GET /orgs/{org}/invitations",
+  "GET /orgs/{org}/invitations/{invitation_id}/teams",
+  "GET /orgs/{org}/issues",
+  "GET /orgs/{org}/members",
+  "GET /orgs/{org}/members/{username}/codespaces",
+  "GET /orgs/{org}/migrations",
+  "GET /orgs/{org}/migrations/{migration_id}/repositories",
+  "GET /orgs/{org}/organization-roles/{role_id}/teams",
+  "GET /orgs/{org}/organization-roles/{role_id}/users",
+  "GET /orgs/{org}/outside_collaborators",
+  "GET /orgs/{org}/packages",
+  "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
+  "GET /orgs/{org}/personal-access-token-requests",
+  "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
+  "GET /orgs/{org}/personal-access-tokens",
+  "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
+  "GET /orgs/{org}/private-registries",
+  "GET /orgs/{org}/projects",
+  "GET /orgs/{org}/projectsV2",
+  "GET /orgs/{org}/projectsV2/{project_number}/fields",
+  "GET /orgs/{org}/projectsV2/{project_number}/items",
+  "GET /orgs/{org}/properties/values",
+  "GET /orgs/{org}/public_members",
+  "GET /orgs/{org}/repos",
+  "GET /orgs/{org}/rulesets",
+  "GET /orgs/{org}/rulesets/rule-suites",
+  "GET /orgs/{org}/rulesets/{ruleset_id}/history",
+  "GET /orgs/{org}/secret-scanning/alerts",
+  "GET /orgs/{org}/security-advisories",
+  "GET /orgs/{org}/settings/immutable-releases/repositories",
+  "GET /orgs/{org}/settings/network-configurations",
+  "GET /orgs/{org}/team/{team_slug}/copilot/metrics",
+  "GET /orgs/{org}/teams",
+  "GET /orgs/{org}/teams/{team_slug}/discussions",
+  "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
+  "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
+  "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
+  "GET /orgs/{org}/teams/{team_slug}/invitations",
+  "GET /orgs/{org}/teams/{team_slug}/members",
+  "GET /orgs/{org}/teams/{team_slug}/projects",
+  "GET /orgs/{org}/teams/{team_slug}/repos",
+  "GET /orgs/{org}/teams/{team_slug}/teams",
+  "GET /projects/{project_id}/collaborators",
+  "GET /repos/{owner}/{repo}/actions/artifacts",
+  "GET /repos/{owner}/{repo}/actions/caches",
+  "GET /repos/{owner}/{repo}/actions/organization-secrets",
+  "GET /repos/{owner}/{repo}/actions/organization-variables",
+  "GET /repos/{owner}/{repo}/actions/runners",
+  "GET /repos/{owner}/{repo}/actions/runs",
+  "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
+  "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
+  "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
+  "GET /repos/{owner}/{repo}/actions/secrets",
+  "GET /repos/{owner}/{repo}/actions/variables",
+  "GET /repos/{owner}/{repo}/actions/workflows",
+  "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
+  "GET /repos/{owner}/{repo}/activity",
+  "GET /repos/{owner}/{repo}/assignees",
+  "GET /repos/{owner}/{repo}/attestations/{subject_digest}",
+  "GET /repos/{owner}/{repo}/branches",
+  "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
+  "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
+  "GET /repos/{owner}/{repo}/code-scanning/alerts",
+  "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
+  "GET /repos/{owner}/{repo}/code-scanning/analyses",
+  "GET /repos/{owner}/{repo}/codespaces",
+  "GET /repos/{owner}/{repo}/codespaces/devcontainers",
+  "GET /repos/{owner}/{repo}/codespaces/secrets",
+  "GET /repos/{owner}/{repo}/collaborators",
+  "GET /repos/{owner}/{repo}/comments",
+  "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
+  "GET /repos/{owner}/{repo}/commits",
+  "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
+  "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
+  "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
+  "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
+  "GET /repos/{owner}/{repo}/commits/{ref}/status",
+  "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
+  "GET /repos/{owner}/{repo}/compare/{basehead}",
+  "GET /repos/{owner}/{repo}/compare/{base}...{head}",
+  "GET /repos/{owner}/{repo}/contributors",
+  "GET /repos/{owner}/{repo}/dependabot/alerts",
+  "GET /repos/{owner}/{repo}/dependabot/secrets",
+  "GET /repos/{owner}/{repo}/deployments",
+  "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
+  "GET /repos/{owner}/{repo}/environments",
+  "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
+  "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
+  "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets",
+  "GET /repos/{owner}/{repo}/environments/{environment_name}/variables",
+  "GET /repos/{owner}/{repo}/events",
+  "GET /repos/{owner}/{repo}/forks",
+  "GET /repos/{owner}/{repo}/hooks",
+  "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
+  "GET /repos/{owner}/{repo}/invitations",
+  "GET /repos/{owner}/{repo}/issues",
+  "GET /repos/{owner}/{repo}/issues/comments",
+  "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
+  "GET /repos/{owner}/{repo}/issues/events",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues",
+  "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
+  "GET /repos/{owner}/{repo}/keys",
+  "GET /repos/{owner}/{repo}/labels",
+  "GET /repos/{owner}/{repo}/milestones",
+  "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
+  "GET /repos/{owner}/{repo}/notifications",
+  "GET /repos/{owner}/{repo}/pages/builds",
+  "GET /repos/{owner}/{repo}/projects",
+  "GET /repos/{owner}/{repo}/pulls",
+  "GET /repos/{owner}/{repo}/pulls/comments",
+  "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
+  "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
+  "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
+  "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
+  "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
+  "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
+  "GET /repos/{owner}/{repo}/releases",
+  "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
+  "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
+  "GET /repos/{owner}/{repo}/rules/branches/{branch}",
+  "GET /repos/{owner}/{repo}/rulesets",
+  "GET /repos/{owner}/{repo}/rulesets/rule-suites",
+  "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history",
+  "GET /repos/{owner}/{repo}/secret-scanning/alerts",
+  "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
+  "GET /repos/{owner}/{repo}/security-advisories",
+  "GET /repos/{owner}/{repo}/stargazers",
+  "GET /repos/{owner}/{repo}/subscribers",
+  "GET /repos/{owner}/{repo}/tags",
+  "GET /repos/{owner}/{repo}/teams",
+  "GET /repos/{owner}/{repo}/topics",
+  "GET /repositories",
+  "GET /search/code",
+  "GET /search/commits",
+  "GET /search/issues",
+  "GET /search/labels",
+  "GET /search/repositories",
+  "GET /search/topics",
+  "GET /search/users",
+  "GET /teams/{team_id}/discussions",
+  "GET /teams/{team_id}/discussions/{discussion_number}/comments",
+  "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
+  "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
+  "GET /teams/{team_id}/invitations",
+  "GET /teams/{team_id}/members",
+  "GET /teams/{team_id}/projects",
+  "GET /teams/{team_id}/repos",
+  "GET /teams/{team_id}/teams",
+  "GET /user/blocks",
+  "GET /user/codespaces",
+  "GET /user/codespaces/secrets",
+  "GET /user/emails",
+  "GET /user/followers",
+  "GET /user/following",
+  "GET /user/gpg_keys",
+  "GET /user/installations",
+  "GET /user/installations/{installation_id}/repositories",
+  "GET /user/issues",
+  "GET /user/keys",
+  "GET /user/marketplace_purchases",
+  "GET /user/marketplace_purchases/stubbed",
+  "GET /user/memberships/orgs",
+  "GET /user/migrations",
+  "GET /user/migrations/{migration_id}/repositories",
+  "GET /user/orgs",
+  "GET /user/packages",
+  "GET /user/packages/{package_type}/{package_name}/versions",
+  "GET /user/public_emails",
+  "GET /user/repos",
+  "GET /user/repository_invitations",
+  "GET /user/social_accounts",
+  "GET /user/ssh_signing_keys",
+  "GET /user/starred",
+  "GET /user/subscriptions",
+  "GET /user/teams",
+  "GET /users",
+  "GET /users/{username}/attestations/{subject_digest}",
+  "GET /users/{username}/events",
+  "GET /users/{username}/events/orgs/{org}",
+  "GET /users/{username}/events/public",
+  "GET /users/{username}/followers",
+  "GET /users/{username}/following",
+  "GET /users/{username}/gists",
+  "GET /users/{username}/gpg_keys",
+  "GET /users/{username}/keys",
+  "GET /users/{username}/orgs",
+  "GET /users/{username}/packages",
+  "GET /users/{username}/projects",
+  "GET /users/{username}/projectsV2",
+  "GET /users/{username}/projectsV2/{project_number}/fields",
+  "GET /users/{username}/projectsV2/{project_number}/items",
+  "GET /users/{username}/received_events",
+  "GET /users/{username}/received_events/public",
+  "GET /users/{username}/repos",
+  "GET /users/{username}/social_accounts",
+  "GET /users/{username}/ssh_signing_keys",
+  "GET /users/{username}/starred",
+  "GET /users/{username}/subscriptions"
+]));
+
+// pkg/dist-src/paginating-endpoints.js
+function isPaginatingEndpoint(arg) {
+  if (typeof arg === "string") {
+    return paginatingEndpoints.includes(arg);
+  } else {
+    return false;
+  }
 }
 
-exports.stringifyCollection = stringifyCollection;
+// pkg/dist-src/index.js
+function paginateRest(octokit) {
+  return {
+    paginate: Object.assign(paginate.bind(null, octokit), {
+      iterator: iterator.bind(null, octokit)
+    })
+  };
+}
+paginateRest.VERSION = plugin_paginate_rest_dist_bundle_VERSION;
 
 
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/utils.js
 
-/***/ 59799:
-/***/ ((__unused_webpack_module, exports) => {
 
-"use strict";
+// octokit + plugins
+
 
 
+const utils_context = new Context();
+const baseUrl = getApiBaseUrl();
+const defaults = {
+    baseUrl,
+    request: {
+        agent: getProxyAgent(baseUrl),
+        fetch: getProxyFetch(baseUrl)
+    }
+};
+const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(defaults);
+
 /**
- * Stringifies a comment.
+ * Convience function to correctly format Octokit Options to pass into the constructor.
  *
- * Empty comment lines are left empty,
- * lines consisting of a single space are replaced by `#`,
- * and all other lines are prefixed with a `#`.
+ * @param     token    the repo PAT or GITHUB_TOKEN
+ * @param     options  other options to set
  */
-const stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, '#');
-function indentComment(comment, indent) {
-    if (/^\n+$/.test(comment))
-        return comment.substring(1);
-    return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
+function getOctokitOptions(token, options) {
+    const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
+    // Auth
+    const auth = getAuthString(token, opts);
+    if (auth) {
+        opts.auth = auth;
+    }
+    // Orchestration ID
+    const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
+    if (userAgent) {
+        opts.userAgent = userAgent;
+    }
+    return opts;
 }
-const lineComment = (str, indent, comment) => str.endsWith('\n')
-    ? indentComment(comment, indent)
-    : comment.includes('\n')
-        ? '\n' + indentComment(comment, indent)
-        : (str.endsWith(' ') ? '' : ' ') + comment;
+//# sourceMappingURL=utils.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/github.js
 
-exports.indentComment = indentComment;
-exports.lineComment = lineComment;
-exports.stringifyComment = stringifyComment;
+
+const github_context = new Context();
+/**
+ * Returns a hydrated octokit ready to use for GitHub Actions
+ *
+ * @param     token    the repo PAT or GITHUB_TOKEN
+ * @param     options  other options to set
+ */
+function getOctokit(token, options, ...additionalPlugins) {
+    const GitHubWithPlugins = GitHub.plugin(...additionalPlugins);
+    return new GitHubWithPlugins(getOctokitOptions(token, options));
+}
+//# sourceMappingURL=github.js.map
+// EXTERNAL MODULE: ./node_modules/unzip-stream/unzip.js
+var unzip = __nccwpck_require__(33991);
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/download/download-artifact.js
+var download_artifact_awaiter = (undefined && undefined.__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());
+    });
+};
 
 
-/***/ }),
 
-/***/ 6829:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
 
-var identity = __nccwpck_require__(41127);
-var stringify = __nccwpck_require__(2148);
-var stringifyComment = __nccwpck_require__(59799);
 
-function stringifyDocument(doc, options) {
-    const lines = [];
-    let hasDirectives = options.directives === true;
-    if (options.directives !== false && doc.directives) {
-        const dir = doc.directives.toString(doc);
-        if (dir) {
-            lines.push(dir);
-            hasDirectives = true;
+
+
+
+
+
+
+
+
+const scrubQueryParameters = (url) => {
+    const parsed = new URL(url);
+    parsed.search = '';
+    return parsed.toString();
+};
+function download_artifact_exists(path) {
+    return download_artifact_awaiter(this, void 0, void 0, function* () {
+        try {
+            yield promises_namespaceObject.access(path);
+            return true;
         }
-        else if (doc.directives.docStart)
-            hasDirectives = true;
-    }
-    if (hasDirectives)
-        lines.push('---');
-    const ctx = stringify.createStringifyContext(doc, options);
-    const { commentString } = ctx.options;
-    if (doc.commentBefore) {
-        if (lines.length !== 1)
-            lines.unshift('');
-        const cs = commentString(doc.commentBefore);
-        lines.unshift(stringifyComment.indentComment(cs, ''));
-    }
-    let chompKeep = false;
-    let contentComment = null;
-    if (doc.contents) {
-        if (identity.isNode(doc.contents)) {
-            if (doc.contents.spaceBefore && hasDirectives)
-                lines.push('');
-            if (doc.contents.commentBefore) {
-                const cs = commentString(doc.contents.commentBefore);
-                lines.push(stringifyComment.indentComment(cs, ''));
+        catch (error) {
+            if (error.code === 'ENOENT') {
+                return false;
+            }
+            else {
+                throw error;
             }
-            // top-level block scalars need to be indented if followed by a comment
-            ctx.forceBlockIndent = !!doc.comment;
-            contentComment = doc.contents.comment;
         }
-        const onChompKeep = contentComment ? undefined : () => (chompKeep = true);
-        let body = stringify.stringify(doc.contents, ctx, () => (contentComment = null), onChompKeep);
-        if (contentComment)
-            body += stringifyComment.lineComment(body, '', commentString(contentComment));
-        if ((body[0] === '|' || body[0] === '>') &&
-            lines[lines.length - 1] === '---') {
-            // Top-level block scalars with a preceding doc marker ought to use the
-            // same line for their header.
-            lines[lines.length - 1] = `--- ${body}`;
+    });
+}
+function streamExtract(url, directory, skipDecompress) {
+    return download_artifact_awaiter(this, void 0, void 0, function* () {
+        let retryCount = 0;
+        while (retryCount < 5) {
+            try {
+                return yield streamExtractExternal(url, directory, { skipDecompress });
+            }
+            catch (error) {
+                retryCount++;
+                core_debug(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`);
+                // wait 5 seconds before retrying
+                yield new Promise(resolve => setTimeout(resolve, 5000));
+            }
         }
-        else
-            lines.push(body);
-    }
-    else {
-        lines.push(stringify.stringify(doc.contents, ctx));
-    }
-    if (doc.directives?.docEnd) {
-        if (doc.comment) {
-            const cs = commentString(doc.comment);
-            if (cs.includes('\n')) {
-                lines.push('...');
-                lines.push(stringifyComment.indentComment(cs, ''));
+        throw new Error(`Artifact download failed after ${retryCount} retries.`);
+    });
+}
+function streamExtractExternal(url_1, directory_1) {
+    return download_artifact_awaiter(this, arguments, void 0, function* (url, directory, opts = {}) {
+        const { timeout = 30 * 1000, skipDecompress = false } = opts;
+        const client = new lib_HttpClient(getUserAgentString());
+        const response = yield client.get(url);
+        if (response.message.statusCode !== 200) {
+            throw new Error(`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`);
+        }
+        const contentType = response.message.headers['content-type'] || '';
+        const mimeType = contentType.split(';', 1)[0].trim().toLowerCase();
+        // Check if the URL path ends with .zip (ignoring query parameters)
+        const urlPath = new URL(url).pathname.toLowerCase();
+        const urlEndsWithZip = urlPath.endsWith('.zip');
+        const isZip = mimeType === 'application/zip' ||
+            mimeType === 'application/x-zip-compressed' ||
+            mimeType === 'application/zip-compressed' ||
+            urlEndsWithZip;
+        // Extract filename from Content-Disposition header
+        // Prefer filename* (RFC 5987) which supports UTF-8 encoded filenames,
+        // fall back to filename which may contain ASCII-only replacements
+        const contentDisposition = response.message.headers['content-disposition'] || '';
+        let fileName = 'artifact';
+        const filenameStar = contentDisposition.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i);
+        const filenamePlain = contentDisposition.match(/(? {
+            const timerFn = () => {
+                const timeoutError = new Error(`Blob storage chunk did not respond in ${timeout}ms`);
+                response.message.destroy(timeoutError);
+                reject(timeoutError);
+            };
+            const timer = setTimeout(timerFn, timeout);
+            const onError = (error) => {
+                core_debug(`response.message: Artifact download failed: ${error.message}`);
+                clearTimeout(timer);
+                reject(error);
+            };
+            const hashStream = external_crypto_.createHash('sha256').setEncoding('hex');
+            const passThrough = new external_stream_.PassThrough()
+                .on('data', () => {
+                timer.refresh();
+            })
+                .on('error', onError);
+            response.message.pipe(passThrough);
+            passThrough.pipe(hashStream);
+            const onClose = () => {
+                clearTimeout(timer);
+                if (hashStream) {
+                    hashStream.end();
+                    sha256Digest = hashStream.read();
+                    info(`SHA256 digest of downloaded artifact is ${sha256Digest}`);
+                }
+                resolve({ sha256Digest: `sha256:${sha256Digest}` });
+            };
+            if (isZip && !skipDecompress) {
+                // Extract zip file
+                passThrough
+                    .pipe(unzip.Extract({ path: directory }))
+                    .on('close', onClose)
+                    .on('error', onError);
             }
             else {
-                lines.push(`... ${cs}`);
+                // Save raw file without extracting
+                const filePath = external_path_.join(directory, fileName);
+                const writeStream = external_fs_.createWriteStream(filePath);
+                info(`Downloading raw file (non-zip) to: ${filePath}`);
+                passThrough.pipe(writeStream).on('close', onClose).on('error', onError);
+            }
+        });
+    });
+}
+function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) {
+    return download_artifact_awaiter(this, void 0, void 0, function* () {
+        const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path);
+        const api = getOctokit(token);
+        let digestMismatch = false;
+        info(`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`);
+        const { headers, status } = yield api.rest.actions.downloadArtifact({
+            owner: repositoryOwner,
+            repo: repositoryName,
+            artifact_id: artifactId,
+            archive_format: 'zip',
+            request: {
+                redirect: 'manual'
+            }
+        });
+        if (status !== 302) {
+            throw new Error(`Unable to download artifact. Unexpected status: ${status}`);
+        }
+        const { location } = headers;
+        if (!location) {
+            throw new Error(`Unable to redirect to artifact download url`);
+        }
+        info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`);
+        try {
+            info(`Starting download of artifact to: ${downloadPath}`);
+            const extractResponse = yield streamExtract(location, downloadPath, options === null || options === void 0 ? void 0 : options.skipDecompress);
+            info(`Artifact download completed successfully.`);
+            if (options === null || options === void 0 ? void 0 : options.expectedHash) {
+                if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) {
+                    digestMismatch = true;
+                    core_debug(`Computed digest: ${extractResponse.sha256Digest}`);
+                    core_debug(`Expected digest: ${options.expectedHash}`);
+                }
+            }
+        }
+        catch (error) {
+            throw new Error(`Unable to download and extract artifact: ${error.message}`);
+        }
+        return { downloadPath, digestMismatch };
+    });
+}
+function downloadArtifactInternal(artifactId, options) {
+    return download_artifact_awaiter(this, void 0, void 0, function* () {
+        const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path);
+        const artifactClient = internalArtifactTwirpClient();
+        let digestMismatch = false;
+        const { workflowRunBackendId, workflowJobRunBackendId } = getBackendIdsFromToken();
+        const listReq = {
+            workflowRunBackendId,
+            workflowJobRunBackendId,
+            idFilter: Int64Value.create({ value: artifactId.toString() })
+        };
+        const { artifacts } = yield artifactClient.ListArtifacts(listReq);
+        if (artifacts.length === 0) {
+            throw new ArtifactNotFoundError(`No artifacts found for ID: ${artifactId}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`);
+        }
+        if (artifacts.length > 1) {
+            warning('Multiple artifacts found, defaulting to first.');
+        }
+        const signedReq = {
+            workflowRunBackendId: artifacts[0].workflowRunBackendId,
+            workflowJobRunBackendId: artifacts[0].workflowJobRunBackendId,
+            name: artifacts[0].name
+        };
+        const { signedUrl } = yield artifactClient.GetSignedArtifactURL(signedReq);
+        info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`);
+        try {
+            info(`Starting download of artifact to: ${downloadPath}`);
+            const extractResponse = yield streamExtract(signedUrl, downloadPath, options === null || options === void 0 ? void 0 : options.skipDecompress);
+            info(`Artifact download completed successfully.`);
+            if (options === null || options === void 0 ? void 0 : options.expectedHash) {
+                if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) {
+                    digestMismatch = true;
+                    core_debug(`Computed digest: ${extractResponse.sha256Digest}`);
+                    core_debug(`Expected digest: ${options.expectedHash}`);
+                }
             }
         }
+        catch (error) {
+            throw new Error(`Unable to download and extract artifact: ${error.message}`);
+        }
+        return { downloadPath, digestMismatch };
+    });
+}
+function resolveOrCreateDirectory() {
+    return download_artifact_awaiter(this, arguments, void 0, function* (downloadPath = getGitHubWorkspaceDir()) {
+        if (!(yield download_artifact_exists(downloadPath))) {
+            core_debug(`Artifact destination folder does not exist, creating: ${downloadPath}`);
+            yield promises_namespaceObject.mkdir(downloadPath, { recursive: true });
+        }
         else {
-            lines.push('...');
+            core_debug(`Artifact destination folder already exists: ${downloadPath}`);
         }
+        return downloadPath;
+    });
+}
+//# sourceMappingURL=download-artifact.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/find/retry-options.js
+
+// Defaults for fetching artifacts
+const defaultMaxRetryNumber = 5;
+const defaultExemptStatusCodes = [400, 401, 403, 404, 422]; // https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
+function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) {
+    var _a;
+    if (retries <= 0) {
+        return [{ enabled: false }, defaultOptions.request];
     }
-    else {
-        let dc = doc.comment;
-        if (dc && chompKeep)
-            dc = dc.replace(/^\n+/, '');
-        if (dc) {
-            if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '')
-                lines.push('');
-            lines.push(stringifyComment.indentComment(commentString(dc), ''));
-        }
+    const retryOptions = {
+        enabled: true
+    };
+    if (exemptStatusCodes.length > 0) {
+        retryOptions.doNotRetry = exemptStatusCodes;
     }
-    return lines.join('\n') + '\n';
+    // The GitHub type has some defaults for `options.request`
+    // see: https://github.com/actions/toolkit/blob/4fbc5c941a57249b19562015edbd72add14be93d/packages/github/src/utils.ts#L15
+    // We pass these in here so they are not overridden.
+    const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries });
+    core_debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : 'octokit default: [400, 401, 403, 404, 422]'})`);
+    return [retryOptions, requestOptions];
 }
+//# sourceMappingURL=retry-options.js.map
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-request-log/dist-src/version.js
+const plugin_request_log_dist_src_version_VERSION = "6.0.0";
 
-exports.stringifyDocument = stringifyDocument;
 
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-request-log/dist-src/index.js
 
-/***/ }),
+function requestLog(octokit) {
+  octokit.hook.wrap("request", (request, options) => {
+    octokit.log.debug("request", options);
+    const start = Date.now();
+    const requestOptions = octokit.request.endpoint.parse(options);
+    const path = requestOptions.url.replace(options.baseUrl, "");
+    return request(options).then((response) => {
+      const requestId = response.headers["x-github-request-id"];
+      octokit.log.info(
+        `${requestOptions.method} ${path} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`
+      );
+      return response;
+    }).catch((error) => {
+      const requestId = error.response?.headers["x-github-request-id"] || "UNKNOWN";
+      octokit.log.error(
+        `${requestOptions.method} ${path} - ${error.status} with id ${requestId} in ${Date.now() - start}ms`
+      );
+      throw error;
+    });
+  });
+}
+requestLog.VERSION = plugin_request_log_dist_src_version_VERSION;
 
-/***/ 28689:
-/***/ ((__unused_webpack_module, exports) => {
 
-"use strict";
+// EXTERNAL MODULE: ./node_modules/bottleneck/light.js
+var light = __nccwpck_require__(63251);
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-retry/dist-bundle/index.js
+// pkg/dist-src/version.js
+var plugin_retry_dist_bundle_VERSION = "0.0.0-development";
 
+// pkg/dist-src/error-request.js
+function isRequestError(error) {
+  return error.request !== void 0;
+}
+async function errorRequest(state, octokit, error, options) {
+  if (!isRequestError(error) || !error?.request.request) {
+    throw error;
+  }
+  if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
+    const retries = options.request.retries != null ? options.request.retries : state.retries;
+    const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
+    throw octokit.retry.retryRequest(error, retries, retryAfter);
+  }
+  throw error;
+}
 
-function stringifyNumber({ format, minFractionDigits, tag, value }) {
-    if (typeof value === 'bigint')
-        return String(value);
-    const num = typeof value === 'number' ? value : Number(value);
-    if (!isFinite(num))
-        return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf';
-    let n = Object.is(value, -0) ? '-0' : JSON.stringify(value);
-    if (!format &&
-        minFractionDigits &&
-        (!tag || tag === 'tag:yaml.org,2002:float') &&
-        /^-?\d/.test(n) &&
-        !n.includes('e')) {
-        let i = n.indexOf('.');
-        if (i < 0) {
-            i = n.length;
-            n += '.';
-        }
-        let d = minFractionDigits - (n.length - i - 1);
-        while (d-- > 0)
-            n += '0';
+// pkg/dist-src/wrap-request.js
+
+
+async function wrapRequest(state, octokit, request, options) {
+  const limiter = new light();
+  limiter.on("failed", function(error, info) {
+    const maxRetries = ~~error.request.request?.retries;
+    const after = ~~error.request.request?.retryAfter;
+    options.request.retryCount = info.retryCount + 1;
+    if (maxRetries > info.retryCount) {
+      return after * state.retryAfterBaseValue;
     }
-    return n;
+  });
+  return limiter.schedule(
+    requestWithGraphqlErrorHandling.bind(null, state, octokit, request),
+    options
+  );
+}
+async function requestWithGraphqlErrorHandling(state, octokit, request, options) {
+  const response = await request(options);
+  if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test(
+    response.data.errors[0].message
+  )) {
+    const error = new RequestError(response.data.errors[0].message, 500, {
+      request: options,
+      response
+    });
+    return errorRequest(state, octokit, error, options);
+  }
+  return response;
 }
 
-exports.stringifyNumber = stringifyNumber;
+// pkg/dist-src/index.js
+function retry(octokit, octokitOptions) {
+  const state = Object.assign(
+    {
+      enabled: true,
+      retryAfterBaseValue: 1e3,
+      doNotRetry: [400, 401, 403, 404, 410, 422, 451],
+      retries: 3
+    },
+    octokitOptions.retry
+  );
+  const retryPlugin = {
+    retry: {
+      retryRequest: (error, retries, retryAfter) => {
+        error.request.request = Object.assign({}, error.request.request, {
+          retries,
+          retryAfter
+        });
+        return error;
+      }
+    }
+  };
+  if (state.enabled) {
+    octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin));
+    octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin));
+  }
+  return retryPlugin;
+}
+retry.VERSION = plugin_retry_dist_bundle_VERSION;
 
 
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/find/get-artifact.js
+var get_artifact_awaiter = (undefined && undefined.__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());
+    });
+};
 
-/***/ 59748:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
 
-var identity = __nccwpck_require__(41127);
-var Scalar = __nccwpck_require__(63301);
-var stringify = __nccwpck_require__(2148);
-var stringifyComment = __nccwpck_require__(59799);
 
-function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
-    const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
-    let keyComment = (identity.isNode(key) && key.comment) || null;
-    if (simpleKeys) {
-        if (keyComment) {
-            throw new Error('With simple keys, key nodes cannot have comments');
-        }
-        if (identity.isCollection(key) || (!identity.isNode(key) && typeof key === 'object')) {
-            const msg = 'With simple keys, collection cannot be used as a key value';
-            throw new Error(msg);
-        }
-    }
-    let explicitKey = !simpleKeys &&
-        (!key ||
-            (keyComment && value == null && !ctx.inFlow) ||
-            identity.isCollection(key) ||
-            (identity.isScalar(key)
-                ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL
-                : typeof key === 'object'));
-    ctx = Object.assign({}, ctx, {
-        allNullValues: false,
-        implicitKey: !explicitKey && (simpleKeys || !allNullValues),
-        indent: indent + indentStep
-    });
-    let keyCommentDone = false;
-    let chompKeep = false;
-    let str = stringify.stringify(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true));
-    if (!explicitKey && !ctx.inFlow && str.length > 1024) {
-        if (simpleKeys)
-            throw new Error('With simple keys, single line scalar must not span more than 1024 characters');
-        explicitKey = true;
-    }
-    if (ctx.inFlow) {
-        if (allNullValues || value == null) {
-            if (keyCommentDone && onComment)
-                onComment();
-            return str === '' ? '?' : explicitKey ? `? ${str}` : str;
-        }
-    }
-    else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {
-        str = `? ${str}`;
-        if (keyComment && !keyCommentDone) {
-            str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
-        }
-        else if (chompKeep && onChompKeep)
-            onChompKeep();
-        return str;
-    }
-    if (keyCommentDone)
-        keyComment = null;
-    if (explicitKey) {
-        if (keyComment)
-            str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
-        str = `? ${str}\n${indent}:`;
-    }
-    else {
-        str = `${str}:`;
-        if (keyComment)
-            str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
-    }
-    let vsb, vcb, valueComment;
-    if (identity.isNode(value)) {
-        vsb = !!value.spaceBefore;
-        vcb = value.commentBefore;
-        valueComment = value.comment;
-    }
-    else {
-        vsb = false;
-        vcb = null;
-        valueComment = null;
-        if (value && typeof value === 'object')
-            value = doc.createNode(value);
-    }
-    ctx.implicitKey = false;
-    if (!explicitKey && !keyComment && identity.isScalar(value))
-        ctx.indentAtStart = str.length + 1;
-    chompKeep = false;
-    if (!indentSeq &&
-        indentStep.length >= 2 &&
-        !ctx.inFlow &&
-        !explicitKey &&
-        identity.isSeq(value) &&
-        !value.flow &&
-        !value.tag &&
-        !value.anchor) {
-        // If indentSeq === false, consider '- ' as part of indentation where possible
-        ctx.indent = ctx.indent.substring(2);
-    }
-    let valueCommentDone = false;
-    const valueStr = stringify.stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));
-    let ws = ' ';
-    if (keyComment || vsb || vcb) {
-        ws = vsb ? '\n' : '';
-        if (vcb) {
-            const cs = commentString(vcb);
-            ws += `\n${stringifyComment.indentComment(cs, ctx.indent)}`;
+
+
+
+
+
+
+function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) {
+    return get_artifact_awaiter(this, void 0, void 0, function* () {
+        var _a;
+        const [retryOpts, requestOpts] = getRetryOptions(defaults);
+        const opts = {
+            log: undefined,
+            userAgent: getUserAgentString(),
+            previews: undefined,
+            retry: retryOpts,
+            request: requestOpts
+        };
+        const github = getOctokit(token, opts, retry, requestLog);
+        const getArtifactResp = yield github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}', {
+            owner: repositoryOwner,
+            repo: repositoryName,
+            run_id: workflowRunId,
+            name: artifactName
+        });
+        if (getArtifactResp.status !== 200) {
+            throw new InvalidResponseError(`Invalid response from GitHub API: ${getArtifactResp.status} (${(_a = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a === void 0 ? void 0 : _a['x-github-request-id']})`);
         }
-        if (valueStr === '' && !ctx.inFlow) {
-            if (ws === '\n' && valueComment)
-                ws = '\n\n';
+        if (getArtifactResp.data.artifacts.length === 0) {
+            throw new ArtifactNotFoundError(`Artifact not found for name: ${artifactName}
+        Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.
+        For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`);
         }
-        else {
-            ws += `\n${ctx.indent}`;
+        let artifact = getArtifactResp.data.artifacts[0];
+        if (getArtifactResp.data.artifacts.length > 1) {
+            artifact = getArtifactResp.data.artifacts.sort((a, b) => b.id - a.id)[0];
+            core_debug(`More than one artifact found for a single name, returning newest (id: ${artifact.id})`);
         }
-    }
-    else if (!explicitKey && identity.isCollection(value)) {
-        const vs0 = valueStr[0];
-        const nl0 = valueStr.indexOf('\n');
-        const hasNewline = nl0 !== -1;
-        const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
-        if (hasNewline || !flow) {
-            let hasPropsLine = false;
-            if (hasNewline && (vs0 === '&' || vs0 === '!')) {
-                let sp0 = valueStr.indexOf(' ');
-                if (vs0 === '&' &&
-                    sp0 !== -1 &&
-                    sp0 < nl0 &&
-                    valueStr[sp0 + 1] === '!') {
-                    sp0 = valueStr.indexOf(' ', sp0 + 1);
-                }
-                if (sp0 === -1 || nl0 < sp0)
-                    hasPropsLine = true;
+        return {
+            artifact: {
+                name: artifact.name,
+                id: artifact.id,
+                size: artifact.size_in_bytes,
+                createdAt: artifact.created_at
+                    ? new Date(artifact.created_at)
+                    : undefined,
+                digest: artifact.digest
             }
-            if (!hasPropsLine)
-                ws = `\n${ctx.indent}`;
+        };
+    });
+}
+function getArtifactInternal(artifactName) {
+    return get_artifact_awaiter(this, void 0, void 0, function* () {
+        var _a;
+        const artifactClient = internalArtifactTwirpClient();
+        const { workflowRunBackendId, workflowJobRunBackendId } = getBackendIdsFromToken();
+        const req = {
+            workflowRunBackendId,
+            workflowJobRunBackendId,
+            nameFilter: StringValue.create({ value: artifactName })
+        };
+        const res = yield artifactClient.ListArtifacts(req);
+        if (res.artifacts.length === 0) {
+            throw new ArtifactNotFoundError(`Artifact not found for name: ${artifactName}
+        Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.
+        For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`);
         }
-    }
-    else if (valueStr === '' || valueStr[0] === '\n') {
-        ws = '';
-    }
-    str += ws + valueStr;
-    if (ctx.inFlow) {
-        if (valueCommentDone && onComment)
-            onComment();
-    }
-    else if (valueComment && !valueCommentDone) {
-        str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));
-    }
-    else if (chompKeep && onChompKeep) {
-        onChompKeep();
-    }
-    return str;
+        let artifact = res.artifacts[0];
+        if (res.artifacts.length > 1) {
+            artifact = res.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0];
+            core_debug(`More than one artifact found for a single name, returning newest (id: ${artifact.databaseId})`);
+        }
+        return {
+            artifact: {
+                name: artifact.name,
+                id: Number(artifact.databaseId),
+                size: Number(artifact.size),
+                createdAt: artifact.createdAt
+                    ? Timestamp.toDate(artifact.createdAt)
+                    : undefined,
+                digest: (_a = artifact.digest) === null || _a === void 0 ? void 0 : _a.value
+            }
+        };
+    });
 }
+//# sourceMappingURL=get-artifact.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/delete/delete-artifact.js
+var delete_artifact_awaiter = (undefined && undefined.__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());
+    });
+};
 
-exports.stringifyPair = stringifyPair;
 
 
-/***/ }),
 
-/***/ 83069:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
 
-var Scalar = __nccwpck_require__(63301);
-var foldFlowLines = __nccwpck_require__(34475);
 
-const getFoldOptions = (ctx, isBlock) => ({
-    indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
-    lineWidth: ctx.options.lineWidth,
-    minContentWidth: ctx.options.minContentWidth
-});
-// Also checks for lines starting with %, as parsing the output as YAML 1.1 will
-// presume that's starting a new document.
-const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
-function lineLengthOverLimit(str, lineWidth, indentLength) {
-    if (!lineWidth || lineWidth < 0)
-        return false;
-    const limit = lineWidth - indentLength;
-    const strLen = str.length;
-    if (strLen <= limit)
-        return false;
-    for (let i = 0, start = 0; i < strLen; ++i) {
-        if (str[i] === '\n') {
-            if (i - start > limit)
-                return true;
-            start = i + 1;
-            if (strLen - start <= limit)
-                return false;
+
+
+
+
+function deleteArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) {
+    return delete_artifact_awaiter(this, void 0, void 0, function* () {
+        var _a;
+        const [retryOpts, requestOpts] = getRetryOptions(defaults);
+        const opts = {
+            log: undefined,
+            userAgent: getUserAgentString(),
+            previews: undefined,
+            retry: retryOpts,
+            request: requestOpts
+        };
+        const github = getOctokit(token, opts, retry, requestLog);
+        const getArtifactResp = yield getArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token);
+        const deleteArtifactResp = yield github.rest.actions.deleteArtifact({
+            owner: repositoryOwner,
+            repo: repositoryName,
+            artifact_id: getArtifactResp.artifact.id
+        });
+        if (deleteArtifactResp.status !== 204) {
+            throw new InvalidResponseError(`Invalid response from GitHub API: ${deleteArtifactResp.status} (${(_a = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a === void 0 ? void 0 : _a['x-github-request-id']})`);
         }
-    }
-    return true;
+        return {
+            id: getArtifactResp.artifact.id
+        };
+    });
 }
-function doubleQuotedString(value, ctx) {
-    const json = JSON.stringify(value);
-    if (ctx.options.doubleQuotedAsJSON)
-        return json;
-    const { implicitKey } = ctx;
-    const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
-    const indent = ctx.indent || (containsDocumentMarker(value) ? '  ' : '');
-    let str = '';
-    let start = 0;
-    for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
-        if (ch === ' ' && json[i + 1] === '\\' && json[i + 2] === 'n') {
-            // space before newline needs to be escaped to not be folded
-            str += json.slice(start, i) + '\\ ';
-            i += 1;
-            start = i;
-            ch = '\\';
+function deleteArtifactInternal(artifactName) {
+    return delete_artifact_awaiter(this, void 0, void 0, function* () {
+        const artifactClient = internalArtifactTwirpClient();
+        const { workflowRunBackendId, workflowJobRunBackendId } = getBackendIdsFromToken();
+        const listReq = {
+            workflowRunBackendId,
+            workflowJobRunBackendId,
+            nameFilter: StringValue.create({ value: artifactName })
+        };
+        const listRes = yield artifactClient.ListArtifacts(listReq);
+        if (listRes.artifacts.length === 0) {
+            throw new ArtifactNotFoundError(`Artifact not found for name: ${artifactName}`);
         }
-        if (ch === '\\')
-            switch (json[i + 1]) {
-                case 'u':
-                    {
-                        str += json.slice(start, i);
-                        const code = json.substr(i + 2, 4);
-                        switch (code) {
-                            case '0000':
-                                str += '\\0';
-                                break;
-                            case '0007':
-                                str += '\\a';
-                                break;
-                            case '000b':
-                                str += '\\v';
-                                break;
-                            case '001b':
-                                str += '\\e';
-                                break;
-                            case '0085':
-                                str += '\\N';
-                                break;
-                            case '00a0':
-                                str += '\\_';
-                                break;
-                            case '2028':
-                                str += '\\L';
-                                break;
-                            case '2029':
-                                str += '\\P';
-                                break;
-                            default:
-                                if (code.substr(0, 2) === '00')
-                                    str += '\\x' + code.substr(2);
-                                else
-                                    str += json.substr(i, 6);
-                        }
-                        i += 5;
-                        start = i + 1;
-                    }
-                    break;
-                case 'n':
-                    if (implicitKey ||
-                        json[i + 2] === '"' ||
-                        json.length < minMultiLineLength) {
-                        i += 1;
-                    }
-                    else {
-                        // folding will eat first newline
-                        str += json.slice(start, i) + '\n\n';
-                        while (json[i + 2] === '\\' &&
-                            json[i + 3] === 'n' &&
-                            json[i + 4] !== '"') {
-                            str += '\n';
-                            i += 2;
-                        }
-                        str += indent;
-                        // space after newline needs to be escaped to not be folded
-                        if (json[i + 2] === ' ')
-                            str += '\\';
-                        i += 1;
-                        start = i + 1;
-                    }
-                    break;
-                default:
-                    i += 1;
-            }
-    }
-    str = start ? str + json.slice(start) : json;
-    return implicitKey
-        ? str
-        : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
-}
-function singleQuotedString(value, ctx) {
-    if (ctx.options.singleQuote === false ||
-        (ctx.implicitKey && value.includes('\n')) ||
-        /[ \t]\n|\n[ \t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline
-    )
-        return doubleQuotedString(value, ctx);
-    const indent = ctx.indent || (containsDocumentMarker(value) ? '  ' : '');
-    const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
-    return ctx.implicitKey
-        ? res
-        : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
-}
-function quotedString(value, ctx) {
-    const { singleQuote } = ctx.options;
-    let qs;
-    if (singleQuote === false)
-        qs = doubleQuotedString;
-    else {
-        const hasDouble = value.includes('"');
-        const hasSingle = value.includes("'");
-        if (hasDouble && !hasSingle)
-            qs = singleQuotedString;
-        else if (hasSingle && !hasDouble)
-            qs = doubleQuotedString;
-        else
-            qs = singleQuote ? singleQuotedString : doubleQuotedString;
-    }
-    return qs(value, ctx);
-}
-// The negative lookbehind avoids a polynomial search,
-// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind
-let blockEndNewlines;
-try {
-    blockEndNewlines = new RegExp('(^|(?\n';
-    // determine chomping from whitespace at value end
-    let chomp;
-    let endStart;
-    for (endStart = value.length; endStart > 0; --endStart) {
-        const ch = value[endStart - 1];
-        if (ch !== '\n' && ch !== '\t' && ch !== ' ')
-            break;
-    }
-    let end = value.substring(endStart);
-    const endNlPos = end.indexOf('\n');
-    if (endNlPos === -1) {
-        chomp = '-'; // strip
-    }
-    else if (value === end || endNlPos !== end.length - 1) {
-        chomp = '+'; // keep
-        if (onChompKeep)
-            onChompKeep();
-    }
-    else {
-        chomp = ''; // clip
-    }
-    if (end) {
-        value = value.slice(0, -end.length);
-        if (end[end.length - 1] === '\n')
-            end = end.slice(0, -1);
-        end = end.replace(blockEndNewlines, `$&${indent}`);
-    }
-    // determine indent indicator from whitespace at value start
-    let startWithSpace = false;
-    let startEnd;
-    let startNlPos = -1;
-    for (startEnd = 0; startEnd < value.length; ++startEnd) {
-        const ch = value[startEnd];
-        if (ch === ' ')
-            startWithSpace = true;
-        else if (ch === '\n')
-            startNlPos = startEnd;
-        else
-            break;
-    }
-    let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
-    if (start) {
-        value = value.substring(start.length);
-        start = start.replace(/\n+/g, `$&${indent}`);
-    }
-    const indentSize = indent ? '2' : '1'; // root is at -1
-    // Leading | or > is added later
-    let header = (startWithSpace ? indentSize : '') + chomp;
-    if (comment) {
-        header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
-        if (onComment)
-            onComment();
-    }
-    if (!literal) {
-        const foldedValue = value
-            .replace(/\n+/g, '\n$&')
-            .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
-            //                ^ more-ind. ^ empty     ^ capture next empty lines only at end of indent
-            .replace(/\n+/g, `$&${indent}`);
-        let literalFallback = false;
-        const foldOptions = getFoldOptions(ctx, true);
-        if (blockQuote !== 'folded' && type !== Scalar.Scalar.BLOCK_FOLDED) {
-            foldOptions.onOverflow = () => {
-                literalFallback = true;
-            };
+        let artifact = listRes.artifacts[0];
+        if (listRes.artifacts.length > 1) {
+            artifact = listRes.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0];
+            core_debug(`More than one artifact found for a single name, returning newest (id: ${artifact.databaseId})`);
         }
-        const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
-        if (!literalFallback)
-            return `>${header}\n${indent}${body}`;
-    }
-    value = value.replace(/\n+/g, `$&${indent}`);
-    return `|${header}\n${indent}${start}${value}${end}`;
+        const req = {
+            workflowRunBackendId: artifact.workflowRunBackendId,
+            workflowJobRunBackendId: artifact.workflowJobRunBackendId,
+            name: artifact.name
+        };
+        const res = yield artifactClient.DeleteArtifact(req);
+        info(`Artifact '${artifactName}' (ID: ${res.artifactId}) deleted`);
+        return {
+            id: Number(res.artifactId)
+        };
+    });
 }
-function plainString(item, ctx, onComment, onChompKeep) {
-    const { type, value } = item;
-    const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
-    if ((implicitKey && value.includes('\n')) ||
-        (inFlow && /[[\]{},]/.test(value))) {
-        return quotedString(value, ctx);
-    }
-    if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
-        // not allowed:
-        // - '-' or '?'
-        // - start with an indicator character (except [?:-]) or /[?-] /
-        // - '\n ', ': ' or ' \n' anywhere
-        // - '#' not preceded by a non-space char
-        // - end with ' ' or ':'
-        return implicitKey || inFlow || !value.includes('\n')
-            ? quotedString(value, ctx)
-            : blockString(item, ctx, onComment, onChompKeep);
-    }
-    if (!implicitKey &&
-        !inFlow &&
-        type !== Scalar.Scalar.PLAIN &&
-        value.includes('\n')) {
-        // Where allowed & type not set explicitly, prefer block style for multiline strings
-        return blockString(item, ctx, onComment, onChompKeep);
-    }
-    if (containsDocumentMarker(value)) {
-        if (indent === '') {
-            ctx.forceBlockIndent = true;
-            return blockString(item, ctx, onComment, onChompKeep);
+//# sourceMappingURL=delete-artifact.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/find/list-artifacts.js
+var list_artifacts_awaiter = (undefined && undefined.__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());
+    });
+};
+
+
+
+
+
+
+
+
+
+
+
+const maximumArtifactCount = getMaxArtifactListCount();
+const paginationCount = 100;
+const maxNumberOfPages = Math.ceil(maximumArtifactCount / paginationCount);
+function listArtifactsPublic(workflowRunId_1, repositoryOwner_1, repositoryName_1, token_1) {
+    return list_artifacts_awaiter(this, arguments, void 0, function* (workflowRunId, repositoryOwner, repositoryName, token, latest = false) {
+        info(`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}`);
+        let artifacts = [];
+        const [retryOpts, requestOpts] = getRetryOptions(defaults);
+        const opts = {
+            log: undefined,
+            userAgent: getUserAgentString(),
+            previews: undefined,
+            retry: retryOpts,
+            request: requestOpts
+        };
+        const github = getOctokit(token, opts, retry, requestLog);
+        let currentPageNumber = 1;
+        const { data: listArtifactResponse } = yield github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', {
+            owner: repositoryOwner,
+            repo: repositoryName,
+            run_id: workflowRunId,
+            per_page: paginationCount,
+            page: currentPageNumber
+        });
+        let numberOfPages = Math.ceil(listArtifactResponse.total_count / paginationCount);
+        const totalArtifactCount = listArtifactResponse.total_count;
+        if (totalArtifactCount > maximumArtifactCount) {
+            warning(`Workflow run ${workflowRunId} has ${totalArtifactCount} artifacts, exceeding the limit of ${maximumArtifactCount}. Results will be incomplete as only the first ${maximumArtifactCount} artifacts will be returned`);
+            numberOfPages = maxNumberOfPages;
         }
-        else if (implicitKey && indent === indentStep) {
-            return quotedString(value, ctx);
+        // Iterate over the first page
+        for (const artifact of listArtifactResponse.artifacts) {
+            artifacts.push({
+                name: artifact.name,
+                id: artifact.id,
+                size: artifact.size_in_bytes,
+                createdAt: artifact.created_at
+                    ? new Date(artifact.created_at)
+                    : undefined,
+                digest: artifact.digest
+            });
+        }
+        // Move to the next page
+        currentPageNumber++;
+        // Iterate over any remaining pages
+        for (currentPageNumber; currentPageNumber <= numberOfPages; currentPageNumber++) {
+            core_debug(`Fetching page ${currentPageNumber} of artifact list`);
+            const { data: listArtifactResponse } = yield github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', {
+                owner: repositoryOwner,
+                repo: repositoryName,
+                run_id: workflowRunId,
+                per_page: paginationCount,
+                page: currentPageNumber
+            });
+            for (const artifact of listArtifactResponse.artifacts) {
+                artifacts.push({
+                    name: artifact.name,
+                    id: artifact.id,
+                    size: artifact.size_in_bytes,
+                    createdAt: artifact.created_at
+                        ? new Date(artifact.created_at)
+                        : undefined,
+                    digest: artifact.digest
+                });
+            }
+        }
+        if (latest) {
+            artifacts = filterLatest(artifacts);
+        }
+        info(`Found ${artifacts.length} artifact(s)`);
+        return {
+            artifacts
+        };
+    });
+}
+function listArtifactsInternal() {
+    return list_artifacts_awaiter(this, arguments, void 0, function* (latest = false) {
+        const artifactClient = internalArtifactTwirpClient();
+        const { workflowRunBackendId, workflowJobRunBackendId } = getBackendIdsFromToken();
+        const req = {
+            workflowRunBackendId,
+            workflowJobRunBackendId
+        };
+        const res = yield artifactClient.ListArtifacts(req);
+        let artifacts = res.artifacts.map(artifact => {
+            var _a;
+            return ({
+                name: artifact.name,
+                id: Number(artifact.databaseId),
+                size: Number(artifact.size),
+                createdAt: artifact.createdAt
+                    ? Timestamp.toDate(artifact.createdAt)
+                    : undefined,
+                digest: (_a = artifact.digest) === null || _a === void 0 ? void 0 : _a.value
+            });
+        });
+        if (latest) {
+            artifacts = filterLatest(artifacts);
         }
-    }
-    const str = value.replace(/\n+/g, `$&\n${indent}`);
-    // Verify that output will be parsed as a string, as e.g. plain numbers and
-    // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),
-    // and others in v1.1.
-    if (actualString) {
-        const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);
-        const { compat, tags } = ctx.doc.schema;
-        if (tags.some(test) || compat?.some(test))
-            return quotedString(value, ctx);
-    }
-    return implicitKey
-        ? str
-        : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
+        info(`Found ${artifacts.length} artifact(s)`);
+        return {
+            artifacts
+        };
+    });
 }
-function stringifyString(item, ctx, onComment, onChompKeep) {
-    const { implicitKey, inFlow } = ctx;
-    const ss = typeof item.value === 'string'
-        ? item
-        : Object.assign({}, item, { value: String(item.value) });
-    let { type } = item;
-    if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
-        // force double quotes on control characters & unpaired surrogates
-        if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
-            type = Scalar.Scalar.QUOTE_DOUBLE;
-    }
-    const _stringify = (_type) => {
-        switch (_type) {
-            case Scalar.Scalar.BLOCK_FOLDED:
-            case Scalar.Scalar.BLOCK_LITERAL:
-                return implicitKey || inFlow
-                    ? quotedString(ss.value, ctx) // blocks are not valid inside flow containers
-                    : blockString(ss, ctx, onComment, onChompKeep);
-            case Scalar.Scalar.QUOTE_DOUBLE:
-                return doubleQuotedString(ss.value, ctx);
-            case Scalar.Scalar.QUOTE_SINGLE:
-                return singleQuotedString(ss.value, ctx);
-            case Scalar.Scalar.PLAIN:
-                return plainString(ss, ctx, onComment, onChompKeep);
-            default:
-                return null;
+/**
+ * Filters a list of artifacts to only include the latest artifact for each name
+ * @param artifacts The artifacts to filter
+ * @returns The filtered list of artifacts
+ */
+function filterLatest(artifacts) {
+    artifacts.sort((a, b) => b.id - a.id);
+    const latestArtifacts = [];
+    const seenArtifactNames = new Set();
+    for (const artifact of artifacts) {
+        if (!seenArtifactNames.has(artifact.name)) {
+            latestArtifacts.push(artifact);
+            seenArtifactNames.add(artifact.name);
         }
-    };
-    let res = _stringify(type);
-    if (res === null) {
-        const { defaultKeyType, defaultStringType } = ctx.options;
-        const t = (implicitKey && defaultKeyType) || defaultStringType;
-        res = _stringify(t);
-        if (res === null)
-            throw new Error(`Unsupported default string type ${t}`);
     }
-    return res;
+    return latestArtifacts;
 }
+//# sourceMappingURL=list-artifacts.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/internal/client.js
+var client_awaiter = (undefined && undefined.__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 __rest = (undefined && undefined.__rest) || function (s, e) {
+    var t = {};
+    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+        t[p] = s[p];
+    if (s != null && typeof Object.getOwnPropertySymbols === "function")
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
+    return t;
+};
 
-exports.stringifyString = stringifyString;
 
 
-/***/ }),
 
-/***/ 10204:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
-"use strict";
 
 
-var identity = __nccwpck_require__(41127);
 
-const BREAK = Symbol('break visit');
-const SKIP = Symbol('skip children');
-const REMOVE = Symbol('remove node');
 /**
- * Apply a visitor to an AST node or document.
- *
- * Walks through the tree (depth-first) starting from `node`, calling a
- * `visitor` function with three arguments:
- *   - `key`: For sequence values and map `Pair`, the node's index in the
- *     collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
- *     `null` for the root node.
- *   - `node`: The current node.
- *   - `path`: The ancestry of the current node.
- *
- * The return value of the visitor may be used to control the traversal:
- *   - `undefined` (default): Do nothing and continue
- *   - `visit.SKIP`: Do not visit the children of this node, continue with next
- *     sibling
- *   - `visit.BREAK`: Terminate traversal completely
- *   - `visit.REMOVE`: Remove the current node, then continue with the next one
- *   - `Node`: Replace the current node, then continue by visiting it
- *   - `number`: While iterating the items of a sequence or map, set the index
- *     of the next step. This is useful especially if the index of the current
- *     node has changed.
- *
- * If `visitor` is a single function, it will be called with all values
- * encountered in the tree, including e.g. `null` values. Alternatively,
- * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
- * `Alias` and `Scalar` node. To define the same visitor function for more than
- * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
- * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
- * specific defined one will be used for each node.
+ * The default artifact client that is used by the artifact action(s).
  */
-function visit(node, visitor) {
-    const visitor_ = initVisitor(visitor);
-    if (identity.isDocument(node)) {
-        const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
-        if (cd === REMOVE)
-            node.contents = null;
-    }
-    else
-        visit_(null, node, visitor_, Object.freeze([]));
-}
-// Without the `as symbol` casts, TS declares these in the `visit`
-// namespace using `var`, but then complains about that because
-// `unique symbol` must be `const`.
-/** Terminate visit traversal completely */
-visit.BREAK = BREAK;
-/** Do not visit the children of the current node */
-visit.SKIP = SKIP;
-/** Remove the current node */
-visit.REMOVE = REMOVE;
-function visit_(key, node, visitor, path) {
-    const ctrl = callVisitor(key, node, visitor, path);
-    if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
-        replaceNode(key, path, ctrl);
-        return visit_(key, ctrl, visitor, path);
-    }
-    if (typeof ctrl !== 'symbol') {
-        if (identity.isCollection(node)) {
-            path = Object.freeze(path.concat(node));
-            for (let i = 0; i < node.items.length; ++i) {
-                const ci = visit_(i, node.items[i], visitor, path);
-                if (typeof ci === 'number')
-                    i = ci - 1;
-                else if (ci === BREAK)
-                    return BREAK;
-                else if (ci === REMOVE) {
-                    node.items.splice(i, 1);
-                    i -= 1;
+class DefaultArtifactClient {
+    uploadArtifact(name, files, rootDirectory, options) {
+        return client_awaiter(this, void 0, void 0, function* () {
+            try {
+                if (isGhes()) {
+                    throw new GHESNotSupportedError();
                 }
+                return uploadArtifact(name, files, rootDirectory, options);
             }
-        }
-        else if (identity.isPair(node)) {
-            path = Object.freeze(path.concat(node));
-            const ck = visit_('key', node.key, visitor, path);
-            if (ck === BREAK)
-                return BREAK;
-            else if (ck === REMOVE)
-                node.key = null;
-            const cv = visit_('value', node.value, visitor, path);
-            if (cv === BREAK)
-                return BREAK;
-            else if (cv === REMOVE)
-                node.value = null;
-        }
-    }
-    return ctrl;
-}
-/**
- * Apply an async visitor to an AST node or document.
- *
- * Walks through the tree (depth-first) starting from `node`, calling a
- * `visitor` function with three arguments:
- *   - `key`: For sequence values and map `Pair`, the node's index in the
- *     collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
- *     `null` for the root node.
- *   - `node`: The current node.
- *   - `path`: The ancestry of the current node.
- *
- * The return value of the visitor may be used to control the traversal:
- *   - `Promise`: Must resolve to one of the following values
- *   - `undefined` (default): Do nothing and continue
- *   - `visit.SKIP`: Do not visit the children of this node, continue with next
- *     sibling
- *   - `visit.BREAK`: Terminate traversal completely
- *   - `visit.REMOVE`: Remove the current node, then continue with the next one
- *   - `Node`: Replace the current node, then continue by visiting it
- *   - `number`: While iterating the items of a sequence or map, set the index
- *     of the next step. This is useful especially if the index of the current
- *     node has changed.
- *
- * If `visitor` is a single function, it will be called with all values
- * encountered in the tree, including e.g. `null` values. Alternatively,
- * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
- * `Alias` and `Scalar` node. To define the same visitor function for more than
- * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
- * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
- * specific defined one will be used for each node.
- */
-async function visitAsync(node, visitor) {
-    const visitor_ = initVisitor(visitor);
-    if (identity.isDocument(node)) {
-        const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
-        if (cd === REMOVE)
-            node.contents = null;
-    }
-    else
-        await visitAsync_(null, node, visitor_, Object.freeze([]));
-}
-// Without the `as symbol` casts, TS declares these in the `visit`
-// namespace using `var`, but then complains about that because
-// `unique symbol` must be `const`.
-/** Terminate visit traversal completely */
-visitAsync.BREAK = BREAK;
-/** Do not visit the children of the current node */
-visitAsync.SKIP = SKIP;
-/** Remove the current node */
-visitAsync.REMOVE = REMOVE;
-async function visitAsync_(key, node, visitor, path) {
-    const ctrl = await callVisitor(key, node, visitor, path);
-    if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
-        replaceNode(key, path, ctrl);
-        return visitAsync_(key, ctrl, visitor, path);
+            catch (error) {
+                warning(`Artifact upload failed with error: ${error}.
+
+Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information.
+
+If the error persists, please check whether Actions is operating normally at [https://githubstatus.com](https://www.githubstatus.com).`);
+                throw error;
+            }
+        });
     }
-    if (typeof ctrl !== 'symbol') {
-        if (identity.isCollection(node)) {
-            path = Object.freeze(path.concat(node));
-            for (let i = 0; i < node.items.length; ++i) {
-                const ci = await visitAsync_(i, node.items[i], visitor, path);
-                if (typeof ci === 'number')
-                    i = ci - 1;
-                else if (ci === BREAK)
-                    return BREAK;
-                else if (ci === REMOVE) {
-                    node.items.splice(i, 1);
-                    i -= 1;
+    downloadArtifact(artifactId, options) {
+        return client_awaiter(this, void 0, void 0, function* () {
+            try {
+                if (isGhes()) {
+                    throw new GHESNotSupportedError();
+                }
+                if (options === null || options === void 0 ? void 0 : options.findBy) {
+                    const { findBy: { repositoryOwner, repositoryName, token } } = options, downloadOptions = __rest(options, ["findBy"]);
+                    return downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, downloadOptions);
                 }
+                return downloadArtifactInternal(artifactId, options);
             }
-        }
-        else if (identity.isPair(node)) {
-            path = Object.freeze(path.concat(node));
-            const ck = await visitAsync_('key', node.key, visitor, path);
-            if (ck === BREAK)
-                return BREAK;
-            else if (ck === REMOVE)
-                node.key = null;
-            const cv = await visitAsync_('value', node.value, visitor, path);
-            if (cv === BREAK)
-                return BREAK;
-            else if (cv === REMOVE)
-                node.value = null;
-        }
-    }
-    return ctrl;
-}
-function initVisitor(visitor) {
-    if (typeof visitor === 'object' &&
-        (visitor.Collection || visitor.Node || visitor.Value)) {
-        return Object.assign({
-            Alias: visitor.Node,
-            Map: visitor.Node,
-            Scalar: visitor.Node,
-            Seq: visitor.Node
-        }, visitor.Value && {
-            Map: visitor.Value,
-            Scalar: visitor.Value,
-            Seq: visitor.Value
-        }, visitor.Collection && {
-            Map: visitor.Collection,
-            Seq: visitor.Collection
-        }, visitor);
-    }
-    return visitor;
-}
-function callVisitor(key, node, visitor, path) {
-    if (typeof visitor === 'function')
-        return visitor(key, node, path);
-    if (identity.isMap(node))
-        return visitor.Map?.(key, node, path);
-    if (identity.isSeq(node))
-        return visitor.Seq?.(key, node, path);
-    if (identity.isPair(node))
-        return visitor.Pair?.(key, node, path);
-    if (identity.isScalar(node))
-        return visitor.Scalar?.(key, node, path);
-    if (identity.isAlias(node))
-        return visitor.Alias?.(key, node, path);
-    return undefined;
-}
-function replaceNode(key, path, node) {
-    const parent = path[path.length - 1];
-    if (identity.isCollection(parent)) {
-        parent.items[key] = node;
+            catch (error) {
+                warning(`Download Artifact failed with error: ${error}.
+
+Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information.
+
+If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`);
+                throw error;
+            }
+        });
     }
-    else if (identity.isPair(parent)) {
-        if (key === 'key')
-            parent.key = node;
-        else
-            parent.value = node;
+    listArtifacts(options) {
+        return client_awaiter(this, void 0, void 0, function* () {
+            try {
+                if (isGhes()) {
+                    throw new GHESNotSupportedError();
+                }
+                if (options === null || options === void 0 ? void 0 : options.findBy) {
+                    const { findBy: { workflowRunId, repositoryOwner, repositoryName, token } } = options;
+                    return listArtifactsPublic(workflowRunId, repositoryOwner, repositoryName, token, options === null || options === void 0 ? void 0 : options.latest);
+                }
+                return listArtifactsInternal(options === null || options === void 0 ? void 0 : options.latest);
+            }
+            catch (error) {
+                warning(`Listing Artifacts failed with error: ${error}.
+
+Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information.
+
+If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`);
+                throw error;
+            }
+        });
     }
-    else if (identity.isDocument(parent)) {
-        parent.contents = node;
+    getArtifact(artifactName, options) {
+        return client_awaiter(this, void 0, void 0, function* () {
+            try {
+                if (isGhes()) {
+                    throw new GHESNotSupportedError();
+                }
+                if (options === null || options === void 0 ? void 0 : options.findBy) {
+                    const { findBy: { workflowRunId, repositoryOwner, repositoryName, token } } = options;
+                    return getArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token);
+                }
+                return getArtifactInternal(artifactName);
+            }
+            catch (error) {
+                warning(`Get Artifact failed with error: ${error}.
+
+Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information.
+
+If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`);
+                throw error;
+            }
+        });
     }
-    else {
-        const pt = identity.isAlias(parent) ? 'alias' : 'scalar';
-        throw new Error(`Cannot replace node with ${pt} parent`);
+    deleteArtifact(artifactName, options) {
+        return client_awaiter(this, void 0, void 0, function* () {
+            try {
+                if (isGhes()) {
+                    throw new GHESNotSupportedError();
+                }
+                if (options === null || options === void 0 ? void 0 : options.findBy) {
+                    const { findBy: { repositoryOwner, repositoryName, workflowRunId, token } } = options;
+                    return deleteArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token);
+                }
+                return deleteArtifactInternal(artifactName);
+            }
+            catch (error) {
+                warning(`Delete Artifact failed with error: ${error}.
+
+Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information.
+
+If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).`);
+                throw error;
+            }
+        });
     }
 }
+//# sourceMappingURL=client.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/artifact/lib/artifact.js
+
+
 
-exports.visit = visit;
-exports.visitAsync = visitAsync;
 
+const client = new DefaultArtifactClient();
+/* harmony default export */ const artifact = ((/* unused pure expression or super */ null && (client)));
+//# sourceMappingURL=artifact.js.map
 
 /***/ }),
 
-/***/ 87269:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 41761:
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
 
-"use strict";
-/*! Axios v1.18.0 Copyright (c) 2026 Matt Zabriskie and contributors */
 
+// EXPORTS
+__nccwpck_require__.d(__webpack_exports__, {
+  A: () => (/* binding */ lib_axios)
+});
+
+// NAMESPACE OBJECT: ./node_modules/axios/lib/platform/common/utils.js
+var common_utils_namespaceObject = {};
+__nccwpck_require__.r(common_utils_namespaceObject);
+__nccwpck_require__.d(common_utils_namespaceObject, {
+  hasBrowserEnv: () => (hasBrowserEnv),
+  hasStandardBrowserEnv: () => (hasStandardBrowserEnv),
+  hasStandardBrowserWebWorkerEnv: () => (hasStandardBrowserWebWorkerEnv),
+  navigator: () => (_navigator),
+  origin: () => (origin)
+});
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/bind.js
 
-var FormData$1 = __nccwpck_require__(96454);
-var crypto = __nccwpck_require__(76982);
-var url = __nccwpck_require__(87016);
-var HttpsProxyAgent = __nccwpck_require__(3669);
-var http = __nccwpck_require__(58611);
-var https = __nccwpck_require__(65692);
-var http2 = __nccwpck_require__(85675);
-var util = __nccwpck_require__(39023);
-var path = __nccwpck_require__(16928);
-var followRedirects = __nccwpck_require__(1573);
-var zlib = __nccwpck_require__(43106);
-var stream = __nccwpck_require__(2203);
-var events = __nccwpck_require__(24434);
 
 /**
  * Create a bound version of a function with a specified `this` context
@@ -123595,23 +156109,23 @@ function bind(fn, thisArg) {
   };
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/utils.js
+
+
+
+
 // utils is a library of generic helper functions non-specific to axios
 
-const {
-  toString
-} = Object.prototype;
-const {
-  getPrototypeOf
-} = Object;
-const {
-  iterator,
-  toStringTag
-} = Symbol;
+const { toString: utils_toString } = Object.prototype;
+const { getPrototypeOf } = Object;
+const { iterator, toStringTag } = Symbol;
 
 /* Creating a function that will check if an object has a property. */
-const hasOwnProperty = (({
-  hasOwnProperty
-}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
+const utils_hasOwnProperty = (
+  ({ hasOwnProperty }) =>
+  (obj, prop) =>
+    hasOwnProperty.call(obj, prop)
+)(Object.prototype);
 
 /**
  * Walk the prototype chain (excluding the shared Object.prototype) looking for
@@ -123628,12 +156142,14 @@ const hasOwnProperty = (({
 const hasOwnInPrototypeChain = (thing, prop) => {
   let obj = thing;
   const seen = [];
+
   while (obj != null && obj !== Object.prototype) {
     if (seen.indexOf(obj) !== -1) {
       return false;
     }
     seen.push(obj);
-    if (hasOwnProperty(obj, prop)) {
+
+    if (utils_hasOwnProperty(obj, prop)) {
       return true;
     }
     obj = getPrototypeOf(obj);
@@ -123652,16 +156168,20 @@ const hasOwnInPrototypeChain = (thing, prop) => {
  *
  * @returns {*} The resolved value, or undefined when unsafe/absent
  */
-const getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
-const kindOf = (cache => thing => {
-  const str = toString.call(thing);
+const getSafeProp = (obj, prop) =>
+  obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
+
+const kindOf = ((cache) => (thing) => {
+  const str = utils_toString.call(thing);
   return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
 })(Object.create(null));
-const kindOfTest = type => {
+
+const kindOfTest = (type) => {
   type = type.toLowerCase();
-  return thing => kindOf(thing) === type;
+  return (thing) => kindOf(thing) === type;
 };
-const typeOfTest = type => thing => typeof thing === type;
+
+const typeOfTest = (type) => (thing) => typeof thing === type;
 
 /**
  * Determine if a value is a non-null object
@@ -123670,9 +156190,7 @@ const typeOfTest = type => thing => typeof thing === type;
  *
  * @returns {boolean} True if value is an Array, otherwise false
  */
-const {
-  isArray
-} = Array;
+const { isArray } = Array;
 
 /**
  * Determine if a value is undefined
@@ -123691,7 +156209,14 @@ const isUndefined = typeOfTest('undefined');
  * @returns {boolean} True if value is a Buffer, otherwise false
  */
 function isBuffer(val) {
-  return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
+  return (
+    val !== null &&
+    !isUndefined(val) &&
+    val.constructor !== null &&
+    !isUndefined(val.constructor) &&
+    isFunction(val.constructor.isBuffer) &&
+    val.constructor.isBuffer(val)
+  );
 }
 
 /**
@@ -123735,7 +156260,7 @@ const isString = typeOfTest('string');
  * @param {*} val The value to test
  * @returns {boolean} True if value is a Function, otherwise false
  */
-const isFunction$1 = typeOfTest('function');
+const isFunction = typeOfTest('function');
 
 /**
  * Determine if a value is a Number
@@ -123753,7 +156278,7 @@ const isNumber = typeOfTest('number');
  *
  * @returns {boolean} True if value is an Object, otherwise false
  */
-const isObject = thing => thing !== null && typeof thing === 'object';
+const isObject = (thing) => thing !== null && typeof thing === 'object';
 
 /**
  * Determine if a value is a Boolean
@@ -123761,7 +156286,7 @@ const isObject = thing => thing !== null && typeof thing === 'object';
  * @param {*} thing The value to test
  * @returns {boolean} True if value is a Boolean, otherwise false
  */
-const isBoolean = thing => thing === true || thing === false;
+const isBoolean = (thing) => thing === true || thing === false;
 
 /**
  * Determine if a value is a plain Object
@@ -123770,16 +156295,22 @@ const isBoolean = thing => thing === true || thing === false;
  *
  * @returns {boolean} True if value is a plain Object, otherwise false
  */
-const isPlainObject = val => {
+const isPlainObject = (val) => {
   if (!isObject(val)) {
     return false;
   }
+
   const prototype = getPrototypeOf(val);
-  return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
-  // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
-  // Symbol.iterator as evidence the value is a tagged/iterable type rather
-  // than a plain object, while ignoring keys injected onto Object.prototype.
-  !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
+  return (
+    (prototype === null ||
+      prototype === Object.prototype ||
+      getPrototypeOf(prototype) === null) &&
+    // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
+    // Symbol.iterator as evidence the value is a tagged/iterable type rather
+    // than a plain object, while ignoring keys injected onto Object.prototype.
+    !hasOwnInPrototypeChain(val, toStringTag) &&
+    !hasOwnInPrototypeChain(val, iterator)
+  );
 };
 
 /**
@@ -123789,11 +156320,12 @@ const isPlainObject = val => {
  *
  * @returns {boolean} True if value is an empty object, otherwise false
  */
-const isEmptyObject = val => {
+const isEmptyObject = (val) => {
   // Early return for non-objects or Buffers to prevent RangeError
   if (!isObject(val) || isBuffer(val)) {
     return false;
   }
+
   try {
     return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
   } catch (e) {
@@ -123831,7 +156363,7 @@ const isFile = kindOfTest('File');
  *
  * @returns {boolean} True if value is a React Native Blob, otherwise false
  */
-const isReactNativeBlob = value => {
+const isReactNativeBlob = (value) => {
   return !!(value && typeof value.uri !== 'undefined');
 };
 
@@ -123843,7 +156375,7 @@ const isReactNativeBlob = value => {
  *
  * @returns {boolean} True if environment is React Native, otherwise false
  */
-const isReactNative = formData => formData && typeof formData.getParts !== 'undefined';
+const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
 
 /**
  * Determine if a value is a Blob
@@ -123870,7 +156402,7 @@ const isFileList = kindOfTest('FileList');
  *
  * @returns {boolean} True if value is a Stream, otherwise false
  */
-const isStream = val => isObject(val) && isFunction$1(val.pipe);
+const isStream = (val) => isObject(val) && isFunction(val.pipe);
 
 /**
  * Determine if a value is a FormData
@@ -123886,19 +156418,23 @@ function getGlobal() {
   if (typeof global !== 'undefined') return global;
   return {};
 }
+
 const G = getGlobal();
 const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
-const isFormData = thing => {
+
+const isFormData = (thing) => {
   if (!thing) return false;
   if (FormDataCtor && thing instanceof FormDataCtor) return true;
   // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
   const proto = getPrototypeOf(thing);
   if (!proto || proto === Object.prototype) return false;
-  if (!isFunction$1(thing.append)) return false;
+  if (!isFunction(thing.append)) return false;
   const kind = kindOf(thing);
-  return kind === 'formdata' ||
-  // detect form-data instance
-  kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]';
+  return (
+    kind === 'formdata' ||
+    // detect form-data instance
+    (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
+  );
 };
 
 /**
@@ -123909,7 +156445,13 @@ const isFormData = thing => {
  * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  */
 const isURLSearchParams = kindOfTest('URLSearchParams');
-const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
+
+const [isReadableStream, isRequest, isResponse, isHeaders] = [
+  'ReadableStream',
+  'Request',
+  'Response',
+  'Headers',
+].map(kindOfTest);
 
 /**
  * Trim excess whitespace off the beginning and end of a string
@@ -123918,7 +156460,7 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
  *
  * @returns {String} The String freed of excess whitespace
  */
-const trim = str => {
+const trim = (str) => {
   return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
 };
 /**
@@ -123937,13 +156479,12 @@ const trim = str => {
  * @param {Boolean} [options.allOwnKeys = false]
  * @returns {any}
  */
-function forEach(obj, fn, {
-  allOwnKeys = false
-} = {}) {
+function forEach(obj, fn, { allOwnKeys = false } = {}) {
   // Don't bother if no value provided
   if (obj === null || typeof obj === 'undefined') {
     return;
   }
+
   let i;
   let l;
 
@@ -123952,6 +156493,7 @@ function forEach(obj, fn, {
     /*eslint no-param-reassign:0*/
     obj = [obj];
   }
+
   if (isArray(obj)) {
     // Iterate over array values
     for (i = 0, l = obj.length; i < l; i++) {
@@ -123967,6 +156509,7 @@ function forEach(obj, fn, {
     const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
     const len = keys.length;
     let key;
+
     for (i = 0; i < len; i++) {
       key = keys[i];
       fn.call(null, obj[key], key, obj);
@@ -123986,6 +156529,7 @@ function findKey(obj, key) {
   if (isBuffer(obj)) {
     return null;
   }
+
   key = key.toLowerCase();
   const keys = Object.keys(obj);
   let i = keys.length;
@@ -123998,12 +156542,14 @@ function findKey(obj, key) {
   }
   return null;
 }
+
 const _global = (() => {
   /*eslint no-undef:0*/
   if (typeof globalThis !== 'undefined') return globalThis;
   return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
 })();
-const isContextDefined = context => !isUndefined(context) && context !== _global;
+
+const isContextDefined = (context) => !isUndefined(context) && context !== _global;
 
 /**
  * Accepts varargs expecting each argument to be an object, then
@@ -124024,10 +156570,7 @@ const isContextDefined = context => !isUndefined(context) && context !== _global
  * @returns {Object} Result of all merge properties
  */
 function merge(...objs) {
-  const {
-    caseless,
-    skipUndefined
-  } = isContextDefined(this) && this || {};
+  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
   const result = {};
   const assignValue = (val, key) => {
     // Skip dangerous property names to prevent prototype pollution
@@ -124037,11 +156580,11 @@ function merge(...objs) {
 
     // findKey lowercases the key, so caseless lookup only applies to strings —
     // symbol keys are identity-matched.
-    const targetKey = caseless && typeof key === 'string' && findKey(result, key) || key;
+    const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;
     // Read via own-prop only — a bare `result[targetKey]` walks the prototype
     // chain, so a polluted Object.prototype value could surface here and get
     // copied into the merged result.
-    const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
+    const existing = utils_hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
     if (isPlainObject(existing) && isPlainObject(val)) {
       result[targetKey] = merge(existing, val);
     } else if (isPlainObject(val)) {
@@ -124052,15 +156595,19 @@ function merge(...objs) {
       result[targetKey] = val;
     }
   };
+
   for (let i = 0, l = objs.length; i < l; i++) {
     const source = objs[i];
     if (!source || isBuffer(source)) {
       continue;
     }
+
     forEach(source, assignValue);
+
     if (typeof source !== 'object' || isArray(source)) {
       continue;
     }
+
     const symbols = Object.getOwnPropertySymbols(source);
     for (let j = 0; j < symbols.length; j++) {
       const symbol = symbols[j];
@@ -124083,32 +156630,32 @@ function merge(...objs) {
  * @param {Boolean} [options.allOwnKeys]
  * @returns {Object} The resulting value of object a
  */
-const extend = (a, b, thisArg, {
-  allOwnKeys
-} = {}) => {
-  forEach(b, (val, key) => {
-    if (thisArg && isFunction$1(val)) {
-      Object.defineProperty(a, key, {
-        // Null-proto descriptor so a polluted Object.prototype.get cannot
-        // hijack defineProperty's accessor-vs-data resolution.
-        __proto__: null,
-        value: bind(val, thisArg),
-        writable: true,
-        enumerable: true,
-        configurable: true
-      });
-    } else {
-      Object.defineProperty(a, key, {
-        __proto__: null,
-        value: val,
-        writable: true,
-        enumerable: true,
-        configurable: true
-      });
-    }
-  }, {
-    allOwnKeys
-  });
+const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
+  forEach(
+    b,
+    (val, key) => {
+      if (thisArg && isFunction(val)) {
+        Object.defineProperty(a, key, {
+          // Null-proto descriptor so a polluted Object.prototype.get cannot
+          // hijack defineProperty's accessor-vs-data resolution.
+          __proto__: null,
+          value: bind(val, thisArg),
+          writable: true,
+          enumerable: true,
+          configurable: true,
+        });
+      } else {
+        Object.defineProperty(a, key, {
+          __proto__: null,
+          value: val,
+          writable: true,
+          enumerable: true,
+          configurable: true,
+        });
+      }
+    },
+    { allOwnKeys }
+  );
   return a;
 };
 
@@ -124119,7 +156666,7 @@ const extend = (a, b, thisArg, {
  *
  * @returns {string} content value without BOM
  */
-const stripBOM = content => {
+const stripBOM = (content) => {
   if (content.charCodeAt(0) === 0xfeff) {
     content = content.slice(1);
   }
@@ -124142,11 +156689,11 @@ const inherits = (constructor, superConstructor, props, descriptors) => {
     value: constructor,
     writable: true,
     enumerable: false,
-    configurable: true
+    configurable: true,
   });
   Object.defineProperty(constructor, 'super', {
     __proto__: null,
-    value: superConstructor.prototype
+    value: superConstructor.prototype,
   });
   props && Object.assign(constructor.prototype, props);
 };
@@ -124165,9 +156712,11 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
   let i;
   let prop;
   const merged = {};
+
   destObj = destObj || {};
   // eslint-disable-next-line no-eq-null,eqeqeq
   if (sourceObj == null) return destObj;
+
   do {
     props = Object.getOwnPropertyNames(sourceObj);
     i = props.length;
@@ -124180,6 +156729,7 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
     }
     sourceObj = filter !== false && getPrototypeOf(sourceObj);
   } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+
   return destObj;
 };
 
@@ -124209,7 +156759,7 @@ const endsWith = (str, searchString, position) => {
  *
  * @returns {?Array}
  */
-const toArray = thing => {
+const toArray = (thing) => {
   if (!thing) return null;
   if (isArray(thing)) return thing;
   let i = thing.length;
@@ -124230,9 +156780,9 @@ const toArray = thing => {
  * @returns {Array}
  */
 // eslint-disable-next-line func-names
-const isTypedArray = (TypedArray => {
+const isTypedArray = ((TypedArray) => {
   // eslint-disable-next-line func-names
-  return thing => {
+  return (thing) => {
     return TypedArray && thing instanceof TypedArray;
   };
 })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
@@ -124247,8 +156797,11 @@ const isTypedArray = (TypedArray => {
  */
 const forEachEntry = (obj, fn) => {
   const generator = obj && obj[iterator];
+
   const _iterator = generator.call(obj);
+
   let result;
+
   while ((result = _iterator.next()) && !result.done) {
     const pair = result.value;
     fn.call(obj, pair[0], pair[1]);
@@ -124266,22 +156819,24 @@ const forEachEntry = (obj, fn) => {
 const matchAll = (regExp, str) => {
   let matches;
   const arr = [];
+
   while ((matches = regExp.exec(str)) !== null) {
     arr.push(matches);
   }
+
   return arr;
 };
 
 /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
 const isHTMLForm = kindOfTest('HTMLFormElement');
-const toCamelCase = str => {
+
+const toCamelCase = (str) => {
   return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
     return p1.toUpperCase() + p2;
   });
 };
-const {
-  propertyIsEnumerable
-} = Object.prototype;
+
+const { propertyIsEnumerable } = Object.prototype;
 
 /**
  * Determine if a value is a RegExp object
@@ -124291,15 +156846,18 @@ const {
  * @returns {boolean} True if value is a RegExp object, otherwise false
  */
 const isRegExp = kindOfTest('RegExp');
+
 const reduceDescriptors = (obj, reducer) => {
   const descriptors = Object.getOwnPropertyDescriptors(obj);
   const reducedDescriptors = {};
+
   forEach(descriptors, (descriptor, name) => {
     let ret;
     if ((ret = reducer(descriptor, name, obj)) !== false) {
       reducedDescriptors[name] = ret || descriptor;
     }
   });
+
   Object.defineProperties(obj, reducedDescriptors);
 };
 
@@ -124308,19 +156866,24 @@ const reduceDescriptors = (obj, reducer) => {
  * @param {Object} obj
  */
 
-const freezeMethods = obj => {
+const freezeMethods = (obj) => {
   reduceDescriptors(obj, (descriptor, name) => {
     // skip restricted props in strict mode
-    if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
+    if (isFunction(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
       return false;
     }
+
     const value = obj[name];
-    if (!isFunction$1(value)) return;
+
+    if (!isFunction(value)) return;
+
     descriptor.enumerable = false;
+
     if ('writable' in descriptor) {
       descriptor.writable = false;
       return;
     }
+
     if (!descriptor.set) {
       descriptor.set = () => {
         throw Error("Can not rewrite read-only method '" + name + "'");
@@ -124339,17 +156902,22 @@ const freezeMethods = obj => {
  */
 const toObjectSet = (arrayOrString, delimiter) => {
   const obj = {};
-  const define = arr => {
-    arr.forEach(value => {
+
+  const define = (arr) => {
+    arr.forEach((value) => {
       obj[value] = true;
     });
   };
+
   isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+
   return obj;
 };
+
 const noop = () => {};
+
 const toFiniteNumber = (value, defaultValue) => {
-  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
+  return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
 };
 
 /**
@@ -124360,7 +156928,12 @@ const toFiniteNumber = (value, defaultValue) => {
  * @returns {boolean}
  */
 function isSpecCompliantForm(thing) {
-  return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
+  return !!(
+    thing &&
+    isFunction(thing.append) &&
+    thing[toStringTag] === 'FormData' &&
+    thing[iterator]
+  );
 }
 
 /**
@@ -124369,9 +156942,10 @@ function isSpecCompliantForm(thing) {
  * @param {Object} obj - The object to convert.
  * @returns {Object} The JSON-compatible object.
  */
-const toJSONObject = obj => {
+const toJSONObject = (obj) => {
   const visited = new WeakSet();
-  const visit = source => {
+
+  const visit = (source) => {
     if (isObject(source)) {
       if (visited.has(source)) {
         return;
@@ -124381,20 +156955,26 @@ const toJSONObject = obj => {
       if (isBuffer(source)) {
         return source;
       }
+
       if (!('toJSON' in source)) {
         // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
         visited.add(source);
         const target = isArray(source) ? [] : {};
+
         forEach(source, (value, key) => {
           const reducedValue = visit(value);
           !isUndefined(reducedValue) && (target[key] = reducedValue);
         });
+
         visited.delete(source);
+
         return target;
       }
     }
+
     return source;
   };
+
   return visit(obj);
 };
 
@@ -124412,7 +156992,11 @@ const isAsyncFn = kindOfTest('AsyncFunction');
  * @param {*} thing - The value to test.
  * @returns {boolean} True if value is thenable, otherwise false.
  */
-const isThenable = thing => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
+const isThenable = (thing) =>
+  thing &&
+  (isObject(thing) || isFunction(thing)) &&
+  isFunction(thing.then) &&
+  isFunction(thing.catch);
 
 // original code
 // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
@@ -124429,21 +157013,26 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
   if (setImmediateSupported) {
     return setImmediate;
   }
-  return postMessageSupported ? ((token, callbacks) => {
-    _global.addEventListener('message', ({
-      source,
-      data
-    }) => {
-      if (source === _global && data === token) {
-        callbacks.length && callbacks.shift()();
-      }
-    }, false);
-    return cb => {
-      callbacks.push(cb);
-      _global.postMessage(token, '*');
-    };
-  })(`axios@${Math.random()}`, []) : cb => setTimeout(cb);
-})(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
+
+  return postMessageSupported
+    ? ((token, callbacks) => {
+        _global.addEventListener(
+          'message',
+          ({ source, data }) => {
+            if (source === _global && data === token) {
+              callbacks.length && callbacks.shift()();
+            }
+          },
+          false
+        );
+
+        return (cb) => {
+          callbacks.push(cb);
+          _global.postMessage(token, '*');
+        };
+      })(`axios@${Math.random()}`, [])
+    : (cb) => setTimeout(cb);
+})(typeof setImmediate === 'function', isFunction(_global.postMessage));
 
 /**
  * Schedules a microtask or asynchronous callback as soon as possible.
@@ -124451,11 +157040,14 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
  *
  * @type {Function}
  */
-const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate;
+const asap =
+  typeof queueMicrotask !== 'undefined'
+    ? queueMicrotask.bind(_global)
+    : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
 
 // *********************
 
-const isIterable = thing => thing != null && isFunction$1(thing[iterator]);
+const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
 
 /**
  * Determine if a value is iterable via an iterator that is NOT sourced solely
@@ -124468,8 +157060,10 @@ const isIterable = thing => thing != null && isFunction$1(thing[iterator]);
  *
  * @returns {boolean} True if value has a non-polluted iterator
  */
-const isSafeIterable = thing => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
-var utils$1 = {
+const isSafeIterable = (thing) =>
+  thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
+
+/* harmony default export */ const utils = ({
   isArray,
   isArrayBuffer,
   isBuffer,
@@ -124492,7 +157086,7 @@ var utils$1 = {
   isReactNative,
   isBlob,
   isRegExp,
-  isFunction: isFunction$1,
+  isFunction,
   isStream,
   isURLSearchParams,
   isTypedArray,
@@ -124511,9 +157105,8 @@ var utils$1 = {
   forEachEntry,
   matchAll,
   isHTMLForm,
-  hasOwnProperty,
-  hasOwnProp: hasOwnProperty,
-  // an alias to avoid ESLint no-prototype-builtins detection
+  hasOwnProperty: utils_hasOwnProperty,
+  hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
   hasOwnInPrototypeChain,
   getSafeProp,
   reduceDescriptors,
@@ -124532,12 +157125,35 @@ var utils$1 = {
   setImmediate: _setImmediate,
   asap,
   isIterable,
-  isSafeIterable
-};
+  isSafeIterable,
+});
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseHeaders.js
+
+
+
 
 // RawAxiosHeaders whose duplicates are ignored by node
 // c.f. https://nodejs.org/api/http.html#http_message_headers
-const ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']);
+const ignoreDuplicateOf = utils.toObjectSet([
+  'age',
+  'authorization',
+  'content-length',
+  'content-type',
+  'etag',
+  'expires',
+  'from',
+  'host',
+  'if-modified-since',
+  'if-unmodified-since',
+  'last-modified',
+  'location',
+  'max-forwards',
+  'proxy-authorization',
+  'referer',
+  'retry-after',
+  'user-agent',
+]);
 
 /**
  * Parse headers into an object
@@ -124553,48 +157169,65 @@ const ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-
  *
  * @returns {Object} Headers parsed into an object
  */
-var parseHeaders = rawHeaders => {
+/* harmony default export */ const parseHeaders = ((rawHeaders) => {
   const parsed = {};
   let key;
   let val;
   let i;
-  rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
-    i = line.indexOf(':');
-    key = line.substring(0, i).trim().toLowerCase();
-    val = line.substring(i + 1).trim();
-    if (!key || parsed[key] && ignoreDuplicateOf[key]) {
-      return;
-    }
-    if (key === 'set-cookie') {
-      if (parsed[key]) {
-        parsed[key].push(val);
+
+  rawHeaders &&
+    rawHeaders.split('\n').forEach(function parser(line) {
+      i = line.indexOf(':');
+      key = line.substring(0, i).trim().toLowerCase();
+      val = line.substring(i + 1).trim();
+
+      if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
+        return;
+      }
+
+      if (key === 'set-cookie') {
+        if (parsed[key]) {
+          parsed[key].push(val);
+        } else {
+          parsed[key] = [val];
+        }
       } else {
-        parsed[key] = [val];
+        parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
       }
-    } else {
-      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
-    }
-  });
+    });
+
   return parsed;
-};
+});
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/sanitizeHeaderValue.js
+
+
+
 
 function trimSPorHTAB(str) {
   let start = 0;
   let end = str.length;
+
   while (start < end) {
     const code = str.charCodeAt(start);
+
     if (code !== 0x09 && code !== 0x20) {
       break;
     }
+
     start += 1;
   }
+
   while (end > start) {
     const code = str.charCodeAt(end - 1);
+
     if (code !== 0x09 && code !== 0x20) {
       break;
     }
+
     end -= 1;
   }
+
   return start === 0 && end === str.length ? str : str.slice(start, end);
 }
 
@@ -124603,65 +157236,99 @@ function trimSPorHTAB(str) {
 const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
 // eslint-disable-next-line no-control-regex
 const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
+
 function sanitizeValue(value, invalidChars) {
-  if (utils$1.isArray(value)) {
-    return value.map(item => sanitizeValue(item, invalidChars));
+  if (utils.isArray(value)) {
+    return value.map((item) => sanitizeValue(item, invalidChars));
   }
+
   return trimSPorHTAB(String(value).replace(invalidChars, ''));
 }
-const sanitizeHeaderValue = value => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
-const sanitizeByteStringHeaderValue = value => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
+
+const sanitizeHeaderValue = (value) =>
+  sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
+
+const sanitizeByteStringHeaderValue = (value) =>
+  sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
+
 function toByteStringHeaderObject(headers) {
   const byteStringHeaders = Object.create(null);
-  utils$1.forEach(headers.toJSON(), (value, header) => {
+
+  utils.forEach(headers.toJSON(), (value, header) => {
     byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
   });
+
   return byteStringHeaders;
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/AxiosHeaders.js
+
+
+
+
+
+
 const $internals = Symbol('internals');
+
 function normalizeHeader(header) {
   return header && String(header).trim().toLowerCase();
 }
+
 function normalizeValue(value) {
   if (value === false || value == null) {
     return value;
   }
-  return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
+
+  return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
 }
+
 function parseTokens(str) {
   const tokens = Object.create(null);
   const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
   let match;
-  while (match = tokensRE.exec(str)) {
+
+  while ((match = tokensRE.exec(str))) {
     tokens[match[1]] = match[2];
   }
+
   return tokens;
 }
-const isValidHeaderName = str => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+
+const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+
 function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
-  if (utils$1.isFunction(filter)) {
+  if (utils.isFunction(filter)) {
     return filter.call(this, value, header);
   }
+
   if (isHeaderNameFilter) {
     value = header;
   }
-  if (!utils$1.isString(value)) return;
-  if (utils$1.isString(filter)) {
+
+  if (!utils.isString(value)) return;
+
+  if (utils.isString(filter)) {
     return value.indexOf(filter) !== -1;
   }
-  if (utils$1.isRegExp(filter)) {
+
+  if (utils.isRegExp(filter)) {
     return filter.test(value);
   }
 }
+
 function formatHeader(header) {
-  return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
-    return char.toUpperCase() + str;
-  });
+  return header
+    .trim()
+    .toLowerCase()
+    .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
+      return char.toUpperCase() + str;
+    });
 }
+
 function buildAccessors(obj, header) {
-  const accessorName = utils$1.toCamelCase(' ' + header);
-  ['get', 'set', 'has'].forEach(methodName => {
+  const accessorName = utils.toCamelCase(' ' + header);
+
+  ['get', 'set', 'has'].forEach((methodName) => {
     Object.defineProperty(obj, methodName + accessorName, {
       // Null-proto descriptor so a polluted Object.prototype.get cannot turn
       // this data descriptor into an accessor descriptor on the way in.
@@ -124669,107 +157336,150 @@ function buildAccessors(obj, header) {
       value: function (arg1, arg2, arg3) {
         return this[methodName].call(this, header, arg1, arg2, arg3);
       },
-      configurable: true
+      configurable: true,
     });
   });
 }
+
 class AxiosHeaders {
   constructor(headers) {
     headers && this.set(headers);
   }
+
   set(header, valueOrRewrite, rewrite) {
     const self = this;
+
     function setHeader(_value, _header, _rewrite) {
       const lHeader = normalizeHeader(_header);
+
       if (!lHeader) {
         return;
       }
-      const key = utils$1.findKey(self, lHeader);
-      if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
+
+      const key = utils.findKey(self, lHeader);
+
+      if (
+        !key ||
+        self[key] === undefined ||
+        _rewrite === true ||
+        (_rewrite === undefined && self[key] !== false)
+      ) {
         self[key || _header] = normalizeValue(_value);
       }
     }
-    const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
-    if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
+
+    const setHeaders = (headers, _rewrite) =>
+      utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
+
+    if (utils.isPlainObject(header) || header instanceof this.constructor) {
       setHeaders(header, valueOrRewrite);
-    } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+    } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
       setHeaders(parseHeaders(header), valueOrRewrite);
-    } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) {
+    } else if (utils.isObject(header) && utils.isSafeIterable(header)) {
       let obj = Object.create(null),
         dest,
         key;
       for (const entry of header) {
-        if (!utils$1.isArray(entry)) {
+        if (!utils.isArray(entry)) {
           throw new TypeError('Object iterator must return a key-value pair');
         }
+
         key = entry[0];
-        if (utils$1.hasOwnProp(obj, key)) {
+
+        if (utils.hasOwnProp(obj, key)) {
           dest = obj[key];
-          obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
+          obj[key] = utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
         } else {
           obj[key] = entry[1];
         }
       }
+
       setHeaders(obj, valueOrRewrite);
     } else {
       header != null && setHeader(valueOrRewrite, header, rewrite);
     }
+
     return this;
   }
+
   get(header, parser) {
     header = normalizeHeader(header);
+
     if (header) {
-      const key = utils$1.findKey(this, header);
+      const key = utils.findKey(this, header);
+
       if (key) {
         const value = this[key];
+
         if (!parser) {
           return value;
         }
+
         if (parser === true) {
           return parseTokens(value);
         }
-        if (utils$1.isFunction(parser)) {
+
+        if (utils.isFunction(parser)) {
           return parser.call(this, value, key);
         }
-        if (utils$1.isRegExp(parser)) {
+
+        if (utils.isRegExp(parser)) {
           return parser.exec(value);
         }
+
         throw new TypeError('parser must be boolean|regexp|function');
       }
     }
   }
+
   has(header, matcher) {
     header = normalizeHeader(header);
+
     if (header) {
-      const key = utils$1.findKey(this, header);
-      return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+      const key = utils.findKey(this, header);
+
+      return !!(
+        key &&
+        this[key] !== undefined &&
+        (!matcher || matchHeaderValue(this, this[key], key, matcher))
+      );
     }
+
     return false;
   }
+
   delete(header, matcher) {
     const self = this;
     let deleted = false;
+
     function deleteHeader(_header) {
       _header = normalizeHeader(_header);
+
       if (_header) {
-        const key = utils$1.findKey(self, _header);
+        const key = utils.findKey(self, _header);
+
         if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
           delete self[key];
+
           deleted = true;
         }
       }
     }
-    if (utils$1.isArray(header)) {
+
+    if (utils.isArray(header)) {
       header.forEach(deleteHeader);
     } else {
       deleteHeader(header);
     }
+
     return deleted;
   }
+
   clear(matcher) {
     const keys = Object.keys(this);
     let i = keys.length;
     let deleted = false;
+
     while (i--) {
       const key = keys[i];
       if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
@@ -124777,102 +157487,156 @@ class AxiosHeaders {
         deleted = true;
       }
     }
+
     return deleted;
   }
+
   normalize(format) {
     const self = this;
     const headers = {};
-    utils$1.forEach(this, (value, header) => {
-      const key = utils$1.findKey(headers, header);
+
+    utils.forEach(this, (value, header) => {
+      const key = utils.findKey(headers, header);
+
       if (key) {
         self[key] = normalizeValue(value);
         delete self[header];
         return;
       }
+
       const normalized = format ? formatHeader(header) : String(header).trim();
+
       if (normalized !== header) {
         delete self[header];
       }
+
       self[normalized] = normalizeValue(value);
+
       headers[normalized] = true;
     });
+
     return this;
   }
+
   concat(...targets) {
     return this.constructor.concat(this, ...targets);
   }
+
   toJSON(asStrings) {
     const obj = Object.create(null);
-    utils$1.forEach(this, (value, header) => {
-      value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+
+    utils.forEach(this, (value, header) => {
+      value != null &&
+        value !== false &&
+        (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
     });
+
     return obj;
   }
+
   [Symbol.iterator]() {
     return Object.entries(this.toJSON())[Symbol.iterator]();
   }
+
   toString() {
-    return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
+    return Object.entries(this.toJSON())
+      .map(([header, value]) => header + ': ' + value)
+      .join('\n');
   }
+
   getSetCookie() {
     return this.get('set-cookie') || [];
   }
+
   get [Symbol.toStringTag]() {
     return 'AxiosHeaders';
   }
+
   static from(thing) {
     return thing instanceof this ? thing : new this(thing);
   }
+
   static concat(first, ...targets) {
     const computed = new this(first);
-    targets.forEach(target => computed.set(target));
+
+    targets.forEach((target) => computed.set(target));
+
     return computed;
   }
+
   static accessor(header) {
-    const internals = this[$internals] = this[$internals] = {
-      accessors: {}
-    };
+    const internals =
+      (this[$internals] =
+      this[$internals] =
+        {
+          accessors: {},
+        });
+
     const accessors = internals.accessors;
     const prototype = this.prototype;
+
     function defineAccessor(_header) {
       const lHeader = normalizeHeader(_header);
+
       if (!accessors[lHeader]) {
         buildAccessors(prototype, _header);
         accessors[lHeader] = true;
       }
     }
-    utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+
+    utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+
     return this;
   }
 }
-AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
+
+AxiosHeaders.accessor([
+  'Content-Type',
+  'Content-Length',
+  'Accept',
+  'Accept-Encoding',
+  'User-Agent',
+  'Authorization',
+]);
 
 // reserved names hotfix
-utils$1.reduceDescriptors(AxiosHeaders.prototype, ({
-  value
-}, key) => {
+utils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
   let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
   return {
     get: () => value,
     set(headerValue) {
       this[mapped] = headerValue;
-    }
+    },
   };
 });
-utils$1.freezeMethods(AxiosHeaders);
+
+utils.freezeMethods(AxiosHeaders);
+
+/* harmony default export */ const core_AxiosHeaders = (AxiosHeaders);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/AxiosError.js
+
+
+
+
 
 const REDACTED = '[REDACTED ****]';
+
 function hasOwnOrPrototypeToJSON(source) {
-  if (utils$1.hasOwnProp(source, 'toJSON')) {
+  if (utils.hasOwnProp(source, 'toJSON')) {
     return true;
   }
+
   let prototype = Object.getPrototypeOf(source);
+
   while (prototype && prototype !== Object.prototype) {
-    if (utils$1.hasOwnProp(prototype, 'toJSON')) {
+    if (utils.hasOwnProp(prototype, 'toJSON')) {
       return true;
     }
+
     prototype = Object.getPrototypeOf(prototype);
   }
+
   return false;
 }
 
@@ -124880,43 +157644,51 @@ function hasOwnOrPrototypeToJSON(source) {
 // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
 // and AxiosHeaders, and short-circuits on circular references.
 function redactConfig(config, redactKeys) {
-  const lowerKeys = new Set(redactKeys.map(k => String(k).toLowerCase()));
+  const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
   const seen = [];
-  const visit = source => {
+
+  const visit = (source) => {
     if (source === null || typeof source !== 'object') return source;
-    if (utils$1.isBuffer(source)) return source;
+    if (utils.isBuffer(source)) return source;
     if (seen.indexOf(source) !== -1) return undefined;
-    if (source instanceof AxiosHeaders) {
+
+    if (source instanceof core_AxiosHeaders) {
       source = source.toJSON();
     }
+
     seen.push(source);
+
     let result;
-    if (utils$1.isArray(source)) {
+    if (utils.isArray(source)) {
       result = [];
       source.forEach((v, i) => {
         const reducedValue = visit(v);
-        if (!utils$1.isUndefined(reducedValue)) {
+        if (!utils.isUndefined(reducedValue)) {
           result[i] = reducedValue;
         }
       });
     } else {
-      if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
+      if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
         seen.pop();
         return source;
       }
+
       result = Object.create(null);
       for (const [key, value] of Object.entries(source)) {
         const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
-        if (!utils$1.isUndefined(reducedValue)) {
+        if (!utils.isUndefined(reducedValue)) {
           result[key] = reducedValue;
         }
       }
     }
+
     seen.pop();
     return result;
   };
+
   return visit(config);
 }
+
 class AxiosError extends Error {
   static from(error, code, config, request, response, customProps) {
     const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
@@ -124927,6 +157699,7 @@ class AxiosError extends Error {
     if (error.status != null && axiosError.status == null) {
       axiosError.status = error.status;
     }
+
     customProps && Object.assign(axiosError, customProps);
     return axiosError;
   }
@@ -124955,8 +157728,9 @@ class AxiosError extends Error {
       value: message,
       enumerable: true,
       writable: true,
-      configurable: true
+      configurable: true,
     });
+
     this.name = 'AxiosError';
     this.isAxiosError = true;
     code && (this.code = code);
@@ -124967,14 +157741,19 @@ class AxiosError extends Error {
       this.status = response.status;
     }
   }
+
   toJSON() {
     // Opt-in redaction: when the request config carries a `redact` array, the
     // value of any matching key (case-insensitive, at any depth) is replaced
     // with REDACTED in the serialized snapshot. Undefined or empty leaves the
     // existing serialization behavior unchanged.
     const config = this.config;
-    const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
-    const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config);
+    const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined;
+    const serializedConfig =
+      utils.isArray(redactKeys) && redactKeys.length > 0
+        ? redactConfig(config, redactKeys)
+        : utils.toJSONObject(config);
+
     return {
       // Standard
       message: this.message,
@@ -124990,7 +157769,7 @@ class AxiosError extends Error {
       // Axios
       config: serializedConfig,
       code: this.code,
-      status: this.status
+      status: this.status,
     };
   }
 }
@@ -125011,6 +157790,23 @@ AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
 AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
 AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
 
+/* harmony default export */ const core_AxiosError = (AxiosError);
+
+// EXTERNAL MODULE: ./node_modules/form-data/lib/form_data.js
+var form_data = __nccwpck_require__(96454);
+;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/node/classes/FormData.js
+
+
+/* harmony default export */ const classes_FormData = (form_data);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/toFormData.js
+
+
+
+
+// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
+
+
 // Default nesting limit shared with the inverse transform (formDataToJSON) so
 // the FormData <-> JSON round-trip stays symmetric.
 const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
@@ -125023,7 +157819,7 @@ const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
  * @returns {boolean}
  */
 function isVisitable(thing) {
-  return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+  return utils.isPlainObject(thing) || utils.isArray(thing);
 }
 
 /**
@@ -125034,7 +157830,7 @@ function isVisitable(thing) {
  * @returns {string} the key without the brackets.
  */
 function removeBrackets(key) {
-  return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+  return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
 }
 
 /**
@@ -125048,11 +157844,14 @@ function removeBrackets(key) {
  */
 function renderKey(path, key, dots) {
   if (!path) return key;
-  return path.concat(key).map(function each(token, i) {
-    // eslint-disable-next-line no-param-reassign
-    token = removeBrackets(token);
-    return !dots && i ? '[' + token + ']' : token;
-  }).join(dots ? '.' : '');
+  return path
+    .concat(key)
+    .map(function each(token, i) {
+      // eslint-disable-next-line no-param-reassign
+      token = removeBrackets(token);
+      return !dots && i ? '[' + token + ']' : token;
+    })
+    .join(dots ? '.' : '');
 }
 
 /**
@@ -125063,9 +157862,10 @@ function renderKey(path, key, dots) {
  * @returns {boolean}
  */
 function isFlatArray(arr) {
-  return utils$1.isArray(arr) && !arr.some(isVisitable);
+  return utils.isArray(arr) && !arr.some(isVisitable);
 }
-const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
+
+const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
   return /^is[A-Z]/.test(prop);
 });
 
@@ -125093,69 +157893,92 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
  * @returns
  */
 function toFormData(obj, formData, options) {
-  if (!utils$1.isObject(obj)) {
+  if (!utils.isObject(obj)) {
     throw new TypeError('target must be an object');
   }
 
   // eslint-disable-next-line no-param-reassign
-  formData = formData || new (FormData$1 || FormData)();
+  formData = formData || new (classes_FormData || FormData)();
 
   // eslint-disable-next-line no-param-reassign
-  options = utils$1.toFlatObject(options, {
-    metaTokens: true,
-    dots: false,
-    indexes: false
-  }, false, function defined(option, source) {
-    // eslint-disable-next-line no-eq-null,eqeqeq
-    return !utils$1.isUndefined(source[option]);
-  });
+  options = utils.toFlatObject(
+    options,
+    {
+      metaTokens: true,
+      dots: false,
+      indexes: false,
+    },
+    false,
+    function defined(option, source) {
+      // eslint-disable-next-line no-eq-null,eqeqeq
+      return !utils.isUndefined(source[option]);
+    }
+  );
+
   const metaTokens = options.metaTokens;
   // eslint-disable-next-line no-use-before-define
   const visitor = options.visitor || defaultVisitor;
   const dots = options.dots;
   const indexes = options.indexes;
-  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+  const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
   const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
-  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
+  const useBlob = _Blob && utils.isSpecCompliantForm(formData);
   const stack = [];
-  if (!utils$1.isFunction(visitor)) {
+
+  if (!utils.isFunction(visitor)) {
     throw new TypeError('visitor must be a function');
   }
+
   function convertValue(value) {
     if (value === null) return '';
-    if (utils$1.isDate(value)) {
+
+    if (utils.isDate(value)) {
       return value.toISOString();
     }
-    if (utils$1.isBoolean(value)) {
+
+    if (utils.isBoolean(value)) {
       return value.toString();
     }
-    if (!useBlob && utils$1.isBlob(value)) {
-      throw new AxiosError('Blob is not supported. Use a Buffer instead.');
+
+    if (!useBlob && utils.isBlob(value)) {
+      throw new core_AxiosError('Blob is not supported. Use a Buffer instead.');
     }
-    if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
+
+    if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
       return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
     }
+
     return value;
   }
+
   function throwIfMaxDepthExceeded(depth) {
     if (depth > maxDepth) {
-      throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
+      throw new core_AxiosError(
+        'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
+        core_AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
+      );
     }
   }
+
   function stringifyWithDepthLimit(value, depth) {
     if (maxDepth === Infinity) {
       return JSON.stringify(value);
     }
+
     const ancestors = [];
+
     return JSON.stringify(value, function limitDepth(_key, currentValue) {
-      if (!utils$1.isObject(currentValue)) {
+      if (!utils.isObject(currentValue)) {
         return currentValue;
       }
+
       while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
         ancestors.pop();
       }
+
       ancestors.push(currentValue);
       throwIfMaxDepthExceeded(depth + ancestors.length - 1);
+
       return currentValue;
     });
   }
@@ -125172,60 +157995,96 @@ function toFormData(obj, formData, options) {
    */
   function defaultVisitor(value, key, path) {
     let arr = value;
-    if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
+
+    if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) {
       formData.append(renderKey(path, key, dots), convertValue(value));
       return false;
     }
+
     if (value && !path && typeof value === 'object') {
-      if (utils$1.endsWith(key, '{}')) {
+      if (utils.endsWith(key, '{}')) {
         // eslint-disable-next-line no-param-reassign
         key = metaTokens ? key : key.slice(0, -2);
         // eslint-disable-next-line no-param-reassign
         value = stringifyWithDepthLimit(value, 1);
-      } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) {
+      } else if (
+        (utils.isArray(value) && isFlatArray(value)) ||
+        ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))
+      ) {
         // eslint-disable-next-line no-param-reassign
         key = removeBrackets(key);
+
         arr.forEach(function each(el, index) {
-          !(utils$1.isUndefined(el) || el === null) && formData.append(
-          // eslint-disable-next-line no-nested-ternary
-          indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
+          !(utils.isUndefined(el) || el === null) &&
+            formData.append(
+              // eslint-disable-next-line no-nested-ternary
+              indexes === true
+                ? renderKey([key], index, dots)
+                : indexes === null
+                  ? key
+                  : key + '[]',
+              convertValue(el)
+            );
         });
         return false;
       }
     }
+
     if (isVisitable(value)) {
       return true;
     }
+
     formData.append(renderKey(path, key, dots), convertValue(value));
+
     return false;
   }
+
   const exposedHelpers = Object.assign(predicates, {
     defaultVisitor,
     convertValue,
-    isVisitable
+    isVisitable,
   });
+
   function build(value, path, depth = 0) {
-    if (utils$1.isUndefined(value)) return;
+    if (utils.isUndefined(value)) return;
+
     throwIfMaxDepthExceeded(depth);
+
     if (stack.indexOf(value) !== -1) {
       throw new Error('Circular reference detected in ' + path.join('.'));
     }
+
     stack.push(value);
-    utils$1.forEach(value, function each(el, key) {
-      const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
+
+    utils.forEach(value, function each(el, key) {
+      const result =
+        !(utils.isUndefined(el) || el === null) &&
+        visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers);
+
       if (result === true) {
         build(el, path ? path.concat(key) : [key], depth + 1);
       }
     });
+
     stack.pop();
   }
-  if (!utils$1.isObject(obj)) {
+
+  if (!utils.isObject(obj)) {
     throw new TypeError('data must be an object');
   }
+
   build(obj);
+
   return formData;
 }
 
+/* harmony default export */ const helpers_toFormData = (toFormData);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js
+
+
+
+
 /**
  * It encodes a string by replacing all characters that are not in the unreserved set with
  * their percent-encoded equivalents
@@ -125234,14 +158093,14 @@ function toFormData(obj, formData, options) {
  *
  * @returns {string} The encoded string.
  */
-function encode$1(str) {
+function encode(str) {
   const charMap = {
     '!': '%21',
     "'": '%27',
     '(': '%28',
     ')': '%29',
     '~': '%7E',
-    '%20': '+'
+    '%20': '+',
   };
   return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
     return charMap[match];
@@ -125258,21 +158117,38 @@ function encode$1(str) {
  */
 function AxiosURLSearchParams(params, options) {
   this._pairs = [];
-  params && toFormData(params, this, options);
+
+  params && helpers_toFormData(params, this, options);
 }
-const prototype = AxiosURLSearchParams.prototype;
-prototype.append = function append(name, value) {
+
+const AxiosURLSearchParams_prototype = AxiosURLSearchParams.prototype;
+
+AxiosURLSearchParams_prototype.append = function append(name, value) {
   this._pairs.push([name, value]);
 };
-prototype.toString = function toString(encoder) {
-  const _encode = encoder ? function (value) {
-    return encoder.call(this, value, encode$1);
-  } : encode$1;
-  return this._pairs.map(function each(pair) {
-    return _encode(pair[0]) + '=' + _encode(pair[1]);
-  }, '').join('&');
+
+AxiosURLSearchParams_prototype.toString = function toString(encoder) {
+  const _encode = encoder
+    ? function (value) {
+        return encoder.call(this, value, encode);
+      }
+    : encode;
+
+  return this._pairs
+    .map(function each(pair) {
+      return _encode(pair[0]) + '=' + _encode(pair[1]);
+    }, '')
+    .join('&');
 };
 
+/* harmony default export */ const helpers_AxiosURLSearchParams = (AxiosURLSearchParams);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/buildURL.js
+
+
+
+
+
 /**
  * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
  * their plain counterparts (`:`, `$`, `,`, `+`).
@@ -125281,8 +158157,12 @@ prototype.toString = function toString(encoder) {
  *
  * @returns {string} The encoded value.
  */
-function encode(val) {
-  return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+');
+function buildURL_encode(val) {
+  return encodeURIComponent(val)
+    .replace(/%3A/gi, ':')
+    .replace(/%24/g, '$')
+    .replace(/%2C/gi, ',')
+    .replace(/%20/g, '+');
 }
 
 /**
@@ -125298,31 +158178,46 @@ function buildURL(url, params, options) {
   if (!params) {
     return url;
   }
-  const _options = utils$1.isFunction(options) ? {
-    serialize: options
-  } : options;
+
+  const _options = utils.isFunction(options)
+    ? {
+        serialize: options,
+      }
+    : options;
 
   // Read serializer options pollution-safely: own properties and methods on a
   // class/template prototype are honored, but values injected onto a polluted
   // Object.prototype are ignored.
-  const _encode = utils$1.getSafeProp(_options, 'encode') || encode;
-  const serializeFn = utils$1.getSafeProp(_options, 'serialize');
+  const _encode = utils.getSafeProp(_options, 'encode') || buildURL_encode;
+  const serializeFn = utils.getSafeProp(_options, 'serialize');
+
   let serializedParams;
+
   if (serializeFn) {
     serializedParams = serializeFn(params, _options);
   } else {
-    serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
+    serializedParams = utils.isURLSearchParams(params)
+      ? params.toString()
+      : new helpers_AxiosURLSearchParams(params, _options).toString(_encode);
   }
+
   if (serializedParams) {
     const hashmarkIndex = url.indexOf('#');
+
     if (hashmarkIndex !== -1) {
       url = url.slice(0, hashmarkIndex);
     }
     url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
   }
+
   return url;
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/InterceptorManager.js
+
+
+
+
 class InterceptorManager {
   constructor() {
     this.handlers = [];
@@ -125342,7 +158237,7 @@ class InterceptorManager {
       fulfilled,
       rejected,
       synchronous: options ? options.synchronous : false,
-      runWhen: options ? options.runWhen : null
+      runWhen: options ? options.runWhen : null,
     });
     return this.handlers.length - 1;
   }
@@ -125382,7 +158277,7 @@ class InterceptorManager {
    * @returns {void}
    */
   forEach(fn) {
-    utils$1.forEach(this.handlers, function forEachHandler(h) {
+    utils.forEach(this.handlers, function forEachHandler(h) {
       if (h !== null) {
         fn(h);
       }
@@ -125390,50 +158285,73 @@ class InterceptorManager {
   }
 }
 
-var transitionalDefaults = {
+/* harmony default export */ const core_InterceptorManager = (InterceptorManager);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/defaults/transitional.js
+
+
+/* harmony default export */ const defaults_transitional = ({
   silentJSONParsing: true,
   forcedJSONParsing: true,
   clarifyTimeoutError: false,
   legacyInterceptorReqResOrdering: true,
   advertiseZstdAcceptEncoding: false,
-  validateStatusUndefinedResolves: true
-};
+  validateStatusUndefinedResolves: true,
+});
+
+// EXTERNAL MODULE: external "crypto"
+var external_crypto_ = __nccwpck_require__(76982);
+// EXTERNAL MODULE: external "url"
+var external_url_ = __nccwpck_require__(87016);
+;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/node/classes/URLSearchParams.js
+
+
+
+/* harmony default export */ const URLSearchParams = (external_url_.URLSearchParams);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/node/index.js
+
+
 
-var URLSearchParams = url.URLSearchParams;
 
 const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
+
 const DIGIT = '0123456789';
+
 const ALPHABET = {
   DIGIT,
   ALPHA,
-  ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+  ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT,
 };
+
 const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
   let str = '';
-  const {
-    length
-  } = alphabet;
+  const { length } = alphabet;
   const randomValues = new Uint32Array(size);
-  crypto.randomFillSync(randomValues);
+  external_crypto_.randomFillSync(randomValues);
   for (let i = 0; i < size; i++) {
     str += alphabet[randomValues[i] % length];
   }
+
   return str;
 };
-var platform$1 = {
+
+/* harmony default export */ const node = ({
   isNode: true,
   classes: {
-    URLSearchParams,
-    FormData: FormData$1,
-    Blob: typeof Blob !== 'undefined' && Blob || null
+    URLSearchParams: URLSearchParams,
+    FormData: classes_FormData,
+    Blob: (typeof Blob !== 'undefined' && Blob) || null,
   },
   ALPHABET,
   generateString,
-  protocols: ['http', 'https', 'file', 'data']
-};
+  protocols: ['http', 'https', 'file', 'data'],
+});
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/common/utils.js
 const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
-const _navigator = typeof navigator === 'object' && navigator || undefined;
+
+const _navigator = (typeof navigator === 'object' && navigator) || undefined;
 
 /**
  * Determine if we're running in a standard browser environment
@@ -125452,7 +158370,9 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
  *
  * @returns {boolean}
  */
-const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
+const hasStandardBrowserEnv =
+  hasBrowserEnv &&
+  (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
 
 /**
  * Determine if we're running in a standard browser webWorker environment
@@ -125464,43 +158384,63 @@ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', '
  * This leads to a problem when axios post `FormData` in webWorker
  */
 const hasStandardBrowserWebWorkerEnv = (() => {
-  return typeof WorkerGlobalScope !== 'undefined' &&
-  // eslint-disable-next-line no-undef
-  self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
+  return (
+    typeof WorkerGlobalScope !== 'undefined' &&
+    // eslint-disable-next-line no-undef
+    self instanceof WorkerGlobalScope &&
+    typeof self.importScripts === 'function'
+  );
 })();
-const origin = hasBrowserEnv && window.location.href || 'http://localhost';
 
-var utils = /*#__PURE__*/Object.freeze({
-  __proto__: null,
-  hasBrowserEnv: hasBrowserEnv,
-  hasStandardBrowserEnv: hasStandardBrowserEnv,
-  hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
-  navigator: _navigator,
-  origin: origin
+const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
+
+
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/index.js
+
+
+
+/* harmony default export */ const platform = ({
+  ...common_utils_namespaceObject,
+  ...node,
 });
 
-var platform = {
-  ...utils,
-  ...platform$1
-};
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/toURLEncodedForm.js
+
+
+
+
+
 
 function toURLEncodedForm(data, options) {
-  return toFormData(data, new platform.classes.URLSearchParams(), {
+  return helpers_toFormData(data, new platform.classes.URLSearchParams(), {
     visitor: function (value, key, path, helpers) {
-      if (platform.isNode && utils$1.isBuffer(value)) {
+      if (platform.isNode && utils.isBuffer(value)) {
         this.append(key, value.toString('base64'));
         return false;
       }
+
       return helpers.defaultVisitor.apply(this, arguments);
     },
-    ...options
+    ...options,
   });
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/formDataToJSON.js
+
+
+
+
+
+
 const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
+
 function throwIfDepthExceeded(index) {
   if (index > MAX_DEPTH) {
-    throw new AxiosError('FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
+    throw new core_AxiosError(
+      'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,
+      core_AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
+    );
   }
 }
 
@@ -125519,10 +158459,12 @@ function parsePropPath(name) {
   const path = [];
   const pattern = /\w+|\[(\w*)]/g;
   let match;
+
   while ((match = pattern.exec(name)) !== null) {
     throwIfDepthExceeded(path.length);
     path.push(match[0] === '[]' ? '' : match[1] || match[0]);
   }
+
   return path;
 }
 
@@ -125556,39 +158498,67 @@ function arrayToObject(arr) {
 function formDataToJSON(formData) {
   function buildPath(path, value, target, index) {
     throwIfDepthExceeded(index);
+
     let name = path[index++];
+
     if (name === '__proto__') return true;
+
     const isNumericKey = Number.isFinite(+name);
     const isLast = index >= path.length;
-    name = !name && utils$1.isArray(target) ? target.length : name;
+    name = !name && utils.isArray(target) ? target.length : name;
+
     if (isLast) {
-      if (utils$1.hasOwnProp(target, name)) {
-        target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
+      if (utils.hasOwnProp(target, name)) {
+        target[name] = utils.isArray(target[name])
+          ? target[name].concat(value)
+          : [target[name], value];
       } else {
         target[name] = value;
       }
+
       return !isNumericKey;
     }
-    if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
+
+    if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {
       target[name] = [];
     }
+
     const result = buildPath(path, value, target[name], index);
-    if (result && utils$1.isArray(target[name])) {
+
+    if (result && utils.isArray(target[name])) {
       target[name] = arrayToObject(target[name]);
     }
+
     return !isNumericKey;
   }
-  if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
+
+  if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
     const obj = {};
-    utils$1.forEachEntry(formData, (name, value) => {
+
+    utils.forEachEntry(formData, (name, value) => {
       buildPath(parsePropPath(name), value, obj, 0);
     });
+
     return obj;
   }
+
   return null;
 }
 
-const own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined;
+/* harmony default export */ const helpers_formDataToJSON = (formDataToJSON);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/defaults/index.js
+
+
+
+
+
+
+
+
+
+
+const own = (obj, key) => (obj != null && utils.hasOwnProp(obj, key) ? obj[key] : undefined);
 
 /**
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
@@ -125601,113 +158571,168 @@ const own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key]
  * @returns {string} A stringified version of the rawValue.
  */
 function stringifySafely(rawValue, parser, encoder) {
-  if (utils$1.isString(rawValue)) {
+  if (utils.isString(rawValue)) {
     try {
       (parser || JSON.parse)(rawValue);
-      return utils$1.trim(rawValue);
+      return utils.trim(rawValue);
     } catch (e) {
       if (e.name !== 'SyntaxError') {
         throw e;
       }
     }
   }
+
   return (encoder || JSON.stringify)(rawValue);
 }
+
 const defaults = {
-  transitional: transitionalDefaults,
+  transitional: defaults_transitional,
+
   adapter: ['xhr', 'http', 'fetch'],
-  transformRequest: [function transformRequest(data, headers) {
-    const contentType = headers.getContentType() || '';
-    const hasJSONContentType = contentType.indexOf('application/json') > -1;
-    const isObjectPayload = utils$1.isObject(data);
-    if (isObjectPayload && utils$1.isHTMLForm(data)) {
-      data = new FormData(data);
-    }
-    const isFormData = utils$1.isFormData(data);
-    if (isFormData) {
-      return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
-    }
-    if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
-      return data;
-    }
-    if (utils$1.isArrayBufferView(data)) {
-      return data.buffer;
-    }
-    if (utils$1.isURLSearchParams(data)) {
-      headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
-      return data.toString();
-    }
-    let isFileList;
-    if (isObjectPayload) {
-      const formSerializer = own(this, 'formSerializer');
-      if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
-        return toURLEncodedForm(data, formSerializer).toString();
+
+  transformRequest: [
+    function transformRequest(data, headers) {
+      const contentType = headers.getContentType() || '';
+      const hasJSONContentType = contentType.indexOf('application/json') > -1;
+      const isObjectPayload = utils.isObject(data);
+
+      if (isObjectPayload && utils.isHTMLForm(data)) {
+        data = new FormData(data);
       }
-      if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
-        const env = own(this, 'env');
-        const _FormData = env && env.FormData;
-        return toFormData(isFileList ? {
-          'files[]': data
-        } : data, _FormData && new _FormData(), formSerializer);
+
+      const isFormData = utils.isFormData(data);
+
+      if (isFormData) {
+        return hasJSONContentType ? JSON.stringify(helpers_formDataToJSON(data)) : data;
       }
-    }
-    if (isObjectPayload || hasJSONContentType) {
-      headers.setContentType('application/json', false);
-      return stringifySafely(data);
-    }
-    return data;
-  }],
-  transformResponse: [function transformResponse(data) {
-    const transitional = own(this, 'transitional') || defaults.transitional;
-    const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
-    const responseType = own(this, 'responseType');
-    const JSONRequested = responseType === 'json';
-    if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
+
+      if (
+        utils.isArrayBuffer(data) ||
+        utils.isBuffer(data) ||
+        utils.isStream(data) ||
+        utils.isFile(data) ||
+        utils.isBlob(data) ||
+        utils.isReadableStream(data)
+      ) {
+        return data;
+      }
+      if (utils.isArrayBufferView(data)) {
+        return data.buffer;
+      }
+      if (utils.isURLSearchParams(data)) {
+        headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+        return data.toString();
+      }
+
+      let isFileList;
+
+      if (isObjectPayload) {
+        const formSerializer = own(this, 'formSerializer');
+        if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+          return toURLEncodedForm(data, formSerializer).toString();
+        }
+
+        if (
+          (isFileList = utils.isFileList(data)) ||
+          contentType.indexOf('multipart/form-data') > -1
+        ) {
+          const env = own(this, 'env');
+          const _FormData = env && env.FormData;
+
+          return helpers_toFormData(
+            isFileList ? { 'files[]': data } : data,
+            _FormData && new _FormData(),
+            formSerializer
+          );
+        }
+      }
+
+      if (isObjectPayload || hasJSONContentType) {
+        headers.setContentType('application/json', false);
+        return stringifySafely(data);
+      }
+
       return data;
-    }
-    if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
-      const silentJSONParsing = transitional && transitional.silentJSONParsing;
-      const strictJSONParsing = !silentJSONParsing && JSONRequested;
-      try {
-        return JSON.parse(data, own(this, 'parseReviver'));
-      } catch (e) {
-        if (strictJSONParsing) {
-          if (e.name === 'SyntaxError') {
-            throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
+    },
+  ],
+
+  transformResponse: [
+    function transformResponse(data) {
+      const transitional = own(this, 'transitional') || defaults.transitional;
+      const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+      const responseType = own(this, 'responseType');
+      const JSONRequested = responseType === 'json';
+
+      if (utils.isResponse(data) || utils.isReadableStream(data)) {
+        return data;
+      }
+
+      if (
+        data &&
+        utils.isString(data) &&
+        ((forcedJSONParsing && !responseType) || JSONRequested)
+      ) {
+        const silentJSONParsing = transitional && transitional.silentJSONParsing;
+        const strictJSONParsing = !silentJSONParsing && JSONRequested;
+
+        try {
+          return JSON.parse(data, own(this, 'parseReviver'));
+        } catch (e) {
+          if (strictJSONParsing) {
+            if (e.name === 'SyntaxError') {
+              throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
+            }
+            throw e;
           }
-          throw e;
         }
       }
-    }
-    return data;
-  }],
+
+      return data;
+    },
+  ],
+
   /**
    * A timeout in milliseconds to abort a request. If set to 0 (default) a
    * timeout is not created.
    */
   timeout: 0,
+
   xsrfCookieName: 'XSRF-TOKEN',
   xsrfHeaderName: 'X-XSRF-TOKEN',
+
   maxContentLength: -1,
   maxBodyLength: -1,
+
   env: {
     FormData: platform.classes.FormData,
-    Blob: platform.classes.Blob
+    Blob: platform.classes.Blob,
   },
+
   validateStatus: function validateStatus(status) {
     return status >= 200 && status < 300;
   },
+
   headers: {
     common: {
       Accept: 'application/json, text/plain, */*',
-      'Content-Type': undefined
-    }
-  }
+      'Content-Type': undefined,
+    },
+  },
 };
-utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], method => {
+
+utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
   defaults.headers[method] = {};
 });
 
+/* harmony default export */ const lib_defaults = (defaults);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/transformData.js
+
+
+
+
+
+
 /**
  * Transform the data for a request or a response
  *
@@ -125717,22 +158742,33 @@ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], meth
  * @returns {*} The resulting transformed data
  */
 function transformData(fns, response) {
-  const config = this || defaults;
+  const config = this || lib_defaults;
   const context = response || config;
-  const headers = AxiosHeaders.from(context.headers);
+  const headers = core_AxiosHeaders.from(context.headers);
   let data = context.data;
-  utils$1.forEach(fns, function transform(fn) {
+
+  utils.forEach(fns, function transform(fn) {
     data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
   });
+
   headers.normalize();
+
   return data;
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/cancel/isCancel.js
+
+
 function isCancel(value) {
   return !!(value && value.__CANCEL__);
 }
 
-class CanceledError extends AxiosError {
+;// CONCATENATED MODULE: ./node_modules/axios/lib/cancel/CanceledError.js
+
+
+
+
+class CanceledError extends core_AxiosError {
   /**
    * A `CanceledError` is an object that is thrown when an operation is canceled.
    *
@@ -125743,12 +158779,19 @@ class CanceledError extends AxiosError {
    * @returns {CanceledError} The created error.
    */
   constructor(message, config, request) {
-    super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
+    super(message == null ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request);
     this.name = 'CanceledError';
     this.__CANCEL__ = true;
   }
 }
 
+/* harmony default export */ const cancel_CanceledError = (CanceledError);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/settle.js
+
+
+
+
 /**
  * Resolve or reject a Promise based on response status.
  *
@@ -125763,10 +158806,19 @@ function settle(resolve, reject, response) {
   if (!response.status || !validateStatus || validateStatus(response.status)) {
     resolve(response);
   } else {
-    reject(new AxiosError('Request failed with status code ' + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response));
+    reject(new core_AxiosError(
+      'Request failed with status code ' + response.status,
+      response.status >= 400 && response.status < 500 ? core_AxiosError.ERR_BAD_REQUEST : core_AxiosError.ERR_BAD_RESPONSE,
+      response.config,
+      response.request,
+      response
+    ));
   }
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/isAbsoluteURL.js
+
+
 /**
  * Determines whether the specified URL is absolute
  *
@@ -125781,9 +158833,13 @@ function isAbsoluteURL(url) {
   if (typeof url !== 'string') {
     return false;
   }
+
   return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/combineURLs.js
+
+
 /**
  * Creates a new URL by combining the specified URLs
  *
@@ -125793,11 +158849,21 @@ function isAbsoluteURL(url) {
  * @returns {string} The combined URL
  */
 function combineURLs(baseURL, relativeURL) {
-  return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
+  return relativeURL
+    ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+    : baseURL;
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/buildFullPath.js
+
+
+
+
+
+
 const malformedHttpProtocol = /^https?:(?!\/\/)/i;
 const httpProtocolControlCharacters = /[\t\n\r]/g;
+
 function stripLeadingC0ControlOrSpace(url) {
   let i = 0;
   while (i < url.length && url.charCodeAt(i) <= 0x20) {
@@ -125805,12 +158871,18 @@ function stripLeadingC0ControlOrSpace(url) {
   }
   return url.slice(i);
 }
+
 function normalizeURLForProtocolCheck(url) {
   return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');
 }
+
 function assertValidHttpProtocolURL(url, config) {
   if (typeof url === 'string' && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) {
-    throw new AxiosError('Invalid URL: missing "//" after protocol', AxiosError.ERR_INVALID_URL, config);
+    throw new core_AxiosError(
+      'Invalid URL: missing "//" after protocol',
+      core_AxiosError.ERR_INVALID_URL,
+      config
+    );
   }
 }
 
@@ -125834,14 +158906,18 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
   return requestedURL;
 }
 
-var DEFAULT_PORTS$1 = {
+;// CONCATENATED MODULE: ./node_modules/proxy-from-env/index.js
+
+
+var DEFAULT_PORTS = {
   ftp: 21,
   gopher: 70,
   http: 80,
   https: 443,
   ws: 80,
-  wss: 443
+  wss: 443,
 };
+
 function parseUrl(urlString) {
   try {
     return new URL(urlString);
@@ -125862,16 +158938,18 @@ function getProxyForUrl(url) {
   var hostname = parsedUrl.host;
   var port = parsedUrl.port;
   if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
-    return ''; // Don't proxy URLs without a valid scheme or host.
+    return '';  // Don't proxy URLs without a valid scheme or host.
   }
+
   proto = proto.split(':', 1)[0];
   // Stripping ports in this way instead of using parsedUrl.hostname to make
   // sure that the brackets around IPv6 addresses are kept.
   hostname = hostname.replace(/:\d*$/, '');
-  port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0;
+  port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
   if (!shouldProxy(hostname, port)) {
-    return ''; // Don't proxy URLs that match NO_PROXY.
+    return '';  // Don't proxy URLs that match NO_PROXY.
   }
+
   var proxy = getEnv(proto + '_proxy') || getEnv('all_proxy');
   if (proxy && proxy.indexOf('://') === -1) {
     // Missing scheme in proxy, default to the requested URL's scheme.
@@ -125891,25 +158969,28 @@ function getProxyForUrl(url) {
 function shouldProxy(hostname, port) {
   var NO_PROXY = getEnv('no_proxy').toLowerCase();
   if (!NO_PROXY) {
-    return true; // Always proxy if NO_PROXY is not set.
+    return true;  // Always proxy if NO_PROXY is not set.
   }
   if (NO_PROXY === '*') {
-    return false; // Never proxy if wildcard is set.
+    return false;  // Never proxy if wildcard is set.
   }
-  return NO_PROXY.split(/[,\s]/).every(function (proxy) {
+
+  return NO_PROXY.split(/[,\s]/).every(function(proxy) {
     if (!proxy) {
-      return true; // Skip zero-length hosts.
+      return true;  // Skip zero-length hosts.
     }
     var parsedProxy = proxy.match(/^(.+):(\d+)$/);
     var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
     var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
     if (parsedProxyPort && parsedProxyPort !== port) {
-      return true; // Skip if ports don't match.
+      return true;  // Skip if ports don't match.
     }
+
     if (!/^[.*]/.test(parsedProxyHostname)) {
       // No wildcards, so stop proxying if there is an exact match.
       return hostname !== parsedProxyHostname;
     }
+
     if (parsedProxyHostname.charAt(0) === '*') {
       // Remove leading wildcard.
       parsedProxyHostname = parsedProxyHostname.slice(1);
@@ -125930,13 +159011,39 @@ function getEnv(key) {
   return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
 }
 
+// EXTERNAL MODULE: ./node_modules/https-proxy-agent/dist/index.js
+var dist = __nccwpck_require__(3669);
+// EXTERNAL MODULE: external "http"
+var external_http_ = __nccwpck_require__(58611);
+// EXTERNAL MODULE: external "https"
+var external_https_ = __nccwpck_require__(65692);
+;// CONCATENATED MODULE: external "http2"
+const external_http2_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2");
+// EXTERNAL MODULE: external "util"
+var external_util_ = __nccwpck_require__(39023);
+// EXTERNAL MODULE: external "path"
+var external_path_ = __nccwpck_require__(16928);
+// EXTERNAL MODULE: ./node_modules/follow-redirects/index.js
+var follow_redirects = __nccwpck_require__(1573);
+// EXTERNAL MODULE: external "zlib"
+var external_zlib_ = __nccwpck_require__(43106);
+;// CONCATENATED MODULE: ./node_modules/axios/lib/env/data.js
 const VERSION = "1.18.0";
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js
+
 
 function parseProtocol(url) {
   const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
-  return match && match[1] || '';
+  return (match && match[1]) || '';
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/fromDataURI.js
+
+
+
+
+
+
 // RFC 2397: data:[][;base64],
 // mediatype = type/subtype followed by optional ;name=value parameters
 const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
@@ -125952,17 +159059,22 @@ const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\
  * @returns {Buffer|Blob}
  */
 function fromDataURI(uri, asBlob, options) {
-  const _Blob = options && options.Blob || platform.classes.Blob;
+  const _Blob = (options && options.Blob) || platform.classes.Blob;
   const protocol = parseProtocol(uri);
+
   if (asBlob === undefined && _Blob) {
     asBlob = true;
   }
+
   if (protocol === 'data') {
     uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
+
     const match = DATA_URL_PATTERN.exec(uri);
+
     if (!match) {
-      throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
+      throw new core_AxiosError('Invalid URL', core_AxiosError.ERR_INVALID_URL);
     }
+
     const type = match[1];
     const params = match[2];
     const encoding = match[3] ? 'base64' : 'utf8';
@@ -125976,37 +159088,56 @@ function fromDataURI(uri, asBlob, options) {
     } else if (params) {
       mime = 'text/plain' + params;
     }
+
     const buffer = Buffer.from(decodeURIComponent(body), encoding);
+
     if (asBlob) {
       if (!_Blob) {
-        throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
+        throw new core_AxiosError('Blob is not supported', core_AxiosError.ERR_NOT_SUPPORT);
       }
-      return new _Blob([buffer], {
-        type: mime
-      });
+
+      return new _Blob([buffer], { type: mime });
     }
+
     return buffer;
   }
-  throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
+
+  throw new core_AxiosError('Unsupported protocol ' + protocol, core_AxiosError.ERR_NOT_SUPPORT);
 }
 
+// EXTERNAL MODULE: external "stream"
+var external_stream_ = __nccwpck_require__(2203);
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/AxiosTransformStream.js
+
+
+
+
+
 const kInternals = Symbol('internals');
-class AxiosTransformStream extends stream.Transform {
+
+class AxiosTransformStream extends external_stream_.Transform {
   constructor(options) {
-    options = utils$1.toFlatObject(options, {
-      maxRate: 0,
-      chunkSize: 64 * 1024,
-      minChunkSize: 100,
-      timeWindow: 500,
-      ticksRate: 2,
-      samplesCount: 15
-    }, null, (prop, source) => {
-      return !utils$1.isUndefined(source[prop]);
-    });
+    options = utils.toFlatObject(
+      options,
+      {
+        maxRate: 0,
+        chunkSize: 64 * 1024,
+        minChunkSize: 100,
+        timeWindow: 500,
+        ticksRate: 2,
+        samplesCount: 15,
+      },
+      null,
+      (prop, source) => {
+        return !utils.isUndefined(source[prop]);
+      }
+    );
+
     super({
-      readableHighWaterMark: options.chunkSize
+      readableHighWaterMark: options.chunkSize,
     });
-    const internals = this[kInternals] = {
+
+    const internals = (this[kInternals] = {
       timeWindow: options.timeWindow,
       chunkSize: options.chunkSize,
       maxRate: options.maxRate,
@@ -126016,9 +159147,10 @@ class AxiosTransformStream extends stream.Transform {
       notifiedBytesLoaded: 0,
       ts: Date.now(),
       bytes: 0,
-      onReadCallback: null
-    };
-    this.on('newListener', event => {
+      onReadCallback: null,
+    });
+
+    this.on('newListener', (event) => {
       if (event === 'progress') {
         if (!internals.isCaptured) {
           internals.isCaptured = true;
@@ -126026,26 +159158,39 @@ class AxiosTransformStream extends stream.Transform {
       }
     });
   }
+
   _read(size) {
     const internals = this[kInternals];
+
     if (internals.onReadCallback) {
       internals.onReadCallback();
     }
+
     return super._read(size);
   }
+
   _transform(chunk, encoding, callback) {
     const internals = this[kInternals];
     const maxRate = internals.maxRate;
+
     const readableHighWaterMark = this.readableHighWaterMark;
+
     const timeWindow = internals.timeWindow;
+
     const divider = 1000 / timeWindow;
     const bytesThreshold = maxRate / divider;
-    const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
+    const minChunkSize =
+      internals.minChunkSize !== false
+        ? Math.max(internals.minChunkSize, bytesThreshold * 0.01)
+        : 0;
+
     const pushChunk = (_chunk, _callback) => {
       const bytes = Buffer.byteLength(_chunk);
       internals.bytesSeen += bytes;
       internals.bytes += bytes;
+
       internals.isCaptured && this.emit('progress', internals.bytesSeen);
+
       if (this.push(_chunk)) {
         process.nextTick(_callback);
       } else {
@@ -126055,22 +159200,27 @@ class AxiosTransformStream extends stream.Transform {
         };
       }
     };
+
     const transformChunk = (_chunk, _callback) => {
       const chunkSize = Buffer.byteLength(_chunk);
       let chunkRemainder = null;
       let maxChunkSize = readableHighWaterMark;
       let bytesLeft;
       let passed = 0;
+
       if (maxRate) {
         const now = Date.now();
+
         if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
           internals.ts = now;
           bytesLeft = bytesThreshold - internals.bytes;
           internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
           passed = 0;
         }
+
         bytesLeft = bytesThreshold - internals.bytes;
       }
+
       if (maxRate) {
         if (bytesLeft <= 0) {
           // next time window
@@ -126078,22 +159228,32 @@ class AxiosTransformStream extends stream.Transform {
             _callback(null, _chunk);
           }, timeWindow - passed);
         }
+
         if (bytesLeft < maxChunkSize) {
           maxChunkSize = bytesLeft;
         }
       }
+
       if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
         chunkRemainder = _chunk.subarray(maxChunkSize);
         _chunk = _chunk.subarray(0, maxChunkSize);
       }
-      pushChunk(_chunk, chunkRemainder ? () => {
-        process.nextTick(_callback, null, chunkRemainder);
-      } : _callback);
+
+      pushChunk(
+        _chunk,
+        chunkRemainder
+          ? () => {
+              process.nextTick(_callback, null, chunkRemainder);
+            }
+          : _callback
+      );
     };
+
     transformChunk(chunk, function transformNextChunk(err, _chunk) {
       if (err) {
         return callback(err);
       }
+
       if (_chunk) {
         transformChunk(_chunk, transformNextChunk);
       } else {
@@ -126103,9 +159263,13 @@ class AxiosTransformStream extends stream.Transform {
   }
 }
 
-const {
-  asyncIterator
-} = Symbol;
+/* harmony default export */ const helpers_AxiosTransformStream = (AxiosTransformStream);
+
+// EXTERNAL MODULE: external "events"
+var external_events_ = __nccwpck_require__(24434);
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/readBlob.js
+const { asyncIterator } = Symbol;
+
 const readBlob = async function* (blob) {
   if (blob.stream) {
     yield* blob.stream();
@@ -126118,93 +159282,140 @@ const readBlob = async function* (blob) {
   }
 };
 
+/* harmony default export */ const helpers_readBlob = (readBlob);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/formDataToStream.js
+
+
+
+
+
+
 const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
-const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();
+
+const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new external_util_.TextEncoder();
+
 const CRLF = '\r\n';
 const CRLF_BYTES = textEncoder.encode(CRLF);
 const CRLF_BYTES_COUNT = 2;
+
 class FormDataPart {
   constructor(name, value) {
-    const {
-      escapeName
-    } = this.constructor;
-    const isStringValue = utils$1.isString(value);
-    let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''}${CRLF}`;
+    const { escapeName } = this.constructor;
+    const isStringValue = utils.isString(value);
+
+    let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
+      !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
+    }${CRLF}`;
+
     if (isStringValue) {
       value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
     } else {
       const safeType = String(value.type || 'application/octet-stream').replace(/[\r\n]/g, '');
       headers += `Content-Type: ${safeType}${CRLF}`;
     }
+
     this.headers = textEncoder.encode(headers + CRLF);
+
     this.contentLength = isStringValue ? value.byteLength : value.size;
+
     this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
+
     this.name = name;
     this.value = value;
   }
+
   async *encode() {
     yield this.headers;
-    const {
-      value
-    } = this;
-    if (utils$1.isTypedArray(value)) {
+
+    const { value } = this;
+
+    if (utils.isTypedArray(value)) {
       yield value;
     } else {
-      yield* readBlob(value);
+      yield* helpers_readBlob(value);
     }
+
     yield CRLF_BYTES;
   }
+
   static escapeName(name) {
-    return String(name).replace(/[\r\n"]/g, match => ({
-      '\r': '%0D',
-      '\n': '%0A',
-      '"': '%22'
-    })[match]);
+    return String(name).replace(
+      /[\r\n"]/g,
+      (match) =>
+        ({
+          '\r': '%0D',
+          '\n': '%0A',
+          '"': '%22',
+        })[match]
+    );
   }
 }
+
 const formDataToStream = (form, headersHandler, options) => {
   const {
     tag = 'form-data-boundary',
     size = 25,
-    boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
+    boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET),
   } = options || {};
-  if (!utils$1.isFormData(form)) {
+
+  if (!utils.isFormData(form)) {
     throw new TypeError('FormData instance required');
   }
+
   if (boundary.length < 1 || boundary.length > 70) {
     throw new Error('boundary must be 1-70 characters long');
   }
+
   const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
   const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
   let contentLength = footerBytes.byteLength;
+
   const parts = Array.from(form.entries()).map(([name, value]) => {
     const part = new FormDataPart(name, value);
     contentLength += part.size;
     return part;
   });
+
   contentLength += boundaryBytes.byteLength * parts.length;
-  contentLength = utils$1.toFiniteNumber(contentLength);
+
+  contentLength = utils.toFiniteNumber(contentLength);
+
   const computedHeaders = {
-    'Content-Type': `multipart/form-data; boundary=${boundary}`
+    'Content-Type': `multipart/form-data; boundary=${boundary}`,
   };
+
   if (Number.isFinite(contentLength)) {
     computedHeaders['Content-Length'] = contentLength;
   }
+
   headersHandler && headersHandler(computedHeaders);
-  return stream.Readable.from(async function* () {
-    for (const part of parts) {
-      yield boundaryBytes;
-      yield* part.encode();
-    }
-    yield footerBytes;
-  }());
+
+  return external_stream_.Readable.from(
+    (async function* () {
+      for (const part of parts) {
+        yield boundaryBytes;
+        yield* part.encode();
+      }
+
+      yield footerBytes;
+    })()
+  );
 };
 
-class ZlibHeaderTransformStream extends stream.Transform {
+/* harmony default export */ const helpers_formDataToStream = (formDataToStream);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
+
+
+
+
+class ZlibHeaderTransformStream extends external_stream_.Transform {
   __transform(chunk, encoding, callback) {
     this.push(chunk);
     callback();
   }
+
   _transform(chunk, encoding, callback) {
     if (chunk.length !== 0) {
       this._transform = this.__transform;
@@ -126218,43 +159429,75 @@ class ZlibHeaderTransformStream extends stream.Transform {
         this.push(header, encoding);
       }
     }
+
     this.__transform(chunk, encoding, callback);
   }
 }
 
+/* harmony default export */ const helpers_ZlibHeaderTransformStream = (ZlibHeaderTransformStream);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/Http2Sessions.js
+
+
+// Node-only: relies on the built-in `http2` module. Browser/react-native
+// builds replace `lib/adapters/http.js` (the sole importer) with `lib/helpers/null.js`
+// via the `browser` package.json field, so this module is never reached in
+// those environments. Do not import it from any browser-reachable code path.
+
+
+
+
 class Http2Sessions {
   constructor() {
     this.sessions = Object.create(null);
   }
+
   getSession(authority, options) {
-    options = Object.assign({
-      sessionTimeout: 1000
-    }, options);
+    options = Object.assign(
+      {
+        sessionTimeout: 1000,
+      },
+      options
+    );
+
     let authoritySessions = this.sessions[authority];
+
     if (authoritySessions) {
       let len = authoritySessions.length;
+
       for (let i = 0; i < len; i++) {
         const [sessionHandle, sessionOptions] = authoritySessions[i];
-        if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {
+        if (
+          !sessionHandle.destroyed &&
+          !sessionHandle.closed &&
+          external_util_.isDeepStrictEqual(sessionOptions, options)
+        ) {
           return sessionHandle;
         }
       }
     }
-    const session = http2.connect(authority, options);
+
+    const session = external_http2_namespaceObject.connect(authority, options);
+
     let removed;
     let timer;
+
     const removeSession = () => {
       if (removed) {
         return;
       }
+
       removed = true;
+
       if (timer) {
         clearTimeout(timer);
         timer = null;
       }
+
       let entries = authoritySessions,
         len = entries.length,
         i = len;
+
       while (i--) {
         if (entries[i][0] === session) {
           if (len === 1) {
@@ -126269,79 +159512,113 @@ class Http2Sessions {
         }
       }
     };
+
     const originalRequestFn = session.request;
-    const {
-      sessionTimeout
-    } = options;
+
+    const { sessionTimeout } = options;
+
     if (sessionTimeout != null) {
       let streamsCount = 0;
+
       session.request = function () {
         const stream = originalRequestFn.apply(this, arguments);
+
         streamsCount++;
+
         if (timer) {
           clearTimeout(timer);
           timer = null;
         }
+
         stream.once('close', () => {
-          if (! --streamsCount) {
+          if (!--streamsCount) {
             timer = setTimeout(() => {
               timer = null;
               removeSession();
             }, sessionTimeout);
           }
         });
+
         return stream;
       };
     }
+
     session.once('close', removeSession);
+
     let entry = [session, options];
-    authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
+
+    authoritySessions
+      ? authoritySessions.push(entry)
+      : (authoritySessions = this.sessions[authority] = [entry]);
+
     return session;
   }
 }
 
+/* harmony default export */ const helpers_Http2Sessions = (Http2Sessions);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/callbackify.js
+
+
 const callbackify = (fn, reducer) => {
-  return utils$1.isAsyncFn(fn) ? function (...args) {
-    const cb = args.pop();
-    fn.apply(this, args).then(value => {
-      try {
-        reducer ? cb(null, ...reducer(value)) : cb(null, value);
-      } catch (err) {
-        cb(err);
+  return utils.isAsyncFn(fn)
+    ? function (...args) {
+        const cb = args.pop();
+        fn.apply(this, args).then((value) => {
+          try {
+            reducer ? cb(null, ...reducer(value)) : cb(null, value);
+          } catch (err) {
+            cb(err);
+          }
+        }, cb);
       }
-    }, cb);
-  } : fn;
+    : fn;
 };
 
+/* harmony default export */ const helpers_callbackify = (callbackify);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/shouldBypassProxy.js
 const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']);
-const isIPv4Loopback = host => {
+
+const isIPv4Loopback = (host) => {
   const parts = host.split('.');
   if (parts.length !== 4) return false;
   if (parts[0] !== '127') return false;
-  return parts.every(p => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
+  return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
 };
-const isIPv6ZeroGroup = group => /^0{1,4}$/.test(group);
+
+const isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group);
 
 // The unspecified address (IPv4 0.0.0.0 / IPv6 ::) resolves to the local host
 // for outbound connections, so treat it as loopback-equivalent for NO_PROXY
 // matching. 0.0.0.0 is covered by LOOPBACK_HOSTNAMES; this handles compressed
 // and full IPv6 all-zero forms so both families bypass symmetrically.
-const isIPv6Unspecified = host => {
+const isIPv6Unspecified = (host) => {
   if (host === '::') return true;
+
   const compressionIndex = host.indexOf('::');
+
   if (compressionIndex !== -1) {
     if (compressionIndex !== host.lastIndexOf('::')) return false;
+
     const left = host.slice(0, compressionIndex);
     const right = host.slice(compressionIndex + 2);
     const leftGroups = left ? left.split(':') : [];
     const rightGroups = right ? right.split(':') : [];
     const explicitGroups = leftGroups.length + rightGroups.length;
-    return explicitGroups < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup);
+
+    return (
+      explicitGroups < 8 &&
+      leftGroups.every(isIPv6ZeroGroup) &&
+      rightGroups.every(isIPv6ZeroGroup)
+    );
   }
+
   const groups = host.split(':');
   return groups.length === 8 && groups.every(isIPv6ZeroGroup);
 };
-const isIPv6Loopback = host => {
+
+const isIPv6Loopback = (host) => {
   // Collapse all-zero groups: any form of ::1 / 0:0:...:0:1
   // First, strip any leading "::" by normalising with Set lookup of common forms,
   // then fall back to structural check.
@@ -126351,6 +159628,7 @@ const isIPv6Loopback = host => {
   // Node's URL parser normalises ::ffff:127.0.0.1 → ::ffff:7f00:1
   const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
   if (v4MappedDotted) return isIPv4Loopback(v4MappedDotted[1]);
+
   const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);
   if (v4MappedHex) {
     const high = parseInt(v4MappedHex[1], 16);
@@ -126367,42 +159645,57 @@ const isIPv6Loopback = host => {
     }
     return /^0*1$/.test(groups[7]);
   }
+
   return false;
 };
-const isLoopback = host => {
+
+const isLoopback = (host) => {
   if (!host) return false;
   if (LOOPBACK_HOSTNAMES.has(host)) return true;
   if (isIPv4Loopback(host)) return true;
   if (isIPv6Unspecified(host)) return true;
   return isIPv6Loopback(host);
 };
-const DEFAULT_PORTS = {
+
+const shouldBypassProxy_DEFAULT_PORTS = {
   http: 80,
   https: 443,
   ws: 80,
   wss: 443,
-  ftp: 21
+  ftp: 21,
 };
-const parseNoProxyEntry = entry => {
+
+const parseNoProxyEntry = (entry) => {
   let entryHost = entry;
   let entryPort = 0;
+
   if (entryHost.charAt(0) === '[') {
     const bracketIndex = entryHost.indexOf(']');
+
     if (bracketIndex !== -1) {
       const host = entryHost.slice(1, bracketIndex);
       const rest = entryHost.slice(bracketIndex + 1);
+
       if (rest.charAt(0) === ':' && /^\d+$/.test(rest.slice(1))) {
         entryPort = Number.parseInt(rest.slice(1), 10);
       }
+
       return [host, entryPort];
     }
   }
+
   const firstColon = entryHost.indexOf(':');
   const lastColon = entryHost.lastIndexOf(':');
-  if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
+
+  if (
+    firstColon !== -1 &&
+    firstColon === lastColon &&
+    /^\d+$/.test(entryHost.slice(lastColon + 1))
+  ) {
     entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
     entryHost = entryHost.slice(0, lastColon);
   }
+
   return [entryHost, entryPort];
 };
 
@@ -126414,65 +159707,91 @@ const parseNoProxyEntry = entry => {
 // representation. Returns the input unchanged when not IPv4-mapped.
 const IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i;
 const IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i;
-const unmapIPv4MappedIPv6 = host => {
+
+const unmapIPv4MappedIPv6 = (host) => {
   if (typeof host !== 'string' || host.indexOf(':') === -1) return host;
+
   const dotted = host.match(IPV4_MAPPED_DOTTED_RE);
   if (dotted) return dotted[1];
+
   const hex = host.match(IPV4_MAPPED_HEX_RE);
   if (hex) {
     const high = parseInt(hex[1], 16);
     const low = parseInt(hex[2], 16);
     return `${high >> 8}.${high & 0xff}.${low >> 8}.${low & 0xff}`;
   }
+
   return host;
 };
-const normalizeNoProxyHost = hostname => {
+
+const normalizeNoProxyHost = (hostname) => {
   if (!hostname) {
     return hostname;
   }
+
   if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') {
     hostname = hostname.slice(1, -1);
   }
+
   return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, ''));
 };
+
 function shouldBypassProxy(location) {
   let parsed;
+
   try {
     parsed = new URL(location);
   } catch (_err) {
     return false;
   }
+
   const noProxy = (process.env.no_proxy || process.env.NO_PROXY || '').toLowerCase();
+
   if (!noProxy) {
     return false;
   }
+
   if (noProxy === '*') {
     return true;
   }
-  const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0;
+
+  const port =
+    Number.parseInt(parsed.port, 10) || shouldBypassProxy_DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0;
+
   const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
-  return noProxy.split(/[\s,]+/).some(entry => {
+
+  return noProxy.split(/[\s,]+/).some((entry) => {
     if (!entry) {
       return false;
     }
+
     let [entryHost, entryPort] = parseNoProxyEntry(entry);
+
     entryHost = normalizeNoProxyHost(entryHost);
+
     if (!entryHost) {
       return false;
     }
+
     if (entryPort && entryPort !== port) {
       return false;
     }
+
     if (entryHost.charAt(0) === '*') {
       entryHost = entryHost.slice(1);
     }
+
     if (entryHost.charAt(0) === '.') {
       return hostname.endsWith(entryHost);
     }
-    return hostname === entryHost || isLoopback(hostname) && isLoopback(entryHost);
+
+    return hostname === entryHost || (isLoopback(hostname) && isLoopback(entryHost));
   });
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/speedometer.js
+
+
 /**
  * Calculate data maxRate
  * @param {Number} [samplesCount= 10]
@@ -126486,33 +159805,48 @@ function speedometer(samplesCount, min) {
   let head = 0;
   let tail = 0;
   let firstSampleTS;
+
   min = min !== undefined ? min : 1000;
+
   return function push(chunkLength) {
     const now = Date.now();
+
     const startedAt = timestamps[tail];
+
     if (!firstSampleTS) {
       firstSampleTS = now;
     }
+
     bytes[head] = chunkLength;
     timestamps[head] = now;
+
     let i = tail;
     let bytesCount = 0;
+
     while (i !== head) {
       bytesCount += bytes[i++];
       i = i % samplesCount;
     }
+
     head = (head + 1) % samplesCount;
+
     if (head === tail) {
       tail = (tail + 1) % samplesCount;
     }
+
     if (now - firstSampleTS < min) {
       return;
     }
+
     const passed = startedAt && now - startedAt;
-    return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+
+    return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
   };
 }
 
+/* harmony default export */ const helpers_speedometer = (speedometer);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/throttle.js
 /**
  * Throttle decorator
  * @param {Function} fn
@@ -126524,6 +159858,7 @@ function throttle(fn, freq) {
   let threshold = 1000 / freq;
   let lastArgs;
   let timer;
+
   const invoke = (args, now = Date.now()) => {
     timestamp = now;
     lastArgs = null;
@@ -126533,6 +159868,7 @@ function throttle(fn, freq) {
     }
     fn(...args);
   };
+
   const throttled = (...args) => {
     const now = Date.now();
     const passed = now - timestamp;
@@ -126548,14 +159884,24 @@ function throttle(fn, freq) {
       }
     }
   };
+
   const flush = () => lastArgs && invoke(lastArgs);
+
   return [throttled, flush];
 }
 
+/* harmony default export */ const helpers_throttle = (throttle);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/progressEventReducer.js
+
+
+
+
 const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
   let bytesNotified = 0;
-  const _speedometer = speedometer(50, 250);
-  return throttle(e => {
+  const _speedometer = helpers_speedometer(50, 250);
+
+  return helpers_throttle((e) => {
     if (!e || typeof e.loaded !== 'number') {
       return;
     }
@@ -126564,7 +159910,9 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
     const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
     const progressBytes = Math.max(0, loaded - bytesNotified);
     const rate = _speedometer(progressBytes);
+
     bytesNotified = Math.max(bytesNotified, loaded);
+
     const data = {
       loaded,
       total,
@@ -126574,21 +159922,33 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
       estimated: rate && total ? (total - loaded) / rate : undefined,
       event: e,
       lengthComputable: total != null,
-      [isDownloadStream ? 'download' : 'upload']: true
+      [isDownloadStream ? 'download' : 'upload']: true,
     };
+
     listener(data);
   }, freq);
 };
+
 const progressEventDecorator = (total, throttled) => {
   const lengthComputable = total != null;
-  return [loaded => throttled[0]({
-    lengthComputable,
-    total,
-    loaded
-  }), throttled[1]];
+
+  return [
+    (loaded) =>
+      throttled[0]({
+        lengthComputable,
+        total,
+        loaded,
+      }),
+    throttled[1],
+  ];
 };
-const asyncDecorator = fn => (...args) => utils$1.asap(() => fn(...args));
 
+const asyncDecorator =
+  (fn) =>
+  (...args) =>
+    utils.asap(() => fn(...args));
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
 /**
  * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
  * - For base64: compute exact decoded size using length and padding;
@@ -126598,16 +159958,25 @@ const asyncDecorator = fn => (...args) => utils$1.asap(() => fn(...args));
  * @param {string} url
  * @returns {number}
  */
-const isHexDigit = charCode => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
-const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
+const isHexDigit = (charCode) =>
+  (charCode >= 48 && charCode <= 57) ||
+  (charCode >= 65 && charCode <= 70) ||
+  (charCode >= 97 && charCode <= 102);
+
+const isPercentEncodedByte = (str, i, len) =>
+  i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
+
 function estimateDataURLDecodedBytes(url) {
   if (!url || typeof url !== 'string') return 0;
   if (!url.startsWith('data:')) return 0;
+
   const comma = url.indexOf(',');
   if (comma < 0) return 0;
+
   const meta = url.slice(5, comma);
   const body = url.slice(comma + 1);
   const isBase64 = /;base64/i.test(meta);
+
   if (isBase64) {
     let effectiveLen = body.length;
     const len = body.length; // cache length
@@ -126617,19 +159986,22 @@ function estimateDataURLDecodedBytes(url) {
         const a = body.charCodeAt(i + 1);
         const b = body.charCodeAt(i + 2);
         const isHex = isHexDigit(a) && isHexDigit(b);
+
         if (isHex) {
           effectiveLen -= 2;
           i += 2;
         }
       }
     }
+
     let pad = 0;
     let idx = len - 1;
-    const tailIsPct3D = j => j >= 2 && body.charCodeAt(j - 2) === 37 &&
-    // '%'
-    body.charCodeAt(j - 1) === 51 && (
-    // '3'
-    body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
+
+    const tailIsPct3D = (j) =>
+      j >= 2 &&
+      body.charCodeAt(j - 2) === 37 && // '%'
+      body.charCodeAt(j - 1) === 51 && // '3'
+      (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
 
     if (idx >= 0) {
       if (body.charCodeAt(idx) === 61 /* '=' */) {
@@ -126640,6 +160012,7 @@ function estimateDataURLDecodedBytes(url) {
         idx -= 3;
       }
     }
+
     if (pad === 1 && idx >= 0) {
       if (body.charCodeAt(idx) === 61 /* '=' */) {
         pad++;
@@ -126647,6 +160020,7 @@ function estimateDataURLDecodedBytes(url) {
         pad++;
       }
     }
+
     const groups = Math.floor(effectiveLen / 4);
     const bytes = groups * 3 - (pad || 0);
     return bytes > 0 ? bytes : 0;
@@ -126680,36 +160054,74 @@ function estimateDataURLDecodedBytes(url) {
   }
   return bytes;
 }
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/adapters/http.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 const zlibOptions = {
-  flush: zlib.constants.Z_SYNC_FLUSH,
-  finishFlush: zlib.constants.Z_SYNC_FLUSH
+  flush: external_zlib_.constants.Z_SYNC_FLUSH,
+  finishFlush: external_zlib_.constants.Z_SYNC_FLUSH,
 };
+
 const brotliOptions = {
-  flush: zlib.constants.BROTLI_OPERATION_FLUSH,
-  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
+  flush: external_zlib_.constants.BROTLI_OPERATION_FLUSH,
+  finishFlush: external_zlib_.constants.BROTLI_OPERATION_FLUSH,
 };
+
 const zstdOptions = {
-  flush: zlib.constants.ZSTD_e_flush,
-  finishFlush: zlib.constants.ZSTD_e_flush
+  flush: external_zlib_.constants.ZSTD_e_flush,
+  finishFlush: external_zlib_.constants.ZSTD_e_flush,
 };
-const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
-const isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress);
+
+const isBrotliSupported = utils.isFunction(external_zlib_.createBrotliDecompress);
+const isZstdSupported = utils.isFunction(external_zlib_.createZstdDecompress);
 const ACCEPT_ENCODING = 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : '');
 const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ', zstd' : '');
-const {
-  http: httpFollow,
-  https: httpsFollow
-} = followRedirects;
+
+const { http: httpFollow, https: httpsFollow } = follow_redirects;
+
 const isHttps = /https:?/;
-const FORM_DATA_CONTENT_HEADERS$1 = ['content-type', 'content-length'];
-function setFormDataHeaders$1(headers, formHeaders, policy) {
+const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
+
+function setFormDataHeaders(headers, formHeaders, policy) {
   if (policy !== 'content-only') {
     headers.set(formHeaders);
     return;
   }
+
   Object.entries(formHeaders).forEach(([key, val]) => {
-    if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) {
+    if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
       headers.set(key, val);
     }
   });
@@ -126731,37 +160143,43 @@ const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel');
 // so unbounded growth is not a concern in practice.
 const tunnelingAgentCache = new Map();
 const tunnelingAgentCacheUser = new WeakMap();
+
 function getTunnelingAgent(agentOptions, userHttpsAgent) {
-  const key = agentOptions.protocol + '//' + agentOptions.hostname + ':' + (agentOptions.port || '') + '#' + (agentOptions.auth || '');
-  const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent) : tunnelingAgentCache;
+  const key =
+    agentOptions.protocol +
+    '//' +
+    agentOptions.hostname +
+    ':' +
+    (agentOptions.port || '') +
+    '#' +
+    (agentOptions.auth || '');
+  const cache = userHttpsAgent
+    ? (tunnelingAgentCacheUser.get(userHttpsAgent) ||
+        tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent))
+    : tunnelingAgentCache;
   let agent = cache.get(key);
   if (agent) return agent;
   // Forward the user's TLS options (custom CA, rejectUnauthorized, client cert,
   // etc.) into the tunneling agent so they apply to the origin TLS upgrade
   // performed after CONNECT. Our proxy fields take precedence on conflict.
-  const merged = userHttpsAgent && userHttpsAgent.options ? {
-    ...userHttpsAgent.options,
-    ...agentOptions
-  } : agentOptions;
-  agent = new HttpsProxyAgent(merged);
+  const merged = userHttpsAgent && userHttpsAgent.options
+    ? { ...userHttpsAgent.options, ...agentOptions }
+    : agentOptions;
+  agent = new dist(merged);
   if (userHttpsAgent && userHttpsAgent.options) {
-    const originTLSOptions = {
-      ...userHttpsAgent.options
-    };
+    const originTLSOptions = { ...userHttpsAgent.options };
     const callback = agent.callback;
     agent.callback = function axiosTunnelingAgentCallback(req, opts) {
       // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.
-      return callback.call(this, req, {
-        ...originTLSOptions,
-        ...opts
-      });
+      return callback.call(this, req, { ...originTLSOptions, ...opts });
     };
   }
   agent[kAxiosInstalledTunnel] = true;
   cache.set(key, agent);
   return agent;
 }
-const supportedProtocols = platform.protocols.map(protocol => {
+
+const supportedProtocols = platform.protocols.map((protocol) => {
   return protocol + ':';
 });
 
@@ -126769,21 +160187,25 @@ const supportedProtocols = platform.protocols.map(protocol => {
 // Decode before composing the `auth` option so credentials such as
 // `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the
 // original value for malformed input so a bad encoding never throws.
-const decodeURIComponentSafe$1 = value => {
-  if (!utils$1.isString(value)) {
+const decodeURIComponentSafe = (value) => {
+  if (!utils.isString(value)) {
     return value;
   }
+
   try {
     return decodeURIComponent(value);
   } catch (error) {
     return value;
   }
 };
+
 const flushOnFinish = (stream, [throttled, flush]) => {
   stream.on('end', flush).on('error', flush);
+
   return throttled;
 };
-const http2Sessions = new Http2Sessions();
+
+const http2Sessions = new helpers_Http2Sessions();
 
 /**
  * If the proxy, auth, sensitive header, or config beforeRedirects functions are defined,
@@ -126807,20 +160229,24 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
     options.beforeRedirects.config(options, responseDetails, requestDetails);
   }
 }
+
 function stripMatchingHeaders(headers, sensitiveSet) {
   if (!headers) {
     return;
   }
-  Object.keys(headers).forEach(header => {
+
+  Object.keys(headers).forEach((header) => {
     if (sensitiveSet.has(header.toLowerCase())) {
       delete headers[header];
     }
   });
 }
+
 function isSameOriginRedirect(redirectOptions, requestDetails) {
   if (!requestDetails) {
     return false;
   }
+
   try {
     return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;
   } catch (e) {
@@ -126875,31 +160301,37 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent)
     // attacker-controlled credentials into the Proxy-Authorization header or
     // redirect proxying to an attacker-controlled host.
     const isProxyURL = proxy instanceof URL;
-    const readProxyField = key => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : undefined;
+    const readProxyField = (key) =>
+      isProxyURL || utils.hasOwnProp(proxy, key) ? proxy[key] : undefined;
+
     const proxyUsername = readProxyField('username');
     const proxyPassword = readProxyField('password');
-    let proxyAuth = utils$1.hasOwnProp(proxy, 'auth') ? proxy.auth : undefined;
+    let proxyAuth = utils.hasOwnProp(proxy, 'auth') ? proxy.auth : undefined;
 
     // Basic proxy authorization
     if (proxyUsername) {
       proxyAuth = (proxyUsername || '') + ':' + (proxyPassword || '');
     }
+
     if (proxyAuth) {
       // Support proxy auth object form. Read sub-fields via own-prop checks so a
       // plain object inheriting from polluted Object.prototype cannot leak creds.
       const authIsObject = typeof proxyAuth === 'object';
-      const authUsername = authIsObject && utils$1.hasOwnProp(proxyAuth, 'username') ? proxyAuth.username : undefined;
-      const authPassword = authIsObject && utils$1.hasOwnProp(proxyAuth, 'password') ? proxyAuth.password : undefined;
+      const authUsername =
+        authIsObject && utils.hasOwnProp(proxyAuth, 'username') ? proxyAuth.username : undefined;
+      const authPassword =
+        authIsObject && utils.hasOwnProp(proxyAuth, 'password') ? proxyAuth.password : undefined;
       const validProxyAuth = Boolean(authUsername || authPassword);
+
       if (validProxyAuth) {
         proxyAuth = (authUsername || '') + ':' + (authPassword || '');
       } else if (authIsObject) {
-        throw new AxiosError('Invalid proxy authorization', AxiosError.ERR_BAD_OPTION, {
-          proxy
-        });
+        throw new core_AxiosError('Invalid proxy authorization', core_AxiosError.ERR_BAD_OPTION, { proxy });
       }
     }
+
     const targetIsHttps = isHttps.test(options.protocol);
+
     if (targetIsHttps) {
       // CONNECT-tunneling path for HTTPS targets. Preserves end-to-end TLS to
       // the origin so the proxy cannot inspect the URL, headers, or body — the
@@ -126911,20 +160343,29 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent)
       // install our own tunneling agent and forward their TLS options (if any)
       // so a custom httpsAgent for cert pinning / rejectUnauthorized still
       // applies to the origin TLS upgrade.
-      if (!(configHttpsAgent instanceof HttpsProxyAgent)) {
+      if (!(configHttpsAgent instanceof dist)) {
         const proxyHost = readProxyField('hostname') || readProxyField('host');
         const proxyPort = readProxyField('port');
         const rawProxyProtocol = readProxyField('protocol');
-        const normalizedProtocol = rawProxyProtocol ? rawProxyProtocol.includes(':') ? rawProxyProtocol : `${rawProxyProtocol}:` : 'http:';
+        const normalizedProtocol = rawProxyProtocol
+          ? rawProxyProtocol.includes(':')
+            ? rawProxyProtocol
+            : `${rawProxyProtocol}:`
+          : 'http:';
         // Bracket IPv6 literals for URL parsing; URL.hostname strips the
         // brackets again on read so the agent receives the raw form.
-        const proxyHostForURL = proxyHost && proxyHost.includes(':') && !proxyHost.startsWith('[') ? `[${proxyHost}]` : proxyHost;
-        const proxyURL = new URL(`${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ':' + proxyPort : ''}`);
+        const proxyHostForURL =
+          proxyHost && proxyHost.includes(':') && !proxyHost.startsWith('[')
+            ? `[${proxyHost}]`
+            : proxyHost;
+        const proxyURL = new URL(
+          `${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ':' + proxyPort : ''}`
+        );
         const agentOptions = {
           protocol: proxyURL.protocol,
           hostname: proxyURL.hostname.replace(/^\[|\]$/g, ''),
           port: proxyURL.port,
-          auth: proxyAuth && typeof proxyAuth === 'string' ? proxyAuth : undefined
+          auth: proxyAuth && typeof proxyAuth === 'string' ? proxyAuth : undefined,
         };
         if (proxyURL.protocol === 'https:') {
           agentOptions.ALPNProtocols = ['http/1.1'];
@@ -126972,805 +160413,1078 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent)
       }
     }
   }
+
   options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
     // Configure proxy for redirected request, passing the original config proxy to apply
     // the exact same logic as if the redirected request was performed by axios directly.
     setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);
   };
 }
-const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
+
+const isHttpAdapterSupported =
+  typeof process !== 'undefined' && utils.kindOf(process) === 'process';
 
 // temporary hotfix
 
-const wrapAsync = asyncExecutor => {
+const wrapAsync = (asyncExecutor) => {
   return new Promise((resolve, reject) => {
     let onDone;
     let isDone;
+
     const done = (value, isRejected) => {
       if (isDone) return;
       isDone = true;
       onDone && onDone(value, isRejected);
     };
-    const _resolve = value => {
+
+    const _resolve = (value) => {
       done(value);
       resolve(value);
     };
-    const _reject = reason => {
+
+    const _reject = (reason) => {
       done(reason, true);
       reject(reason);
     };
-    asyncExecutor(_resolve, _reject, onDoneHandler => onDone = onDoneHandler).catch(_reject);
+
+    asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
   });
 };
-const resolveFamily = ({
-  address,
-  family
-}) => {
-  if (!utils$1.isString(address)) {
+
+const resolveFamily = ({ address, family }) => {
+  if (!utils.isString(address)) {
     throw TypeError('address must be a string');
   }
   return {
     address,
-    family: family || (address.indexOf('.') < 0 ? 6 : 4)
+    family: family || (address.indexOf('.') < 0 ? 6 : 4),
   };
 };
-const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {
-  address,
-  family
-});
+
+const buildAddressEntry = (address, family) =>
+  resolveFamily(utils.isObject(address) ? address : { address, family });
+
 const http2Transport = {
   request(options, cb) {
-    const authority = options.protocol + '//' + options.hostname + ':' + (options.port || (options.protocol === 'https:' ? 443 : 80));
-    const {
-      http2Options,
-      headers
-    } = options;
+    const authority =
+      options.protocol +
+      '//' +
+      options.hostname +
+      ':' +
+      (options.port || (options.protocol === 'https:' ? 443 : 80));
+
+    const { http2Options, headers } = options;
+
     const session = http2Sessions.getSession(authority, http2Options);
-    const {
-      HTTP2_HEADER_SCHEME,
-      HTTP2_HEADER_METHOD,
-      HTTP2_HEADER_PATH,
-      HTTP2_HEADER_STATUS
-    } = http2.constants;
+
+    const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } =
+      external_http2_namespaceObject.constants;
+
     const http2Headers = {
       [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
       [HTTP2_HEADER_METHOD]: options.method,
-      [HTTP2_HEADER_PATH]: options.path
+      [HTTP2_HEADER_PATH]: options.path,
     };
-    utils$1.forEach(headers, (header, name) => {
+
+    utils.forEach(headers, (header, name) => {
       name.charAt(0) !== ':' && (http2Headers[name] = header);
     });
+
     const req = session.request(http2Headers);
-    req.once('response', responseHeaders => {
+
+    req.once('response', (responseHeaders) => {
       const response = req; //duplex
 
       responseHeaders = Object.assign({}, responseHeaders);
+
       const status = responseHeaders[HTTP2_HEADER_STATUS];
+
       delete responseHeaders[HTTP2_HEADER_STATUS];
+
       response.headers = responseHeaders;
+
       response.statusCode = +status;
+
       cb(response);
     });
+
     return req;
-  }
+  },
 };
 
 /*eslint consistent-return:0*/
-var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
-  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
-    // Read config pollution-safely: own properties and members inherited from
-    // a non-Object.prototype source (e.g. an Object.create(defaults) template)
-    // are honored, but values injected onto a polluted Object.prototype are
-    // ignored. All behavior-affecting reads in this adapter go through own()
-    // so the protection boundary stays consistent.
-    const own = key => utils$1.getSafeProp(config, key);
-    const transitional = own('transitional') || transitionalDefaults;
-    let data = own('data');
-    let lookup = own('lookup');
-    let family = own('family');
-    let httpVersion = own('httpVersion');
-    if (httpVersion === undefined) httpVersion = 1;
-    let http2Options = own('http2Options');
-    const responseType = own('responseType');
-    const responseEncoding = own('responseEncoding');
-    const httpAgent = own('httpAgent');
-    const httpsAgent = own('httpsAgent');
-    const method = own('method').toUpperCase();
-    const maxRedirects = own('maxRedirects');
-    const maxBodyLength = own('maxBodyLength');
-    const maxContentLength = own('maxContentLength');
-    const decompress = own('decompress');
-    let isDone;
-    let rejected = false;
-    let req;
-    let connectPhaseTimer;
-    httpVersion = +httpVersion;
-    if (Number.isNaN(httpVersion)) {
-      throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
-    }
-    if (httpVersion !== 1 && httpVersion !== 2) {
-      throw TypeError(`Unsupported protocol version '${httpVersion}'`);
-    }
-    const isHttp2 = httpVersion === 2;
-    if (lookup) {
-      const _lookup = callbackify(lookup, value => utils$1.isArray(value) ? value : [value]);
-      // hotfix to support opt.all option which is required for node 20.x
-      lookup = (hostname, opt, cb) => {
-        _lookup(hostname, opt, (err, arg0, arg1) => {
-          if (err) {
-            return cb(err);
-          }
-          const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
-          opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
-        });
-      };
-    }
-    const abortEmitter = new events.EventEmitter();
-    function abort(reason) {
-      try {
-        abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
-      } catch (err) {
-        // ignore emit errors
-      }
-    }
-    function clearConnectPhaseTimer() {
-      if (connectPhaseTimer) {
-        clearTimeout(connectPhaseTimer);
-        connectPhaseTimer = null;
-      }
-    }
-    function createTimeoutError() {
-      const configTimeout = own('timeout');
-      let timeoutErrorMessage = configTimeout ? 'timeout of ' + configTimeout + 'ms exceeded' : 'timeout exceeded';
-      const configTimeoutErrorMessage = own('timeoutErrorMessage');
-      if (configTimeoutErrorMessage) {
-        timeoutErrorMessage = configTimeoutErrorMessage;
+/* harmony default export */ const http = (isHttpAdapterSupported &&
+  function httpAdapter(config) {
+    return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
+      // Read config pollution-safely: own properties and members inherited from
+      // a non-Object.prototype source (e.g. an Object.create(defaults) template)
+      // are honored, but values injected onto a polluted Object.prototype are
+      // ignored. All behavior-affecting reads in this adapter go through own()
+      // so the protection boundary stays consistent.
+      const own = (key) => utils.getSafeProp(config, key);
+      const transitional = own('transitional') || defaults_transitional;
+      let data = own('data');
+      let lookup = own('lookup');
+      let family = own('family');
+      let httpVersion = own('httpVersion');
+      if (httpVersion === undefined) httpVersion = 1;
+      let http2Options = own('http2Options');
+      const responseType = own('responseType');
+      const responseEncoding = own('responseEncoding');
+      const httpAgent = own('httpAgent');
+      const httpsAgent = own('httpsAgent');
+      const method = own('method').toUpperCase();
+      const maxRedirects = own('maxRedirects');
+      const maxBodyLength = own('maxBodyLength');
+      const maxContentLength = own('maxContentLength');
+      const decompress = own('decompress');
+      let isDone;
+      let rejected = false;
+      let req;
+      let connectPhaseTimer;
+
+      httpVersion = +httpVersion;
+
+      if (Number.isNaN(httpVersion)) {
+        throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
+      }
+
+      if (httpVersion !== 1 && httpVersion !== 2) {
+        throw TypeError(`Unsupported protocol version '${httpVersion}'`);
+      }
+
+      const isHttp2 = httpVersion === 2;
+
+      if (lookup) {
+        const _lookup = helpers_callbackify(lookup, (value) => (utils.isArray(value) ? value : [value]));
+        // hotfix to support opt.all option which is required for node 20.x
+        lookup = (hostname, opt, cb) => {
+          _lookup(hostname, opt, (err, arg0, arg1) => {
+            if (err) {
+              return cb(err);
+            }
+
+            const addresses = utils.isArray(arg0)
+              ? arg0.map((addr) => buildAddressEntry(addr))
+              : [buildAddressEntry(arg0, arg1)];
+
+            opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
+          });
+        };
       }
-      return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req);
-    }
-    abortEmitter.once('abort', reject);
-    const onFinished = () => {
-      clearConnectPhaseTimer();
-      if (config.cancelToken) {
-        config.cancelToken.unsubscribe(abort);
+
+      const abortEmitter = new external_events_.EventEmitter();
+
+      function abort(reason) {
+        try {
+          abortEmitter.emit(
+            'abort',
+            !reason || reason.type ? new cancel_CanceledError(null, config, req) : reason
+          );
+        } catch (err) {
+          // ignore emit errors
+        }
       }
-      if (config.signal) {
-        config.signal.removeEventListener('abort', abort);
+
+      function clearConnectPhaseTimer() {
+        if (connectPhaseTimer) {
+          clearTimeout(connectPhaseTimer);
+          connectPhaseTimer = null;
+        }
       }
-      abortEmitter.removeAllListeners();
-    };
-    if (config.cancelToken || config.signal) {
-      config.cancelToken && config.cancelToken.subscribe(abort);
-      if (config.signal) {
-        config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
+
+      function createTimeoutError() {
+        const configTimeout = own('timeout');
+        let timeoutErrorMessage = configTimeout
+          ? 'timeout of ' + configTimeout + 'ms exceeded'
+          : 'timeout exceeded';
+        const configTimeoutErrorMessage = own('timeoutErrorMessage');
+        if (configTimeoutErrorMessage) {
+          timeoutErrorMessage = configTimeoutErrorMessage;
+        }
+        return new core_AxiosError(
+          timeoutErrorMessage,
+          transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED,
+          config,
+          req
+        );
       }
-    }
-    onDone((response, isRejected) => {
-      isDone = true;
-      clearConnectPhaseTimer();
-      if (isRejected) {
-        rejected = true;
-        onFinished();
-        return;
+
+      abortEmitter.once('abort', reject);
+
+      const onFinished = () => {
+        clearConnectPhaseTimer();
+
+        if (config.cancelToken) {
+          config.cancelToken.unsubscribe(abort);
+        }
+
+        if (config.signal) {
+          config.signal.removeEventListener('abort', abort);
+        }
+
+        abortEmitter.removeAllListeners();
+      };
+
+      if (config.cancelToken || config.signal) {
+        config.cancelToken && config.cancelToken.subscribe(abort);
+        if (config.signal) {
+          config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
+        }
       }
-      const {
-        data
-      } = response;
-      if (data instanceof stream.Readable || data instanceof stream.Duplex) {
-        const offListeners = stream.finished(data, () => {
-          offListeners();
+
+      onDone((response, isRejected) => {
+        isDone = true;
+        clearConnectPhaseTimer();
+
+        if (isRejected) {
+          rejected = true;
           onFinished();
-        });
-      } else {
-        onFinished();
-      }
-    });
+          return;
+        }
 
-    // Parse url
-    const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config);
-    const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
-    const protocol = parsed.protocol || supportedProtocols[0];
-    if (protocol === 'data:') {
-      // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
-      if (maxContentLength > -1) {
-        // Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed.
-        const dataUrl = String(own('url') || fullPath || '');
-        const estimated = estimateDataURLDecodedBytes(dataUrl);
-        if (estimated > maxContentLength) {
-          return reject(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config));
+        const { data } = response;
+
+        if (data instanceof external_stream_.Readable || data instanceof external_stream_.Duplex) {
+          const offListeners = external_stream_.finished(data, () => {
+            offListeners();
+            onFinished();
+          });
+        } else {
+          onFinished();
         }
-      }
-      let convertedData;
-      if (method !== 'GET') {
+      });
+
+      // Parse url
+      const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config);
+      const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
+      const protocol = parsed.protocol || supportedProtocols[0];
+
+      if (protocol === 'data:') {
+        // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
+        if (maxContentLength > -1) {
+          // Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed.
+          const dataUrl = String(own('url') || fullPath || '');
+          const estimated = estimateDataURLDecodedBytes(dataUrl);
+
+          if (estimated > maxContentLength) {
+            return reject(
+              new core_AxiosError(
+                'maxContentLength size of ' + maxContentLength + ' exceeded',
+                core_AxiosError.ERR_BAD_RESPONSE,
+                config
+              )
+            );
+          }
+        }
+
+        let convertedData;
+
+        if (method !== 'GET') {
+          return settle(resolve, reject, {
+            status: 405,
+            statusText: 'method not allowed',
+            headers: {},
+            config,
+          });
+        }
+
+        try {
+          convertedData = fromDataURI(own('url'), responseType === 'blob', {
+            Blob: config.env && config.env.Blob,
+          });
+        } catch (err) {
+          throw core_AxiosError.from(err, core_AxiosError.ERR_BAD_REQUEST, config);
+        }
+
+        if (responseType === 'text') {
+          convertedData = convertedData.toString(responseEncoding);
+
+          if (!responseEncoding || responseEncoding === 'utf8') {
+            convertedData = utils.stripBOM(convertedData);
+          }
+        } else if (responseType === 'stream') {
+          convertedData = external_stream_.Readable.from(convertedData);
+        }
+
         return settle(resolve, reject, {
-          status: 405,
-          statusText: 'method not allowed',
-          headers: {},
-          config
+          data: convertedData,
+          status: 200,
+          statusText: 'OK',
+          headers: new core_AxiosHeaders(),
+          config,
         });
       }
-      try {
-        convertedData = fromDataURI(own('url'), responseType === 'blob', {
-          Blob: config.env && config.env.Blob
-        });
-      } catch (err) {
-        throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
+
+      if (supportedProtocols.indexOf(protocol) === -1) {
+        return reject(
+          new core_AxiosError('Unsupported protocol ' + protocol, core_AxiosError.ERR_BAD_REQUEST, config)
+        );
       }
-      if (responseType === 'text') {
-        convertedData = convertedData.toString(responseEncoding);
-        if (!responseEncoding || responseEncoding === 'utf8') {
-          convertedData = utils$1.stripBOM(convertedData);
+
+      const headers = core_AxiosHeaders.from(config.headers).normalize();
+
+      // Set User-Agent (required by some servers)
+      // See https://github.com/axios/axios/issues/69
+      // User-Agent is specified; handle case where no UA header is desired
+      // Only set header if it hasn't been set in config
+      headers.set('User-Agent', 'axios/' + VERSION, false);
+
+      const { onUploadProgress, onDownloadProgress } = config;
+      const maxRate = config.maxRate;
+      let maxUploadRate = undefined;
+      let maxDownloadRate = undefined;
+
+      // support for spec compliant FormData objects
+      if (utils.isSpecCompliantForm(data)) {
+        const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
+
+        data = helpers_formDataToStream(
+          data,
+          (formHeaders) => {
+            headers.set(formHeaders);
+          },
+          {
+            tag: `axios-${VERSION}-boundary`,
+            boundary: (userBoundary && userBoundary[1]) || undefined,
+          }
+        );
+        // support for https://www.npmjs.com/package/form-data api
+      } else if (
+        utils.isFormData(data) &&
+        utils.isFunction(data.getHeaders) &&
+        data.getHeaders !== Object.prototype.getHeaders
+      ) {
+        setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
+
+        if (!headers.hasContentLength()) {
+          try {
+            const knownLength = await external_util_.promisify(data.getLength).call(data);
+            Number.isFinite(knownLength) &&
+              knownLength >= 0 &&
+              headers.setContentLength(knownLength);
+            /*eslint no-empty:0*/
+          } catch (e) {}
+        }
+      } else if (utils.isBlob(data) || utils.isFile(data)) {
+        data.size && headers.setContentType(data.type || 'application/octet-stream');
+        headers.setContentLength(data.size || 0);
+        data = external_stream_.Readable.from(helpers_readBlob(data));
+      } else if (data && !utils.isStream(data)) {
+        if (Buffer.isBuffer(data)) {
+          // Nothing to do...
+        } else if (utils.isArrayBuffer(data)) {
+          data = Buffer.from(new Uint8Array(data));
+        } else if (utils.isString(data)) {
+          data = Buffer.from(data, 'utf-8');
+        } else {
+          return reject(
+            new core_AxiosError(
+              'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
+              core_AxiosError.ERR_BAD_REQUEST,
+              config
+            )
+          );
+        }
+
+        // Add Content-Length header if data exists
+        headers.setContentLength(data.length, false);
+
+        if (maxBodyLength > -1 && data.length > maxBodyLength) {
+          return reject(
+            new core_AxiosError(
+              'Request body larger than maxBodyLength limit',
+              core_AxiosError.ERR_BAD_REQUEST,
+              config
+            )
+          );
         }
-      } else if (responseType === 'stream') {
-        convertedData = stream.Readable.from(convertedData);
       }
-      return settle(resolve, reject, {
-        data: convertedData,
-        status: 200,
-        statusText: 'OK',
-        headers: new AxiosHeaders(),
-        config
-      });
-    }
-    if (supportedProtocols.indexOf(protocol) === -1) {
-      return reject(new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config));
-    }
-    const headers = AxiosHeaders.from(config.headers).normalize();
 
-    // Set User-Agent (required by some servers)
-    // See https://github.com/axios/axios/issues/69
-    // User-Agent is specified; handle case where no UA header is desired
-    // Only set header if it hasn't been set in config
-    headers.set('User-Agent', 'axios/' + VERSION, false);
-    const {
-      onUploadProgress,
-      onDownloadProgress
-    } = config;
-    const maxRate = config.maxRate;
-    let maxUploadRate = undefined;
-    let maxDownloadRate = undefined;
-
-    // support for spec compliant FormData objects
-    if (utils$1.isSpecCompliantForm(data)) {
-      const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
-      data = formDataToStream(data, formHeaders => {
-        headers.set(formHeaders);
-      }, {
-        tag: `axios-${VERSION}-boundary`,
-        boundary: userBoundary && userBoundary[1] || undefined
-      });
-      // support for https://www.npmjs.com/package/form-data api
-    } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
-      setFormDataHeaders$1(headers, data.getHeaders(), own('formDataHeaderPolicy'));
-      if (!headers.hasContentLength()) {
-        try {
-          const knownLength = await util.promisify(data.getLength).call(data);
-          Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
-          /*eslint no-empty:0*/
-        } catch (e) {}
-      }
-    } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
-      data.size && headers.setContentType(data.type || 'application/octet-stream');
-      headers.setContentLength(data.size || 0);
-      data = stream.Readable.from(readBlob(data));
-    } else if (data && !utils$1.isStream(data)) {
-      if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
-        data = Buffer.from(new Uint8Array(data));
-      } else if (utils$1.isString(data)) {
-        data = Buffer.from(data, 'utf-8');
+      const contentLength = utils.toFiniteNumber(headers.getContentLength());
+
+      if (utils.isArray(maxRate)) {
+        maxUploadRate = maxRate[0];
+        maxDownloadRate = maxRate[1];
       } else {
-        return reject(new AxiosError('Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', AxiosError.ERR_BAD_REQUEST, config));
+        maxUploadRate = maxDownloadRate = maxRate;
       }
 
-      // Add Content-Length header if data exists
-      headers.setContentLength(data.length, false);
-      if (maxBodyLength > -1 && data.length > maxBodyLength) {
-        return reject(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config));
-      }
-    }
-    const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
-    if (utils$1.isArray(maxRate)) {
-      maxUploadRate = maxRate[0];
-      maxDownloadRate = maxRate[1];
-    } else {
-      maxUploadRate = maxDownloadRate = maxRate;
-    }
-    if (data && (onUploadProgress || maxUploadRate)) {
-      if (!utils$1.isStream(data)) {
-        data = stream.Readable.from(data, {
-          objectMode: false
-        });
+      if (data && (onUploadProgress || maxUploadRate)) {
+        if (!utils.isStream(data)) {
+          data = external_stream_.Readable.from(data, { objectMode: false });
+        }
+
+        data = external_stream_.pipeline(
+          [
+            data,
+            new helpers_AxiosTransformStream({
+              maxRate: utils.toFiniteNumber(maxUploadRate),
+            }),
+          ],
+          utils.noop
+        );
+
+        onUploadProgress &&
+          data.on(
+            'progress',
+            flushOnFinish(
+              data,
+              progressEventDecorator(
+                contentLength,
+                progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
+              )
+            )
+          );
       }
-      data = stream.pipeline([data, new AxiosTransformStream({
-        maxRate: utils$1.toFiniteNumber(maxUploadRate)
-      })], utils$1.noop);
-      onUploadProgress && data.on('progress', flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
-    }
 
-    // HTTP basic authentication
-    let auth = undefined;
-    const configAuth = own('auth');
-    if (configAuth) {
-      const username = utils$1.getSafeProp(configAuth, 'username') || '';
-      const password = utils$1.getSafeProp(configAuth, 'password') || '';
-      auth = username + ':' + password;
-    }
-    if (!auth && (parsed.username || parsed.password)) {
-      const urlUsername = decodeURIComponentSafe$1(parsed.username);
-      const urlPassword = decodeURIComponentSafe$1(parsed.password);
-      auth = urlUsername + ':' + urlPassword;
-    }
-    auth && headers.delete('authorization');
-    let path$1;
-    try {
-      path$1 = buildURL(parsed.pathname + parsed.search, own('params'), own('paramsSerializer')).replace(/^\?/, '');
-    } catch (err) {
-      const customErr = new Error(err.message);
-      customErr.config = config;
-      customErr.url = own('url');
-      customErr.exists = true;
-      return reject(customErr);
-    }
-    headers.set('Accept-Encoding', utils$1.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false);
-
-    // Null-prototype to block prototype pollution gadgets on properties read
-    // directly by Node's http.request (e.g. insecureHTTPParser, lookup).
-    const options = Object.assign(Object.create(null), {
-      path: path$1,
-      method: method,
-      headers: toByteStringHeaderObject(headers),
-      agents: {
-        http: httpAgent,
-        https: httpsAgent
-      },
-      auth,
-      protocol,
-      family,
-      beforeRedirect: dispatchBeforeRedirect,
-      beforeRedirects: Object.create(null),
-      http2Options
-    });
+      // HTTP basic authentication
+      let auth = undefined;
+      const configAuth = own('auth');
+      if (configAuth) {
+        const username = utils.getSafeProp(configAuth, 'username') || '';
+        const password = utils.getSafeProp(configAuth, 'password') || '';
+        auth = username + ':' + password;
+      }
 
-    // cacheable-lookup integration hotfix
-    !utils$1.isUndefined(lookup) && (options.lookup = lookup);
-    const socketPath = own('socketPath');
-    if (socketPath) {
-      if (typeof socketPath !== 'string') {
-        return reject(new AxiosError('socketPath must be a string', AxiosError.ERR_BAD_OPTION_VALUE, config));
+      if (!auth && (parsed.username || parsed.password)) {
+        const urlUsername = decodeURIComponentSafe(parsed.username);
+        const urlPassword = decodeURIComponentSafe(parsed.password);
+        auth = urlUsername + ':' + urlPassword;
       }
-      const allowedSocketPaths = own('allowedSocketPaths');
-      if (allowedSocketPaths != null) {
-        const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths];
-        const resolvedSocket = path.resolve(socketPath);
-        const isAllowed = allowed.some(entry => typeof entry === 'string' && path.resolve(entry) === resolvedSocket);
-        if (!isAllowed) {
-          return reject(new AxiosError(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config));
+
+      auth && headers.delete('authorization');
+
+      let path;
+
+      try {
+        path = buildURL(
+          parsed.pathname + parsed.search,
+          own('params'),
+          own('paramsSerializer')
+        ).replace(/^\?/, '');
+      } catch (err) {
+        const customErr = new Error(err.message);
+        customErr.config = config;
+        customErr.url = own('url');
+        customErr.exists = true;
+        return reject(customErr);
+      }
+
+      headers.set(
+        'Accept-Encoding',
+        utils.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') &&
+        transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING,
+        false
+      );
+
+      // Null-prototype to block prototype pollution gadgets on properties read
+      // directly by Node's http.request (e.g. insecureHTTPParser, lookup).
+      const options = Object.assign(Object.create(null), {
+        path,
+        method: method,
+        headers: toByteStringHeaderObject(headers),
+        agents: { http: httpAgent, https: httpsAgent },
+        auth,
+        protocol,
+        family,
+        beforeRedirect: dispatchBeforeRedirect,
+        beforeRedirects: Object.create(null),
+        http2Options,
+      });
+
+      // cacheable-lookup integration hotfix
+      !utils.isUndefined(lookup) && (options.lookup = lookup);
+
+      const socketPath = own('socketPath');
+      if (socketPath) {
+        if (typeof socketPath !== 'string') {
+          return reject(
+            new core_AxiosError('socketPath must be a string', core_AxiosError.ERR_BAD_OPTION_VALUE, config)
+          );
+        }
+
+        const allowedSocketPaths = own('allowedSocketPaths');
+        if (allowedSocketPaths != null) {
+          const allowed = Array.isArray(allowedSocketPaths)
+            ? allowedSocketPaths
+            : [allowedSocketPaths];
+
+          const resolvedSocket = (0,external_path_.resolve)(socketPath);
+          const isAllowed = allowed.some(
+            (entry) => typeof entry === 'string' && (0,external_path_.resolve)(entry) === resolvedSocket
+          );
+
+          if (!isAllowed) {
+            return reject(
+              new core_AxiosError(
+                `socketPath "${socketPath}" is not permitted by allowedSocketPaths`,
+                core_AxiosError.ERR_BAD_OPTION_VALUE,
+                config
+              )
+            );
+          }
         }
+
+        options.socketPath = socketPath;
+      } else {
+        options.hostname = parsed.hostname.startsWith('[')
+          ? parsed.hostname.slice(1, -1)
+          : parsed.hostname;
+        options.port = parsed.port;
+        setProxy(
+          options,
+          own('proxy'),
+          protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path,
+          false,
+          httpsAgent
+        );
       }
-      options.socketPath = socketPath;
-    } else {
-      options.hostname = parsed.hostname.startsWith('[') ? parsed.hostname.slice(1, -1) : parsed.hostname;
-      options.port = parsed.port;
-      setProxy(options, own('proxy'), protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, httpsAgent);
-    }
-    let transport;
-    let isNativeTransport = false;
-    // True only for the follow-redirects transport, which applies
-    // options.maxBodyLength itself. Every other transport (http2, native
-    // http/https, a user-supplied custom transport) needs the explicit
-    // byte-counting pipeline below to enforce maxBodyLength on streamed uploads.
-    let transportEnforcesMaxBodyLength = false;
-    const isHttpsRequest = isHttps.test(options.protocol);
-    // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an
-    // HTTPS target.
-    if (options.agent == null) {
-      options.agent = isHttpsRequest ? httpsAgent : httpAgent;
-    }
-    if (isHttp2) {
-      transport = http2Transport;
-    } else {
-      const configTransport = own('transport');
-      if (configTransport) {
-        transport = configTransport;
-      } else if (maxRedirects === 0) {
-        transport = isHttpsRequest ? https : http;
-        isNativeTransport = true;
+      let transport;
+      let isNativeTransport = false;
+      // True only for the follow-redirects transport, which applies
+      // options.maxBodyLength itself. Every other transport (http2, native
+      // http/https, a user-supplied custom transport) needs the explicit
+      // byte-counting pipeline below to enforce maxBodyLength on streamed uploads.
+      let transportEnforcesMaxBodyLength = false;
+      const isHttpsRequest = isHttps.test(options.protocol);
+      // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an
+      // HTTPS target.
+      if (options.agent == null) {
+        options.agent = isHttpsRequest ? httpsAgent : httpAgent;
+      }
+
+      if (isHttp2) {
+        transport = http2Transport;
       } else {
-        transportEnforcesMaxBodyLength = true;
-        options.sensitiveHeaders = [];
-        if (maxRedirects) {
-          options.maxRedirects = maxRedirects;
-        }
-        const configBeforeRedirect = own('beforeRedirect');
-        if (configBeforeRedirect) {
-          options.beforeRedirects.config = configBeforeRedirect;
-        }
-        if (auth) {
-          // Restore HTTP Basic credentials on same-origin redirects only.
-          // follow-redirects >= 1.15.8 strips Authorization on every redirect (see #6929);
-          // cross-origin stripping is the documented mitigation for T-R2 in THREATMODEL.md
-          // and is preserved by deliberately not restoring on origin change.
-          const requestOrigin = parsed.origin;
-          const authToRestore = auth;
-          options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) {
-            try {
-              if (new URL(redirectOptions.href).origin === requestOrigin) {
-                redirectOptions.auth = authToRestore;
-              }
-            } catch (e) {
-              // ignore malformed URL: leaving auth stripped is fail-safe
-            }
-          };
-        }
-        const sensitiveHeaders = own('sensitiveHeaders');
-        if (sensitiveHeaders != null) {
-          if (!utils$1.isArray(sensitiveHeaders)) {
-            return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config));
+        const configTransport = own('transport');
+        if (configTransport) {
+          transport = configTransport;
+        } else if (maxRedirects === 0) {
+          transport = isHttpsRequest ? external_https_ : external_http_;
+          isNativeTransport = true;
+        } else {
+          transportEnforcesMaxBodyLength = true;
+          options.sensitiveHeaders = [];
+          if (maxRedirects) {
+            options.maxRedirects = maxRedirects;
           }
-          const sensitiveSet = new Set();
-          for (const header of sensitiveHeaders) {
-            if (!utils$1.isString(header)) {
-              return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config));
-            }
-            sensitiveSet.add(header.toLowerCase());
+          const configBeforeRedirect = own('beforeRedirect');
+          if (configBeforeRedirect) {
+            options.beforeRedirects.config = configBeforeRedirect;
           }
-          if (sensitiveSet.size) {
-            options.sensitiveHeaders = Array.from(sensitiveSet);
-            options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) {
-              if (!isSameOriginRedirect(redirectOptions, requestDetails)) {
-                stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
+          if (auth) {
+            // Restore HTTP Basic credentials on same-origin redirects only.
+            // follow-redirects >= 1.15.8 strips Authorization on every redirect (see #6929);
+            // cross-origin stripping is the documented mitigation for T-R2 in THREATMODEL.md
+            // and is preserved by deliberately not restoring on origin change.
+            const requestOrigin = parsed.origin;
+            const authToRestore = auth;
+            options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) {
+              try {
+                if (new URL(redirectOptions.href).origin === requestOrigin) {
+                  redirectOptions.auth = authToRestore;
+                }
+              } catch (e) {
+                // ignore malformed URL: leaving auth stripped is fail-safe
               }
             };
           }
+          const sensitiveHeaders = own('sensitiveHeaders');
+          if (sensitiveHeaders != null) {
+            if (!utils.isArray(sensitiveHeaders)) {
+              return reject(
+                new core_AxiosError(
+                  'sensitiveHeaders must be an array of strings',
+                  core_AxiosError.ERR_BAD_OPTION_VALUE,
+                  config
+                )
+              );
+            }
+
+            const sensitiveSet = new Set();
+            for (const header of sensitiveHeaders) {
+              if (!utils.isString(header)) {
+                return reject(
+                  new core_AxiosError(
+                    'sensitiveHeaders must be an array of strings',
+                    core_AxiosError.ERR_BAD_OPTION_VALUE,
+                    config
+                  )
+                );
+              }
+
+              sensitiveSet.add(header.toLowerCase());
+            }
+
+            if (sensitiveSet.size) {
+              options.sensitiveHeaders = Array.from(sensitiveSet);
+              options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(
+                redirectOptions,
+                requestDetails
+              ) {
+                if (!isSameOriginRedirect(redirectOptions, requestDetails)) {
+                  stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
+                }
+              };
+            }
+          }
+          transport = isHttpsRequest ? httpsFollow : httpFollow;
         }
-        transport = isHttpsRequest ? httpsFollow : httpFollow;
       }
-    }
-    if (maxBodyLength > -1) {
-      options.maxBodyLength = maxBodyLength;
-    } else {
-      // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
-      options.maxBodyLength = Infinity;
-    }
-
-    // Always set an explicit own value so a polluted
-    // Object.prototype.insecureHTTPParser cannot enable the lenient parser
-    // through Node's internal options copy
-    options.insecureHTTPParser = Boolean(own('insecureHTTPParser'));
-
-    // Create the request
-    req = transport.request(options, function handleResponse(res) {
-      clearConnectPhaseTimer();
-      if (req.destroyed) return;
-      const streams = [res];
-      const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
-      if (onDownloadProgress || maxDownloadRate) {
-        const transformStream = new AxiosTransformStream({
-          maxRate: utils$1.toFiniteNumber(maxDownloadRate)
-        });
-        onDownloadProgress && transformStream.on('progress', flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
-        streams.push(transformStream);
+
+      if (maxBodyLength > -1) {
+        options.maxBodyLength = maxBodyLength;
+      } else {
+        // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
+        options.maxBodyLength = Infinity;
       }
 
-      // decompress the response body transparently if required
-      let responseStream = res;
+      // Always set an explicit own value so a polluted
+      // Object.prototype.insecureHTTPParser cannot enable the lenient parser
+      // through Node's internal options copy
+      options.insecureHTTPParser = Boolean(own('insecureHTTPParser'));
+
+      // Create the request
+      req = transport.request(options, function handleResponse(res) {
+        clearConnectPhaseTimer();
+
+        if (req.destroyed) return;
+
+        const streams = [res];
 
-      // return the last request in case of redirects
-      const lastRequest = res.req || req;
+        const responseLength = utils.toFiniteNumber(res.headers['content-length']);
 
-      // if decompress disabled we should not decompress
-      if (decompress !== false && res.headers['content-encoding']) {
-        // if no content, but headers still say that it is encoded,
-        // remove the header not confuse downstream operations
-        if (method === 'HEAD' || res.statusCode === 204) {
-          delete res.headers['content-encoding'];
+        if (onDownloadProgress || maxDownloadRate) {
+          const transformStream = new helpers_AxiosTransformStream({
+            maxRate: utils.toFiniteNumber(maxDownloadRate),
+          });
+
+          onDownloadProgress &&
+            transformStream.on(
+              'progress',
+              flushOnFinish(
+                transformStream,
+                progressEventDecorator(
+                  responseLength,
+                  progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
+                )
+              )
+            );
+
+          streams.push(transformStream);
         }
-        switch ((res.headers['content-encoding'] || '').toLowerCase()) {
-          /*eslint default-case:0*/
-          case 'gzip':
-          case 'x-gzip':
-          case 'compress':
-          case 'x-compress':
-            // add the unzipper to the body stream processing pipeline
-            streams.push(zlib.createUnzip(zlibOptions));
 
-            // remove the content-encoding in order to not confuse downstream operations
-            delete res.headers['content-encoding'];
-            break;
-          case 'deflate':
-            streams.push(new ZlibHeaderTransformStream());
+        // decompress the response body transparently if required
+        let responseStream = res;
 
-            // add the unzipper to the body stream processing pipeline
-            streams.push(zlib.createUnzip(zlibOptions));
+        // return the last request in case of redirects
+        const lastRequest = res.req || req;
 
-            // remove the content-encoding in order to not confuse downstream operations
+        // if decompress disabled we should not decompress
+        if (decompress !== false && res.headers['content-encoding']) {
+          // if no content, but headers still say that it is encoded,
+          // remove the header not confuse downstream operations
+          if (method === 'HEAD' || res.statusCode === 204) {
             delete res.headers['content-encoding'];
-            break;
-          case 'br':
-            if (isBrotliSupported) {
-              streams.push(zlib.createBrotliDecompress(brotliOptions));
+          }
+
+          switch ((res.headers['content-encoding'] || '').toLowerCase()) {
+            /*eslint default-case:0*/
+            case 'gzip':
+            case 'x-gzip':
+            case 'compress':
+            case 'x-compress':
+              // add the unzipper to the body stream processing pipeline
+              streams.push(external_zlib_.createUnzip(zlibOptions));
+
+              // remove the content-encoding in order to not confuse downstream operations
               delete res.headers['content-encoding'];
-            }
-            break;
-          case 'zstd':
-            if (isZstdSupported) {
-              streams.push(zlib.createZstdDecompress(zstdOptions));
+              break;
+            case 'deflate':
+              streams.push(new helpers_ZlibHeaderTransformStream());
+
+              // add the unzipper to the body stream processing pipeline
+              streams.push(external_zlib_.createUnzip(zlibOptions));
+
+              // remove the content-encoding in order to not confuse downstream operations
               delete res.headers['content-encoding'];
-            }
-            break;
+              break;
+            case 'br':
+              if (isBrotliSupported) {
+                streams.push(external_zlib_.createBrotliDecompress(brotliOptions));
+                delete res.headers['content-encoding'];
+              }
+              break;
+            case 'zstd':
+              if (isZstdSupported) {
+                streams.push(external_zlib_.createZstdDecompress(zstdOptions));
+                delete res.headers['content-encoding'];
+              }
+              break;
+          }
         }
-      }
-      responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
-      const response = {
-        status: res.statusCode,
-        statusText: res.statusMessage,
-        headers: new AxiosHeaders(res.headers),
-        config,
-        request: lastRequest
-      };
-      if (responseType === 'stream') {
-        // Enforce maxContentLength on streamed responses; previously this
-        // was applied only to buffered responses.
-        if (maxContentLength > -1) {
-          const limit = maxContentLength;
-          const source = responseStream;
-          async function* enforceMaxContentLength() {
-            let totalResponseBytes = 0;
-            for await (const chunk of source) {
-              totalResponseBytes += chunk.length;
-              if (totalResponseBytes > limit) {
-                throw new AxiosError('maxContentLength size of ' + limit + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
+
+        responseStream = streams.length > 1 ? external_stream_.pipeline(streams, utils.noop) : streams[0];
+
+        const response = {
+          status: res.statusCode,
+          statusText: res.statusMessage,
+          headers: new core_AxiosHeaders(res.headers),
+          config,
+          request: lastRequest,
+        };
+
+        if (responseType === 'stream') {
+          // Enforce maxContentLength on streamed responses; previously this
+          // was applied only to buffered responses.
+          if (maxContentLength > -1) {
+            const limit = maxContentLength;
+            const source = responseStream;
+            async function* enforceMaxContentLength() {
+              let totalResponseBytes = 0;
+              for await (const chunk of source) {
+                totalResponseBytes += chunk.length;
+                if (totalResponseBytes > limit) {
+                  throw new core_AxiosError(
+                    'maxContentLength size of ' + limit + ' exceeded',
+                    core_AxiosError.ERR_BAD_RESPONSE,
+                    config,
+                    lastRequest
+                  );
+                }
+                yield chunk;
               }
-              yield chunk;
             }
+            responseStream = external_stream_.Readable.from(enforceMaxContentLength(), {
+              objectMode: false,
+            });
           }
-          responseStream = stream.Readable.from(enforceMaxContentLength(), {
-            objectMode: false
+          response.data = responseStream;
+          settle(resolve, reject, response);
+        } else {
+          const responseBuffer = [];
+          let totalResponseBytes = 0;
+
+          responseStream.on('data', function handleStreamData(chunk) {
+            responseBuffer.push(chunk);
+            totalResponseBytes += chunk.length;
+
+            // make sure the content length is not over the maxContentLength if specified
+            if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
+              // stream.destroy() emit aborted event before calling reject() on Node.js v16
+              rejected = true;
+              responseStream.destroy();
+              abort(
+                new core_AxiosError(
+                  'maxContentLength size of ' + maxContentLength + ' exceeded',
+                  core_AxiosError.ERR_BAD_RESPONSE,
+                  config,
+                  lastRequest
+                )
+              );
+            }
+          });
+
+          responseStream.on('aborted', function handlerStreamAborted() {
+            if (rejected) {
+              return;
+            }
+
+            const err = new core_AxiosError(
+              'stream has been aborted',
+              core_AxiosError.ERR_BAD_RESPONSE,
+              config,
+              lastRequest,
+              response
+            );
+            responseStream.destroy(err);
+            reject(err);
+          });
+
+          responseStream.on('error', function handleStreamError(err) {
+            if (rejected) return;
+            reject(core_AxiosError.from(err, null, config, lastRequest, response));
+          });
+
+          responseStream.on('end', function handleStreamEnd() {
+            try {
+              let responseData =
+                responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
+              if (responseType !== 'arraybuffer') {
+                responseData = responseData.toString(responseEncoding);
+                if (!responseEncoding || responseEncoding === 'utf8') {
+                  responseData = utils.stripBOM(responseData);
+                }
+              }
+              response.data = responseData;
+            } catch (err) {
+              return reject(core_AxiosError.from(err, null, config, response.request, response));
+            }
+            settle(resolve, reject, response);
           });
         }
-        response.data = responseStream;
-        settle(resolve, reject, response);
-      } else {
-        const responseBuffer = [];
-        let totalResponseBytes = 0;
-        responseStream.on('data', function handleStreamData(chunk) {
-          responseBuffer.push(chunk);
-          totalResponseBytes += chunk.length;
-
-          // make sure the content length is not over the maxContentLength if specified
-          if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
-            // stream.destroy() emit aborted event before calling reject() on Node.js v16
-            rejected = true;
+
+        abortEmitter.once('abort', (err) => {
+          if (!responseStream.destroyed) {
+            responseStream.emit('error', err);
             responseStream.destroy();
-            abort(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
-          }
-        });
-        responseStream.on('aborted', function handlerStreamAborted() {
-          if (rejected) {
-            return;
           }
-          const err = new AxiosError('stream has been aborted', AxiosError.ERR_BAD_RESPONSE, config, lastRequest, response);
-          responseStream.destroy(err);
-          reject(err);
         });
-        responseStream.on('error', function handleStreamError(err) {
-          if (rejected) return;
-          reject(AxiosError.from(err, null, config, lastRequest, response));
-        });
-        responseStream.on('end', function handleStreamEnd() {
-          try {
-            let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
-            if (responseType !== 'arraybuffer') {
-              responseData = responseData.toString(responseEncoding);
-              if (!responseEncoding || responseEncoding === 'utf8') {
-                responseData = utils$1.stripBOM(responseData);
-              }
+      });
+
+      abortEmitter.once('abort', (err) => {
+        if (req.close) {
+          req.close();
+        } else {
+          req.destroy(err);
+        }
+      });
+
+      // Handle errors
+      req.on('error', function handleRequestError(err) {
+        reject(core_AxiosError.from(err, null, config, req));
+      });
+
+      // set tcp keep alive to prevent drop connection by peer
+      // Track every socket bound to this outer RedirectableRequest so a single
+      // 'close' listener can release ownership on all of them. follow-redirects
+      // re-emits the 'socket' event for each hop's native request onto the same
+      // outer request, so attaching per-request listeners inside this handler
+      // would accumulate across hops and trigger MaxListenersExceededWarning at
+      // >= 11 redirects. Clearing only the last-bound socket would leave stale
+      // kAxiosCurrentReq refs on earlier hop sockets returned to the keep-alive
+      // pool, causing an idle-pool 'error' to be attributed to a closed req.
+      const boundSockets = new Set();
+
+      req.on('socket', function handleRequestSocket(socket) {
+        // default interval of sending ack packet is 1 minute
+        socket.setKeepAlive(true, 1000 * 60);
+
+        // Install a single 'error' listener per socket (not per request) to avoid
+        // accumulating listeners on pooled keep-alive sockets that get reassigned
+        // to new requests before the previous request's 'close' fires (issue #10780).
+        // The listener is bound to the socket's currently-active request via a
+        // symbol, which is swapped as the socket is reassigned.
+        if (!socket[kAxiosSocketListener]) {
+          socket.on('error', function handleSocketError(err) {
+            const current = socket[kAxiosCurrentReq];
+            if (current && !current.destroyed) {
+              current.destroy(err);
             }
-            response.data = responseData;
-          } catch (err) {
-            return reject(AxiosError.from(err, null, config, response.request, response));
+          });
+          socket[kAxiosSocketListener] = true;
+        }
+
+        socket[kAxiosCurrentReq] = req;
+        boundSockets.add(socket);
+      });
+
+      req.once('close', function clearCurrentReq() {
+        clearConnectPhaseTimer();
+
+        for (const socket of boundSockets) {
+          if (socket[kAxiosCurrentReq] === req) {
+            socket[kAxiosCurrentReq] = null;
           }
-          settle(resolve, reject, response);
-        });
-      }
-      abortEmitter.once('abort', err => {
-        if (!responseStream.destroyed) {
-          responseStream.emit('error', err);
-          responseStream.destroy();
         }
+        boundSockets.clear();
       });
-    });
-    abortEmitter.once('abort', err => {
-      if (req.close) {
-        req.close();
+
+      // Handle request timeout
+      if (own('timeout')) {
+        // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
+        const timeout = parseInt(own('timeout'), 10);
+
+        if (Number.isNaN(timeout)) {
+          abort(
+            new core_AxiosError(
+              'error trying to parse `config.timeout` to int',
+              core_AxiosError.ERR_BAD_OPTION_VALUE,
+              config,
+              req
+            )
+          );
+
+          return;
+        }
+
+        const handleTimeout = function handleTimeout() {
+          if (isDone) return;
+          abort(createTimeoutError());
+        };
+
+        if (isNativeTransport && timeout > 0) {
+          // Native ClientRequest#setTimeout starts from the socket lifecycle and
+          // may not fire while TCP connect is still pending. Mirror the
+          // follow-redirects wall-clock timer for the maxRedirects === 0 path.
+          connectPhaseTimer = setTimeout(handleTimeout, timeout);
+        }
+
+        // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
+        // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
+        // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
+        // And then these socket which be hang up will devouring CPU little by little.
+        // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
+        req.setTimeout(timeout, handleTimeout);
       } else {
-        req.destroy(err);
+        // explicitly reset the socket timeout value for a possible `keep-alive` request
+        req.setTimeout(0);
       }
-    });
 
-    // Handle errors
-    req.on('error', function handleRequestError(err) {
-      reject(AxiosError.from(err, null, config, req));
-    });
+      // Send the request
+      if (utils.isStream(data)) {
+        let ended = false;
+        let errored = false;
+
+        data.on('end', () => {
+          ended = true;
+        });
 
-    // set tcp keep alive to prevent drop connection by peer
-    // Track every socket bound to this outer RedirectableRequest so a single
-    // 'close' listener can release ownership on all of them. follow-redirects
-    // re-emits the 'socket' event for each hop's native request onto the same
-    // outer request, so attaching per-request listeners inside this handler
-    // would accumulate across hops and trigger MaxListenersExceededWarning at
-    // >= 11 redirects. Clearing only the last-bound socket would leave stale
-    // kAxiosCurrentReq refs on earlier hop sockets returned to the keep-alive
-    // pool, causing an idle-pool 'error' to be attributed to a closed req.
-    const boundSockets = new Set();
-    req.on('socket', function handleRequestSocket(socket) {
-      // default interval of sending ack packet is 1 minute
-      socket.setKeepAlive(true, 1000 * 60);
-
-      // Install a single 'error' listener per socket (not per request) to avoid
-      // accumulating listeners on pooled keep-alive sockets that get reassigned
-      // to new requests before the previous request's 'close' fires (issue #10780).
-      // The listener is bound to the socket's currently-active request via a
-      // symbol, which is swapped as the socket is reassigned.
-      if (!socket[kAxiosSocketListener]) {
-        socket.on('error', function handleSocketError(err) {
-          const current = socket[kAxiosCurrentReq];
-          if (current && !current.destroyed) {
-            current.destroy(err);
+        data.once('error', (err) => {
+          errored = true;
+          req.destroy(err);
+        });
+
+        data.on('close', () => {
+          if (!ended && !errored) {
+            abort(new cancel_CanceledError('Request stream has been aborted', config, req));
           }
         });
-        socket[kAxiosSocketListener] = true;
+
+        // Enforce maxBodyLength for streamed uploads on every transport that
+        // does not apply options.maxBodyLength itself (native http/https, http2,
+        // and user-supplied custom transports). The follow-redirects transport
+        // enforces it on the redirected HTTP/1 path.
+        let uploadStream = data;
+        if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
+          const limit = maxBodyLength;
+          let bytesSent = 0;
+          uploadStream = external_stream_.pipeline(
+            [
+              data,
+              new external_stream_.Transform({
+                transform(chunk, _enc, cb) {
+                  bytesSent += chunk.length;
+                  if (bytesSent > limit) {
+                    return cb(
+                      new core_AxiosError(
+                        'Request body larger than maxBodyLength limit',
+                        core_AxiosError.ERR_BAD_REQUEST,
+                        config,
+                        req
+                      )
+                    );
+                  }
+                  cb(null, chunk);
+                },
+              }),
+            ],
+            utils.noop
+          );
+          uploadStream.on('error', (err) => {
+            if (!req.destroyed) req.destroy(err);
+          });
+        }
+
+        uploadStream.pipe(req);
+      } else {
+        data && req.write(data);
+        req.end();
       }
-      socket[kAxiosCurrentReq] = req;
-      boundSockets.add(socket);
     });
-    req.once('close', function clearCurrentReq() {
-      clearConnectPhaseTimer();
-      for (const socket of boundSockets) {
-        if (socket[kAxiosCurrentReq] === req) {
-          socket[kAxiosCurrentReq] = null;
+  });
+
+const __setProxy = (/* unused pure expression or super */ null && (setProxy));
+const __isSameOriginRedirect = (/* unused pure expression or super */ null && (isSameOriginRedirect));
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/isURLSameOrigin.js
+
+
+/* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv
+  ? ((origin, isMSIE) => (url) => {
+      url = new URL(url, platform.origin);
+
+      return (
+        origin.protocol === url.protocol &&
+        origin.host === url.host &&
+        (isMSIE || origin.port === url.port)
+      );
+    })(
+      new URL(platform.origin),
+      platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
+    )
+  : () => true);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/cookies.js
+
+
+
+/* harmony default export */ const cookies = (platform.hasStandardBrowserEnv
+  ? // Standard browser envs support document.cookie
+    {
+      write(name, value, expires, path, domain, secure, sameSite) {
+        if (typeof document === 'undefined') return;
+
+        const cookie = [`${name}=${encodeURIComponent(value)}`];
+
+        if (utils.isNumber(expires)) {
+          cookie.push(`expires=${new Date(expires).toUTCString()}`);
         }
-      }
-      boundSockets.clear();
+        if (utils.isString(path)) {
+          cookie.push(`path=${path}`);
+        }
+        if (utils.isString(domain)) {
+          cookie.push(`domain=${domain}`);
+        }
+        if (secure === true) {
+          cookie.push('secure');
+        }
+        if (utils.isString(sameSite)) {
+          cookie.push(`SameSite=${sameSite}`);
+        }
+
+        document.cookie = cookie.join('; ');
+      },
+
+      read(name) {
+        if (typeof document === 'undefined') return null;
+        // Match name=value by splitting on the semicolon separator instead of building a
+        // RegExp from `name` — interpolating an unescaped string into a RegExp would let
+        // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
+        // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
+        // "; ", so ignore optional whitespace before each cookie name.
+        const cookies = document.cookie.split(';');
+        for (let i = 0; i < cookies.length; i++) {
+          const cookie = cookies[i].replace(/^\s+/, '');
+          const eq = cookie.indexOf('=');
+          if (eq !== -1 && cookie.slice(0, eq) === name) {
+            return decodeURIComponent(cookie.slice(eq + 1));
+          }
+        }
+        return null;
+      },
+
+      remove(name) {
+        this.write(name, '', Date.now() - 86400000, '/');
+      },
+    }
+  : // Non-standard browser env (web workers, react-native) lack needed support.
+    {
+      write() {},
+      read() {
+        return null;
+      },
+      remove() {},
     });
 
-    // Handle request timeout
-    if (own('timeout')) {
-      // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
-      const timeout = parseInt(own('timeout'), 10);
-      if (Number.isNaN(timeout)) {
-        abort(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req));
-        return;
-      }
-      const handleTimeout = function handleTimeout() {
-        if (isDone) return;
-        abort(createTimeoutError());
-      };
-      if (isNativeTransport && timeout > 0) {
-        // Native ClientRequest#setTimeout starts from the socket lifecycle and
-        // may not fire while TCP connect is still pending. Mirror the
-        // follow-redirects wall-clock timer for the maxRedirects === 0 path.
-        connectPhaseTimer = setTimeout(handleTimeout, timeout);
-      }
-
-      // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
-      // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
-      // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
-      // And then these socket which be hang up will devouring CPU little by little.
-      // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
-      req.setTimeout(timeout, handleTimeout);
-    } else {
-      // explicitly reset the socket timeout value for a possible `keep-alive` request
-      req.setTimeout(0);
-    }
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/mergeConfig.js
 
-    // Send the request
-    if (utils$1.isStream(data)) {
-      let ended = false;
-      let errored = false;
-      data.on('end', () => {
-        ended = true;
-      });
-      data.once('error', err => {
-        errored = true;
-        req.destroy(err);
-      });
-      data.on('close', () => {
-        if (!ended && !errored) {
-          abort(new CanceledError('Request stream has been aborted', config, req));
-        }
-      });
 
-      // Enforce maxBodyLength for streamed uploads on every transport that
-      // does not apply options.maxBodyLength itself (native http/https, http2,
-      // and user-supplied custom transports). The follow-redirects transport
-      // enforces it on the redirected HTTP/1 path.
-      let uploadStream = data;
-      if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
-        const limit = maxBodyLength;
-        let bytesSent = 0;
-        uploadStream = stream.pipeline([data, new stream.Transform({
-          transform(chunk, _enc, cb) {
-            bytesSent += chunk.length;
-            if (bytesSent > limit) {
-              return cb(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, req));
-            }
-            cb(null, chunk);
-          }
-        })], utils$1.noop);
-        uploadStream.on('error', err => {
-          if (!req.destroyed) req.destroy(err);
-        });
-      }
-      uploadStream.pipe(req);
-    } else {
-      data && req.write(data);
-      req.end();
-    }
-  });
-};
 
-var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => url => {
-  url = new URL(url, platform.origin);
-  return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
-})(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : () => true;
 
-var cookies = platform.hasStandardBrowserEnv ?
-// Standard browser envs support document.cookie
-{
-  write(name, value, expires, path, domain, secure, sameSite) {
-    if (typeof document === 'undefined') return;
-    const cookie = [`${name}=${encodeURIComponent(value)}`];
-    if (utils$1.isNumber(expires)) {
-      cookie.push(`expires=${new Date(expires).toUTCString()}`);
-    }
-    if (utils$1.isString(path)) {
-      cookie.push(`path=${path}`);
-    }
-    if (utils$1.isString(domain)) {
-      cookie.push(`domain=${domain}`);
-    }
-    if (secure === true) {
-      cookie.push('secure');
-    }
-    if (utils$1.isString(sameSite)) {
-      cookie.push(`SameSite=${sameSite}`);
-    }
-    document.cookie = cookie.join('; ');
-  },
-  read(name) {
-    if (typeof document === 'undefined') return null;
-    // Match name=value by splitting on the semicolon separator instead of building a
-    // RegExp from `name` — interpolating an unescaped string into a RegExp would let
-    // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
-    // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
-    // "; ", so ignore optional whitespace before each cookie name.
-    const cookies = document.cookie.split(';');
-    for (let i = 0; i < cookies.length; i++) {
-      const cookie = cookies[i].replace(/^\s+/, '');
-      const eq = cookie.indexOf('=');
-      if (eq !== -1 && cookie.slice(0, eq) === name) {
-        return decodeURIComponent(cookie.slice(eq + 1));
-      }
-    }
-    return null;
-  },
-  remove(name) {
-    this.write(name, '', Date.now() - 86400000, '/');
-  }
-} :
-// Non-standard browser env (web workers, react-native) lack needed support.
-{
-  write() {},
-  read() {
-    return null;
-  },
-  remove() {}
-};
 
-const headersToObject = thing => thing instanceof AxiosHeaders ? {
-  ...thing
-} : thing;
+const headersToObject = (thing) => (thing instanceof core_AxiosHeaders ? { ...thing } : thing);
 
 /**
  * Config-specific merge-function which creates a new config-object
@@ -127797,69 +161511,75 @@ function mergeConfig(config1, config2) {
     value: Object.prototype.hasOwnProperty,
     enumerable: false,
     writable: true,
-    configurable: true
+    configurable: true,
   });
+
   function getMergedValue(target, source, prop, caseless) {
-    if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
-      return utils$1.merge.call({
-        caseless
-      }, target, source);
-    } else if (utils$1.isPlainObject(source)) {
-      return utils$1.merge({}, source);
-    } else if (utils$1.isArray(source)) {
+    if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
+      return utils.merge.call({ caseless }, target, source);
+    } else if (utils.isPlainObject(source)) {
+      return utils.merge({}, source);
+    } else if (utils.isArray(source)) {
       return source.slice();
     }
     return source;
   }
+
   function mergeDeepProperties(a, b, prop, caseless) {
-    if (!utils$1.isUndefined(b)) {
+    if (!utils.isUndefined(b)) {
       return getMergedValue(a, b, prop, caseless);
-    } else if (!utils$1.isUndefined(a)) {
+    } else if (!utils.isUndefined(a)) {
       return getMergedValue(undefined, a, prop, caseless);
     }
   }
 
   // eslint-disable-next-line consistent-return
   function valueFromConfig2(a, b) {
-    if (!utils$1.isUndefined(b)) {
+    if (!utils.isUndefined(b)) {
       return getMergedValue(undefined, b);
     }
   }
 
   // eslint-disable-next-line consistent-return
   function defaultToConfig2(a, b) {
-    if (!utils$1.isUndefined(b)) {
+    if (!utils.isUndefined(b)) {
       return getMergedValue(undefined, b);
-    } else if (!utils$1.isUndefined(a)) {
+    } else if (!utils.isUndefined(a)) {
       return getMergedValue(undefined, a);
     }
   }
+
   function getMergedTransitionalOption(prop) {
-    const transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined;
-    if (!utils$1.isUndefined(transitional2)) {
-      if (utils$1.isPlainObject(transitional2)) {
-        if (utils$1.hasOwnProp(transitional2, prop)) {
+    const transitional2 = utils.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined;
+
+    if (!utils.isUndefined(transitional2)) {
+      if (utils.isPlainObject(transitional2)) {
+        if (utils.hasOwnProp(transitional2, prop)) {
           return transitional2[prop];
         }
       } else {
         return undefined;
       }
     }
-    const transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined;
-    if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
+
+    const transitional1 = utils.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined;
+
+    if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {
       return transitional1[prop];
     }
+
     return undefined;
   }
 
   // eslint-disable-next-line consistent-return
   function mergeDirectKeys(a, b, prop) {
-    if (utils$1.hasOwnProp(config2, prop)) {
+    if (utils.hasOwnProp(config2, prop)) {
       return getMergedValue(a, b);
-    } else if (utils$1.hasOwnProp(config1, prop)) {
+    } else if (utils.hasOwnProp(config1, prop)) {
       return getMergedValue(undefined, a);
     }
   }
+
   const mergeMap = {
     url: valueFromConfig2,
     method: valueFromConfig2,
@@ -127890,37 +161610,54 @@ function mergeConfig(config1, config2) {
     allowedSocketPaths: defaultToConfig2,
     responseEncoding: defaultToConfig2,
     validateStatus: mergeDirectKeys,
-    headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
+    headers: (a, b, prop) =>
+      mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
   };
-  utils$1.forEach(Object.keys({
-    ...config1,
-    ...config2
-  }), function computeConfigValue(prop) {
+
+  utils.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
     if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
-    const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
-    const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
-    const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
+    const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
+    const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;
+    const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;
     const configValue = merge(a, b, prop);
-    utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
+    (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
   });
-  if (utils$1.hasOwnProp(config2, 'validateStatus') && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption('validateStatusUndefinedResolves') === false) {
-    if (utils$1.hasOwnProp(config1, 'validateStatus')) {
+
+  if (
+    utils.hasOwnProp(config2, 'validateStatus') &&
+    utils.isUndefined(config2.validateStatus) &&
+    getMergedTransitionalOption('validateStatusUndefinedResolves') === false
+  ) {
+    if (utils.hasOwnProp(config1, 'validateStatus')) {
       config.validateStatus = getMergedValue(undefined, config1.validateStatus);
     } else {
       delete config.validateStatus;
     }
   }
+
   return config;
 }
 
-const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
-function setFormDataHeaders(headers, formHeaders, policy) {
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/resolveConfig.js
+
+
+
+
+
+
+
+
+
+const resolveConfig_FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
+
+function resolveConfig_setFormDataHeaders(headers, formHeaders, policy) {
   if (policy !== 'content-only') {
     headers.set(formHeaders);
     return;
   }
+
   Object.entries(formHeaders).forEach(([key, val]) => {
-    if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
+    if (resolveConfig_FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
       headers.set(key, val);
     }
   });
@@ -127934,13 +161671,18 @@ function setFormDataHeaders(headers, formHeaders, policy) {
  *
  * @returns {string} UTF-8 bytes as a Latin-1 string
  */
-const encodeUTF8$1 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
+const encodeUTF8 = (str) =>
+  encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
+    String.fromCharCode(parseInt(hex, 16))
+  );
+
 function resolveConfig(config) {
   const newConfig = mergeConfig({}, config);
 
   // Read only own properties to prevent prototype pollution gadgets
   // (e.g. Object.prototype.baseURL = 'https://evil.com').
-  const own = key => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined;
+  const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
+
   const data = own('data');
   let withXSRFToken = own('withXSRFToken');
   const xsrfHeaderName = own('xsrfHeaderName');
@@ -127950,21 +161692,36 @@ function resolveConfig(config) {
   const baseURL = own('baseURL');
   const allowAbsoluteUrls = own('allowAbsoluteUrls');
   const url = own('url');
-  newConfig.headers = headers = AxiosHeaders.from(headers);
-  newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer'));
+
+  newConfig.headers = headers = core_AxiosHeaders.from(headers);
+
+  newConfig.url = buildURL(
+    buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),
+    own('params'),
+    own('paramsSerializer')
+  );
 
   // HTTP basic authentication
   if (auth) {
-    const username = utils$1.getSafeProp(auth, 'username') || '';
-    const password = utils$1.getSafeProp(auth, 'password') || '';
-    headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')));
+    const username = utils.getSafeProp(auth, 'username') || '';
+    const password = utils.getSafeProp(auth, 'password') || '';
+
+    headers.set(
+      'Authorization',
+      'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))
+    );
   }
-  if (utils$1.isFormData(data)) {
-    if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
+
+  if (utils.isFormData(data)) {
+    if (
+      platform.hasStandardBrowserEnv ||
+      platform.hasStandardBrowserWebWorkerEnv ||
+      utils.isReactNative(data)
+    ) {
       headers.setContentType(undefined); // browser/web worker/RN handles it
-    } else if (utils$1.isFunction(data.getHeaders)) {
+    } else if (utils.isFunction(data.getHeaders)) {
       // Node.js FormData (like form-data package)
-      setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
+      resolveConfig_setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
     }
   }
 
@@ -127973,268 +161730,353 @@ function resolveConfig(config) {
   // Specifically not if we're in a web worker, or react-native.
 
   if (platform.hasStandardBrowserEnv) {
-    if (utils$1.isFunction(withXSRFToken)) {
+    if (utils.isFunction(withXSRFToken)) {
       withXSRFToken = withXSRFToken(newConfig);
     }
 
     // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
     // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
     // the XSRF token cross-origin.
-    const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url);
+    const shouldSendXSRF =
+      withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
+
     if (shouldSendXSRF) {
       const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
+
       if (xsrfValue) {
         headers.set(xsrfHeaderName, xsrfValue);
       }
     }
   }
+
   return newConfig;
 }
 
+/* harmony default export */ const helpers_resolveConfig = (resolveConfig);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/adapters/xhr.js
+
+
+
+
+
+
+
+
+
+
+
+
 const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
-var xhrAdapter = isXHRAdapterSupported && function (config) {
-  return new Promise(function dispatchXhrRequest(resolve, reject) {
-    const _config = resolveConfig(config);
-    let requestData = _config.data;
-    const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
-    let {
-      responseType,
-      onUploadProgress,
-      onDownloadProgress
-    } = _config;
-    let onCanceled;
-    let uploadThrottled, downloadThrottled;
-    let flushUpload, flushDownload;
-    function done() {
-      flushUpload && flushUpload(); // flush events
-      flushDownload && flushDownload(); // flush events
 
-      _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
-      _config.signal && _config.signal.removeEventListener('abort', onCanceled);
-    }
-    let request = new XMLHttpRequest();
-    request.open(_config.method.toUpperCase(), _config.url, true);
+/* harmony default export */ const xhr = (isXHRAdapterSupported &&
+  function (config) {
+    return new Promise(function dispatchXhrRequest(resolve, reject) {
+      const _config = helpers_resolveConfig(config);
+      let requestData = _config.data;
+      const requestHeaders = core_AxiosHeaders.from(_config.headers).normalize();
+      let { responseType, onUploadProgress, onDownloadProgress } = _config;
+      let onCanceled;
+      let uploadThrottled, downloadThrottled;
+      let flushUpload, flushDownload;
 
-    // Set the request timeout in MS
-    request.timeout = _config.timeout;
-    function onloadend() {
-      if (!request) {
-        return;
+      function done() {
+        flushUpload && flushUpload(); // flush events
+        flushDownload && flushDownload(); // flush events
+
+        _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
+
+        _config.signal && _config.signal.removeEventListener('abort', onCanceled);
       }
-      // Prepare the response
-      const responseHeaders = AxiosHeaders.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
-      const responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
-      const response = {
-        data: responseData,
-        status: request.status,
-        statusText: request.statusText,
-        headers: responseHeaders,
-        config,
-        request
-      };
-      settle(function _resolve(value) {
-        resolve(value);
-        done();
-      }, function _reject(err) {
-        reject(err);
-        done();
-      }, response);
 
-      // Clean up request
-      request = null;
-    }
-    if ('onloadend' in request) {
-      // Use onloadend if available
-      request.onloadend = onloadend;
-    } else {
-      // Listen for ready state to emulate onloadend
-      request.onreadystatechange = function handleLoad() {
-        if (!request || request.readyState !== 4) {
+      let request = new XMLHttpRequest();
+
+      request.open(_config.method.toUpperCase(), _config.url, true);
+
+      // Set the request timeout in MS
+      request.timeout = _config.timeout;
+
+      function onloadend() {
+        if (!request) {
           return;
         }
+        // Prepare the response
+        const responseHeaders = core_AxiosHeaders.from(
+          'getAllResponseHeaders' in request && request.getAllResponseHeaders()
+        );
+        const responseData =
+          !responseType || responseType === 'text' || responseType === 'json'
+            ? request.responseText
+            : request.response;
+        const response = {
+          data: responseData,
+          status: request.status,
+          statusText: request.statusText,
+          headers: responseHeaders,
+          config,
+          request,
+        };
+
+        settle(
+          function _resolve(value) {
+            resolve(value);
+            done();
+          },
+          function _reject(err) {
+            reject(err);
+            done();
+          },
+          response
+        );
+
+        // Clean up request
+        request = null;
+      }
+
+      if ('onloadend' in request) {
+        // Use onloadend if available
+        request.onloadend = onloadend;
+      } else {
+        // Listen for ready state to emulate onloadend
+        request.onreadystatechange = function handleLoad() {
+          if (!request || request.readyState !== 4) {
+            return;
+          }
+
+          // The request errored out and we didn't get a response, this will be
+          // handled by onerror instead
+          // With one exception: request that using file: protocol, most browsers
+          // will return status as 0 even though it's a successful request
+          if (
+            request.status === 0 &&
+            !(request.responseURL && request.responseURL.startsWith('file:'))
+          ) {
+            return;
+          }
+          // readystate handler is calling before onerror or ontimeout handlers,
+          // so we should call onloadend on the next 'tick'
+          setTimeout(onloadend);
+        };
+      }
 
-        // The request errored out and we didn't get a response, this will be
-        // handled by onerror instead
-        // With one exception: request that using file: protocol, most browsers
-        // will return status as 0 even though it's a successful request
-        if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith('file:'))) {
+      // Handle browser request cancellation (as opposed to a manual cancellation)
+      request.onabort = function handleAbort() {
+        if (!request) {
           return;
         }
-        // readystate handler is calling before onerror or ontimeout handlers,
-        // so we should call onloadend on the next 'tick'
-        setTimeout(onloadend);
+
+        reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request));
+        done();
+
+        // Clean up request
+        request = null;
       };
-    }
 
-    // Handle browser request cancellation (as opposed to a manual cancellation)
-    request.onabort = function handleAbort() {
-      if (!request) {
-        return;
-      }
-      reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
-      done();
+      // Handle low level network errors
+      request.onerror = function handleError(event) {
+        // Browsers deliver a ProgressEvent in XHR onerror
+        // (message may be empty; when present, surface it)
+        // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
+        const msg = event && event.message ? event.message : 'Network Error';
+        const err = new core_AxiosError(msg, core_AxiosError.ERR_NETWORK, config, request);
+        // attach the underlying event for consumers who want details
+        err.event = event || null;
+        reject(err);
+        done();
+        request = null;
+      };
 
-      // Clean up request
-      request = null;
-    };
+      // Handle timeout
+      request.ontimeout = function handleTimeout() {
+        let timeoutErrorMessage = _config.timeout
+          ? 'timeout of ' + _config.timeout + 'ms exceeded'
+          : 'timeout exceeded';
+        const transitional = _config.transitional || defaults_transitional;
+        if (_config.timeoutErrorMessage) {
+          timeoutErrorMessage = _config.timeoutErrorMessage;
+        }
+        reject(
+          new core_AxiosError(
+            timeoutErrorMessage,
+            transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED,
+            config,
+            request
+          )
+        );
+        done();
 
-    // Handle low level network errors
-    request.onerror = function handleError(event) {
-      // Browsers deliver a ProgressEvent in XHR onerror
-      // (message may be empty; when present, surface it)
-      // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
-      const msg = event && event.message ? event.message : 'Network Error';
-      const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
-      // attach the underlying event for consumers who want details
-      err.event = event || null;
-      reject(err);
-      done();
-      request = null;
-    };
+        // Clean up request
+        request = null;
+      };
 
-    // Handle timeout
-    request.ontimeout = function handleTimeout() {
-      let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
-      const transitional = _config.transitional || transitionalDefaults;
-      if (_config.timeoutErrorMessage) {
-        timeoutErrorMessage = _config.timeoutErrorMessage;
+      // Remove Content-Type if data is undefined
+      requestData === undefined && requestHeaders.setContentType(null);
+
+      // Add headers to the request
+      if ('setRequestHeader' in request) {
+        utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
+          request.setRequestHeader(key, val);
+        });
       }
-      reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
-      done();
 
-      // Clean up request
-      request = null;
-    };
+      // Add withCredentials to request if needed
+      if (!utils.isUndefined(_config.withCredentials)) {
+        request.withCredentials = !!_config.withCredentials;
+      }
 
-    // Remove Content-Type if data is undefined
-    requestData === undefined && requestHeaders.setContentType(null);
+      // Add responseType to request if needed
+      if (responseType && responseType !== 'json') {
+        request.responseType = _config.responseType;
+      }
 
-    // Add headers to the request
-    if ('setRequestHeader' in request) {
-      utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
-        request.setRequestHeader(key, val);
-      });
-    }
+      // Handle progress if needed
+      if (onDownloadProgress) {
+        [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
+        request.addEventListener('progress', downloadThrottled);
+      }
 
-    // Add withCredentials to request if needed
-    if (!utils$1.isUndefined(_config.withCredentials)) {
-      request.withCredentials = !!_config.withCredentials;
-    }
+      // Not all browsers support upload events
+      if (onUploadProgress && request.upload) {
+        [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
 
-    // Add responseType to request if needed
-    if (responseType && responseType !== 'json') {
-      request.responseType = _config.responseType;
-    }
+        request.upload.addEventListener('progress', uploadThrottled);
 
-    // Handle progress if needed
-    if (onDownloadProgress) {
-      [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
-      request.addEventListener('progress', downloadThrottled);
-    }
+        request.upload.addEventListener('loadend', flushUpload);
+      }
 
-    // Not all browsers support upload events
-    if (onUploadProgress && request.upload) {
-      [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
-      request.upload.addEventListener('progress', uploadThrottled);
-      request.upload.addEventListener('loadend', flushUpload);
-    }
-    if (_config.cancelToken || _config.signal) {
-      // Handle cancellation
-      // eslint-disable-next-line func-names
-      onCanceled = cancel => {
-        if (!request) {
-          return;
+      if (_config.cancelToken || _config.signal) {
+        // Handle cancellation
+        // eslint-disable-next-line func-names
+        onCanceled = (cancel) => {
+          if (!request) {
+            return;
+          }
+          reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel);
+          request.abort();
+          done();
+          request = null;
+        };
+
+        _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
+        if (_config.signal) {
+          _config.signal.aborted
+            ? onCanceled()
+            : _config.signal.addEventListener('abort', onCanceled);
         }
-        reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
-        request.abort();
-        done();
-        request = null;
-      };
-      _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
-      if (_config.signal) {
-        _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
       }
-    }
-    const protocol = parseProtocol(_config.url);
-    if (protocol && !platform.protocols.includes(protocol)) {
-      reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
-      return;
-    }
 
-    // Send the request
-    request.send(requestData || null);
+      const protocol = parseProtocol(_config.url);
+
+      if (protocol && !platform.protocols.includes(protocol)) {
+        reject(
+          new core_AxiosError(
+            'Unsupported protocol ' + protocol + ':',
+            core_AxiosError.ERR_BAD_REQUEST,
+            config
+          )
+        );
+        return;
+      }
+
+      // Send the request
+      request.send(requestData || null);
+    });
   });
-};
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/composeSignals.js
+
+
+
 
 const composeSignals = (signals, timeout) => {
   signals = signals ? signals.filter(Boolean) : [];
+
   if (!timeout && !signals.length) {
     return;
   }
+
   const controller = new AbortController();
+
   let aborted = false;
+
   const onabort = function (reason) {
     if (!aborted) {
       aborted = true;
       unsubscribe();
       const err = reason instanceof Error ? reason : this.reason;
-      controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
+      controller.abort(
+        err instanceof core_AxiosError
+          ? err
+          : new cancel_CanceledError(err instanceof Error ? err.message : err)
+      );
     }
   };
-  let timer = timeout && setTimeout(() => {
-    timer = null;
-    onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
-  }, timeout);
+
+  let timer =
+    timeout &&
+    setTimeout(() => {
+      timer = null;
+      onabort(new core_AxiosError(`timeout of ${timeout}ms exceeded`, core_AxiosError.ETIMEDOUT));
+    }, timeout);
+
   const unsubscribe = () => {
-    if (!signals) {
-      return;
-    }
+    if (!signals) { return; }
     timer && clearTimeout(timer);
     timer = null;
-    signals.forEach(signal => {
-      signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
+    signals.forEach((signal) => {
+      signal.unsubscribe
+        ? signal.unsubscribe(onabort)
+        : signal.removeEventListener('abort', onabort);
     });
     signals = null;
   };
-  signals.forEach(signal => signal.addEventListener('abort', onabort));
-  const {
-    signal
-  } = controller;
-  signal.unsubscribe = () => utils$1.asap(unsubscribe);
+
+  signals.forEach((signal) => signal.addEventListener('abort', onabort));
+
+  const { signal } = controller;
+
+  signal.unsubscribe = () => utils.asap(unsubscribe);
+
   return signal;
 };
 
+/* harmony default export */ const helpers_composeSignals = (composeSignals);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/trackStream.js
 const streamChunk = function* (chunk, chunkSize) {
   let len = chunk.byteLength;
-  if (len < chunkSize) {
+
+  if (!chunkSize || len < chunkSize) {
     yield chunk;
     return;
   }
+
   let pos = 0;
   let end;
+
   while (pos < len) {
     end = pos + chunkSize;
     yield chunk.slice(pos, end);
     pos = end;
   }
 };
+
 const readBytes = async function* (iterable, chunkSize) {
   for await (const chunk of readStream(iterable)) {
     yield* streamChunk(chunk, chunkSize);
   }
 };
+
 const readStream = async function* (stream) {
   if (stream[Symbol.asyncIterator]) {
     yield* stream;
     return;
   }
+
   const reader = stream.getReader();
   try {
     for (;;) {
-      const {
-        done,
-        value
-      } = await reader.read();
+      const { done, value } = await reader.read();
       if (done) {
         break;
       }
@@ -128244,52 +162086,70 @@ const readStream = async function* (stream) {
     await reader.cancel();
   }
 };
+
 const trackStream = (stream, chunkSize, onProgress, onFinish) => {
   const iterator = readBytes(stream, chunkSize);
+
   let bytes = 0;
   let done;
-  let _onFinish = e => {
+  let _onFinish = (e) => {
     if (!done) {
       done = true;
       onFinish && onFinish(e);
     }
   };
-  return new ReadableStream({
-    async pull(controller) {
-      try {
-        const {
-          done,
-          value
-        } = await iterator.next();
-        if (done) {
-          _onFinish();
-          controller.close();
-          return;
-        }
-        let len = value.byteLength;
-        if (onProgress) {
-          let loadedBytes = bytes += len;
-          onProgress(loadedBytes);
+
+  return new ReadableStream(
+    {
+      async pull(controller) {
+        try {
+          const { done, value } = await iterator.next();
+
+          if (done) {
+            _onFinish();
+            controller.close();
+            return;
+          }
+
+          let len = value.byteLength;
+          if (onProgress) {
+            let loadedBytes = (bytes += len);
+            onProgress(loadedBytes);
+          }
+          controller.enqueue(new Uint8Array(value));
+        } catch (err) {
+          _onFinish(err);
+          throw err;
         }
-        controller.enqueue(new Uint8Array(value));
-      } catch (err) {
-        _onFinish(err);
-        throw err;
-      }
+      },
+      cancel(reason) {
+        _onFinish(reason);
+        return iterator.return();
+      },
     },
-    cancel(reason) {
-      _onFinish(reason);
-      return iterator.return();
+    {
+      highWaterMark: 2,
     }
-  }, {
-    highWaterMark: 2
-  });
+  );
 };
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/adapters/fetch.js
+
+
+
+
+
+
+
+
+
+
+
+
+
 const DEFAULT_CHUNK_SIZE = 64 * 1024;
-const {
-  isFunction
-} = utils$1;
+
+const { isFunction: fetch_isFunction } = utils;
 
 /**
  * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
@@ -128299,22 +162159,27 @@ const {
  *
  * @returns {string} UTF-8 bytes as a Latin-1 string
  */
-const encodeUTF8 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
+const fetch_encodeUTF8 = (str) =>
+  encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
+    String.fromCharCode(parseInt(hex, 16))
+  );
 
 // Node's WHATWG URL parser returns `username` and `password` percent-encoded.
 // Decode before composing the `auth` option so credentials such as
 // `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the
 // original value for malformed input so a bad encoding never throws.
-const decodeURIComponentSafe = value => {
-  if (!utils$1.isString(value)) {
+const fetch_decodeURIComponentSafe = (value) => {
+  if (!utils.isString(value)) {
     return value;
   }
+
   try {
     return decodeURIComponent(value);
   } catch (error) {
     return value;
   }
 };
+
 const test = (fn, ...args) => {
   try {
     return !!fn(...args);
@@ -128322,7 +162187,8 @@ const test = (fn, ...args) => {
     return false;
   }
 };
-const maybeWithAuthCredentials = url => {
+
+const maybeWithAuthCredentials = (url) => {
   const protocolIndex = url.indexOf('://');
   let urlToCheck = url;
   if (protocolIndex !== -1) {
@@ -128330,91 +162196,135 @@ const maybeWithAuthCredentials = url => {
   }
   return urlToCheck.includes('@') || urlToCheck.includes(':');
 };
-const factory = env => {
-  const globalObject = utils$1.global !== undefined && utils$1.global !== null ? utils$1.global : globalThis;
-  const {
-    ReadableStream,
-    TextEncoder
-  } = globalObject;
-  env = utils$1.merge.call({
-    skipUndefined: true
-  }, {
-    Request: globalObject.Request,
-    Response: globalObject.Response
-  }, env);
-  const {
-    fetch: envFetch,
-    Request,
-    Response
-  } = env;
-  const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
-  const isRequestSupported = isFunction(Request);
-  const isResponseSupported = isFunction(Response);
+
+const factory = (env) => {
+  const globalObject =
+    utils.global !== undefined && utils.global !== null
+      ? utils.global
+      : globalThis;
+  const { ReadableStream, TextEncoder } = globalObject;
+
+  env = utils.merge.call(
+    {
+      skipUndefined: true,
+    },
+    {
+      Request: globalObject.Request,
+      Response: globalObject.Response,
+    },
+    env
+  );
+
+  const { fetch: envFetch, Request, Response } = env;
+  const isFetchSupported = envFetch ? fetch_isFunction(envFetch) : typeof fetch === 'function';
+  const isRequestSupported = fetch_isFunction(Request);
+  const isResponseSupported = fetch_isFunction(Response);
+
   if (!isFetchSupported) {
     return false;
   }
-  const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
-  const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? (encoder => str => encoder.encode(str))(new TextEncoder()) : async str => new Uint8Array(await new Request(str).arrayBuffer()));
-  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
-    let duplexAccessed = false;
-    const request = new Request(platform.origin, {
-      body: new ReadableStream(),
-      method: 'POST',
-      get duplex() {
-        duplexAccessed = true;
-        return 'half';
+
+  const isReadableStreamSupported = isFetchSupported && fetch_isFunction(ReadableStream);
+
+  const encodeText =
+    isFetchSupported &&
+    (typeof TextEncoder === 'function'
+      ? (
+          (encoder) => (str) =>
+            encoder.encode(str)
+        )(new TextEncoder())
+      : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
+
+  const supportsRequestStream =
+    isRequestSupported &&
+    isReadableStreamSupported &&
+    test(() => {
+      let duplexAccessed = false;
+
+      const request = new Request(platform.origin, {
+        body: new ReadableStream(),
+        method: 'POST',
+        get duplex() {
+          duplexAccessed = true;
+          return 'half';
+        },
+      });
+
+      const hasContentType = request.headers.has('Content-Type');
+
+      if (request.body != null) {
+        request.body.cancel();
       }
+
+      return duplexAccessed && !hasContentType;
     });
-    const hasContentType = request.headers.has('Content-Type');
-    if (request.body != null) {
-      request.body.cancel();
-    }
-    return duplexAccessed && !hasContentType;
-  });
-  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response('').body));
+
+  const supportsResponseStream =
+    isResponseSupported &&
+    isReadableStreamSupported &&
+    test(() => utils.isReadableStream(new Response('').body));
+
   const resolvers = {
-    stream: supportsResponseStream && (res => res.body)
+    stream: supportsResponseStream && ((res) => res.body),
   };
-  isFetchSupported && (() => {
-    ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
-      !resolvers[type] && (resolvers[type] = (res, config) => {
-        let method = res && res[type];
-        if (method) {
-          return method.call(res);
-        }
-        throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
+
+  isFetchSupported &&
+    (() => {
+      ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
+        !resolvers[type] &&
+          (resolvers[type] = (res, config) => {
+            let method = res && res[type];
+
+            if (method) {
+              return method.call(res);
+            }
+
+            throw new core_AxiosError(
+              `Response type '${type}' is not supported`,
+              core_AxiosError.ERR_NOT_SUPPORT,
+              config
+            );
+          });
       });
-    });
-  })();
-  const getBodyLength = async body => {
+    })();
+
+  const getBodyLength = async (body) => {
     if (body == null) {
       return 0;
     }
-    if (utils$1.isBlob(body)) {
+
+    if (utils.isBlob(body)) {
       return body.size;
     }
-    if (utils$1.isSpecCompliantForm(body)) {
+
+    if (utils.isSpecCompliantForm(body)) {
       const _request = new Request(platform.origin, {
         method: 'POST',
-        body
+        body,
       });
       return (await _request.arrayBuffer()).byteLength;
     }
-    if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
+
+    if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
       return body.byteLength;
     }
-    if (utils$1.isURLSearchParams(body)) {
+
+    if (utils.isURLSearchParams(body)) {
       body = body + '';
     }
-    if (utils$1.isString(body)) {
+
+    if (utils.isString(body)) {
       return (await encodeText(body)).byteLength;
     }
   };
+
   const resolveBodyLength = async (headers, body) => {
-    const length = utils$1.toFiniteNumber(headers.getContentLength());
+    const length = utils.toFiniteNumber(headers.getContentLength());
+
     return length == null ? getBodyLength(body) : length;
   };
-  return async config => {
+
+  return async (config) => {
     let {
       url,
       method,
@@ -128429,18 +162339,31 @@ const factory = env => {
       withCredentials = 'same-origin',
       fetchOptions,
       maxContentLength,
-      maxBodyLength
-    } = resolveConfig(config);
-    const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
-    const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
-    const own = key => utils$1.hasOwnProp(config, key) ? config[key] : undefined;
+      maxBodyLength,
+    } = helpers_resolveConfig(config);
+
+    const hasMaxContentLength = utils.isNumber(maxContentLength) && maxContentLength > -1;
+    const hasMaxBodyLength = utils.isNumber(maxBodyLength) && maxBodyLength > -1;
+    const own = (key) => (utils.hasOwnProp(config, key) ? config[key] : undefined);
+
     let _fetch = envFetch || fetch;
+
     responseType = responseType ? (responseType + '').toLowerCase() : 'text';
-    let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
+
+    let composedSignal = helpers_composeSignals(
+      [signal, cancelToken && cancelToken.toAbortSignal()],
+      timeout
+    );
+
     let request = null;
-    const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
-      composedSignal.unsubscribe();
-    });
+
+    const unsubscribe =
+      composedSignal &&
+      composedSignal.unsubscribe &&
+      (() => {
+        composedSignal.unsubscribe();
+      });
+
     let requestContentLength;
 
     // AxiosError we raise while the request body is being streamed. Captured
@@ -128448,38 +162371,54 @@ const factory = env => {
     // how the runtime wraps the resulting fetch rejection (undici exposes it
     // as `err.cause`; some browsers drop the original error entirely).
     let pendingBodyError = null;
-    const maxBodyLengthError = () => new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request);
+
+    const maxBodyLengthError = () =>
+      new core_AxiosError(
+        'Request body larger than maxBodyLength limit',
+        core_AxiosError.ERR_BAD_REQUEST,
+        config,
+        request
+      );
+
     try {
       // HTTP basic authentication
       let auth = undefined;
       const configAuth = own('auth');
+
       if (configAuth) {
-        const username = utils$1.getSafeProp(configAuth, 'username') || '';
-        const password = utils$1.getSafeProp(configAuth, 'password') || '';
+        const username = utils.getSafeProp(configAuth, 'username') || '';
+        const password = utils.getSafeProp(configAuth, 'password') || '';
         auth = {
           username,
           password
         };
       }
+
       if (maybeWithAuthCredentials(url)) {
         const parsedURL = new URL(url, platform.origin);
+
         if (!auth && (parsedURL.username || parsedURL.password)) {
-          const urlUsername = decodeURIComponentSafe(parsedURL.username);
-          const urlPassword = decodeURIComponentSafe(parsedURL.password);
+          const urlUsername = fetch_decodeURIComponentSafe(parsedURL.username);
+          const urlPassword = fetch_decodeURIComponentSafe(parsedURL.password);
           auth = {
             username: urlUsername,
             password: urlPassword
           };
         }
+
         if (parsedURL.username || parsedURL.password) {
           parsedURL.username = '';
           parsedURL.password = '';
           url = parsedURL.href;
         }
       }
+
       if (auth) {
         headers.delete('authorization');
-        headers.set('Authorization', 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || ''))));
+        headers.set(
+          'Authorization',
+          'Basic ' + btoa(fetch_encodeUTF8((auth.username || '') + ':' + (auth.password || '')))
+        );
       }
 
       // Enforce maxContentLength for data: URLs up-front so we never materialize
@@ -128488,7 +162427,12 @@ const factory = env => {
       if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
         const estimated = estimateDataURLDecodedBytes(url);
         if (estimated > maxContentLength) {
-          throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+          throw new core_AxiosError(
+            'maxContentLength size of ' + maxContentLength + ' exceeded',
+            core_AxiosError.ERR_BAD_RESPONSE,
+            config,
+            request
+          );
         }
       }
 
@@ -128509,15 +162453,30 @@ const factory = env => {
 
       // A streamed body under maxBodyLength must be counted as fetch consumes
       // it; its size is never trusted from a caller-declared Content-Length.
-      const mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data));
-      const trackRequestStream = (stream, onProgress, flush) => trackStream(stream, DEFAULT_CHUNK_SIZE, loadedBytes => {
-        if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
-          throw pendingBodyError = maxBodyLengthError();
-        }
-        onProgress && onProgress(loadedBytes);
-      }, flush);
-      if (supportsRequestStream && method !== 'get' && method !== 'head' && (onUploadProgress || mustEnforceStreamBody)) {
-        requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
+      const mustEnforceStreamBody =
+        hasMaxBodyLength && (utils.isReadableStream(data) || utils.isStream(data));
+
+      const trackRequestStream = (stream, onProgress, flush) =>
+        trackStream(
+          stream,
+          DEFAULT_CHUNK_SIZE,
+          (loadedBytes) => {
+            if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
+              throw (pendingBodyError = maxBodyLengthError());
+            }
+            onProgress && onProgress(loadedBytes);
+          },
+          flush
+        );
+
+      if (
+        supportsRequestStream &&
+        method !== 'get' &&
+        method !== 'head' &&
+        (onUploadProgress || mustEnforceStreamBody)
+      ) {
+        requestContentLength =
+          requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
 
         // A declared length of 0 is only trusted to skip the wrap when we are
         // not enforcing a stream limit (which must not rely on that header).
@@ -128525,23 +162484,51 @@ const factory = env => {
           let _request = new Request(url, {
             method: 'POST',
             body: data,
-            duplex: 'half'
+            duplex: 'half',
           });
+
           let contentTypeHeader;
-          if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
+
+          if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
             headers.setContentType(contentTypeHeader);
           }
+
           if (_request.body) {
-            const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [];
+            const [onProgress, flush] =
+              (onUploadProgress &&
+                progressEventDecorator(
+                  requestContentLength,
+                  progressEventReducer(asyncDecorator(onUploadProgress))
+                )) ||
+              [];
+
             data = trackRequestStream(_request.body, onProgress, flush);
           }
         }
-      } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== 'get' && method !== 'head') {
+      } else if (
+        mustEnforceStreamBody &&
+        !isRequestSupported &&
+        isReadableStreamSupported &&
+        method !== 'get' &&
+        method !== 'head'
+      ) {
         data = trackRequestStream(data);
-      } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== 'get' && method !== 'head') {
-        throw new AxiosError('Stream request bodies are not supported by the current fetch implementation', AxiosError.ERR_NOT_SUPPORT, config, request);
+      } else if (
+        mustEnforceStreamBody &&
+        isRequestSupported &&
+        !supportsRequestStream &&
+        method !== 'get' &&
+        method !== 'head'
+      ) {
+        throw new core_AxiosError(
+          'Stream request bodies are not supported by the current fetch implementation',
+          core_AxiosError.ERR_NOT_SUPPORT,
+          config,
+          request
+        );
       }
-      if (!utils$1.isString(withCredentials)) {
+
+      if (!utils.isString(withCredentials)) {
         withCredentials = withCredentials ? 'include' : 'omit';
       }
 
@@ -128551,15 +162538,20 @@ const factory = env => {
 
       // If data is FormData and Content-Type is multipart/form-data without boundary,
       // delete it so fetch can set it correctly with the boundary
-      if (utils$1.isFormData(data)) {
+      if (utils.isFormData(data)) {
         const contentType = headers.getContentType();
-        if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
+        if (
+          contentType &&
+          /^multipart\/form-data/i.test(contentType) &&
+          !/boundary=/i.test(contentType)
+        ) {
           headers.delete('content-type');
         }
       }
 
       // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
       headers.set('User-Agent', 'axios/' + VERSION, false);
+
       const resolvedOptions = {
         ...fetchOptions,
         signal: composedSignal,
@@ -128567,45 +162559,86 @@ const factory = env => {
         headers: toByteStringHeaderObject(headers.normalize()),
         body: data,
         duplex: 'half',
-        credentials: isCredentialsSupported ? withCredentials : undefined
+        credentials: isCredentialsSupported ? withCredentials : undefined,
       };
+
       request = isRequestSupported && new Request(url, resolvedOptions);
-      let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
-      const responseHeaders = AxiosHeaders.from(response.headers);
+
+      let response = await (isRequestSupported
+        ? _fetch(request, fetchOptions)
+        : _fetch(url, resolvedOptions));
+
+      const responseHeaders = core_AxiosHeaders.from(response.headers);
 
       // Cheap pre-check: if the server honestly declares a content-length that
       // already exceeds the cap, reject before we start streaming.
       if (hasMaxContentLength) {
-        const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
+        const declaredLength = utils.toFiniteNumber(responseHeaders.getContentLength());
         if (declaredLength != null && declaredLength > maxContentLength) {
-          throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+          throw new core_AxiosError(
+            'maxContentLength size of ' + maxContentLength + ' exceeded',
+            core_AxiosError.ERR_BAD_RESPONSE,
+            config,
+            request
+          );
         }
       }
-      const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
-      if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
+
+      const isStreamResponse =
+        supportsResponseStream && (responseType === 'stream' || responseType === 'response');
+
+      if (
+        supportsResponseStream &&
+        response.body &&
+        (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
+      ) {
         const options = {};
-        ['status', 'statusText', 'headers'].forEach(prop => {
+
+        ['status', 'statusText', 'headers'].forEach((prop) => {
           options[prop] = response[prop];
         });
-        const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
-        const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
+
+        const responseContentLength = utils.toFiniteNumber(responseHeaders.getContentLength());
+
+        const [onProgress, flush] =
+          (onDownloadProgress &&
+            progressEventDecorator(
+              responseContentLength,
+              progressEventReducer(asyncDecorator(onDownloadProgress), true)
+            )) ||
+          [];
+
         let bytesRead = 0;
-        const onChunkProgress = loadedBytes => {
+        const onChunkProgress = (loadedBytes) => {
           if (hasMaxContentLength) {
             bytesRead = loadedBytes;
             if (bytesRead > maxContentLength) {
-              throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+              throw new core_AxiosError(
+                'maxContentLength size of ' + maxContentLength + ' exceeded',
+                core_AxiosError.ERR_BAD_RESPONSE,
+                config,
+                request
+              );
             }
           }
           onProgress && onProgress(loadedBytes);
         };
-        response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
-          flush && flush();
-          unsubscribe && unsubscribe();
-        }), options);
+
+        response = new Response(
+          trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
+            flush && flush();
+            unsubscribe && unsubscribe();
+          }),
+          options
+        );
       }
+
       responseType = responseType || 'text';
-      let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
+
+      let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](
+        response,
+        config
+      );
 
       // Fallback enforcement for environments without ReadableStream support
       // (legacy runtimes). Detect materialized size from typed output; skip
@@ -128618,22 +162651,32 @@ const factory = env => {
           } else if (typeof responseData.size === 'number') {
             materializedSize = responseData.size;
           } else if (typeof responseData === 'string') {
-            materializedSize = typeof TextEncoder === 'function' ? new TextEncoder().encode(responseData).byteLength : responseData.length;
+            materializedSize =
+              typeof TextEncoder === 'function'
+                ? new TextEncoder().encode(responseData).byteLength
+                : responseData.length;
           }
         }
         if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
-          throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+          throw new core_AxiosError(
+            'maxContentLength size of ' + maxContentLength + ' exceeded',
+            core_AxiosError.ERR_BAD_RESPONSE,
+            config,
+            request
+          );
         }
       }
+
       !isStreamResponse && unsubscribe && unsubscribe();
+
       return await new Promise((resolve, reject) => {
         settle(resolve, reject, {
           data: responseData,
-          headers: AxiosHeaders.from(response.headers),
+          headers: core_AxiosHeaders.from(response.headers),
           status: response.status,
           statusText: response.statusText,
           config,
-          request
+          request,
         });
       });
     } catch (err) {
@@ -128642,7 +162685,7 @@ const factory = env => {
       // Safari can surface fetch aborts as a DOMException-like object whose
       // branded getters throw. Prefer our composed signal reason before reading
       // the caught error, preserving timeout vs cancellation semantics.
-      if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
+      if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof core_AxiosError) {
         const canceledError = composedSignal.reason;
         canceledError.config = config;
         request && (canceledError.request = request);
@@ -128662,42 +162705,66 @@ const factory = env => {
 
       // Re-throw AxiosErrors we raised synchronously (data: URL / content-length
       // pre-checks, response size enforcement) without re-wrapping them.
-      if (err instanceof AxiosError) {
+      if (err instanceof core_AxiosError) {
         request && !err.request && (err.request = request);
         throw err;
       }
+
       if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
-        throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response), {
-          cause: err.cause || err
-        });
+        throw Object.assign(
+          new core_AxiosError(
+            'Network Error',
+            core_AxiosError.ERR_NETWORK,
+            config,
+            request,
+            err && err.response
+          ),
+          {
+            cause: err.cause || err,
+          }
+        );
       }
-      throw AxiosError.from(err, err && err.code, config, request, err && err.response);
+
+      throw core_AxiosError.from(err, err && err.code, config, request, err && err.response);
     }
   };
 };
+
 const seedCache = new Map();
-const getFetch = config => {
-  let env = config && config.env || {};
-  const {
-    fetch,
-    Request,
-    Response
-  } = env;
+
+const getFetch = (config) => {
+  let env = (config && config.env) || {};
+  const { fetch, Request, Response } = env;
   const seeds = [Request, Response, fetch];
+
   let len = seeds.length,
     i = len,
     seed,
     target,
     map = seedCache;
+
   while (i--) {
     seed = seeds[i];
     target = map.get(seed);
-    target === undefined && map.set(seed, target = i ? new Map() : factory(env));
+
+    target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
+
     map = target;
   }
+
   return target;
 };
-getFetch();
+
+const adapter = getFetch();
+
+/* harmony default export */ const adapters_fetch = ((/* unused pure expression or super */ null && (adapter)));
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/adapters/adapters.js
+
+
+
+
+
 
 /**
  * Known adapters mapping.
@@ -128709,30 +162776,24 @@ getFetch();
  * @type {Object}
  */
 const knownAdapters = {
-  http: httpAdapter,
-  xhr: xhrAdapter,
+  http: http,
+  xhr: xhr,
   fetch: {
-    get: getFetch
-  }
+    get: getFetch,
+  },
 };
 
 // Assign adapter names for easier debugging and identification
-utils$1.forEach(knownAdapters, (fn, value) => {
+utils.forEach(knownAdapters, (fn, value) => {
   if (fn) {
     try {
       // Null-proto descriptors so a polluted Object.prototype.get cannot turn
       // these data descriptors into accessor descriptors on the way in.
-      Object.defineProperty(fn, 'name', {
-        __proto__: null,
-        value
-      });
+      Object.defineProperty(fn, 'name', { __proto__: null, value });
     } catch (e) {
       // eslint-disable-next-line no-empty
     }
-    Object.defineProperty(fn, 'adapterName', {
-      __proto__: null,
-      value
-    });
+    Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
   }
 });
 
@@ -128742,7 +162803,7 @@ utils$1.forEach(knownAdapters, (fn, value) => {
  * @param {string} reason
  * @returns {string}
  */
-const renderReason = reason => `- ${reason}`;
+const renderReason = (reason) => `- ${reason}`;
 
 /**
  * Check if the adapter is resolved (function, null, or false)
@@ -128750,7 +162811,8 @@ const renderReason = reason => `- ${reason}`;
  * @param {Function|null|false} adapter
  * @returns {boolean}
  */
-const isResolvedHandle = adapter => utils$1.isFunction(adapter) || adapter === null || adapter === false;
+const isResolvedHandle = (adapter) =>
+  utils.isFunction(adapter) || adapter === null || adapter === false;
 
 /**
  * Get the first suitable adapter from the provided list.
@@ -128763,51 +162825,83 @@ const isResolvedHandle = adapter => utils$1.isFunction(adapter) || adapter === n
  * @returns {Function} The resolved adapter function
  */
 function getAdapter(adapters, config) {
-  adapters = utils$1.isArray(adapters) ? adapters : [adapters];
-  const {
-    length
-  } = adapters;
+  adapters = utils.isArray(adapters) ? adapters : [adapters];
+
+  const { length } = adapters;
   let nameOrAdapter;
   let adapter;
+
   const rejectedReasons = {};
+
   for (let i = 0; i < length; i++) {
     nameOrAdapter = adapters[i];
     let id;
+
     adapter = nameOrAdapter;
+
     if (!isResolvedHandle(nameOrAdapter)) {
       adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+
       if (adapter === undefined) {
-        throw new AxiosError(`Unknown adapter '${id}'`);
+        throw new core_AxiosError(`Unknown adapter '${id}'`);
       }
     }
-    if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
+
+    if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {
       break;
     }
+
     rejectedReasons[id || '#' + i] = adapter;
   }
+
   if (!adapter) {
-    const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build'));
-    let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
-    throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT');
+    const reasons = Object.entries(rejectedReasons).map(
+      ([id, state]) =>
+        `adapter ${id} ` +
+        (state === false ? 'is not supported by the environment' : 'is not available in the build')
+    );
+
+    let s = length
+      ? reasons.length > 1
+        ? 'since :\n' + reasons.map(renderReason).join('\n')
+        : ' ' + renderReason(reasons[0])
+      : 'as no adapter specified';
+
+    throw new core_AxiosError(
+      `There is no suitable adapter to dispatch the request ` + s,
+      'ERR_NOT_SUPPORT'
+    );
   }
+
   return adapter;
 }
 
 /**
  * Exports Axios adapters and utility to resolve an adapter
  */
-var adapters = {
+/* harmony default export */ const adapters = ({
   /**
    * Resolve an adapter from a list of adapter names or functions.
    * @type {Function}
    */
   getAdapter,
+
   /**
    * Exposes all known adapters
    * @type {Object}
    */
-  adapters: knownAdapters
-};
+  adapters: knownAdapters,
+});
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/dispatchRequest.js
+
+
+
+
+
+
+
+
 
 /**
  * Throws a `CanceledError` if cancellation has been requested.
@@ -128820,8 +162914,9 @@ function throwIfCancellationRequested(config) {
   if (config.cancelToken) {
     config.cancelToken.throwIfRequested();
   }
+
   if (config.signal && config.signal.aborted) {
-    throw new CanceledError(null, config);
+    throw new cancel_CanceledError(null, config);
   }
 }
 
@@ -128834,55 +162929,76 @@ function throwIfCancellationRequested(config) {
  */
 function dispatchRequest(config) {
   throwIfCancellationRequested(config);
-  config.headers = AxiosHeaders.from(config.headers);
+
+  config.headers = core_AxiosHeaders.from(config.headers);
 
   // Transform request data
   config.data = transformData.call(config, config.transformRequest);
+
   if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
     config.headers.setContentType('application/x-www-form-urlencoded', false);
   }
-  const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
-  return adapter(config).then(function onAdapterResolution(response) {
-    throwIfCancellationRequested(config);
 
-    // Expose the current response on config so that transformResponse can
-    // attach it to any AxiosError it throws (e.g. on JSON parse failure).
-    // We clean it up afterwards to avoid polluting the config object.
-    config.response = response;
-    try {
-      response.data = transformData.call(config, config.transformResponse, response);
-    } finally {
-      delete config.response;
-    }
-    response.headers = AxiosHeaders.from(response.headers);
-    return response;
-  }, function onAdapterRejection(reason) {
-    if (!isCancel(reason)) {
+  const adapter = adapters.getAdapter(config.adapter || lib_defaults.adapter, config);
+
+  return adapter(config).then(
+    function onAdapterResolution(response) {
       throwIfCancellationRequested(config);
 
-      // Transform response data
-      if (reason && reason.response) {
-        config.response = reason.response;
-        try {
-          reason.response.data = transformData.call(config, config.transformResponse, reason.response);
-        } finally {
-          delete config.response;
+      // Expose the current response on config so that transformResponse can
+      // attach it to any AxiosError it throws (e.g. on JSON parse failure).
+      // We clean it up afterwards to avoid polluting the config object.
+      config.response = response;
+      try {
+        response.data = transformData.call(config, config.transformResponse, response);
+      } finally {
+        delete config.response;
+      }
+
+      response.headers = core_AxiosHeaders.from(response.headers);
+
+      return response;
+    },
+    function onAdapterRejection(reason) {
+      if (!isCancel(reason)) {
+        throwIfCancellationRequested(config);
+
+        // Transform response data
+        if (reason && reason.response) {
+          config.response = reason.response;
+          try {
+            reason.response.data = transformData.call(
+              config,
+              config.transformResponse,
+              reason.response
+            );
+          } finally {
+            delete config.response;
+          }
+          reason.response.headers = core_AxiosHeaders.from(reason.response.headers);
         }
-        reason.response.headers = AxiosHeaders.from(reason.response.headers);
       }
+
+      return Promise.reject(reason);
     }
-    return Promise.reject(reason);
-  });
+  );
 }
 
-const validators$1 = {};
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/validator.js
+
+
+
+
+
+const validators = {};
 
 // eslint-disable-next-line func-names
 ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
-  validators$1[type] = function validator(thing) {
+  validators[type] = function validator(thing) {
     return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
   };
 });
+
 const deprecatedWarnings = {};
 
 /**
@@ -128894,25 +163010,44 @@ const deprecatedWarnings = {};
  *
  * @returns {function}
  */
-validators$1.transitional = function transitional(validator, version, message) {
+validators.transitional = function transitional(validator, version, message) {
   function formatMessage(opt, desc) {
-    return '[Axios v' + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? '. ' + message : '');
+    return (
+      '[Axios v' +
+      VERSION +
+      "] Transitional option '" +
+      opt +
+      "'" +
+      desc +
+      (message ? '. ' + message : '')
+    );
   }
 
   // eslint-disable-next-line func-names
   return (value, opt, opts) => {
     if (validator === false) {
-      throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED);
+      throw new core_AxiosError(
+        formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
+        core_AxiosError.ERR_DEPRECATED
+      );
     }
+
     if (version && !deprecatedWarnings[opt]) {
       deprecatedWarnings[opt] = true;
       // eslint-disable-next-line no-console
-      console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future'));
+      console.warn(
+        formatMessage(
+          opt,
+          ' has been deprecated since v' + version + ' and will be removed in the near future'
+        )
+      );
     }
+
     return validator ? validator(value, opt, opts) : true;
   };
 };
-validators$1.spelling = function spelling(correctSpelling) {
+
+validators.spelling = function spelling(correctSpelling) {
   return (value, opt) => {
     // eslint-disable-next-line no-console
     console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
@@ -128932,7 +163067,7 @@ validators$1.spelling = function spelling(correctSpelling) {
 
 function assertOptions(options, schema, allowUnknown) {
   if (typeof options !== 'object') {
-    throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+    throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE);
   }
   const keys = Object.keys(options);
   let i = keys.length;
@@ -128945,21 +163080,38 @@ function assertOptions(options, schema, allowUnknown) {
       const value = options[opt];
       const result = value === undefined || validator(value, opt, options);
       if (result !== true) {
-        throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
+        throw new core_AxiosError(
+          'option ' + opt + ' must be ' + result,
+          core_AxiosError.ERR_BAD_OPTION_VALUE
+        );
       }
       continue;
     }
     if (allowUnknown !== true) {
-      throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+      throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION);
     }
   }
 }
-var validator = {
+
+/* harmony default export */ const validator = ({
   assertOptions,
-  validators: validators$1
-};
+  validators,
+});
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/core/Axios.js
+
+
+
+
 
-const validators = validator.validators;
+
+
+
+
+
+
+
+const Axios_validators = validator.validators;
 
 /**
  * Create a new instance of Axios
@@ -128972,8 +163124,8 @@ class Axios {
   constructor(instanceConfig) {
     this.defaults = instanceConfig || {};
     this.interceptors = {
-      request: new InterceptorManager(),
-      response: new InterceptorManager()
+      request: new core_InterceptorManager(),
+      response: new core_InterceptorManager(),
     };
   }
 
@@ -128991,14 +163143,17 @@ class Axios {
     } catch (err) {
       if (err instanceof Error) {
         let dummy = {};
-        Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
+
+        Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
 
         // slice off the Error: ... line
         const stack = (() => {
           if (!dummy.stack) {
             return '';
           }
+
           const firstNewlineIndex = dummy.stack.indexOf('\n');
+
           return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
         })();
         try {
@@ -129007,8 +163162,11 @@ class Axios {
             // match without the 2 top stack lines
           } else if (stack) {
             const firstNewlineIndex = stack.indexOf('\n');
-            const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
-            const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
+            const secondNewlineIndex =
+              firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
+            const stackWithoutTwoTopLines =
+              secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
+
             if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
               err.stack += '\n' + stack;
             }
@@ -129017,9 +163175,11 @@ class Axios {
           // ignore the case where "stack" is an un-writable property
         }
       }
+
       throw err;
     }
   }
+
   _request(configOrUrl, config) {
     /*eslint no-param-reassign:0*/
     // Allow for axios('example/url'[, config]) a la fetch API
@@ -129029,55 +163189,73 @@ class Axios {
     } else {
       config = configOrUrl || {};
     }
+
     config = mergeConfig(this.defaults, config);
-    const {
-      transitional,
-      paramsSerializer,
-      headers
-    } = config;
+
+    const { transitional, paramsSerializer, headers } = config;
+
     if (transitional !== undefined) {
-      validator.assertOptions(transitional, {
-        silentJSONParsing: validators.transitional(validators.boolean),
-        forcedJSONParsing: validators.transitional(validators.boolean),
-        clarifyTimeoutError: validators.transitional(validators.boolean),
-        legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
-        advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),
-        validateStatusUndefinedResolves: validators.transitional(validators.boolean)
-      }, false);
+      validator.assertOptions(
+        transitional,
+        {
+          silentJSONParsing: Axios_validators.transitional(Axios_validators.boolean),
+          forcedJSONParsing: Axios_validators.transitional(Axios_validators.boolean),
+          clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean),
+          legacyInterceptorReqResOrdering: Axios_validators.transitional(Axios_validators.boolean),
+          advertiseZstdAcceptEncoding: Axios_validators.transitional(Axios_validators.boolean),
+          validateStatusUndefinedResolves: Axios_validators.transitional(Axios_validators.boolean),
+        },
+        false
+      );
     }
+
     if (paramsSerializer != null) {
-      if (utils$1.isFunction(paramsSerializer)) {
+      if (utils.isFunction(paramsSerializer)) {
         config.paramsSerializer = {
-          serialize: paramsSerializer
+          serialize: paramsSerializer,
         };
       } else {
-        validator.assertOptions(paramsSerializer, {
-          encode: validators.function,
-          serialize: validators.function
-        }, true);
+        validator.assertOptions(
+          paramsSerializer,
+          {
+            encode: Axios_validators.function,
+            serialize: Axios_validators.function,
+          },
+          true
+        );
       }
     }
 
     // Set config.allowAbsoluteUrls
-    if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
+    if (config.allowAbsoluteUrls !== undefined) {
+      // do nothing
+    } else if (this.defaults.allowAbsoluteUrls !== undefined) {
       config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
     } else {
       config.allowAbsoluteUrls = true;
     }
-    validator.assertOptions(config, {
-      baseUrl: validators.spelling('baseURL'),
-      withXsrfToken: validators.spelling('withXSRFToken')
-    }, true);
+
+    validator.assertOptions(
+      config,
+      {
+        baseUrl: Axios_validators.spelling('baseURL'),
+        withXsrfToken: Axios_validators.spelling('withXSRFToken'),
+      },
+      true
+    );
 
     // Set config.method
     config.method = (config.method || this.defaults.method || 'get').toLowerCase();
 
     // Flatten headers
-    let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
-    headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], method => {
-      delete headers[method];
-    });
-    config.headers = AxiosHeaders.concat(contextHeaders, headers);
+    let contextHeaders = headers && utils.merge(headers.common, headers[config.method]);
+
+    headers &&
+      utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
+        delete headers[method];
+      });
+
+    config.headers = core_AxiosHeaders.concat(contextHeaders, headers);
 
     // filter out skipped interceptors
     const requestInterceptorChain = [];
@@ -129086,35 +163264,48 @@ class Axios {
       if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
         return;
       }
+
       synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
-      const transitional = config.transitional || transitionalDefaults;
-      const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
+
+      const transitional = config.transitional || defaults_transitional;
+      const legacyInterceptorReqResOrdering =
+        transitional && transitional.legacyInterceptorReqResOrdering;
+
       if (legacyInterceptorReqResOrdering) {
         requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
       } else {
         requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
       }
     });
+
     const responseInterceptorChain = [];
     this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
       responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
     });
+
     let promise;
     let i = 0;
     let len;
+
     if (!synchronousRequestInterceptors) {
       const chain = [dispatchRequest.bind(this), undefined];
       chain.unshift(...requestInterceptorChain);
       chain.push(...responseInterceptorChain);
       len = chain.length;
+
       promise = Promise.resolve(config);
+
       while (i < len) {
         promise = promise.then(chain[i++], chain[i++]);
       }
+
       return promise;
     }
+
     len = requestInterceptorChain.length;
+
     let newConfig = config;
+
     while (i < len) {
       const onFulfilled = requestInterceptorChain[i++];
       const onRejected = requestInterceptorChain[i++];
@@ -129125,18 +163316,23 @@ class Axios {
         break;
       }
     }
+
     try {
       promise = dispatchRequest.call(this, newConfig);
     } catch (error) {
       return Promise.reject(error);
     }
+
     i = 0;
     len = responseInterceptorChain.length;
+
     while (i < len) {
       promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
     }
+
     return promise;
   }
+
   getUri(config) {
     config = mergeConfig(this.defaults, config);
     const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
@@ -129145,29 +163341,37 @@ class Axios {
 }
 
 // Provide aliases for supported request methods
-utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
   /*eslint func-names:0*/
   Axios.prototype[method] = function (url, config) {
-    return this.request(mergeConfig(config || {}, {
-      method,
-      url,
-      data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined
-    }));
+    return this.request(
+      mergeConfig(config || {}, {
+        method,
+        url,
+        data: config && utils.hasOwnProp(config, 'data') ? config.data : undefined,
+      })
+    );
   };
 });
-utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
+
+utils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
   function generateHTTPMethod(isForm) {
     return function httpMethod(url, data, config) {
-      return this.request(mergeConfig(config || {}, {
-        method,
-        headers: isForm ? {
-          'Content-Type': 'multipart/form-data'
-        } : {},
-        url,
-        data
-      }));
+      return this.request(
+        mergeConfig(config || {}, {
+          method,
+          headers: isForm
+            ? {
+                'Content-Type': 'multipart/form-data',
+              }
+            : {},
+          url,
+          data,
+        })
+      );
     };
   }
+
   Axios.prototype[method] = generateHTTPMethod();
 
   // QUERY is a safe/idempotent read method; multipart form bodies don't fit
@@ -129177,6 +163381,13 @@ utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithDat
   }
 });
 
+/* harmony default export */ const core_Axios = (Axios);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/cancel/CancelToken.js
+
+
+
+
 /**
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
  *
@@ -129189,16 +163400,21 @@ class CancelToken {
     if (typeof executor !== 'function') {
       throw new TypeError('executor must be a function.');
     }
+
     let resolvePromise;
+
     this.promise = new Promise(function promiseExecutor(resolve) {
       resolvePromise = resolve;
     });
+
     const token = this;
 
     // eslint-disable-next-line func-names
-    this.promise.then(cancel => {
+    this.promise.then((cancel) => {
       if (!token._listeners) return;
+
       let i = token._listeners.length;
+
       while (i-- > 0) {
         token._listeners[i](cancel);
       }
@@ -129206,24 +163422,28 @@ class CancelToken {
     });
 
     // eslint-disable-next-line func-names
-    this.promise.then = onfulfilled => {
+    this.promise.then = (onfulfilled) => {
       let _resolve;
       // eslint-disable-next-line func-names
-      const promise = new Promise(resolve => {
+      const promise = new Promise((resolve) => {
         token.subscribe(resolve);
         _resolve = resolve;
       }).then(onfulfilled);
+
       promise.cancel = function reject() {
         token.unsubscribe(_resolve);
       };
+
       return promise;
     };
+
     executor(function cancel(message, config, request) {
       if (token.reason) {
         // Cancellation has already been requested
         return;
       }
-      token.reason = new CanceledError(message, config, request);
+
+      token.reason = new cancel_CanceledError(message, config, request);
       resolvePromise(token.reason);
     });
   }
@@ -129246,6 +163466,7 @@ class CancelToken {
       listener(this.reason);
       return;
     }
+
     if (this._listeners) {
       this._listeners.push(listener);
     } else {
@@ -129266,13 +163487,18 @@ class CancelToken {
       this._listeners.splice(index, 1);
     }
   }
+
   toAbortSignal() {
     const controller = new AbortController();
-    const abort = err => {
+
+    const abort = (err) => {
       controller.abort(err);
     };
+
     this.subscribe(abort);
+
     controller.signal.unsubscribe = () => this.unsubscribe(abort);
+
     return controller.signal;
   }
 
@@ -129287,11 +163513,16 @@ class CancelToken {
     });
     return {
       token,
-      cancel
+      cancel,
     };
   }
 }
 
+/* harmony default export */ const cancel_CancelToken = (CancelToken);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/spread.js
+
+
 /**
  * Syntactic sugar for invoking a function and expanding an array for arguments.
  *
@@ -129319,6 +163550,11 @@ function spread(callback) {
   };
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/isAxiosError.js
+
+
+
+
 /**
  * Determines whether the payload is an error thrown by Axios
  *
@@ -129327,9 +163563,10 @@ function spread(callback) {
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
  */
 function isAxiosError(payload) {
-  return utils$1.isObject(payload) && payload.isAxiosError === true;
+  return utils.isObject(payload) && payload.isAxiosError === true;
 }
 
+;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/HttpStatusCode.js
 const HttpStatusCode = {
   Continue: 100,
   SwitchingProtocols: 101,
@@ -129399,12 +163636,36 @@ const HttpStatusCode = {
   OriginIsUnreachable: 523,
   TimeoutOccurred: 524,
   SslHandshakeFailed: 525,
-  InvalidSslCertificate: 526
+  InvalidSslCertificate: 526,
 };
+
 Object.entries(HttpStatusCode).forEach(([key, value]) => {
   HttpStatusCode[value] = key;
 });
 
+/* harmony default export */ const helpers_HttpStatusCode = (HttpStatusCode);
+
+;// CONCATENATED MODULE: ./node_modules/axios/lib/axios.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 /**
  * Create an instance of Axios
  *
@@ -129413,41 +163674,38 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
  * @returns {Axios} A new instance of Axios
  */
 function createInstance(defaultConfig) {
-  const context = new Axios(defaultConfig);
-  const instance = bind(Axios.prototype.request, context);
+  const context = new core_Axios(defaultConfig);
+  const instance = bind(core_Axios.prototype.request, context);
 
   // Copy axios.prototype to instance
-  utils$1.extend(instance, Axios.prototype, context, {
-    allOwnKeys: true
-  });
+  utils.extend(instance, core_Axios.prototype, context, { allOwnKeys: true });
 
   // Copy context to instance
-  utils$1.extend(instance, context, null, {
-    allOwnKeys: true
-  });
+  utils.extend(instance, context, null, { allOwnKeys: true });
 
   // Factory for creating new instances
   instance.create = function create(instanceConfig) {
     return createInstance(mergeConfig(defaultConfig, instanceConfig));
   };
+
   return instance;
 }
 
 // Create the default instance to be exported
-const axios = createInstance(defaults);
+const axios = createInstance(lib_defaults);
 
 // Expose Axios class to allow class inheritance
-axios.Axios = Axios;
+axios.Axios = core_Axios;
 
 // Expose Cancel & CancelToken
-axios.CanceledError = CanceledError;
-axios.CancelToken = CancelToken;
+axios.CanceledError = cancel_CanceledError;
+axios.CancelToken = cancel_CancelToken;
 axios.isCancel = isCancel;
 axios.VERSION = VERSION;
-axios.toFormData = toFormData;
+axios.toFormData = helpers_toFormData;
 
 // Expose AxiosError class
-axios.AxiosError = AxiosError;
+axios.AxiosError = core_AxiosError;
 
 // alias for CanceledError for backward compatibility
 axios.Cancel = axios.CanceledError;
@@ -129456,6 +163714,7 @@ axios.Cancel = axios.CanceledError;
 axios.all = function all(promises) {
   return Promise.all(promises);
 };
+
 axios.spread = spread;
 
 // Expose isAxiosError
@@ -129463,550 +163722,218 @@ axios.isAxiosError = isAxiosError;
 
 // Expose mergeConfig
 axios.mergeConfig = mergeConfig;
-axios.AxiosHeaders = AxiosHeaders;
-axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
-axios.getAdapter = adapters.getAdapter;
-axios.HttpStatusCode = HttpStatusCode;
-axios.default = axios;
-
-module.exports = axios;
-//# sourceMappingURL=axios.cjs.map
-
-
-/***/ }),
-
-/***/ 84928:
-/***/ ((module) => {
 
-"use strict";
-
-
-function getDefaultExportFromCjs (x) {
-	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
-}
-
-const CRC_TABLE = new Int32Array([
-  0,
-  1996959894,
-  3993919788,
-  2567524794,
-  124634137,
-  1886057615,
-  3915621685,
-  2657392035,
-  249268274,
-  2044508324,
-  3772115230,
-  2547177864,
-  162941995,
-  2125561021,
-  3887607047,
-  2428444049,
-  498536548,
-  1789927666,
-  4089016648,
-  2227061214,
-  450548861,
-  1843258603,
-  4107580753,
-  2211677639,
-  325883990,
-  1684777152,
-  4251122042,
-  2321926636,
-  335633487,
-  1661365465,
-  4195302755,
-  2366115317,
-  997073096,
-  1281953886,
-  3579855332,
-  2724688242,
-  1006888145,
-  1258607687,
-  3524101629,
-  2768942443,
-  901097722,
-  1119000684,
-  3686517206,
-  2898065728,
-  853044451,
-  1172266101,
-  3705015759,
-  2882616665,
-  651767980,
-  1373503546,
-  3369554304,
-  3218104598,
-  565507253,
-  1454621731,
-  3485111705,
-  3099436303,
-  671266974,
-  1594198024,
-  3322730930,
-  2970347812,
-  795835527,
-  1483230225,
-  3244367275,
-  3060149565,
-  1994146192,
-  31158534,
-  2563907772,
-  4023717930,
-  1907459465,
-  112637215,
-  2680153253,
-  3904427059,
-  2013776290,
-  251722036,
-  2517215374,
-  3775830040,
-  2137656763,
-  141376813,
-  2439277719,
-  3865271297,
-  1802195444,
-  476864866,
-  2238001368,
-  4066508878,
-  1812370925,
-  453092731,
-  2181625025,
-  4111451223,
-  1706088902,
-  314042704,
-  2344532202,
-  4240017532,
-  1658658271,
-  366619977,
-  2362670323,
-  4224994405,
-  1303535960,
-  984961486,
-  2747007092,
-  3569037538,
-  1256170817,
-  1037604311,
-  2765210733,
-  3554079995,
-  1131014506,
-  879679996,
-  2909243462,
-  3663771856,
-  1141124467,
-  855842277,
-  2852801631,
-  3708648649,
-  1342533948,
-  654459306,
-  3188396048,
-  3373015174,
-  1466479909,
-  544179635,
-  3110523913,
-  3462522015,
-  1591671054,
-  702138776,
-  2966460450,
-  3352799412,
-  1504918807,
-  783551873,
-  3082640443,
-  3233442989,
-  3988292384,
-  2596254646,
-  62317068,
-  1957810842,
-  3939845945,
-  2647816111,
-  81470997,
-  1943803523,
-  3814918930,
-  2489596804,
-  225274430,
-  2053790376,
-  3826175755,
-  2466906013,
-  167816743,
-  2097651377,
-  4027552580,
-  2265490386,
-  503444072,
-  1762050814,
-  4150417245,
-  2154129355,
-  426522225,
-  1852507879,
-  4275313526,
-  2312317920,
-  282753626,
-  1742555852,
-  4189708143,
-  2394877945,
-  397917763,
-  1622183637,
-  3604390888,
-  2714866558,
-  953729732,
-  1340076626,
-  3518719985,
-  2797360999,
-  1068828381,
-  1219638859,
-  3624741850,
-  2936675148,
-  906185462,
-  1090812512,
-  3747672003,
-  2825379669,
-  829329135,
-  1181335161,
-  3412177804,
-  3160834842,
-  628085408,
-  1382605366,
-  3423369109,
-  3138078467,
-  570562233,
-  1426400815,
-  3317316542,
-  2998733608,
-  733239954,
-  1555261956,
-  3268935591,
-  3050360625,
-  752459403,
-  1541320221,
-  2607071920,
-  3965973030,
-  1969922972,
-  40735498,
-  2617837225,
-  3943577151,
-  1913087877,
-  83908371,
-  2512341634,
-  3803740692,
-  2075208622,
-  213261112,
-  2463272603,
-  3855990285,
-  2094854071,
-  198958881,
-  2262029012,
-  4057260610,
-  1759359992,
-  534414190,
-  2176718541,
-  4139329115,
-  1873836001,
-  414664567,
-  2282248934,
-  4279200368,
-  1711684554,
-  285281116,
-  2405801727,
-  4167216745,
-  1634467795,
-  376229701,
-  2685067896,
-  3608007406,
-  1308918612,
-  956543938,
-  2808555105,
-  3495958263,
-  1231636301,
-  1047427035,
-  2932959818,
-  3654703836,
-  1088359270,
-  936918e3,
-  2847714899,
-  3736837829,
-  1202900863,
-  817233897,
-  3183342108,
-  3401237130,
-  1404277552,
-  615818150,
-  3134207493,
-  3453421203,
-  1423857449,
-  601450431,
-  3009837614,
-  3294710456,
-  1567103746,
-  711928724,
-  3020668471,
-  3272380065,
-  1510334235,
-  755167117
-]);
-function ensureBuffer(input) {
-  if (Buffer.isBuffer(input)) {
-    return input;
-  }
-  if (typeof input === "number") {
-    return Buffer.alloc(input);
-  } else if (typeof input === "string") {
-    return Buffer.from(input);
-  } else {
-    throw new Error("input must be buffer, number, or string, received " + typeof input);
-  }
-}
-function bufferizeInt(num) {
-  const tmp = ensureBuffer(4);
-  tmp.writeInt32BE(num, 0);
-  return tmp;
-}
-function _crc32(buf, previous) {
-  buf = ensureBuffer(buf);
-  if (Buffer.isBuffer(previous)) {
-    previous = previous.readUInt32BE(0);
-  }
-  let crc = ~~previous ^ -1;
-  for (var n = 0; n < buf.length; n++) {
-    crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
-  }
-  return crc ^ -1;
-}
-function crc32() {
-  return bufferizeInt(_crc32.apply(null, arguments));
-}
-crc32.signed = function() {
-  return _crc32.apply(null, arguments);
-};
-crc32.unsigned = function() {
-  return _crc32.apply(null, arguments) >>> 0;
-};
-var bufferCrc32 = crc32;
+axios.AxiosHeaders = core_AxiosHeaders;
 
-const index = /*@__PURE__*/getDefaultExportFromCjs(bufferCrc32);
+axios.formToJSON = (thing) => helpers_formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
 
-module.exports = index;
+axios.getAdapter = adapters.getAdapter;
 
+axios.HttpStatusCode = helpers_HttpStatusCode;
 
-/***/ }),
+axios.default = axios;
 
-/***/ 50591:
-/***/ ((module) => {
+// this module should only have a default export
+/* harmony default export */ const lib_axios = (axios);
 
-(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>xe,XMLParser:()=>Jt,XMLValidator:()=>be});const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("^["+i+"]["+i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function r(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)l+=t[s];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),s--),!E(l)){let e;return e=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",y("InvalidTag",e,w(t,s))}const p=g(t,s);if(!1===p)return y("InvalidAttr","Attributes for '"+l+"' have open quote.",w(t,s));let u=p.value;if(s=p.index,"/"===u[u.length-1]){const i=s-u.length;u=u.substring(0,u.length-1);const r=x(u,e);if(!0!==r)return y(r.err.code,r.err.msg,w(t,i+r.err.line));n=!0}else if(a){if(!p.tagClosed)return y("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",w(t,s));if(u.trim().length>0)return y("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",w(t,o));if(0===i.length)return y("InvalidTag","Closing tag '"+l+"' has not been opened.",w(t,o));{const e=i.pop();if(l!==e.tagName){let i=w(t,e.tagStartPos);return y("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+i.line+", col "+i.col+") instead of closing tag '"+l+"'.",w(t,o))}0==i.length&&(r=!0)}}else{const a=x(u,e);if(!0!==a)return y(a.err.code,a.err.msg,w(t,s-u.length+a.err.line));if(!0===r)return y("InvalidXml","Multiple possible root nodes found.",w(t,s));-1!==e.unpairedTags.indexOf(l)||i.push({tagName:l,tagStartPos:o}),n=!0}for(s++;s0)||y("InvalidXml","Invalid '"+JSON.stringify(i.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):y("InvalidXml","Start tag expected.",1)}function c(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function h(t,e){const i=e;for(;e5&&"xml"===n)return y("InvalidXml","XML declaration allowed only at the start of the document.",w(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function d(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}const u='"',f="'";function g(t,e){let i="",n="",r=!1;for(;e"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}const m=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function x(t,e){const i=r(t,m),n={};for(let t=0;to.includes(t)?"__"+t:t,A={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:S};function T(t,e){if("string"!=typeof t)return;const i=t.toLowerCase();if(o.some(t=>i===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(a.some(t=>i===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function _(t,e){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null,appliesTo:t.appliesTo??"all"}:_(!0)}const C=function(t){const e=Object.assign({},A,t),i=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:t,name:e}of i)t&&T(t,e);return null===e.onDangerousProperty&&(e.onDangerousProperty=S),e.processEntities=_(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(t=>"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t)),e};let $;$="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class O{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][$]={startIndex:e})}static getMetaDataSymbol(){return $}}const P=":A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�",j=":A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",I=j+"\\-\\.\\d·̀-ͯ҇‿-⁀",k=(t,e,i="")=>{const n=`[${t.replace(":","")}][${e.replace(":","")}]*`;return{name:new RegExp(`^[${t}][${e}]*$`,i),ncName:new RegExp(`^${n}$`,i),qName:new RegExp(`^${n}(?::${n})?$`,i),nmToken:new RegExp(`^[${e}]+$`,i),nmTokens:new RegExp(`^[${e}]+(?:\\s+[${e}]+)*$`,i)}},L=k(P,P+"\\-\\.\\d·̀-ͯ‿-⁀"),D=k(j,I,"u"),R=(t,{xmlVersion:e="1.0"}={})=>((t="1.0")=>"1.1"===t?D:L)(e).qName.test(t);class M{constructor(t,e){this.suppressValidationErr=!t,this.options=t,this.xmlVersion=e||1}setXmlVersion(t=1){this.xmlVersion=t}readDocType(t,e){const i=Object.create(null);let n=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let r=1,s=!1,o=!1,a="";for(;e"===t[e]){if(o?"-"===t[e-1]&&"-"===t[e-2]&&(o=!1,r--):r--,0===r)break}else"["===t[e]?s=!0:a+=t[e];else{if(s&&q(t,"!ENTITY",e)){let r,s;if(e+=7,[r,s,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===s.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&n>=this.options.maxEntityCount)throw new Error(`Entity count (${n+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);i[r]=s,n++}}else if(s&&q(t,"!ELEMENT",e)){e+=8;const{index:i}=this.readElementExp(t,e+1);e=i}else if(s&&q(t,"!ATTLIST",e))e+=8;else if(s&&q(t,"!NOTATION",e)){e+=9;const{index:i}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=i}else{if(!q(t,"!--",e))throw new Error("Invalid DOCTYPE");o=!0}r++,a=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:e}}readEntityExp(t,e){const i=e=V(t,e);for(;ethis.options.maxEntitySize)throw new Error(`Entity "${n}" size (${r.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,r,--e]}readNotationExp(t,e){const i=e=V(t,e);for(;e{for(;e=48&&r<=57||45===r))if(r=55296&&r<=56319){if(n+1=56320&&e<=57343){const t=65536+(r-55296<<10)+(e-56320);if(G.has(t)){i=n;break}}}}else if(255!==W[r-B]||X.has(r)){i=n;break}}if(-1===i)return t;const n=[];i>0&&n.push(t.slice(0,i));for(let r=i;r=48&&i<=57||45===i){n.push(t[r]);continue}if(i=55296&&i<=56319){if(r+1=56320&&e<=57343){const t=65536+(i-55296<<10)+(e-56320),s=G.get(t);if(void 0!==s){n.push(String.fromCharCode(s+48)),r++;continue}}}n.push(t[r]);continue}if(X.has(i)){n.push("-");continue}const s=W[i-B];n.push(255!==s?String.fromCharCode(s+48):t[r])}return n.join("")}(i),"0"===i))return 0;if(e.hex&&Y.test(i))return tt(i,16);if(e.binary&&z.test(i))return tt(i,2);if(e.octal&&H.test(i))return tt(i,8);if(isFinite(i)){if(i.includes("e")||i.includes("E"))return function(t,e,i){if(!i.eNotation)return t;const n=e.match(K);if(n){let r=n[1]||"";const s=-1===n[3].indexOf("e")?"E":"e",o=n[2],a=r?t[o.length+1]===s:t[o.length]===s;return o.length>1&&a?t:(1!==o.length||!n[3].startsWith(`.${s}`)&&n[3][0]!==s)&&o.length>0?i.leadingZeros&&!a?(e=(n[1]||"")+n[3],Number(e)):t:Number(e)}return t}(t,i,e);{const r=Q.exec(i);if(r){const s=r[1]||"",o=r[2];let a=(n=r[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n;const l=s?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const n=Number(i),r=String(n);if(0===n)return n;if(-1!==r.search(/[eE]/))return e.eNotation?n:t;if(-1!==i.indexOf("."))return"0"===r||r===a||r===`${s}${a}`?n:t;let l=o?a:i;return o?l===r||s+l===r?n:t:l===r||l===s+r?n:t}}return t}}var n;return function(t,e,i){const n=e===1/0;switch(i.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return n?"Infinity":"-Infinity";default:return t}}(t,Number(i),e)}const K=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function tt(t,e){const i=t.trim();if(2!==e&&8!==e||(t=i.substring(2)),parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}class et{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const i=e[e.length-1];return void 0!==i.values&&t in i.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class it{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new et(this)}push(t,e=null,i=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);const r=this.siblingStacks[n],s=i?`${i}:${t}`:t,o=r.get(s)||0;let a=0;for(const t of r.values())a+=t;r.set(s,o+1);const l={tag:t,position:a,counter:o};null!=i&&(l.namespace=i),null!=e&&(l.values=e),this.path.push(l)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const i=t||this.separator;if(i===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(i);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(i)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e=0&&e>=0;){const n=t[i];if("deep-wildcard"===n.type){if(i--,i<0)return!0;const n=t[i];let r=!1;for(let t=e;t>=0;t--)if(this._matchSegment(n,this.path[t],t===this.path.length-1)){e=t-1,i--,r=!0;break}if(!r)return!1}else{if(!this._matchSegment(n,this.path[e],e===this.path.length-1))return!1;e--,i--}}return i<0}_matchSegment(t,e,i){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!i)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!i)return!1;const n=e.counter??0;if("first"===t.position&&0!==n)return!1;if("odd"===t.position&&n%2!=1)return!1;if("even"===t.position&&n%2!=0)return!1;if("nth"===t.position&&n!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class nt{constructor(t,e={},i){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=i,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let i=0,n="";for(;i",lt:"<",quot:'"'},at={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},lt=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),pt=new Set("!?\\\\/[]$%{}^&*()<>|+");function ct(t){if("#"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(const e of t)if(pt.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function ht(...t){const e=Object.create(null);for(const i of t)if(i)for(const t of Object.keys(i)){const n=i[t];if("string"==typeof n)e[t]=n;else if(n&&"object"==typeof n&&void 0!==n.val){const i=n.val;"string"==typeof i&&(e[t]=i)}}return e}const dt="external",ut="base",ft="all",gt=Object.freeze({allow:0,leave:1,remove:2,throw:3}),mt=new Set([9,10,13]);class xt{constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck="function"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??dt)&&e!==dt?e===ft?new Set([ft]):e===ut?new Set([ut]):Array.isArray(e)?new Set(e):new Set([dt]):new Set([dt]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=ht(ot,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const i=function(t){if(!t)return{xmlVersion:1,onLevel:gt.allow,nullLevel:gt.remove};const e=1.1===t.xmlVersion?1.1:1,i=gt[t.onNCR]??gt.allow,n=gt[t.nullNCR]??gt.remove;return{xmlVersion:e,onLevel:i,nullLevel:Math.max(n,gt.remove)}}(t.ncr);this._ncrXmlVersion=i.xmlVersion,this._ncrOnLevel=i.onLevel,this._ncrNullLevel=i.nullLevel,this._onExternalEntity="function"==typeof t.onExternalEntity?t.onExternalEntity:null,this._onInputEntity="function"==typeof t.onInputEntity?t.onInputEntity:null}_applyRegistrationHook(t,e,i,n){if(!t)return!0;const r=t(e,i);if(r===lt.BLOCK)return!1;if(r===lt.THROW)throw new Error(`[EntityDecoder] Registration of ${n} entity "&${e};" was rejected by hook`);return!0}setExternalEntities(t){if(t)for(const e of Object.keys(t))ct(e);if(!this._onExternalEntity)return void(this._externalMap=ht(t));const e=ht(t),i=Object.create(null);for(const[t,n]of Object.entries(e))this._applyRegistrationHook(this._onExternalEntity,t,n,"external")&&(i[t]=n);this._externalMap=i}addExternalEntity(t,e){ct(t),"string"==typeof e&&-1===e.indexOf("&")&&this._applyRegistrationHook(this._onExternalEntity,t,e,"external")&&(this._externalMap[t]=e)}addInputEntities(t){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity)return void(this._inputMap=ht(t));const e=ht(t),i=Object.create(null);for(const[t,n]of Object.entries(e))this._applyRegistrationHook(this._onInputEntity,t,n,"input")&&(i[t]=n);this._inputMap=i}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if("string"!=typeof t||0===t.length)return t;if(-1===t.indexOf("&"))return t;const e=t,i=[],n=t.length;let r=0,s=0;const o=this._maxTotalExpansions>0,a=this._maxExpandedLength>0,l=o||a;for(;s=n||59!==t.charCodeAt(e)){s++;continue}const p=t.slice(s+1,e);if(0===p.length){s++;continue}let c,h;if(this._removeSet.has(p))c="",void 0===h&&(h=dt);else{if(this._leaveSet.has(p)){s++;continue}if(35===p.charCodeAt(0)){const t=this._resolveNCR(p);if(void 0===t){s++;continue}c=t,h=ut}else{const t=this._resolveName(p);c=t?.value,h=t?.tier}}if(void 0!==c){if(s>r&&i.push(t.slice(r,s)),i.push(c),r=e+1,s=r,l&&this._tierCounts(h)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(a){const t=c.length-(p.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else s++}r=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!mt.has(t)?gt.remove:-1}_applyNCRAction(t,e,i){switch(t){case gt.allow:return String.fromCodePoint(i);case gt.remove:return"";case gt.leave:return;case gt.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${i.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(i)}}_resolveNCR(t){const e=t.charCodeAt(1);let i;if(i=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(i)||i<0||i>1114111)return;const n=this._classifyNCR(i);if(!this._numericAllowed&&n/]/i},{id:"html-script-close",description:"<\/script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI — can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI — can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded