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,CAKA,QAAAgQ,GACI,OAAO7Z,KAAK4jB,UAAU/J,UAC1B,E","sources":["webpack://power-app-fe/./node_modules/@azure/abort-controller/dist/browser/AbortError.js","webpack://power-app-fe/./node_modules/@azure/core-auth/dist/browser/tokenCredential.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/base64.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/interfaces.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/utils.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/serializer.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/state.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/operationHelpers.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/deserializationPolicy.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/interfaceHelpers.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/serializationPolicy.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/pipeline.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/httpClientCache.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/urlHelpers.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/log.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/serviceClient.js","webpack://power-app-fe/./node_modules/@azure/core-client/dist/browser/authorizeRequestOnTenantChallenge.js","webpack://power-app-fe/./node_modules/@azure/core-http-compat/dist/browser/policies/disableKeepAlivePolicy.js","webpack://power-app-fe/./node_modules/@azure/core-http-compat/dist/browser/util.js","webpack://power-app-fe/./node_modules/@azure/core-http-compat/dist/browser/response.js","webpack://power-app-fe/./node_modules/@azure/core-http-compat/dist/browser/extendedClient.js","webpack://power-app-fe/./node_modules/@azure/core-http-compat/dist/browser/policies/requestPolicyFactoryPolicy.js","webpack://power-app-fe/./node_modules/@azure/core-http-compat/dist/browser/httpClientAdapter.js","webpack://power-app-fe/./node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * This error is thrown when an asynchronous operation has been aborted.\n * Check for this error by testing the `name` that the name property of the\n * error matches `\"AbortError\"`.\n *\n * @example\n * ```ts\n * const controller = new AbortController();\n * controller.abort();\n * try {\n * doAsyncWork(controller.signal)\n * } catch (e) {\n * if (e.name === 'AbortError') {\n * // handle abort error here.\n * }\n * }\n * ```\n */\nexport class AbortError extends Error {\n constructor(message) {\n super(message);\n this.name = \"AbortError\";\n }\n}\n//# sourceMappingURL=AbortError.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @internal\n * @param accessToken - Access token\n * @returns Whether a token is bearer type or not\n */\nexport function isBearerToken(accessToken) {\n return !accessToken.tokenType || accessToken.tokenType === \"Bearer\";\n}\n/**\n * @internal\n * @param accessToken - Access token\n * @returns Whether a token is Pop token or not\n */\nexport function isPopToken(accessToken) {\n return accessToken.tokenType === \"pop\";\n}\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential - The assumed TokenCredential to be tested.\n */\nexport function isTokenCredential(credential) {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n const castCredential = credential;\n return (castCredential &&\n typeof castCredential.getToken === \"function\" &&\n (castCredential.signRequest === undefined || castCredential.getToken.length > 0));\n}\n//# sourceMappingURL=tokenCredential.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Encodes a string in base64 format.\n * @param value - the string to encode\n * @internal\n */\nexport function encodeString(value) {\n return btoa(value);\n}\n/**\n * Encodes a byte array in base64 format.\n * @param value - the Uint8Aray to encode\n * @internal\n */\nexport function encodeByteArray(value) {\n let str = \"\";\n for (let i = 0; i < value.length; i++) {\n str += String.fromCharCode(value[i]);\n }\n return btoa(str);\n}\n/**\n * Decodes a base64 string into a byte array.\n * @param value - the base64 string to decode\n * @internal\n */\nexport function decodeString(value) {\n const byteString = atob(value);\n const arr = new Uint8Array(byteString.length);\n for (let i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n}\n/**\n * Decodes a base64 string into a string.\n * @param value - the base64 string to decode\n * @internal\n */\nexport function decodeStringToString(value) {\n return atob(value);\n}\n//# sourceMappingURL=base64-browser.mjs.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Default key used to access the XML attributes.\n */\nexport const XML_ATTRKEY = \"$\";\n/**\n * Default key used to access the XML value content.\n */\nexport const XML_CHARKEY = \"_\";\n//# sourceMappingURL=interfaces.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * A type guard for a primitive response body.\n * @param value - Value to test\n *\n * @internal\n */\nexport function isPrimitiveBody(value, mapperTypeName) {\n return (mapperTypeName !== \"Composite\" &&\n mapperTypeName !== \"Dictionary\" &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !==\n null ||\n value === undefined ||\n value === null));\n}\nconst validateISODuration = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n/**\n * Returns true if the given string is in ISO 8601 format.\n * @param value - The value to be validated for ISO 8601 duration format.\n * @internal\n */\nexport function isDuration(value) {\n return validateISODuration.test(value);\n}\nconst 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;\n/**\n * Returns true if the provided uuid is valid.\n *\n * @param uuid - The uuid that needs to be validated.\n *\n * @internal\n */\nexport function isValidUuid(uuid) {\n return validUuidRegex.test(uuid);\n}\n/**\n * Maps the response as follows:\n * - wraps the response body if needed (typically if its type is primitive).\n * - returns null if the combination of the headers and the body is empty.\n * - otherwise, returns the combination of the headers and the body.\n *\n * @param responseObject - a representation of the parsed response\n * @returns the response that will be returned to the user which can be null and/or wrapped\n *\n * @internal\n */\nfunction handleNullableResponseAndWrappableBody(responseObject) {\n const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body);\n if (responseObject.hasNullableType &&\n Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) {\n return responseObject.shouldWrapBody ? { body: null } : null;\n }\n else {\n return responseObject.shouldWrapBody\n ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody;\n }\n}\n/**\n * Take a `FullOperationResponse` and turn it into a flat\n * response object to hand back to the consumer.\n * @param fullResponse - The processed response from the operation request\n * @param responseSpec - The response map from the OperationSpec\n *\n * @internal\n */\nexport function flattenResponse(fullResponse, responseSpec) {\n var _a, _b;\n const parsedHeaders = fullResponse.parsedHeaders;\n // head methods never have a body, but we return a boolean set to body property\n // to indicate presence/absence of the resource\n if (fullResponse.request.method === \"HEAD\") {\n return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody });\n }\n const bodyMapper = responseSpec && responseSpec.bodyMapper;\n const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable);\n const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name;\n /** If the body is asked for, we look at the expected body type to handle it */\n if (expectedBodyTypeName === \"Stream\") {\n return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody });\n }\n const modelProperties = (expectedBodyTypeName === \"Composite\" &&\n bodyMapper.type.modelProperties) ||\n {};\n const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === \"\");\n if (expectedBodyTypeName === \"Sequence\" || isPageableResponse) {\n const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : [];\n for (const key of Object.keys(modelProperties)) {\n if (modelProperties[key].serializedName) {\n arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key];\n }\n }\n if (parsedHeaders) {\n for (const key of Object.keys(parsedHeaders)) {\n arrayResponse[key] = parsedHeaders[key];\n }\n }\n return isNullable &&\n !fullResponse.parsedBody &&\n !parsedHeaders &&\n Object.getOwnPropertyNames(modelProperties).length === 0\n ? null\n : arrayResponse;\n }\n return handleNullableResponseAndWrappableBody({\n body: fullResponse.parsedBody,\n headers: parsedHeaders,\n hasNullableType: isNullable,\n shouldWrapBody: isPrimitiveBody(fullResponse.parsedBody, expectedBodyTypeName),\n });\n}\n//# sourceMappingURL=utils.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport * as base64 from \"./base64.js\";\nimport { XML_ATTRKEY, XML_CHARKEY, } from \"./interfaces.js\";\nimport { isDuration, isValidUuid } from \"./utils.js\";\nclass SerializerImpl {\n constructor(modelMappers = {}, isXML = false) {\n this.modelMappers = modelMappers;\n this.isXML = isXML;\n }\n /**\n * @deprecated Removing the constraints validation on client side.\n */\n validateConstraints(mapper, value, objectName) {\n const failValidation = (constraintName, constraintValue) => {\n throw new Error(`\"${objectName}\" with value \"${value}\" should satisfy the constraint \"${constraintName}\": ${constraintValue}.`);\n };\n if (mapper.constraints && value !== undefined && value !== null) {\n const { ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems, } = mapper.constraints;\n if (ExclusiveMaximum !== undefined && value >= ExclusiveMaximum) {\n failValidation(\"ExclusiveMaximum\", ExclusiveMaximum);\n }\n if (ExclusiveMinimum !== undefined && value <= ExclusiveMinimum) {\n failValidation(\"ExclusiveMinimum\", ExclusiveMinimum);\n }\n if (InclusiveMaximum !== undefined && value > InclusiveMaximum) {\n failValidation(\"InclusiveMaximum\", InclusiveMaximum);\n }\n if (InclusiveMinimum !== undefined && value < InclusiveMinimum) {\n failValidation(\"InclusiveMinimum\", InclusiveMinimum);\n }\n if (MaxItems !== undefined && value.length > MaxItems) {\n failValidation(\"MaxItems\", MaxItems);\n }\n if (MaxLength !== undefined && value.length > MaxLength) {\n failValidation(\"MaxLength\", MaxLength);\n }\n if (MinItems !== undefined && value.length < MinItems) {\n failValidation(\"MinItems\", MinItems);\n }\n if (MinLength !== undefined && value.length < MinLength) {\n failValidation(\"MinLength\", MinLength);\n }\n if (MultipleOf !== undefined && value % MultipleOf !== 0) {\n failValidation(\"MultipleOf\", MultipleOf);\n }\n if (Pattern) {\n const pattern = typeof Pattern === \"string\" ? new RegExp(Pattern) : Pattern;\n if (typeof value !== \"string\" || value.match(pattern) === null) {\n failValidation(\"Pattern\", Pattern);\n }\n }\n if (UniqueItems &&\n value.some((item, i, ar) => ar.indexOf(item) !== i)) {\n failValidation(\"UniqueItems\", UniqueItems);\n }\n }\n }\n /**\n * Serialize the given object based on its metadata defined in the mapper\n *\n * @param mapper - The mapper which defines the metadata of the serializable object\n *\n * @param object - A valid Javascript object to be serialized\n *\n * @param objectName - Name of the serialized object\n *\n * @param options - additional options to serialization\n *\n * @returns A valid serialized Javascript object\n */\n serialize(mapper, object, objectName, options = { xml: {} }) {\n var _a, _b, _c;\n const updatedOptions = {\n xml: {\n rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : \"\",\n includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false,\n xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY,\n },\n };\n let payload = {};\n const mapperType = mapper.type.name;\n if (!objectName) {\n objectName = mapper.serializedName;\n }\n if (mapperType.match(/^Sequence$/i) !== null) {\n payload = [];\n }\n if (mapper.isConstant) {\n object = mapper.defaultValue;\n }\n // This table of allowed values should help explain\n // the mapper.required and mapper.nullable properties.\n // X means \"neither undefined or null are allowed\".\n // || required\n // || true | false\n // nullable || ==========================\n // true || null | undefined/null\n // false || X | undefined\n // undefined || X | undefined/null\n const { required, nullable } = mapper;\n if (required && nullable && object === undefined) {\n throw new Error(`${objectName} cannot be undefined.`);\n }\n if (required && !nullable && (object === undefined || object === null)) {\n throw new Error(`${objectName} cannot be null or undefined.`);\n }\n if (!required && nullable === false && object === null) {\n throw new Error(`${objectName} cannot be null.`);\n }\n if (object === undefined || object === null) {\n payload = object;\n }\n else {\n if (mapperType.match(/^any$/i) !== null) {\n payload = object;\n }\n else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) {\n payload = serializeBasicTypes(mapperType, objectName, object);\n }\n else if (mapperType.match(/^Enum$/i) !== null) {\n const enumMapper = mapper;\n payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object);\n }\n else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) {\n payload = serializeDateTypes(mapperType, object, objectName);\n }\n else if (mapperType.match(/^ByteArray$/i) !== null) {\n payload = serializeByteArrayType(objectName, object);\n }\n else if (mapperType.match(/^Base64Url$/i) !== null) {\n payload = serializeBase64UrlType(objectName, object);\n }\n else if (mapperType.match(/^Sequence$/i) !== null) {\n payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);\n }\n else if (mapperType.match(/^Dictionary$/i) !== null) {\n payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);\n }\n else if (mapperType.match(/^Composite$/i) !== null) {\n payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);\n }\n }\n return payload;\n }\n /**\n * Deserialize the given object based on its metadata defined in the mapper\n *\n * @param mapper - The mapper which defines the metadata of the serializable object\n *\n * @param responseBody - A valid Javascript entity to be deserialized\n *\n * @param objectName - Name of the deserialized object\n *\n * @param options - Controls behavior of XML parser and builder.\n *\n * @returns A valid deserialized Javascript object\n */\n deserialize(mapper, responseBody, objectName, options = { xml: {} }) {\n var _a, _b, _c, _d;\n const updatedOptions = {\n xml: {\n rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : \"\",\n includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false,\n xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY,\n },\n ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : false,\n };\n if (responseBody === undefined || responseBody === null) {\n if (this.isXML && mapper.type.name === \"Sequence\" && !mapper.xmlIsWrapped) {\n // Edge case for empty XML non-wrapped lists. xml2js can't distinguish\n // between the list being empty versus being missing,\n // so let's do the more user-friendly thing and return an empty list.\n responseBody = [];\n }\n // specifically check for undefined as default value can be a falsey value `0, \"\", false, null`\n if (mapper.defaultValue !== undefined) {\n responseBody = mapper.defaultValue;\n }\n return responseBody;\n }\n let payload;\n const mapperType = mapper.type.name;\n if (!objectName) {\n objectName = mapper.serializedName;\n }\n if (mapperType.match(/^Composite$/i) !== null) {\n payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions);\n }\n else {\n if (this.isXML) {\n const xmlCharKey = updatedOptions.xml.xmlCharKey;\n /**\n * If the mapper specifies this as a non-composite type value but the responseBody contains\n * both header (\"$\" i.e., XML_ATTRKEY) and body (\"#\" i.e., XML_CHARKEY) properties,\n * then just reduce the responseBody value to the body (\"#\" i.e., XML_CHARKEY) property.\n */\n if (responseBody[XML_ATTRKEY] !== undefined && responseBody[xmlCharKey] !== undefined) {\n responseBody = responseBody[xmlCharKey];\n }\n }\n if (mapperType.match(/^Number$/i) !== null) {\n payload = parseFloat(responseBody);\n if (isNaN(payload)) {\n payload = responseBody;\n }\n }\n else if (mapperType.match(/^Boolean$/i) !== null) {\n if (responseBody === \"true\") {\n payload = true;\n }\n else if (responseBody === \"false\") {\n payload = false;\n }\n else {\n payload = responseBody;\n }\n }\n else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) {\n payload = responseBody;\n }\n else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) {\n payload = new Date(responseBody);\n }\n else if (mapperType.match(/^UnixTime$/i) !== null) {\n payload = unixTimeToDate(responseBody);\n }\n else if (mapperType.match(/^ByteArray$/i) !== null) {\n payload = base64.decodeString(responseBody);\n }\n else if (mapperType.match(/^Base64Url$/i) !== null) {\n payload = base64UrlToByteArray(responseBody);\n }\n else if (mapperType.match(/^Sequence$/i) !== null) {\n payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions);\n }\n else if (mapperType.match(/^Dictionary$/i) !== null) {\n payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions);\n }\n }\n if (mapper.isConstant) {\n payload = mapper.defaultValue;\n }\n return payload;\n }\n}\n/**\n * Method that creates and returns a Serializer.\n * @param modelMappers - Known models to map\n * @param isXML - If XML should be supported\n */\nexport function createSerializer(modelMappers = {}, isXML = false) {\n return new SerializerImpl(modelMappers, isXML);\n}\nfunction trimEnd(str, ch) {\n let len = str.length;\n while (len - 1 >= 0 && str[len - 1] === ch) {\n --len;\n }\n return str.substr(0, len);\n}\nfunction bufferToBase64Url(buffer) {\n if (!buffer) {\n return undefined;\n }\n if (!(buffer instanceof Uint8Array)) {\n throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);\n }\n // Uint8Array to Base64.\n const str = base64.encodeByteArray(buffer);\n // Base64 to Base64Url.\n return trimEnd(str, \"=\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n}\nfunction base64UrlToByteArray(str) {\n if (!str) {\n return undefined;\n }\n if (str && typeof str.valueOf() !== \"string\") {\n throw new Error(\"Please provide an input of type string for converting to Uint8Array\");\n }\n // Base64Url to Base64.\n str = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Base64 to Uint8Array.\n return base64.decodeString(str);\n}\nfunction splitSerializeName(prop) {\n const classes = [];\n let partialclass = \"\";\n if (prop) {\n const subwords = prop.split(\".\");\n for (const item of subwords) {\n if (item.charAt(item.length - 1) === \"\\\\\") {\n partialclass += item.substr(0, item.length - 1) + \".\";\n }\n else {\n partialclass += item;\n classes.push(partialclass);\n partialclass = \"\";\n }\n }\n }\n return classes;\n}\nfunction dateToUnixTime(d) {\n if (!d) {\n return undefined;\n }\n if (typeof d.valueOf() === \"string\") {\n d = new Date(d);\n }\n return Math.floor(d.getTime() / 1000);\n}\nfunction unixTimeToDate(n) {\n if (!n) {\n return undefined;\n }\n return new Date(n * 1000);\n}\nfunction serializeBasicTypes(typeName, objectName, value) {\n if (value !== null && value !== undefined) {\n if (typeName.match(/^Number$/i) !== null) {\n if (typeof value !== \"number\") {\n throw new Error(`${objectName} with value ${value} must be of type number.`);\n }\n }\n else if (typeName.match(/^String$/i) !== null) {\n if (typeof value.valueOf() !== \"string\") {\n throw new Error(`${objectName} with value \"${value}\" must be of type string.`);\n }\n }\n else if (typeName.match(/^Uuid$/i) !== null) {\n if (!(typeof value.valueOf() === \"string\" && isValidUuid(value))) {\n throw new Error(`${objectName} with value \"${value}\" must be of type string and a valid uuid.`);\n }\n }\n else if (typeName.match(/^Boolean$/i) !== null) {\n if (typeof value !== \"boolean\") {\n throw new Error(`${objectName} with value ${value} must be of type boolean.`);\n }\n }\n else if (typeName.match(/^Stream$/i) !== null) {\n const objectType = typeof value;\n if (objectType !== \"string\" &&\n typeof value.pipe !== \"function\" && // NodeJS.ReadableStream\n typeof value.tee !== \"function\" && // browser ReadableStream\n !(value instanceof ArrayBuffer) &&\n !ArrayBuffer.isView(value) &&\n // File objects count as a type of Blob, so we want to use instanceof explicitly\n !((typeof Blob === \"function\" || typeof Blob === \"object\") && value instanceof Blob) &&\n objectType !== \"function\") {\n throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, ReadableStream, or () => ReadableStream.`);\n }\n }\n }\n return value;\n}\nfunction serializeEnumType(objectName, allowedValues, value) {\n if (!allowedValues) {\n throw new Error(`Please provide a set of allowedValues to validate ${objectName} as an Enum Type.`);\n }\n const isPresent = allowedValues.some((item) => {\n if (typeof item.valueOf() === \"string\") {\n return item.toLowerCase() === value.toLowerCase();\n }\n return item === value;\n });\n if (!isPresent) {\n throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`);\n }\n return value;\n}\nfunction serializeByteArrayType(objectName, value) {\n if (value !== undefined && value !== null) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`${objectName} must be of type Uint8Array.`);\n }\n value = base64.encodeByteArray(value);\n }\n return value;\n}\nfunction serializeBase64UrlType(objectName, value) {\n if (value !== undefined && value !== null) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`${objectName} must be of type Uint8Array.`);\n }\n value = bufferToBase64Url(value);\n }\n return value;\n}\nfunction serializeDateTypes(typeName, value, objectName) {\n if (value !== undefined && value !== null) {\n if (typeName.match(/^Date$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`);\n }\n value =\n value instanceof Date\n ? value.toISOString().substring(0, 10)\n : new Date(value).toISOString().substring(0, 10);\n }\n else if (typeName.match(/^DateTime$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`);\n }\n value = value instanceof Date ? value.toISOString() : new Date(value).toISOString();\n }\n else if (typeName.match(/^DateTimeRfc1123$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123 format.`);\n }\n value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString();\n }\n else if (typeName.match(/^UnixTime$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123/ISO8601 format ` +\n `for it to be serialized in UnixTime/Epoch format.`);\n }\n value = dateToUnixTime(value);\n }\n else if (typeName.match(/^TimeSpan$/i) !== null) {\n if (!isDuration(value)) {\n throw new Error(`${objectName} must be a string in ISO 8601 format. Instead was \"${value}\".`);\n }\n }\n }\n return value;\n}\nfunction serializeSequenceType(serializer, mapper, object, objectName, isXml, options) {\n var _a;\n if (!Array.isArray(object)) {\n throw new Error(`${objectName} must be of type Array.`);\n }\n let elementType = mapper.type.element;\n if (!elementType || typeof elementType !== \"object\") {\n throw new Error(`element\" metadata for an Array must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}.`);\n }\n // Quirk: Composite mappers referenced by `element` might\n // not have *all* properties declared (like uberParent),\n // so let's try to look up the full definition by name.\n if (elementType.type.name === \"Composite\" && elementType.type.className) {\n elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType;\n }\n const tempArray = [];\n for (let i = 0; i < object.length; i++) {\n const serializedValue = serializer.serialize(elementType, object[i], objectName, options);\n if (isXml && elementType.xmlNamespace) {\n const xmlnsKey = elementType.xmlNamespacePrefix\n ? `xmlns:${elementType.xmlNamespacePrefix}`\n : \"xmlns\";\n if (elementType.type.name === \"Composite\") {\n tempArray[i] = Object.assign({}, serializedValue);\n tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace };\n }\n else {\n tempArray[i] = {};\n tempArray[i][options.xml.xmlCharKey] = serializedValue;\n tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace };\n }\n }\n else {\n tempArray[i] = serializedValue;\n }\n }\n return tempArray;\n}\nfunction serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) {\n if (typeof object !== \"object\") {\n throw new Error(`${objectName} must be of type object.`);\n }\n const valueType = mapper.type.value;\n if (!valueType || typeof valueType !== \"object\") {\n throw new Error(`\"value\" metadata for a Dictionary must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}.`);\n }\n const tempDictionary = {};\n for (const key of Object.keys(object)) {\n const serializedValue = serializer.serialize(valueType, object[key], objectName, options);\n // If the element needs an XML namespace we need to add it within the $ property\n tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options);\n }\n // Add the namespace to the root element if needed\n if (isXml && mapper.xmlNamespace) {\n const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : \"xmlns\";\n const result = tempDictionary;\n result[XML_ATTRKEY] = { [xmlnsKey]: mapper.xmlNamespace };\n return result;\n }\n return tempDictionary;\n}\n/**\n * Resolves the additionalProperties property from a referenced mapper\n * @param serializer - the serializer containing the entire set of mappers\n * @param mapper - the composite mapper to resolve\n * @param objectName - name of the object being serialized\n */\nfunction resolveAdditionalProperties(serializer, mapper, objectName) {\n const additionalProperties = mapper.type.additionalProperties;\n if (!additionalProperties && mapper.type.className) {\n const modelMapper = resolveReferencedMapper(serializer, mapper, objectName);\n return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties;\n }\n return additionalProperties;\n}\n/**\n * Finds the mapper referenced by className\n * @param serializer - the serializer containing the entire set of mappers\n * @param mapper - the composite mapper to resolve\n * @param objectName - name of the object being serialized\n */\nfunction resolveReferencedMapper(serializer, mapper, objectName) {\n const className = mapper.type.className;\n if (!className) {\n throw new Error(`Class name for model \"${objectName}\" is not provided in the mapper \"${JSON.stringify(mapper, undefined, 2)}\".`);\n }\n return serializer.modelMappers[className];\n}\n/**\n * Resolves a composite mapper's modelProperties.\n * @param serializer - the serializer containing the entire set of mappers\n * @param mapper - the composite mapper to resolve\n */\nfunction resolveModelProperties(serializer, mapper, objectName) {\n let modelProps = mapper.type.modelProperties;\n if (!modelProps) {\n const modelMapper = resolveReferencedMapper(serializer, mapper, objectName);\n if (!modelMapper) {\n throw new Error(`mapper() cannot be null or undefined for model \"${mapper.type.className}\".`);\n }\n modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties;\n if (!modelProps) {\n throw new Error(`modelProperties cannot be null or undefined in the ` +\n `mapper \"${JSON.stringify(modelMapper)}\" of type \"${mapper.type.className}\" for object \"${objectName}\".`);\n }\n }\n return modelProps;\n}\nfunction serializeCompositeType(serializer, mapper, object, objectName, isXml, options) {\n if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {\n mapper = getPolymorphicMapper(serializer, mapper, object, \"clientName\");\n }\n if (object !== undefined && object !== null) {\n const payload = {};\n const modelProps = resolveModelProperties(serializer, mapper, objectName);\n for (const key of Object.keys(modelProps)) {\n const propertyMapper = modelProps[key];\n if (propertyMapper.readOnly) {\n continue;\n }\n let propName;\n let parentObject = payload;\n if (serializer.isXML) {\n if (propertyMapper.xmlIsWrapped) {\n propName = propertyMapper.xmlName;\n }\n else {\n propName = propertyMapper.xmlElementName || propertyMapper.xmlName;\n }\n }\n else {\n const paths = splitSerializeName(propertyMapper.serializedName);\n propName = paths.pop();\n for (const pathName of paths) {\n const childObject = parentObject[pathName];\n if ((childObject === undefined || childObject === null) &&\n ((object[key] !== undefined && object[key] !== null) ||\n propertyMapper.defaultValue !== undefined)) {\n parentObject[pathName] = {};\n }\n parentObject = parentObject[pathName];\n }\n }\n if (parentObject !== undefined && parentObject !== null) {\n if (isXml && mapper.xmlNamespace) {\n const xmlnsKey = mapper.xmlNamespacePrefix\n ? `xmlns:${mapper.xmlNamespacePrefix}`\n : \"xmlns\";\n parentObject[XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace });\n }\n const propertyObjectName = propertyMapper.serializedName !== \"\"\n ? objectName + \".\" + propertyMapper.serializedName\n : objectName;\n let toSerialize = object[key];\n const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper);\n if (polymorphicDiscriminator &&\n polymorphicDiscriminator.clientName === key &&\n (toSerialize === undefined || toSerialize === null)) {\n toSerialize = mapper.serializedName;\n }\n const serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options);\n if (serializedValue !== undefined && propName !== undefined && propName !== null) {\n const value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options);\n if (isXml && propertyMapper.xmlIsAttribute) {\n // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js.\n // This keeps things simple while preventing name collision\n // with names in user documents.\n parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {};\n parentObject[XML_ATTRKEY][propName] = serializedValue;\n }\n else if (isXml && propertyMapper.xmlIsWrapped) {\n parentObject[propName] = { [propertyMapper.xmlElementName]: value };\n }\n else {\n parentObject[propName] = value;\n }\n }\n }\n }\n const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName);\n if (additionalPropertiesMapper) {\n const propNames = Object.keys(modelProps);\n for (const clientPropName in object) {\n const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName);\n if (isAdditionalProperty) {\n payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '[\"' + clientPropName + '\"]', options);\n }\n }\n }\n return payload;\n }\n return object;\n}\nfunction getXmlObjectValue(propertyMapper, serializedValue, isXml, options) {\n if (!isXml || !propertyMapper.xmlNamespace) {\n return serializedValue;\n }\n const xmlnsKey = propertyMapper.xmlNamespacePrefix\n ? `xmlns:${propertyMapper.xmlNamespacePrefix}`\n : \"xmlns\";\n const xmlNamespace = { [xmlnsKey]: propertyMapper.xmlNamespace };\n if ([\"Composite\"].includes(propertyMapper.type.name)) {\n if (serializedValue[XML_ATTRKEY]) {\n return serializedValue;\n }\n else {\n const result = Object.assign({}, serializedValue);\n result[XML_ATTRKEY] = xmlNamespace;\n return result;\n }\n }\n const result = {};\n result[options.xml.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = xmlNamespace;\n return result;\n}\nfunction isSpecialXmlProperty(propertyName, options) {\n return [XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName);\n}\nfunction deserializeCompositeType(serializer, mapper, responseBody, objectName, options) {\n var _a, _b;\n const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;\n if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {\n mapper = getPolymorphicMapper(serializer, mapper, responseBody, \"serializedName\");\n }\n const modelProps = resolveModelProperties(serializer, mapper, objectName);\n let instance = {};\n const handledPropertyNames = [];\n for (const key of Object.keys(modelProps)) {\n const propertyMapper = modelProps[key];\n const paths = splitSerializeName(modelProps[key].serializedName);\n handledPropertyNames.push(paths[0]);\n const { serializedName, xmlName, xmlElementName } = propertyMapper;\n let propertyObjectName = objectName;\n if (serializedName !== \"\" && serializedName !== undefined) {\n propertyObjectName = objectName + \".\" + serializedName;\n }\n const headerCollectionPrefix = propertyMapper.headerCollectionPrefix;\n if (headerCollectionPrefix) {\n const dictionary = {};\n for (const headerKey of Object.keys(responseBody)) {\n if (headerKey.startsWith(headerCollectionPrefix)) {\n dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options);\n }\n handledPropertyNames.push(headerKey);\n }\n instance[key] = dictionary;\n }\n else if (serializer.isXML) {\n if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {\n instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options);\n }\n else if (propertyMapper.xmlIsMsText) {\n if (responseBody[xmlCharKey] !== undefined) {\n instance[key] = responseBody[xmlCharKey];\n }\n else if (typeof responseBody === \"string\") {\n // The special case where xml parser parses \"content\" into JSON of\n // `{ name: \"content\"}` instead of `{ name: { \"_\": \"content\" }}`\n instance[key] = responseBody;\n }\n }\n else {\n const propertyName = xmlElementName || xmlName || serializedName;\n if (propertyMapper.xmlIsWrapped) {\n /* a list of wrapped by \n For the xml example below\n \n ...\n ...\n \n the responseBody has\n {\n Cors: {\n CorsRule: [{...}, {...}]\n }\n }\n xmlName is \"Cors\" and xmlElementName is\"CorsRule\".\n */\n const wrapped = responseBody[xmlName];\n const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : [];\n instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options);\n handledPropertyNames.push(xmlName);\n }\n else {\n const property = responseBody[propertyName];\n instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options);\n handledPropertyNames.push(propertyName);\n }\n }\n }\n else {\n // deserialize the property if it is present in the provided responseBody instance\n let propertyInstance;\n let res = responseBody;\n // traversing the object step by step.\n let steps = 0;\n for (const item of paths) {\n if (!res)\n break;\n steps++;\n res = res[item];\n }\n // only accept null when reaching the last position of object otherwise it would be undefined\n if (res === null && steps < paths.length) {\n res = undefined;\n }\n propertyInstance = res;\n const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator;\n // checking that the model property name (key)(ex: \"fishtype\") and the\n // clientName of the polymorphicDiscriminator {metadata} (ex: \"fishtype\")\n // instead of the serializedName of the polymorphicDiscriminator (ex: \"fish.type\")\n // is a better approach. The generator is not consistent with escaping '\\.' in the\n // serializedName of the property (ex: \"fish\\.type\") that is marked as polymorphic discriminator\n // and the serializedName of the metadata polymorphicDiscriminator (ex: \"fish.type\"). However,\n // the clientName transformation of the polymorphicDiscriminator (ex: \"fishtype\") and\n // the transformation of model property name (ex: \"fishtype\") is done consistently.\n // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator.\n if (polymorphicDiscriminator &&\n key === polymorphicDiscriminator.clientName &&\n (propertyInstance === undefined || propertyInstance === null)) {\n propertyInstance = mapper.serializedName;\n }\n let serializedValue;\n // paging\n if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === \"\") {\n propertyInstance = responseBody[key];\n const arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);\n // Copy over any properties that have already been added into the instance, where they do\n // not exist on the newly de-serialized array\n for (const [k, v] of Object.entries(instance)) {\n if (!Object.prototype.hasOwnProperty.call(arrayInstance, k)) {\n arrayInstance[k] = v;\n }\n }\n instance = arrayInstance;\n }\n else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) {\n serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);\n instance[key] = serializedValue;\n }\n }\n }\n const additionalPropertiesMapper = mapper.type.additionalProperties;\n if (additionalPropertiesMapper) {\n const isAdditionalProperty = (responsePropName) => {\n for (const clientPropName in modelProps) {\n const paths = splitSerializeName(modelProps[clientPropName].serializedName);\n if (paths[0] === responsePropName) {\n return false;\n }\n }\n return true;\n };\n for (const responsePropName in responseBody) {\n if (isAdditionalProperty(responsePropName)) {\n instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '[\"' + responsePropName + '\"]', options);\n }\n }\n }\n else if (responseBody && !options.ignoreUnknownProperties) {\n for (const key of Object.keys(responseBody)) {\n if (instance[key] === undefined &&\n !handledPropertyNames.includes(key) &&\n !isSpecialXmlProperty(key, options)) {\n instance[key] = responseBody[key];\n }\n }\n }\n return instance;\n}\nfunction deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) {\n /* jshint validthis: true */\n const value = mapper.type.value;\n if (!value || typeof value !== \"object\") {\n throw new Error(`\"value\" metadata for a Dictionary must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}`);\n }\n if (responseBody) {\n const tempDictionary = {};\n for (const key of Object.keys(responseBody)) {\n tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options);\n }\n return tempDictionary;\n }\n return responseBody;\n}\nfunction deserializeSequenceType(serializer, mapper, responseBody, objectName, options) {\n var _a;\n let element = mapper.type.element;\n if (!element || typeof element !== \"object\") {\n throw new Error(`element\" metadata for an Array must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}`);\n }\n if (responseBody) {\n if (!Array.isArray(responseBody)) {\n // xml2js will interpret a single element array as just the element, so force it to be an array\n responseBody = [responseBody];\n }\n // Quirk: Composite mappers referenced by `element` might\n // not have *all* properties declared (like uberParent),\n // so let's try to look up the full definition by name.\n if (element.type.name === \"Composite\" && element.type.className) {\n element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element;\n }\n const tempArray = [];\n for (let i = 0; i < responseBody.length; i++) {\n tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options);\n }\n return tempArray;\n }\n return responseBody;\n}\nfunction getIndexDiscriminator(discriminators, discriminatorValue, typeName) {\n const typeNamesToCheck = [typeName];\n while (typeNamesToCheck.length) {\n const currentName = typeNamesToCheck.shift();\n const indexDiscriminator = discriminatorValue === currentName\n ? discriminatorValue\n : currentName + \".\" + discriminatorValue;\n if (Object.prototype.hasOwnProperty.call(discriminators, indexDiscriminator)) {\n return discriminators[indexDiscriminator];\n }\n else {\n for (const [name, mapper] of Object.entries(discriminators)) {\n if (name.startsWith(currentName + \".\") &&\n mapper.type.uberParent === currentName &&\n mapper.type.className) {\n typeNamesToCheck.push(mapper.type.className);\n }\n }\n }\n }\n return undefined;\n}\nfunction getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) {\n var _a;\n const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper);\n if (polymorphicDiscriminator) {\n let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName];\n if (discriminatorName) {\n // The serializedName might have \\\\, which we just want to ignore\n if (polymorphicPropertyName === \"serializedName\") {\n discriminatorName = discriminatorName.replace(/\\\\/gi, \"\");\n }\n const discriminatorValue = object[discriminatorName];\n const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className;\n if (typeof discriminatorValue === \"string\" && typeName) {\n const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName);\n if (polymorphicMapper) {\n mapper = polymorphicMapper;\n }\n }\n }\n }\n return mapper;\n}\nfunction getPolymorphicDiscriminatorRecursively(serializer, mapper) {\n return (mapper.type.polymorphicDiscriminator ||\n getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) ||\n getPolymorphicDiscriminatorSafely(serializer, mapper.type.className));\n}\nfunction getPolymorphicDiscriminatorSafely(serializer, typeName) {\n return (typeName &&\n serializer.modelMappers[typeName] &&\n serializer.modelMappers[typeName].type.polymorphicDiscriminator);\n}\n/**\n * Known types of Mappers\n */\nexport const MapperTypeNames = {\n Base64Url: \"Base64Url\",\n Boolean: \"Boolean\",\n ByteArray: \"ByteArray\",\n Composite: \"Composite\",\n Date: \"Date\",\n DateTime: \"DateTime\",\n DateTimeRfc1123: \"DateTimeRfc1123\",\n Dictionary: \"Dictionary\",\n Enum: \"Enum\",\n Number: \"Number\",\n Object: \"Object\",\n Sequence: \"Sequence\",\n String: \"String\",\n Stream: \"Stream\",\n TimeSpan: \"TimeSpan\",\n UnixTime: \"UnixTime\",\n};\n//# sourceMappingURL=serializer.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Browser-only implementation of the module's state. The browser esm variant will not load the commonjs state, so we do not need to share state between the two.\n */\nexport const state = {\n operationRequestMap: new WeakMap(),\n};\n//# sourceMappingURL=state-browser.mjs.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { state } from \"./state.js\";\n/**\n * @internal\n * Retrieves the value to use for a given operation argument\n * @param operationArguments - The arguments passed from the generated client\n * @param parameter - The parameter description\n * @param fallbackObject - If something isn't found in the arguments bag, look here.\n * Generally used to look at the service client properties.\n */\nexport function getOperationArgumentValueFromParameter(operationArguments, parameter, fallbackObject) {\n let parameterPath = parameter.parameterPath;\n const parameterMapper = parameter.mapper;\n let value;\n if (typeof parameterPath === \"string\") {\n parameterPath = [parameterPath];\n }\n if (Array.isArray(parameterPath)) {\n if (parameterPath.length > 0) {\n if (parameterMapper.isConstant) {\n value = parameterMapper.defaultValue;\n }\n else {\n let propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath);\n if (!propertySearchResult.propertyFound && fallbackObject) {\n propertySearchResult = getPropertyFromParameterPath(fallbackObject, parameterPath);\n }\n let useDefaultValue = false;\n if (!propertySearchResult.propertyFound) {\n useDefaultValue =\n parameterMapper.required ||\n (parameterPath[0] === \"options\" && parameterPath.length === 2);\n }\n value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue;\n }\n }\n }\n else {\n if (parameterMapper.required) {\n value = {};\n }\n for (const propertyName in parameterPath) {\n const propertyMapper = parameterMapper.type.modelProperties[propertyName];\n const propertyPath = parameterPath[propertyName];\n const propertyValue = getOperationArgumentValueFromParameter(operationArguments, {\n parameterPath: propertyPath,\n mapper: propertyMapper,\n }, fallbackObject);\n if (propertyValue !== undefined) {\n if (!value) {\n value = {};\n }\n value[propertyName] = propertyValue;\n }\n }\n }\n return value;\n}\nfunction getPropertyFromParameterPath(parent, parameterPath) {\n const result = { propertyFound: false };\n let i = 0;\n for (; i < parameterPath.length; ++i) {\n const parameterPathPart = parameterPath[i];\n // Make sure to check inherited properties too, so don't use hasOwnProperty().\n if (parent && parameterPathPart in parent) {\n parent = parent[parameterPathPart];\n }\n else {\n break;\n }\n }\n if (i === parameterPath.length) {\n result.propertyValue = parent;\n result.propertyFound = true;\n }\n return result;\n}\nconst originalRequestSymbol = Symbol.for(\"@azure/core-client original request\");\nfunction hasOriginalRequest(request) {\n return originalRequestSymbol in request;\n}\nexport function getOperationRequestInfo(request) {\n if (hasOriginalRequest(request)) {\n return getOperationRequestInfo(request[originalRequestSymbol]);\n }\n let info = state.operationRequestMap.get(request);\n if (!info) {\n info = {};\n state.operationRequestMap.set(request, info);\n }\n return info;\n}\n//# sourceMappingURL=operationHelpers.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { XML_CHARKEY, } from \"./interfaces.js\";\nimport { RestError, } from \"@azure/core-rest-pipeline\";\nimport { MapperTypeNames } from \"./serializer.js\";\nimport { getOperationRequestInfo } from \"./operationHelpers.js\";\nconst defaultJsonContentTypes = [\"application/json\", \"text/json\"];\nconst defaultXmlContentTypes = [\"application/xml\", \"application/atom+xml\"];\n/**\n * The programmatic identifier of the deserializationPolicy.\n */\nexport const deserializationPolicyName = \"deserializationPolicy\";\n/**\n * This policy handles parsing out responses according to OperationSpecs on the request.\n */\nexport function deserializationPolicy(options = {}) {\n var _a, _b, _c, _d, _e, _f, _g;\n const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes;\n const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes;\n const parseXML = options.parseXML;\n const serializerOptions = options.serializerOptions;\n const updatedOptions = {\n xml: {\n rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : \"\",\n includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false,\n xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : XML_CHARKEY,\n },\n };\n return {\n name: deserializationPolicyName,\n async sendRequest(request, next) {\n const response = await next(request);\n return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML);\n },\n };\n}\nfunction getOperationResponseMap(parsedResponse) {\n let result;\n const request = parsedResponse.request;\n const operationInfo = getOperationRequestInfo(request);\n const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec;\n if (operationSpec) {\n if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) {\n result = operationSpec.responses[parsedResponse.status];\n }\n else {\n result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse);\n }\n }\n return result;\n}\nfunction shouldDeserializeResponse(parsedResponse) {\n const request = parsedResponse.request;\n const operationInfo = getOperationRequestInfo(request);\n const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize;\n let result;\n if (shouldDeserialize === undefined) {\n result = true;\n }\n else if (typeof shouldDeserialize === \"boolean\") {\n result = shouldDeserialize;\n }\n else {\n result = shouldDeserialize(parsedResponse);\n }\n return result;\n}\nasync function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) {\n const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML);\n if (!shouldDeserializeResponse(parsedResponse)) {\n return parsedResponse;\n }\n const operationInfo = getOperationRequestInfo(parsedResponse.request);\n const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec;\n if (!operationSpec || !operationSpec.responses) {\n return parsedResponse;\n }\n const responseSpec = getOperationResponseMap(parsedResponse);\n const { error, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options);\n if (error) {\n throw error;\n }\n else if (shouldReturnResponse) {\n return parsedResponse;\n }\n // An operation response spec does exist for current status code, so\n // use it to deserialize the response.\n if (responseSpec) {\n if (responseSpec.bodyMapper) {\n let valueToDeserialize = parsedResponse.parsedBody;\n if (operationSpec.isXML && responseSpec.bodyMapper.type.name === MapperTypeNames.Sequence) {\n valueToDeserialize =\n typeof valueToDeserialize === \"object\"\n ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName]\n : [];\n }\n try {\n parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, \"operationRes.parsedBody\", options);\n }\n catch (deserializeError) {\n const restError = new RestError(`Error ${deserializeError} occurred in deserializing the responseBody - ${parsedResponse.bodyAsText}`, {\n statusCode: parsedResponse.status,\n request: parsedResponse.request,\n response: parsedResponse,\n });\n throw restError;\n }\n }\n else if (operationSpec.httpMethod === \"HEAD\") {\n // head methods never have a body, but we return a boolean to indicate presence/absence of the resource\n parsedResponse.parsedBody = response.status >= 200 && response.status < 300;\n }\n if (responseSpec.headersMapper) {\n parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), \"operationRes.parsedHeaders\", { xml: {}, ignoreUnknownProperties: true });\n }\n }\n return parsedResponse;\n}\nfunction isOperationSpecEmpty(operationSpec) {\n const expectedStatusCodes = Object.keys(operationSpec.responses);\n return (expectedStatusCodes.length === 0 ||\n (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === \"default\"));\n}\nfunction handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) {\n var _a;\n const isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300;\n const isExpectedStatusCode = isOperationSpecEmpty(operationSpec)\n ? isSuccessByStatus\n : !!responseSpec;\n if (isExpectedStatusCode) {\n if (responseSpec) {\n if (!responseSpec.isError) {\n return { error: null, shouldReturnResponse: false };\n }\n }\n else {\n return { error: null, shouldReturnResponse: false };\n }\n }\n const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default;\n const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status))\n ? `Unexpected status code: ${parsedResponse.status}`\n : parsedResponse.bodyAsText;\n const error = new RestError(initialErrorMessage, {\n statusCode: parsedResponse.status,\n request: parsedResponse.request,\n response: parsedResponse,\n });\n // If the item failed but there's no error spec or default spec to deserialize the error,\n // we should fail so we just throw the parsed response\n if (!errorResponseSpec) {\n throw error;\n }\n const defaultBodyMapper = errorResponseSpec.bodyMapper;\n const defaultHeadersMapper = errorResponseSpec.headersMapper;\n try {\n // If error response has a body, try to deserialize it using default body mapper.\n // Then try to extract error code & message from it\n if (parsedResponse.parsedBody) {\n const parsedBody = parsedResponse.parsedBody;\n let deserializedError;\n if (defaultBodyMapper) {\n let valueToDeserialize = parsedBody;\n if (operationSpec.isXML && defaultBodyMapper.type.name === MapperTypeNames.Sequence) {\n valueToDeserialize = [];\n const elementName = defaultBodyMapper.xmlElementName;\n if (typeof parsedBody === \"object\" && elementName) {\n valueToDeserialize = parsedBody[elementName];\n }\n }\n deserializedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, \"error.response.parsedBody\", options);\n }\n const internalError = parsedBody.error || deserializedError || parsedBody;\n error.code = internalError.code;\n if (internalError.message) {\n error.message = internalError.message;\n }\n if (defaultBodyMapper) {\n error.response.parsedBody = deserializedError;\n }\n }\n // If error response has headers, try to deserialize it using default header mapper\n if (parsedResponse.headers && defaultHeadersMapper) {\n error.response.parsedHeaders =\n operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), \"operationRes.parsedHeaders\");\n }\n }\n catch (defaultError) {\n error.message = `Error \"${defaultError.message}\" occurred in deserializing the responseBody - \"${parsedResponse.bodyAsText}\" for the default response.`;\n }\n return { error, shouldReturnResponse: false };\n}\nasync function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) {\n var _a;\n if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) &&\n operationResponse.bodyAsText) {\n const text = operationResponse.bodyAsText;\n const contentType = operationResponse.headers.get(\"Content-Type\") || \"\";\n const contentComponents = !contentType\n ? []\n : contentType.split(\";\").map((component) => component.toLowerCase());\n try {\n if (contentComponents.length === 0 ||\n contentComponents.some((component) => jsonContentTypes.indexOf(component) !== -1)) {\n operationResponse.parsedBody = JSON.parse(text);\n return operationResponse;\n }\n else if (contentComponents.some((component) => xmlContentTypes.indexOf(component) !== -1)) {\n if (!parseXML) {\n throw new Error(\"Parsing XML not supported.\");\n }\n const body = await parseXML(text, opts.xml);\n operationResponse.parsedBody = body;\n return operationResponse;\n }\n }\n catch (err) {\n const msg = `Error \"${err}\" occurred while parsing the response body - ${operationResponse.bodyAsText}.`;\n const errCode = err.code || RestError.PARSE_ERROR;\n const e = new RestError(msg, {\n code: errCode,\n statusCode: operationResponse.status,\n request: operationResponse.request,\n response: operationResponse,\n });\n throw e;\n }\n }\n return operationResponse;\n}\n//# sourceMappingURL=deserializationPolicy.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { MapperTypeNames } from \"./serializer.js\";\n/**\n * Gets the list of status codes for streaming responses.\n * @internal\n */\nexport function getStreamingResponseStatusCodes(operationSpec) {\n const result = new Set();\n for (const statusCode in operationSpec.responses) {\n const operationResponse = operationSpec.responses[statusCode];\n if (operationResponse.bodyMapper &&\n operationResponse.bodyMapper.type.name === MapperTypeNames.Stream) {\n result.add(Number(statusCode));\n }\n }\n return result;\n}\n/**\n * Get the path to this parameter's value as a dotted string (a.b.c).\n * @param parameter - The parameter to get the path string for.\n * @returns The path to this parameter's value as a dotted string.\n * @internal\n */\nexport function getPathStringFromParameter(parameter) {\n const { parameterPath, mapper } = parameter;\n let result;\n if (typeof parameterPath === \"string\") {\n result = parameterPath;\n }\n else if (Array.isArray(parameterPath)) {\n result = parameterPath.join(\".\");\n }\n else {\n result = mapper.serializedName;\n }\n return result;\n}\n//# sourceMappingURL=interfaceHelpers.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { XML_ATTRKEY, XML_CHARKEY, } from \"./interfaces.js\";\nimport { getOperationArgumentValueFromParameter, getOperationRequestInfo, } from \"./operationHelpers.js\";\nimport { MapperTypeNames } from \"./serializer.js\";\nimport { getPathStringFromParameter } from \"./interfaceHelpers.js\";\n/**\n * The programmatic identifier of the serializationPolicy.\n */\nexport const serializationPolicyName = \"serializationPolicy\";\n/**\n * This policy handles assembling the request body and headers using\n * an OperationSpec and OperationArguments on the request.\n */\nexport function serializationPolicy(options = {}) {\n const stringifyXML = options.stringifyXML;\n return {\n name: serializationPolicyName,\n async sendRequest(request, next) {\n const operationInfo = getOperationRequestInfo(request);\n const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec;\n const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments;\n if (operationSpec && operationArguments) {\n serializeHeaders(request, operationArguments, operationSpec);\n serializeRequestBody(request, operationArguments, operationSpec, stringifyXML);\n }\n return next(request);\n },\n };\n}\n/**\n * @internal\n */\nexport function serializeHeaders(request, operationArguments, operationSpec) {\n var _a, _b;\n if (operationSpec.headerParameters) {\n for (const headerParameter of operationSpec.headerParameters) {\n let headerValue = getOperationArgumentValueFromParameter(operationArguments, headerParameter);\n if ((headerValue !== null && headerValue !== undefined) || headerParameter.mapper.required) {\n headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter));\n const headerCollectionPrefix = headerParameter.mapper\n .headerCollectionPrefix;\n if (headerCollectionPrefix) {\n for (const key of Object.keys(headerValue)) {\n request.headers.set(headerCollectionPrefix + key, headerValue[key]);\n }\n }\n else {\n request.headers.set(headerParameter.mapper.serializedName || getPathStringFromParameter(headerParameter), headerValue);\n }\n }\n }\n }\n const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders;\n if (customHeaders) {\n for (const customHeaderName of Object.keys(customHeaders)) {\n request.headers.set(customHeaderName, customHeaders[customHeaderName]);\n }\n }\n}\n/**\n * @internal\n */\nexport function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function () {\n throw new Error(\"XML serialization unsupported!\");\n}) {\n var _a, _b, _c, _d, _e;\n const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions;\n const updatedOptions = {\n xml: {\n rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : \"\",\n includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false,\n xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : XML_CHARKEY,\n },\n };\n const xmlCharKey = updatedOptions.xml.xmlCharKey;\n if (operationSpec.requestBody && operationSpec.requestBody.mapper) {\n request.body = getOperationArgumentValueFromParameter(operationArguments, operationSpec.requestBody);\n const bodyMapper = operationSpec.requestBody.mapper;\n const { required, serializedName, xmlName, xmlElementName, xmlNamespace, xmlNamespacePrefix, nullable, } = bodyMapper;\n const typeName = bodyMapper.type.name;\n try {\n if ((request.body !== undefined && request.body !== null) ||\n (nullable && request.body === null) ||\n required) {\n const requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody);\n request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions);\n const isStream = typeName === MapperTypeNames.Stream;\n if (operationSpec.isXML) {\n const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : \"xmlns\";\n const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions);\n if (typeName === MapperTypeNames.Sequence) {\n request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey });\n }\n else if (!isStream) {\n request.body = stringifyXML(value, {\n rootName: xmlName || serializedName,\n xmlCharKey,\n });\n }\n }\n else if (typeName === MapperTypeNames.String &&\n (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match(\"text/plain\")) || operationSpec.mediaType === \"text\")) {\n // the String serializer has validated that request body is a string\n // so just send the string.\n return;\n }\n else if (!isStream) {\n request.body = JSON.stringify(request.body);\n }\n }\n }\n catch (error) {\n throw new Error(`Error \"${error.message}\" occurred in serializing the payload - ${JSON.stringify(serializedName, undefined, \" \")}.`);\n }\n }\n else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) {\n request.formData = {};\n for (const formDataParameter of operationSpec.formDataParameters) {\n const formDataParameterValue = getOperationArgumentValueFromParameter(operationArguments, formDataParameter);\n if (formDataParameterValue !== undefined && formDataParameterValue !== null) {\n const formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter);\n request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions);\n }\n }\n }\n}\n/**\n * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself\n */\nfunction getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) {\n // Composite and Sequence schemas already got their root namespace set during serialization\n // We just need to add xmlns to the other schema types\n if (xmlNamespace && ![\"Composite\", \"Sequence\", \"Dictionary\"].includes(typeName)) {\n const result = {};\n result[options.xml.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = { [xmlnsKey]: xmlNamespace };\n return result;\n }\n return serializedValue;\n}\nfunction prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) {\n if (!Array.isArray(obj)) {\n obj = [obj];\n }\n if (!xmlNamespaceKey || !xmlNamespace) {\n return { [elementName]: obj };\n }\n const result = { [elementName]: obj };\n result[XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace };\n return result;\n}\n//# sourceMappingURL=serializationPolicy.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { deserializationPolicy } from \"./deserializationPolicy.js\";\nimport { bearerTokenAuthenticationPolicy, createPipelineFromOptions, } from \"@azure/core-rest-pipeline\";\nimport { serializationPolicy } from \"./serializationPolicy.js\";\n/**\n * Creates a new Pipeline for use with a Service Client.\n * Adds in deserializationPolicy by default.\n * Also adds in bearerTokenAuthenticationPolicy if passed a TokenCredential.\n * @param options - Options to customize the created pipeline.\n */\nexport function createClientPipeline(options = {}) {\n const pipeline = createPipelineFromOptions(options !== null && options !== void 0 ? options : {});\n if (options.credentialOptions) {\n pipeline.addPolicy(bearerTokenAuthenticationPolicy({\n credential: options.credentialOptions.credential,\n scopes: options.credentialOptions.credentialScopes,\n }));\n }\n pipeline.addPolicy(serializationPolicy(options.serializationOptions), { phase: \"Serialize\" });\n pipeline.addPolicy(deserializationPolicy(options.deserializationOptions), {\n phase: \"Deserialize\",\n });\n return pipeline;\n}\n//# sourceMappingURL=pipeline.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createDefaultHttpClient } from \"@azure/core-rest-pipeline\";\nlet cachedHttpClient;\nexport function getCachedDefaultHttpClient() {\n if (!cachedHttpClient) {\n cachedHttpClient = createDefaultHttpClient();\n }\n return cachedHttpClient;\n}\n//# sourceMappingURL=httpClientCache.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { getOperationArgumentValueFromParameter } from \"./operationHelpers.js\";\nimport { getPathStringFromParameter } from \"./interfaceHelpers.js\";\nconst CollectionFormatToDelimiterMap = {\n CSV: \",\",\n SSV: \" \",\n Multi: \"Multi\",\n TSV: \"\\t\",\n Pipes: \"|\",\n};\nexport function getRequestUrl(baseUri, operationSpec, operationArguments, fallbackObject) {\n const urlReplacements = calculateUrlReplacements(operationSpec, operationArguments, fallbackObject);\n let isAbsolutePath = false;\n let requestUrl = replaceAll(baseUri, urlReplacements);\n if (operationSpec.path) {\n let path = replaceAll(operationSpec.path, urlReplacements);\n // QUIRK: sometimes we get a path component like /{nextLink}\n // which may be a fully formed URL with a leading /. In that case, we should\n // remove the leading /\n if (operationSpec.path === \"/{nextLink}\" && path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n // QUIRK: sometimes we get a path component like {nextLink}\n // which may be a fully formed URL. In that case, we should\n // ignore the baseUri.\n if (isAbsoluteUrl(path)) {\n requestUrl = path;\n isAbsolutePath = true;\n }\n else {\n requestUrl = appendPath(requestUrl, path);\n }\n }\n const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);\n /**\n * Notice that this call sets the `noOverwrite` parameter to true if the `requestUrl`\n * is an absolute path. This ensures that existing query parameter values in `requestUrl`\n * do not get overwritten. On the other hand when `requestUrl` is not absolute path, it\n * is still being built so there is nothing to overwrite.\n */\n requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath);\n return requestUrl;\n}\nfunction replaceAll(input, replacements) {\n let result = input;\n for (const [searchValue, replaceValue] of replacements) {\n result = result.split(searchValue).join(replaceValue);\n }\n return result;\n}\nfunction calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) {\n var _a;\n const result = new Map();\n if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.length) {\n for (const urlParameter of operationSpec.urlParameters) {\n let urlParameterValue = getOperationArgumentValueFromParameter(operationArguments, urlParameter, fallbackObject);\n const parameterPathString = getPathStringFromParameter(urlParameter);\n urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, parameterPathString);\n if (!urlParameter.skipEncoding) {\n urlParameterValue = encodeURIComponent(urlParameterValue);\n }\n result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue);\n }\n }\n return result;\n}\nfunction isAbsoluteUrl(url) {\n return url.includes(\"://\");\n}\nfunction appendPath(url, pathToAppend) {\n if (!pathToAppend) {\n return url;\n }\n const parsedUrl = new URL(url);\n let newPath = parsedUrl.pathname;\n if (!newPath.endsWith(\"/\")) {\n newPath = `${newPath}/`;\n }\n if (pathToAppend.startsWith(\"/\")) {\n pathToAppend = pathToAppend.substring(1);\n }\n const searchStart = pathToAppend.indexOf(\"?\");\n if (searchStart !== -1) {\n const path = pathToAppend.substring(0, searchStart);\n const search = pathToAppend.substring(searchStart + 1);\n newPath = newPath + path;\n if (search) {\n parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;\n }\n }\n else {\n newPath = newPath + pathToAppend;\n }\n parsedUrl.pathname = newPath;\n return parsedUrl.toString();\n}\nfunction calculateQueryParameters(operationSpec, operationArguments, fallbackObject) {\n var _a;\n const result = new Map();\n const sequenceParams = new Set();\n if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.length) {\n for (const queryParameter of operationSpec.queryParameters) {\n if (queryParameter.mapper.type.name === \"Sequence\" && queryParameter.mapper.serializedName) {\n sequenceParams.add(queryParameter.mapper.serializedName);\n }\n let queryParameterValue = getOperationArgumentValueFromParameter(operationArguments, queryParameter, fallbackObject);\n if ((queryParameterValue !== undefined && queryParameterValue !== null) ||\n queryParameter.mapper.required) {\n queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter));\n const delimiter = queryParameter.collectionFormat\n ? CollectionFormatToDelimiterMap[queryParameter.collectionFormat]\n : \"\";\n if (Array.isArray(queryParameterValue)) {\n // replace null and undefined\n queryParameterValue = queryParameterValue.map((item) => {\n if (item === null || item === undefined) {\n return \"\";\n }\n return item;\n });\n }\n if (queryParameter.collectionFormat === \"Multi\" && queryParameterValue.length === 0) {\n continue;\n }\n else if (Array.isArray(queryParameterValue) &&\n (queryParameter.collectionFormat === \"SSV\" || queryParameter.collectionFormat === \"TSV\")) {\n queryParameterValue = queryParameterValue.join(delimiter);\n }\n if (!queryParameter.skipEncoding) {\n if (Array.isArray(queryParameterValue)) {\n queryParameterValue = queryParameterValue.map((item) => {\n return encodeURIComponent(item);\n });\n }\n else {\n queryParameterValue = encodeURIComponent(queryParameterValue);\n }\n }\n // Join pipes and CSV *after* encoding, or the server will be upset.\n if (Array.isArray(queryParameterValue) &&\n (queryParameter.collectionFormat === \"CSV\" || queryParameter.collectionFormat === \"Pipes\")) {\n queryParameterValue = queryParameterValue.join(delimiter);\n }\n result.set(queryParameter.mapper.serializedName || getPathStringFromParameter(queryParameter), queryParameterValue);\n }\n }\n }\n return {\n queryParams: result,\n sequenceParams,\n };\n}\nfunction simpleParseQueryParams(queryString) {\n const result = new Map();\n if (!queryString || queryString[0] !== \"?\") {\n return result;\n }\n // remove the leading ?\n queryString = queryString.slice(1);\n const pairs = queryString.split(\"&\");\n for (const pair of pairs) {\n const [name, value] = pair.split(\"=\", 2);\n const existingValue = result.get(name);\n if (existingValue) {\n if (Array.isArray(existingValue)) {\n existingValue.push(value);\n }\n else {\n result.set(name, [existingValue, value]);\n }\n }\n else {\n result.set(name, value);\n }\n }\n return result;\n}\n/** @internal */\nexport function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) {\n if (queryParams.size === 0) {\n return url;\n }\n const parsedUrl = new URL(url);\n // QUIRK: parsedUrl.searchParams will have their name/value pairs decoded, which\n // can change their meaning to the server, such as in the case of a SAS signature.\n // To avoid accidentally un-encoding a query param, we parse the key/values ourselves\n const combinedParams = simpleParseQueryParams(parsedUrl.search);\n for (const [name, value] of queryParams) {\n const existingValue = combinedParams.get(name);\n if (Array.isArray(existingValue)) {\n if (Array.isArray(value)) {\n existingValue.push(...value);\n const valueSet = new Set(existingValue);\n combinedParams.set(name, Array.from(valueSet));\n }\n else {\n existingValue.push(value);\n }\n }\n else if (existingValue) {\n if (Array.isArray(value)) {\n value.unshift(existingValue);\n }\n else if (sequenceParams.has(name)) {\n combinedParams.set(name, [existingValue, value]);\n }\n if (!noOverwrite) {\n combinedParams.set(name, value);\n }\n }\n else {\n combinedParams.set(name, value);\n }\n }\n const searchPieces = [];\n for (const [name, value] of combinedParams) {\n if (typeof value === \"string\") {\n searchPieces.push(`${name}=${value}`);\n }\n else if (Array.isArray(value)) {\n // QUIRK: If we get an array of values, include multiple key/value pairs\n for (const subValue of value) {\n searchPieces.push(`${name}=${subValue}`);\n }\n }\n else {\n searchPieces.push(`${name}=${value}`);\n }\n }\n // QUIRK: we have to set search manually as searchParams will encode comma when it shouldn't.\n parsedUrl.search = searchPieces.length ? `?${searchPieces.join(\"&\")}` : \"\";\n return parsedUrl.toString();\n}\n//# sourceMappingURL=urlHelpers.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"core-client\");\n//# sourceMappingURL=log.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createPipelineRequest, } from \"@azure/core-rest-pipeline\";\nimport { createClientPipeline } from \"./pipeline.js\";\nimport { flattenResponse } from \"./utils.js\";\nimport { getCachedDefaultHttpClient } from \"./httpClientCache.js\";\nimport { getOperationRequestInfo } from \"./operationHelpers.js\";\nimport { getRequestUrl } from \"./urlHelpers.js\";\nimport { getStreamingResponseStatusCodes } from \"./interfaceHelpers.js\";\nimport { logger } from \"./log.js\";\n/**\n * Initializes a new instance of the ServiceClient.\n */\nexport class ServiceClient {\n /**\n * The ServiceClient constructor\n * @param credential - The credentials used for authentication with the service.\n * @param options - The service client options that govern the behavior of the client.\n */\n constructor(options = {}) {\n var _a, _b;\n this._requestContentType = options.requestContentType;\n this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri;\n if (options.baseUri) {\n logger.warning(\"The baseUri option for SDK Clients has been deprecated, please use endpoint instead.\");\n }\n this._allowInsecureConnection = options.allowInsecureConnection;\n this._httpClient = options.httpClient || getCachedDefaultHttpClient();\n this.pipeline = options.pipeline || createDefaultPipeline(options);\n if ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.length) {\n for (const { policy, position } of options.additionalPolicies) {\n // Sign happens after Retry and is commonly needed to occur\n // before policies that intercept post-retry.\n const afterPhase = position === \"perRetry\" ? \"Sign\" : undefined;\n this.pipeline.addPolicy(policy, {\n afterPhase,\n });\n }\n }\n }\n /**\n * Send the provided httpRequest.\n */\n async sendRequest(request) {\n return this.pipeline.sendRequest(this._httpClient, request);\n }\n /**\n * Send an HTTP request that is populated using the provided OperationSpec.\n * @typeParam T - The typed result of the request, based on the OperationSpec.\n * @param operationArguments - The arguments that the HTTP request's templated values will be populated from.\n * @param operationSpec - The OperationSpec to use to populate the httpRequest.\n */\n async sendOperationRequest(operationArguments, operationSpec) {\n const endpoint = operationSpec.baseUrl || this._endpoint;\n if (!endpoint) {\n throw new Error(\"If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.\");\n }\n // Templatized URLs sometimes reference properties on the ServiceClient child class,\n // so we have to pass `this` below in order to search these properties if they're\n // not part of OperationArguments\n const url = getRequestUrl(endpoint, operationSpec, operationArguments, this);\n const request = createPipelineRequest({\n url,\n });\n request.method = operationSpec.httpMethod;\n const operationInfo = getOperationRequestInfo(request);\n operationInfo.operationSpec = operationSpec;\n operationInfo.operationArguments = operationArguments;\n const contentType = operationSpec.contentType || this._requestContentType;\n if (contentType && operationSpec.requestBody) {\n request.headers.set(\"Content-Type\", contentType);\n }\n const options = operationArguments.options;\n if (options) {\n const requestOptions = options.requestOptions;\n if (requestOptions) {\n if (requestOptions.timeout) {\n request.timeout = requestOptions.timeout;\n }\n if (requestOptions.onUploadProgress) {\n request.onUploadProgress = requestOptions.onUploadProgress;\n }\n if (requestOptions.onDownloadProgress) {\n request.onDownloadProgress = requestOptions.onDownloadProgress;\n }\n if (requestOptions.shouldDeserialize !== undefined) {\n operationInfo.shouldDeserialize = requestOptions.shouldDeserialize;\n }\n if (requestOptions.allowInsecureConnection) {\n request.allowInsecureConnection = true;\n }\n }\n if (options.abortSignal) {\n request.abortSignal = options.abortSignal;\n }\n if (options.tracingOptions) {\n request.tracingOptions = options.tracingOptions;\n }\n }\n if (this._allowInsecureConnection) {\n request.allowInsecureConnection = true;\n }\n if (request.streamResponseStatusCodes === undefined) {\n request.streamResponseStatusCodes = getStreamingResponseStatusCodes(operationSpec);\n }\n try {\n const rawResponse = await this.sendRequest(request);\n const flatResponse = flattenResponse(rawResponse, operationSpec.responses[rawResponse.status]);\n if (options === null || options === void 0 ? void 0 : options.onResponse) {\n options.onResponse(rawResponse, flatResponse);\n }\n return flatResponse;\n }\n catch (error) {\n if (typeof error === \"object\" && (error === null || error === void 0 ? void 0 : error.response)) {\n const rawResponse = error.response;\n const flatResponse = flattenResponse(rawResponse, operationSpec.responses[error.statusCode] || operationSpec.responses[\"default\"]);\n error.details = flatResponse;\n if (options === null || options === void 0 ? void 0 : options.onResponse) {\n options.onResponse(rawResponse, flatResponse, error);\n }\n }\n throw error;\n }\n }\n}\nfunction createDefaultPipeline(options) {\n const credentialScopes = getCredentialScopes(options);\n const credentialOptions = options.credential && credentialScopes\n ? { credentialScopes, credential: options.credential }\n : undefined;\n return createClientPipeline(Object.assign(Object.assign({}, options), { credentialOptions }));\n}\nfunction getCredentialScopes(options) {\n if (options.credentialScopes) {\n return options.credentialScopes;\n }\n if (options.endpoint) {\n return `${options.endpoint}/.default`;\n }\n if (options.baseUri) {\n return `${options.baseUri}/.default`;\n }\n if (options.credential && !options.credentialScopes) {\n throw new Error(`When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy`);\n }\n return undefined;\n}\n//# sourceMappingURL=serviceClient.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * A set of constants used internally when processing requests.\n */\nconst Constants = {\n DefaultScope: \"/.default\",\n /**\n * Defines constants for use with HTTP headers.\n */\n HeaderConstants: {\n /**\n * The Authorization header.\n */\n AUTHORIZATION: \"authorization\",\n },\n};\nfunction isUuid(text) {\n return /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/.test(text);\n}\n/**\n * Defines a callback to handle auth challenge for Storage APIs.\n * This implements the bearer challenge process described here: https://docs.microsoft.com/rest/api/storageservices/authorize-with-azure-active-directory#bearer-challenge\n * Handling has specific features for storage that departs to the general AAD challenge docs.\n **/\nexport const authorizeRequestOnTenantChallenge = async (challengeOptions) => {\n const requestOptions = requestToOptions(challengeOptions.request);\n const challenge = getChallenge(challengeOptions.response);\n if (challenge) {\n const challengeInfo = parseChallenge(challenge);\n const challengeScopes = buildScopes(challengeOptions, challengeInfo);\n const tenantId = extractTenantId(challengeInfo);\n if (!tenantId) {\n return false;\n }\n const accessToken = await challengeOptions.getAccessToken(challengeScopes, Object.assign(Object.assign({}, requestOptions), { tenantId }));\n if (!accessToken) {\n return false;\n }\n challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${accessToken.token}`);\n return true;\n }\n return false;\n};\n/**\n * Extracts the tenant id from the challenge information\n * The tenant id is contained in the authorization_uri as the first\n * path part.\n */\nfunction extractTenantId(challengeInfo) {\n const parsedAuthUri = new URL(challengeInfo.authorization_uri);\n const pathSegments = parsedAuthUri.pathname.split(\"/\");\n const tenantId = pathSegments[1];\n if (tenantId && isUuid(tenantId)) {\n return tenantId;\n }\n return undefined;\n}\n/**\n * Builds the authentication scopes based on the information that comes in the\n * challenge information. Scopes url is present in the resource_id, if it is empty\n * we keep using the original scopes.\n */\nfunction buildScopes(challengeOptions, challengeInfo) {\n if (!challengeInfo.resource_id) {\n return challengeOptions.scopes;\n }\n const challengeScopes = new URL(challengeInfo.resource_id);\n challengeScopes.pathname = Constants.DefaultScope;\n let scope = challengeScopes.toString();\n if (scope === \"https://disk.azure.com/.default\") {\n // the extra slash is required by the service\n scope = \"https://disk.azure.com//.default\";\n }\n return [scope];\n}\n/**\n * We will retrieve the challenge only if the response status code was 401,\n * and if the response contained the header \"WWW-Authenticate\" with a non-empty value.\n */\nfunction getChallenge(response) {\n const challenge = response.headers.get(\"WWW-Authenticate\");\n if (response.status === 401 && challenge) {\n return challenge;\n }\n return;\n}\n/**\n * Converts: `Bearer a=\"b\" c=\"d\"`.\n * Into: `[ { a: 'b', c: 'd' }]`.\n *\n * @internal\n */\nfunction parseChallenge(challenge) {\n const bearerChallenge = challenge.slice(\"Bearer \".length);\n const challengeParts = `${bearerChallenge.trim()} `.split(\" \").filter((x) => x);\n const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split(\"=\")));\n // Key-value pairs to plain object:\n return keyValuePairs.reduce((a, b) => (Object.assign(Object.assign({}, a), b)), {});\n}\n/**\n * Extracts the options form a Pipeline Request for later re-use\n */\nfunction requestToOptions(request) {\n return {\n abortSignal: request.abortSignal,\n requestOptions: {\n timeout: request.timeout,\n },\n tracingOptions: request.tracingOptions,\n };\n}\n//# sourceMappingURL=authorizeRequestOnTenantChallenge.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nexport const disableKeepAlivePolicyName = \"DisableKeepAlivePolicy\";\nexport function createDisableKeepAlivePolicy() {\n return {\n name: disableKeepAlivePolicyName,\n async sendRequest(request, next) {\n request.disableKeepAlive = true;\n return next(request);\n },\n };\n}\n/**\n * @internal\n */\nexport function pipelineContainsDisableKeepAlivePolicy(pipeline) {\n return pipeline.getOrderedPolicies().some((policy) => policy.name === disableKeepAlivePolicyName);\n}\n//# sourceMappingURL=disableKeepAlivePolicy.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createHttpHeaders, createPipelineRequest, } from \"@azure/core-rest-pipeline\";\n// We use a custom symbol to cache a reference to the original request without\n// exposing it on the public interface.\nconst originalRequestSymbol = Symbol(\"Original PipelineRequest\");\n// Symbol.for() will return the same symbol if it's already been created\n// This particular one is used in core-client to handle the case of when a request is\n// cloned but we need to retrieve the OperationSpec and OperationArguments from the\n// original request.\nconst originalClientRequestSymbol = Symbol.for(\"@azure/core-client original request\");\nexport function toPipelineRequest(webResource, options = {}) {\n const compatWebResource = webResource;\n const request = compatWebResource[originalRequestSymbol];\n const headers = createHttpHeaders(webResource.headers.toJson({ preserveCase: true }));\n if (request) {\n request.headers = headers;\n return request;\n }\n else {\n const newRequest = createPipelineRequest({\n url: webResource.url,\n method: webResource.method,\n headers,\n withCredentials: webResource.withCredentials,\n timeout: webResource.timeout,\n requestId: webResource.requestId,\n abortSignal: webResource.abortSignal,\n body: webResource.body,\n formData: webResource.formData,\n disableKeepAlive: !!webResource.keepAlive,\n onDownloadProgress: webResource.onDownloadProgress,\n onUploadProgress: webResource.onUploadProgress,\n proxySettings: webResource.proxySettings,\n streamResponseStatusCodes: webResource.streamResponseStatusCodes,\n });\n if (options.originalRequest) {\n newRequest[originalClientRequestSymbol] =\n options.originalRequest;\n }\n return newRequest;\n }\n}\nexport function toWebResourceLike(request, options) {\n var _a;\n const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request;\n const webResource = {\n url: request.url,\n method: request.method,\n headers: toHttpHeadersLike(request.headers),\n withCredentials: request.withCredentials,\n timeout: request.timeout,\n requestId: request.headers.get(\"x-ms-client-request-id\") || request.requestId,\n abortSignal: request.abortSignal,\n body: request.body,\n formData: request.formData,\n keepAlive: !!request.disableKeepAlive,\n onDownloadProgress: request.onDownloadProgress,\n onUploadProgress: request.onUploadProgress,\n proxySettings: request.proxySettings,\n streamResponseStatusCodes: request.streamResponseStatusCodes,\n clone() {\n throw new Error(\"Cannot clone a non-proxied WebResourceLike\");\n },\n prepare() {\n throw new Error(\"WebResourceLike.prepare() is not supported by @azure/core-http-compat\");\n },\n validateRequestProperties() {\n /** do nothing */\n },\n };\n if (options === null || options === void 0 ? void 0 : options.createProxy) {\n return new Proxy(webResource, {\n get(target, prop, receiver) {\n if (prop === originalRequestSymbol) {\n return request;\n }\n else if (prop === \"clone\") {\n return () => {\n return toWebResourceLike(toPipelineRequest(webResource, { originalRequest }), {\n createProxy: true,\n originalRequest,\n });\n };\n }\n return Reflect.get(target, prop, receiver);\n },\n set(target, prop, value, receiver) {\n if (prop === \"keepAlive\") {\n request.disableKeepAlive = !value;\n }\n const passThroughProps = [\n \"url\",\n \"method\",\n \"withCredentials\",\n \"timeout\",\n \"requestId\",\n \"abortSignal\",\n \"body\",\n \"formData\",\n \"onDownloadProgress\",\n \"onUploadProgress\",\n \"proxySettings\",\n \"streamResponseStatusCodes\",\n ];\n if (typeof prop === \"string\" && passThroughProps.includes(prop)) {\n request[prop] = value;\n }\n return Reflect.set(target, prop, value, receiver);\n },\n });\n }\n else {\n return webResource;\n }\n}\n/**\n * Converts HttpHeaders from core-rest-pipeline to look like\n * HttpHeaders from core-http.\n * @param headers - HttpHeaders from core-rest-pipeline\n * @returns HttpHeaders as they looked in core-http\n */\nexport function toHttpHeadersLike(headers) {\n return new HttpHeaders(headers.toJSON({ preserveCase: true }));\n}\n/**\n * A collection of HttpHeaders that can be sent with a HTTP request.\n */\nfunction getHeaderKey(headerName) {\n return headerName.toLowerCase();\n}\n/**\n * A collection of HTTP header key/value pairs.\n */\nexport class HttpHeaders {\n constructor(rawHeaders) {\n this._headersMap = {};\n if (rawHeaders) {\n for (const headerName in rawHeaders) {\n this.set(headerName, rawHeaders[headerName]);\n }\n }\n }\n /**\n * Set a header in this collection with the provided name and value. The name is\n * case-insensitive.\n * @param headerName - The name of the header to set. This value is case-insensitive.\n * @param headerValue - The value of the header to set.\n */\n set(headerName, headerValue) {\n this._headersMap[getHeaderKey(headerName)] = {\n name: headerName,\n value: headerValue.toString(),\n };\n }\n /**\n * Get the header value for the provided header name, or undefined if no header exists in this\n * collection with the provided name.\n * @param headerName - The name of the header.\n */\n get(headerName) {\n const header = this._headersMap[getHeaderKey(headerName)];\n return !header ? undefined : header.value;\n }\n /**\n * Get whether or not this header collection contains a header entry for the provided header name.\n */\n contains(headerName) {\n return !!this._headersMap[getHeaderKey(headerName)];\n }\n /**\n * Remove the header with the provided headerName. Return whether or not the header existed and\n * was removed.\n * @param headerName - The name of the header to remove.\n */\n remove(headerName) {\n const result = this.contains(headerName);\n delete this._headersMap[getHeaderKey(headerName)];\n return result;\n }\n /**\n * Get the headers that are contained this collection as an object.\n */\n rawHeaders() {\n return this.toJson({ preserveCase: true });\n }\n /**\n * Get the headers that are contained in this collection as an array.\n */\n headersArray() {\n const headers = [];\n for (const headerKey in this._headersMap) {\n headers.push(this._headersMap[headerKey]);\n }\n return headers;\n }\n /**\n * Get the header names that are contained in this collection.\n */\n headerNames() {\n const headerNames = [];\n const headers = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerNames.push(headers[i].name);\n }\n return headerNames;\n }\n /**\n * Get the header values that are contained in this collection.\n */\n headerValues() {\n const headerValues = [];\n const headers = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerValues.push(headers[i].value);\n }\n return headerValues;\n }\n /**\n * Get the JSON object representation of this HTTP header collection.\n */\n toJson(options = {}) {\n const result = {};\n if (options.preserveCase) {\n for (const headerKey in this._headersMap) {\n const header = this._headersMap[headerKey];\n result[header.name] = header.value;\n }\n }\n else {\n for (const headerKey in this._headersMap) {\n const header = this._headersMap[headerKey];\n result[getHeaderKey(header.name)] = header.value;\n }\n }\n return result;\n }\n /**\n * Get the string representation of this HTTP header collection.\n */\n toString() {\n return JSON.stringify(this.toJson({ preserveCase: true }));\n }\n /**\n * Create a deep clone/copy of this HttpHeaders collection.\n */\n clone() {\n const resultPreservingCasing = {};\n for (const headerKey in this._headersMap) {\n const header = this._headersMap[headerKey];\n resultPreservingCasing[header.name] = header.value;\n }\n return new HttpHeaders(resultPreservingCasing);\n }\n}\n//# sourceMappingURL=util.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { toHttpHeadersLike, toPipelineRequest, toWebResourceLike, } from \"./util.js\";\nconst originalResponse = Symbol(\"Original FullOperationResponse\");\n/**\n * A helper to convert response objects from the new pipeline back to the old one.\n * @param response - A response object from core-client.\n * @returns A response compatible with `HttpOperationResponse` from core-http.\n */\nexport function toCompatResponse(response, options) {\n let request = toWebResourceLike(response.request);\n let headers = toHttpHeadersLike(response.headers);\n if (options === null || options === void 0 ? void 0 : options.createProxy) {\n return new Proxy(response, {\n get(target, prop, receiver) {\n if (prop === \"headers\") {\n return headers;\n }\n else if (prop === \"request\") {\n return request;\n }\n else if (prop === originalResponse) {\n return response;\n }\n return Reflect.get(target, prop, receiver);\n },\n set(target, prop, value, receiver) {\n if (prop === \"headers\") {\n headers = value;\n }\n else if (prop === \"request\") {\n request = value;\n }\n return Reflect.set(target, prop, value, receiver);\n },\n });\n }\n else {\n return Object.assign(Object.assign({}, response), { request,\n headers });\n }\n}\n/**\n * A helper to convert back to a PipelineResponse\n * @param compatResponse - A response compatible with `HttpOperationResponse` from core-http.\n */\nexport function toPipelineResponse(compatResponse) {\n const extendedCompatResponse = compatResponse;\n const response = extendedCompatResponse[originalResponse];\n const headers = createHttpHeaders(compatResponse.headers.toJson({ preserveCase: true }));\n if (response) {\n response.headers = headers;\n return response;\n }\n else {\n return Object.assign(Object.assign({}, compatResponse), { headers, request: toPipelineRequest(compatResponse.request) });\n }\n}\n//# sourceMappingURL=response.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createDisableKeepAlivePolicy, pipelineContainsDisableKeepAlivePolicy, } from \"./policies/disableKeepAlivePolicy.js\";\nimport { redirectPolicyName } from \"@azure/core-rest-pipeline\";\nimport { ServiceClient, } from \"@azure/core-client\";\nimport { toCompatResponse } from \"./response.js\";\n/**\n * Client to provide compatability between core V1 & V2.\n */\nexport class ExtendedServiceClient extends ServiceClient {\n constructor(options) {\n var _a, _b;\n super(options);\n if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false &&\n !pipelineContainsDisableKeepAlivePolicy(this.pipeline)) {\n this.pipeline.addPolicy(createDisableKeepAlivePolicy());\n }\n if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.handleRedirects) === false) {\n this.pipeline.removePolicy({\n name: redirectPolicyName,\n });\n }\n }\n /**\n * Compatible send operation request function.\n *\n * @param operationArguments - Operation arguments\n * @param operationSpec - Operation Spec\n * @returns\n */\n async sendOperationRequest(operationArguments, operationSpec) {\n var _a;\n const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse;\n let lastResponse;\n function onResponse(rawResponse, flatResponse, error) {\n lastResponse = rawResponse;\n if (userProvidedCallBack) {\n userProvidedCallBack(rawResponse, flatResponse, error);\n }\n }\n operationArguments.options = Object.assign(Object.assign({}, operationArguments.options), { onResponse });\n const result = await super.sendOperationRequest(operationArguments, operationSpec);\n if (lastResponse) {\n Object.defineProperty(result, \"_response\", {\n value: toCompatResponse(lastResponse),\n });\n }\n return result;\n }\n}\n//# sourceMappingURL=extendedClient.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { toPipelineRequest, toWebResourceLike } from \"../util.js\";\nimport { toCompatResponse, toPipelineResponse } from \"../response.js\";\n/**\n * An enum for compatibility with RequestPolicy\n */\nexport var HttpPipelineLogLevel;\n(function (HttpPipelineLogLevel) {\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"ERROR\"] = 1] = \"ERROR\";\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"INFO\"] = 3] = \"INFO\";\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"OFF\"] = 0] = \"OFF\";\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"WARNING\"] = 2] = \"WARNING\";\n})(HttpPipelineLogLevel || (HttpPipelineLogLevel = {}));\nconst mockRequestPolicyOptions = {\n log(_logLevel, _message) {\n /* do nothing */\n },\n shouldLog(_logLevel) {\n return false;\n },\n};\n/**\n * The name of the RequestPolicyFactoryPolicy\n */\nexport const requestPolicyFactoryPolicyName = \"RequestPolicyFactoryPolicy\";\n/**\n * A policy that wraps policies written for core-http.\n * @param factories - An array of `RequestPolicyFactory` objects from a core-http pipeline\n */\nexport function createRequestPolicyFactoryPolicy(factories) {\n const orderedFactories = factories.slice().reverse();\n return {\n name: requestPolicyFactoryPolicyName,\n async sendRequest(request, next) {\n let httpPipeline = {\n async sendRequest(httpRequest) {\n const response = await next(toPipelineRequest(httpRequest));\n return toCompatResponse(response, { createProxy: true });\n },\n };\n for (const factory of orderedFactories) {\n httpPipeline = factory.create(httpPipeline, mockRequestPolicyOptions);\n }\n const webResourceLike = toWebResourceLike(request, { createProxy: true });\n const response = await httpPipeline.sendRequest(webResourceLike);\n return toPipelineResponse(response);\n },\n };\n}\n//# sourceMappingURL=requestPolicyFactoryPolicy.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { toPipelineResponse } from \"./response.js\";\nimport { toWebResourceLike } from \"./util.js\";\n/**\n * Converts a RequestPolicy based HttpClient to a PipelineRequest based HttpClient.\n * @param requestPolicyClient - A HttpClient compatible with core-http\n * @returns A HttpClient compatible with core-rest-pipeline\n */\nexport function convertHttpClient(requestPolicyClient) {\n return {\n sendRequest: async (request) => {\n const response = await requestPolicyClient.sendRequest(toWebResourceLike(request, { createProxy: true }));\n return toPipelineResponse(response);\n },\n };\n}\n//# sourceMappingURL=httpClientAdapter.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * When a poller is manually stopped through the `stopPolling` method,\n * the poller will be rejected with an instance of the PollerStoppedError.\n */\nexport class PollerStoppedError extends Error {\n constructor(message) {\n super(message);\n this.name = \"PollerStoppedError\";\n Object.setPrototypeOf(this, PollerStoppedError.prototype);\n }\n}\n/**\n * When the operation is cancelled, the poller will be rejected with an instance\n * of the PollerCancelledError.\n */\nexport class PollerCancelledError extends Error {\n constructor(message) {\n super(message);\n this.name = \"PollerCancelledError\";\n Object.setPrototypeOf(this, PollerCancelledError.prototype);\n }\n}\n/**\n * A class that represents the definition of a program that polls through consecutive requests\n * until it reaches a state of completion.\n *\n * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed.\n * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes.\n * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation.\n *\n * ```ts\n * const poller = new MyPoller();\n *\n * // Polling just once:\n * await poller.poll();\n *\n * // We can try to cancel the request here, by calling:\n * //\n * // await poller.cancelOperation();\n * //\n *\n * // Getting the final result:\n * const result = await poller.pollUntilDone();\n * ```\n *\n * The Poller is defined by two types, a type representing the state of the poller, which\n * must include a basic set of properties from `PollOperationState`,\n * and a return type defined by `TResult`, which can be anything.\n *\n * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having\n * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type.\n *\n * ```ts\n * class Client {\n * public async makePoller: PollerLike {\n * const poller = new MyPoller({});\n * // It might be preferred to return the poller after the first request is made,\n * // so that some information can be obtained right away.\n * await poller.poll();\n * return poller;\n * }\n * }\n *\n * const poller: PollerLike = myClient.makePoller();\n * ```\n *\n * A poller can be created through its constructor, then it can be polled until it's completed.\n * At any point in time, the state of the poller can be obtained without delay through the getOperationState method.\n * At any point in time, the intermediate forms of the result type can be requested without delay.\n * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned.\n *\n * ```ts\n * const poller = myClient.makePoller();\n * const state: MyOperationState = poller.getOperationState();\n *\n * // The intermediate result can be obtained at any time.\n * const result: MyResult | undefined = poller.getResult();\n *\n * // The final result can only be obtained after the poller finishes.\n * const result: MyResult = await poller.pollUntilDone();\n * ```\n *\n */\n// eslint-disable-next-line no-use-before-define\nexport class Poller {\n /**\n * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`.\n *\n * When writing an implementation of a Poller, this implementation needs to deal with the initialization\n * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's\n * operation has already been defined, at least its basic properties. The code below shows how to approach\n * the definition of the constructor of a new custom poller.\n *\n * ```ts\n * export class MyPoller extends Poller {\n * constructor({\n * // Anything you might need outside of the basics\n * }) {\n * let state: MyOperationState = {\n * privateProperty: private,\n * publicProperty: public,\n * };\n *\n * const operation = {\n * state,\n * update,\n * cancel,\n * toString\n * }\n *\n * // Sending the operation to the parent's constructor.\n * super(operation);\n *\n * // You can assign more local properties here.\n * }\n * }\n * ```\n *\n * Inside of this constructor, a new promise is created. This will be used to\n * tell the user when the poller finishes (see `pollUntilDone()`). The promise's\n * resolve and reject methods are also used internally to control when to resolve\n * or reject anyone waiting for the poller to finish.\n *\n * The constructor of a custom implementation of a poller is where any serialized version of\n * a previous poller's operation should be deserialized into the operation sent to the\n * base constructor. For example:\n *\n * ```ts\n * export class MyPoller extends Poller {\n * constructor(\n * baseOperation: string | undefined\n * ) {\n * let state: MyOperationState = {};\n * if (baseOperation) {\n * state = {\n * ...JSON.parse(baseOperation).state,\n * ...state\n * };\n * }\n * const operation = {\n * state,\n * // ...\n * }\n * super(operation);\n * }\n * }\n * ```\n *\n * @param operation - Must contain the basic properties of `PollOperation`.\n */\n constructor(operation) {\n /** controls whether to throw an error if the operation failed or was canceled. */\n this.resolveOnUnsuccessful = false;\n this.stopped = true;\n this.pollProgressCallbacks = [];\n this.operation = operation;\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown.\n // The above warning would get thrown if `poller.poll` is called, it returns an error,\n // and pullUntilDone did not have a .catch or await try/catch on it's return value.\n this.promise.catch(() => {\n /* intentionally blank */\n });\n }\n /**\n * Starts a loop that will break only if the poller is done\n * or if the poller is stopped.\n */\n async startPolling(pollOptions = {}) {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll(pollOptions);\n await this.delay();\n }\n }\n /**\n * pollOnce does one polling, by calling to the update method of the underlying\n * poll operation to make any relevant change effective.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n async pollOnce(options = {}) {\n if (!this.isDone()) {\n this.operation = await this.operation.update({\n abortSignal: options.abortSignal,\n fireProgress: this.fireProgress.bind(this),\n });\n }\n this.processUpdatedState();\n }\n /**\n * fireProgress calls the functions passed in via onProgress the method of the poller.\n *\n * It loops over all of the callbacks received from onProgress, and executes them, sending them\n * the current operation state.\n *\n * @param state - The current operation state.\n */\n fireProgress(state) {\n for (const callback of this.pollProgressCallbacks) {\n callback(state);\n }\n }\n /**\n * Invokes the underlying operation's cancel method.\n */\n async cancelOnce(options = {}) {\n this.operation = await this.operation.cancel(options);\n }\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n poll(options = {}) {\n if (!this.pollOncePromise) {\n this.pollOncePromise = this.pollOnce(options);\n const clearPollOncePromise = () => {\n this.pollOncePromise = undefined;\n };\n this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject);\n }\n return this.pollOncePromise;\n }\n processUpdatedState() {\n if (this.operation.state.error) {\n this.stopped = true;\n if (!this.resolveOnUnsuccessful) {\n this.reject(this.operation.state.error);\n throw this.operation.state.error;\n }\n }\n if (this.operation.state.isCancelled) {\n this.stopped = true;\n if (!this.resolveOnUnsuccessful) {\n const error = new PollerCancelledError(\"Operation was canceled\");\n this.reject(error);\n throw error;\n }\n }\n if (this.isDone() && this.resolve) {\n // If the poller has finished polling, this means we now have a result.\n // However, it can be the case that TResult is instantiated to void, so\n // we are not expecting a result anyway. To assert that we might not\n // have a result eventually after finishing polling, we cast the result\n // to TResult.\n this.resolve(this.getResult());\n }\n }\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n async pollUntilDone(pollOptions = {}) {\n if (this.stopped) {\n this.startPolling(pollOptions).catch(this.reject);\n }\n // This is needed because the state could have been updated by\n // `cancelOperation`, e.g. the operation is canceled or an error occurred.\n this.processUpdatedState();\n return this.promise;\n }\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback) {\n this.pollProgressCallbacks.push(callback);\n return () => {\n this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback);\n };\n }\n /**\n * Returns true if the poller has finished polling.\n */\n isDone() {\n const state = this.operation.state;\n return Boolean(state.isCompleted || state.isCancelled || state.error);\n }\n /**\n * Stops the poller from continuing to poll.\n */\n stopPolling() {\n if (!this.stopped) {\n this.stopped = true;\n if (this.reject) {\n this.reject(new PollerStoppedError(\"This poller is already stopped\"));\n }\n }\n }\n /**\n * Returns true if the poller is stopped.\n */\n isStopped() {\n return this.stopped;\n }\n /**\n * Attempts to cancel the underlying operation.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * If it's called again before it finishes, it will throw an error.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n cancelOperation(options = {}) {\n if (!this.cancelPromise) {\n this.cancelPromise = this.cancelOnce(options);\n }\n else if (options.abortSignal) {\n throw new Error(\"A cancel request is currently pending\");\n }\n return this.cancelPromise;\n }\n /**\n * Returns the state of the operation.\n *\n * Even though TState will be the same type inside any of the methods of any extension of the Poller class,\n * implementations of the pollers can customize what's shared with the public by writing their own\n * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller\n * and a public type representing a safe to share subset of the properties of the internal state.\n * Their definition of getOperationState can then return their public type.\n *\n * Example:\n *\n * ```ts\n * // Let's say we have our poller's operation state defined as:\n * interface MyOperationState extends PollOperationState {\n * privateProperty?: string;\n * publicProperty?: string;\n * }\n *\n * // To allow us to have a true separation of public and private state, we have to define another interface:\n * interface PublicState extends PollOperationState {\n * publicProperty?: string;\n * }\n *\n * // Then, we define our Poller as follows:\n * export class MyPoller extends Poller {\n * // ... More content is needed here ...\n *\n * public getOperationState(): PublicState {\n * const state: PublicState = this.operation.state;\n * return {\n * // Properties from PollOperationState\n * isStarted: state.isStarted,\n * isCompleted: state.isCompleted,\n * isCancelled: state.isCancelled,\n * error: state.error,\n * result: state.result,\n *\n * // The only other property needed by PublicState.\n * publicProperty: state.publicProperty\n * }\n * }\n * }\n * ```\n *\n * You can see this in the tests of this repository, go to the file:\n * `../test/utils/testPoller.ts`\n * and look for the getOperationState implementation.\n */\n getOperationState() {\n return this.operation.state;\n }\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult() {\n const state = this.operation.state;\n return state.result;\n }\n /**\n * Returns a serialized version of the poller's operation\n * by invoking the operation's toString method.\n */\n toString() {\n return this.operation.toString();\n }\n}\n//# sourceMappingURL=poller.js.map"],"names":["AbortError","Error","constructor","message","super","this","name","isTokenCredential","credential","castCredential","getToken","undefined","signRequest","length","encodeByteArray","value","str","i","String","fromCharCode","btoa","decodeString","byteString","atob","arr","Uint8Array","charCodeAt","XML_ATTRKEY","XML_CHARKEY","validateISODuration","validUuidRegex","flattenResponse","fullResponse","responseSpec","_a","_b","parsedHeaders","request","method","Object","assign","body","parsedBody","bodyMapper","isNullable","Boolean","nullable","expectedBodyTypeName","type","blobBody","readableStreamBody","modelProperties","isPageableResponse","keys","some","k","serializedName","arrayResponse","key","getOwnPropertyNames","responseObject","combinedHeadersAndBody","headers","hasNullableType","shouldWrapBody","handleNullableResponseAndWrappableBody","mapperTypeName","match","SerializerImpl","modelMappers","isXML","validateConstraints","mapper","objectName","failValidation","constraintName","constraintValue","constraints","ExclusiveMaximum","ExclusiveMinimum","InclusiveMaximum","InclusiveMinimum","MaxItems","MaxLength","MinItems","MinLength","MultipleOf","Pattern","UniqueItems","pattern","RegExp","item","ar","indexOf","serialize","object","options","xml","_c","updatedOptions","rootName","includeRoot","xmlCharKey","payload","mapperType","isConstant","defaultValue","required","typeName","valueOf","uuid","test","objectType","pipe","tee","ArrayBuffer","isView","Blob","serializeBasicTypes","allowedValues","toLowerCase","JSON","stringify","serializeEnumType","Date","isNaN","parse","toISOString","substring","toUTCString","d","Math","floor","getTime","dateToUnixTime","isDuration","serializeDateTypes","serializeByteArrayType","buffer","ch","len","substr","trimEnd","replace","bufferToBase64Url","serializeBase64UrlType","serializer","isXml","Array","isArray","elementType","element","className","tempArray","serializedValue","xmlNamespace","xmlnsKey","xmlNamespacePrefix","serializeSequenceType","valueType","tempDictionary","getXmlObjectValue","result","serializeDictionaryType","getPolymorphicDiscriminatorRecursively","getPolymorphicMapper","modelProps","resolveModelProperties","propertyMapper","readOnly","propName","parentObject","xmlIsWrapped","xmlName","xmlElementName","paths","splitSerializeName","pop","pathName","childObject","propertyObjectName","toSerialize","polymorphicDiscriminator","clientName","xmlIsAttribute","additionalPropertiesMapper","additionalProperties","modelMapper","resolveReferencedMapper","resolveAdditionalProperties","propNames","clientPropName","every","pn","serializeCompositeType","deserialize","responseBody","_d","ignoreUnknownProperties","instance","handledPropertyNames","push","headerCollectionPrefix","dictionary","headerKey","startsWith","xmlIsMsText","propertyName","wrapped","elementList","property","propertyInstance","res","steps","arrayInstance","v","entries","prototype","hasOwnProperty","call","isAdditionalProperty","responsePropName","includes","isSpecialXmlProperty","deserializeCompositeType","parseFloat","n","unixTimeToDate","base64UrlToByteArray","deserializeSequenceType","deserializeDictionaryType","createSerializer","prop","classes","partialclass","subwords","split","charAt","polymorphicPropertyName","discriminatorName","discriminatorValue","uberParent","polymorphicMapper","discriminators","typeNamesToCheck","currentName","shift","indexDiscriminator","getIndexDiscriminator","getPolymorphicDiscriminatorSafely","MapperTypeNames","Base64Url","ByteArray","Composite","DateTime","DateTimeRfc1123","Dictionary","Enum","Number","Sequence","Stream","TimeSpan","UnixTime","state","operationRequestMap","WeakMap","getOperationArgumentValueFromParameter","operationArguments","parameter","fallbackObject","parameterPath","parameterMapper","propertySearchResult","getPropertyFromParameterPath","propertyFound","useDefaultValue","propertyValue","parent","parameterPathPart","originalRequestSymbol","Symbol","for","getOperationRequestInfo","hasOriginalRequest","info","get","set","defaultJsonContentTypes","defaultXmlContentTypes","deserializationPolicyName","deserializationPolicy","_e","_f","_g","jsonContentTypes","expectedContentTypes","json","xmlContentTypes","parseXML","serializerOptions","sendRequest","next","response","async","parsedResponse","operationResponse","opts","streamResponseStatusCodes","has","status","bodyAsText","text","contentType","contentComponents","map","component","err","msg","errCode","code","PARSE_ERROR","statusCode","operationInfo","shouldDeserialize","shouldDeserializeResponse","operationSpec","responses","operationResponseGetter","getOperationResponseMap","error","shouldReturnResponse","isSuccessByStatus","isExpectedStatusCode","expectedStatusCodes","isOperationSpecEmpty","isError","errorResponseSpec","default","initialErrorMessage","defaultBodyMapper","defaultHeadersMapper","headersMapper","deserializedError","valueToDeserialize","elementName","internalError","toJSON","defaultError","handleErrorResponse","deserializeError","httpMethod","deserializeResponseBody","getPathStringFromParameter","join","serializationPolicyName","serializationPolicy","stringifyXML","headerParameters","headerParameter","headerValue","customHeaders","requestOptions","customHeaderName","serializeHeaders","requestBody","requestBodyParameterPathString","isStream","getXmlValueWithNamespace","obj","xmlNamespaceKey","prepareXMLRootList","mediaType","formDataParameters","formData","formDataParameter","formDataParameterValue","formDataParameterPropertyName","serializeRequestBody","createClientPipeline","pipeline","credentialOptions","addPolicy","scopes","credentialScopes","serializationOptions","phase","deserializationOptions","cachedHttpClient","CollectionFormatToDelimiterMap","CSV","SSV","Multi","TSV","Pipes","getRequestUrl","baseUri","urlReplacements","Map","urlParameters","urlParameter","urlParameterValue","parameterPathString","skipEncoding","encodeURIComponent","calculateUrlReplacements","isAbsolutePath","requestUrl","replaceAll","path","url","pathToAppend","parsedUrl","URL","newPath","pathname","endsWith","searchStart","search","toString","appendPath","queryParams","sequenceParams","Set","queryParameters","queryParameter","add","queryParameterValue","delimiter","collectionFormat","calculateQueryParameters","noOverwrite","size","combinedParams","queryString","pairs","slice","pair","existingValue","simpleParseQueryParams","valueSet","from","unshift","searchPieces","subValue","appendQueryParams","input","replacements","searchValue","replaceValue","logger","ServiceClient","_requestContentType","requestContentType","_endpoint","endpoint","warning","_allowInsecureConnection","allowInsecureConnection","_httpClient","httpClient","getCredentialScopes","createDefaultPipeline","additionalPolicies","policy","position","afterPhase","sendOperationRequest","baseUrl","timeout","onUploadProgress","onDownloadProgress","abortSignal","tracingOptions","getStreamingResponseStatusCodes","rawResponse","flatResponse","onResponse","details","Constants","AUTHORIZATION","authorizeRequestOnTenantChallenge","challengeOptions","challenge","getChallenge","challengeInfo","bearerChallenge","challengeParts","trim","filter","x","keyValue","reduce","a","b","parseChallenge","challengeScopes","resource_id","scope","buildScopes","tenantId","parsedAuthUri","authorization_uri","extractTenantId","accessToken","getAccessToken","token","disableKeepAlivePolicyName","originalClientRequestSymbol","toPipelineRequest","webResource","toJson","preserveCase","newRequest","withCredentials","requestId","disableKeepAlive","keepAlive","proxySettings","originalRequest","toWebResourceLike","toHttpHeadersLike","clone","prepare","validateRequestProperties","createProxy","Proxy","target","receiver","Reflect","HttpHeaders","getHeaderKey","headerName","rawHeaders","_headersMap","header","contains","remove","headersArray","headerNames","headerValues","resultPreservingCasing","originalResponse","toCompatResponse","toPipelineResponse","compatResponse","ExtendedServiceClient","keepAliveOptions","enable","getOrderedPolicies","redirectOptions","handleRedirects","removePolicy","userProvidedCallBack","lastResponse","defineProperty","HttpPipelineLogLevel","mockRequestPolicyOptions","log","_logLevel","_message","shouldLog","requestPolicyFactoryPolicyName","createRequestPolicyFactoryPolicy","factories","orderedFactories","reverse","httpPipeline","httpRequest","factory","create","webResourceLike","convertHttpClient","requestPolicyClient","PollerStoppedError","setPrototypeOf","PollerCancelledError","Poller","operation","resolveOnUnsuccessful","stopped","pollProgressCallbacks","promise","Promise","resolve","reject","catch","startPolling","pollOptions","isStopped","isDone","poll","delay","pollOnce","update","fireProgress","bind","processUpdatedState","callback","cancelOnce","cancel","pollOncePromise","clearPollOncePromise","then","isCancelled","getResult","pollUntilDone","onProgress","c","isCompleted","stopPolling","cancelOperation","cancelPromise","getOperationState"],"sourceRoot":""}