{"version":3,"file":"ms.cv-4.0.2.min.js","sources":["../../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-es5/Constants.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/internal/constants.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/base.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/get_own_prop_desc.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/has_own_prop.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/has_own.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/for_each_key.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/throw.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/object.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/internal/map.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/symbol/well_known.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/internal/global.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/string/as_string.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/diagnostics.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/internal/unwrapFunction.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/polyfills/symbol.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/math/min_max.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/string/slice.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/string/substring.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/define.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/lazy.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/safe_lazy.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/safe_get.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/environment.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/symbol/symbol.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/iterator/forOf.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/iterator/iterator.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/funcs/fnApply.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/array/forEach.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/array/indexOf.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/set_proto.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/array/slice.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/funcs/fnCall.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/create.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/customError.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/object/is_plain_object.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/perf.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/helpers/date.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/string/index_of.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/timer/handler.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-shims/dist-es5/TsLibShims.js","../../../../common/temp/node_modules/@microsoft/dynamicproto-js/dist-es5/DynamicProto.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/__DynamicConstants.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AggregationError.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/InternalConstants.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/HelperFuncs.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/EnvUtils.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/RandomHelper.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DataCacheHelper.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/ConfigDefaults.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicSupport.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicProperty.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicState.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/timer/timeout.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicConfig.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DbgExtensionUtils.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DiagnosticLogger.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/PerfManager.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/TelemetryHelpers.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/ProcessTelemetryContext.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHandlerContainer.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHookContainer.js","../../../../common/temp/node_modules/@nevware21/ts-utils/dist-es5/array/append.js","../../../../common/temp/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/BaseTelemetryPlugin.js","../../../../common/temp/node_modules/@microsoft/1ds-core-js/dist-es5/__DynamicConstants.js","../../dist-es5/CorrelationVectorPlugin.js","../../dist-es5/Cv.js","../../../../common/temp/node_modules/@microsoft/1ds-core-js/dist-es5/Utils.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var strShimFunction = \"function\";\r\nexport var strShimObject = \"object\";\r\nexport var strShimUndefined = \"undefined\";\r\nexport var strShimPrototype = \"prototype\";\r\nexport var strDefault = \"default\";\r\nexport var ObjClass = Object;\r\nexport var ObjProto = ObjClass[strShimPrototype];\r\n//# sourceMappingURL=Constants.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\n// These constants are currently NOT exported directly, we may export them later associated with a frozen namespace (maybe)\r\n// For now do NOT expect that we will export these values.\r\nexport var UNDEF_VALUE = undefined;\r\nexport var NULL_VALUE = null;\r\nexport var EMPTY = \"\";\r\nexport var BOOLEAN = \"boolean\";\r\nexport var FUNCTION = \"function\";\r\nexport var NUMBER = \"number\";\r\nexport var OBJECT = \"object\";\r\nexport var PROTOTYPE = \"prototype\";\r\nexport var __PROTO__ = \"__proto__\";\r\nexport var STRING = \"string\";\r\nexport var UNDEFINED = \"undefined\";\r\nexport var CONSTRUCTOR = \"constructor\";\r\nexport var SYMBOL = \"Symbol\";\r\nexport var POLYFILL_TAG = \"_polyfill\";\r\nexport var INDEX_OF = \"indexOf\";\r\nexport var LAST_INDEX_OF = \"lastIndexOf\";\r\nexport var LENGTH = \"length\";\r\nexport var DONE = \"done\";\r\nexport var VALUE = \"value\";\r\nexport var NAME = \"name\";\r\nexport var SLICE = \"slice\";\r\n/**\r\n * @ignore\r\n */\r\nexport var ObjClass = Object;\r\n/**\r\n * @ignore\r\n */\r\nexport var ObjProto = ObjClass[PROTOTYPE];\r\n/**\r\n * @ignore\r\n */\r\nexport var StrCls = String;\r\n/**\r\n * @ignore\r\n */\r\nexport var StrProto = StrCls[PROTOTYPE];\r\n/**\r\n * @ignore\r\n */\r\nexport var MathCls = Math;\r\n/**\r\n * @ignore\r\n */\r\nexport var ArrCls = Array;\r\n/**\r\n * @ignore\r\n */\r\nexport var ArrProto = ArrCls[PROTOTYPE];\r\n//# sourceMappingURL=constants.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { ArrCls, BOOLEAN, FUNCTION, NULL_VALUE, NUMBER, OBJECT, ObjProto, STRING, UNDEFINED, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { safeGet } from \"./safe_get\";\r\nvar PRIMITIVE_TYPES = [STRING, NUMBER, BOOLEAN, UNDEFINED, \"symbol\", \"bigint\"];\r\n/**\r\n * @ignore\r\n * @internal\r\n * Create and returns a function that will return `true` if the argument passed\r\n * to it matches the provided type.\r\n * @param theType - The type to match against the `typeof value`\r\n * @returns A function which takes a single argument and returns a boolean\r\n */\r\nexport function _createIs(theType) {\r\n return function (value) {\r\n return typeof value === theType;\r\n };\r\n}\r\n/**\r\n * @ignore\r\n * @internal\r\n * Create and returns a function that will return `true` if the argument passed\r\n * to it matches the object type specified based on {@link objToString}.\r\n * @param - The object name to match for the `objToString(value)`\r\n * @returns A function which takes a single argument and returns a boolean\r\n */\r\nexport function _createObjIs(theName) {\r\n var theType = \"[object \" + theName + \"]\";\r\n return function (value) {\r\n return !!(value && objToString(value) === theType);\r\n };\r\n}\r\n/**\r\n * The `objToString()` method returns a string representing the object. This explicitly\r\n * always calls the `Object.prototype.toString()` method.\r\n *\r\n * An object's toString() method is most commonly invoked when that object undergoes:\r\n * - explicit type conversion to a string (for example, String(myObject))\r\n * - implicit type coercion into a string (for example, myObject + \"hello world\")\r\n *\r\n * @group Object\r\n * @param value - The object to be converted into a string\r\n * @returns A string representation of the object\r\n * @example\r\n * ```ts\r\n * objToString(new Date()); // [object Date]\r\n * objToString(new String()); // [object String]\r\n *\r\n * // Math has its Symbol.toStringTag\r\n * objToString(Math); // [object Math]\r\n *\r\n * objToString(undefined); // [object Undefined]\r\n * objToString(null); // [object Null]\r\n * ```\r\n */\r\nexport function objToString(value) {\r\n return ObjProto.toString.call(value);\r\n}\r\n/**\r\n * Validate if the provided value object is of the expected type\r\n * @group Type Identity\r\n * @param value - The value to check\r\n * @param theType - The expected type name as a string\r\n * @returns `true` if the value matches the provided type\r\n */\r\nexport function isTypeof(value, theType) {\r\n return typeof value === theType;\r\n}\r\n/**\r\n * Checks if the provided value is undefined or contains the string value \"undefined\",\r\n * if you want to consider the string value as undefined see {@link isStrictUndefined}\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param value - The value to check\r\n * @returns true if the value is undefined or \"undefined\", otherwise false\r\n * @example\r\n * ```ts\r\n * isUndefined(undefined); // true\r\n * isUndefined(\"undefined\"); // true\r\n *\r\n * isUndefined(null); // false\r\n * isUndefined(\"null\"); // false\r\n * isUndefined(\"1\"); // false\r\n * isUndefined(\"aa\"); // false\r\n * isUndefined(new Date()); // false\r\n * isUndefined(1); // false\r\n * isUndefined(\"\"); // false\r\n * isUndefined(_dummyFunction); // false\r\n * isUndefined([]); // false\r\n * isUndefined(new Array(1)); // false\r\n * isUndefined(true); // false\r\n * isUndefined(false); // false\r\n * isUndefined(\"true\"); // false\r\n * isUndefined(\"false\"); // false\r\n * isUndefined(new Boolean(true)); // false\r\n * isUndefined(new Boolean(false)); // false\r\n * isUndefined(new Boolean(\"true\")); // false\r\n * isUndefined(new Boolean(\"false\")); // false\r\n * isUndefined(Boolean(true)); // false\r\n * isUndefined(Boolean(false)); // false\r\n * isUndefined(Boolean(\"true\")); // false\r\n * isUndefined(Boolean(\"false\")); // false\r\n * isUndefined(new RegExp(\"\")); // false\r\n * isUndefined(new ArrayBuffer(0)); // false\r\n * isUndefined(new Error(\"Test Error\"));// false\r\n * isUndefined(new TypeError(\"Test TypeError\")); // false\r\n * isUndefined(new TestError(\"Test TestError\")); // false\r\n * isUndefined(_dummyError()); // false\r\n * isUndefined(Promise.reject()); // false\r\n * isUndefined(Promise.resolve()); // false\r\n * isUndefined(new Promise(() => {})); // false\r\n * isUndefined(_simplePromise()); // false\r\n * isUndefined(_simplePromiseLike()); // false\r\n * isUndefined(Object.create(null)); // false\r\n * isUndefined(polyObjCreate(null)); // false\r\n * ```\r\n */\r\nexport function isUndefined(value) {\r\n return typeof value === UNDEFINED || value === UNDEFINED;\r\n}\r\n/**\r\n * Checks if the provided value is undefined, a string value of \"undefined\" is NOT considered\r\n * to be undefined.\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param value - The value to check\r\n * @returns true if the typeof value === UNDEFINED\r\n * @example\r\n * ```ts\r\n * isStrictUndefined(undefined); // true\r\n *\r\n * isStrictUndefined(null); // false\r\n * isStrictUndefined(\"null\"); // false\r\n * isStrictUndefined(\"undefined\"); // false\r\n * isStrictUndefined(\"1\"); // false\r\n * isStrictUndefined(\"aa\"); // false\r\n * isStrictUndefined(new Date()); // false\r\n * isStrictUndefined(0); // false\r\n * isStrictUndefined(1); // false\r\n * isStrictUndefined(\"\"); // false\r\n * ```\r\n */\r\nexport function isStrictUndefined(arg) {\r\n return !isDefined(arg);\r\n}\r\n/**\r\n * Checks if the provided value is null, undefined or contains the string value of \"undefined\".\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param value - The value to check\r\n * @returns `true` if the value is `null` or `undefined`\r\n * @example\r\n * ```ts\r\n * isNullOrUndefined(null); // true\r\n * isNullOrUndefined(undefined); // true\r\n * isNullOrUndefined(\"undefined\"); // true\r\n *\r\n * let value = null;\r\n * isNullOrUndefined(value); // true\r\n * let value = undefined;\r\n * isNullOrUndefined(value); // true\r\n *\r\n * isNullOrUndefined(\"\"); // false\r\n * isNullOrUndefined(0); // false\r\n * isNullOrUndefined(new Date()); // false\r\n * isNullOrUndefined(true); // false\r\n * isNullOrUndefined(false); // false\r\n * ```\r\n */\r\nexport function isNullOrUndefined(value) {\r\n return value === NULL_VALUE || isUndefined(value);\r\n}\r\n/**\r\n * Checks if the provided value is null, undefined only, a string value of \"undefined\" is NOT considered\r\n * to be undefined.\r\n * @group Type Identity\r\n * @group Value Check\r\n * @param value - The value to check\r\n * @returns\r\n * @example\r\n * ```ts\r\n * isStrictNullOrUndefined(null); // true\r\n * isStrictNullOrUndefined(undefined); // true\r\n * isStrictNullOrUndefined(\"undefined\"); // false\r\n *\r\n * let value = null;\r\n * isStrictNullOrUndefined(value); // true\r\n * let value = undefined;\r\n * isStrictNullOrUndefined(value); // true\r\n *\r\n * isStrictNullOrUndefined(\"\"); // false\r\n * isStrictNullOrUndefined(0); // false\r\n * isStrictNullOrUndefined(new Date()); // false\r\n * isStrictNullOrUndefined(true); // false\r\n * isStrictNullOrUndefined(false); // false\r\n * ```\r\n */\r\nexport function isStrictNullOrUndefined(value) {\r\n return value === NULL_VALUE || !isDefined(value);\r\n}\r\n/**\r\n * Checks if the passed value is defined, which means it has any value and is not undefined.\r\n * A string value of \"undefined\" is considered to be defined.\r\n * @group Value Check\r\n * @param arg - The value to check\r\n * @returns true if arg has a value (is not === undefined)\r\n * @example\r\n * ```ts\r\n * isDefined(null); // false\r\n * isDefined(undefined); // false\r\n * isDefined(\"undefined\"); // true\r\n *\r\n * let value = null;\r\n * isDefined(value); // false\r\n * let value = undefined;\r\n * isDefined(value); // false\r\n *\r\n * isDefined(\"\"); // true\r\n * isDefined(0); // true\r\n * isDefined(new Date()); // true\r\n * isDefined(true); // true\r\n * isDefined(false); // true\r\n * ```\r\n */\r\nexport function isDefined(arg) {\r\n return !!arg || arg !== UNDEF_VALUE;\r\n}\r\n/**\r\n * Identifies whether the provided value is a JavaScript [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)\r\n * which is when is it not an object and has no methods or properties. There are 7 primitive data types:\r\n * - string\r\n * - number\r\n * - bigint\r\n * - boolean\r\n * - undefined\r\n * - null\r\n * - symbol\r\n *\r\n * Most of the time, a primitive value is represented directly at the lowest level of the language implementation.\r\n *\r\n * All primitives are immutable; that is, they cannot be altered. It is important not to confuse a primitive itself\r\n * with a variable assigned a primitive value. The variable may be reassigned to a new value, but the existing value\r\n * can not be changed in the ways that objects, arrays, and functions can be altered. The language does not offer\r\n * utilities to mutate primitive values.\r\n * @since 0.4.4\r\n * @group Type Identity\r\n * @param value - The value to check whether it's a primitive value\r\n * @example\r\n * ```ts\r\n * isPrimitive(null); // true\r\n * isPrimitive(undefined); // true\r\n * isPrimitive(\"null\"); // true\r\n * isPrimitive(\"undefined\"); // true\r\n * isPrimitive(\"1\"); // true\r\n * isPrimitive(\"aa\"); // true\r\n * isPrimitive(1); // true\r\n * isPrimitive(Number(2)); // true\r\n * isPrimitive(\"\"); // true\r\n * isPrimitive(String(\"\")); // true\r\n * isPrimitive(true); // true\r\n * isPrimitive(false); // true\r\n * isPrimitive(\"true\"); // true\r\n * isPrimitive(\"false\"); // true\r\n * isPrimitive(BigInt(42)); // true\r\n * isPrimitive(Symbol.for(\"Hello\")); // true\r\n *\r\n * isPrimitive(new String(\"aa\")); // false\r\n * isPrimitive(new Date()); // false\r\n * isPrimitive(_dummyFunction); // false\r\n * isPrimitive([]); // false\r\n * isPrimitive(new Array(1)); // false\r\n * isPrimitive(new Boolean(true)); // false\r\n * isPrimitive(new Boolean(false)); // false\r\n * isPrimitive(new Boolean(\"true\")); // false\r\n * isPrimitive(new Boolean(\"false\")); // false\r\n * ```\r\n */\r\nexport var isPrimitive = function (value) {\r\n return value === NULL_VALUE || isPrimitiveType(typeof value);\r\n};\r\n/**\r\n * Identifies whether the provided value is a JavaScript [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)\r\n * which is when is it not an object and has no methods or properties. There are 6 primitive data types:\r\n * - string\r\n * - number\r\n * - bigint\r\n * - boolean\r\n * - undefined\r\n * - symbol\r\n *\r\n * Most of the time, a primitive value is represented directly at the lowest level of the language implementation.\r\n *\r\n * All primitives are immutable; that is, they cannot be altered. It is important not to confuse a primitive itself\r\n * with a variable assigned a primitive value. The variable may be reassigned to a new value, but the existing value\r\n * can not be changed in the ways that objects, arrays, and functions can be altered. The language does not offer\r\n * utilities to mutate primitive values.\r\n * @since 0.9.6\r\n * @group Type Identity\r\n * @param theType - The type as a string value to be checked whther it's a primitive type, this should be the value\r\n * returned from `typeof value`.\r\n * @example\r\n * ```ts\r\n * isPrimitiveType(null); // false\r\n * isPrimitiveType(undefined); // false\r\n * isPrimitiveType(\"null\"); // false\r\n * isPrimitiveType(\"undefined\"); // false\r\n * isPrimitiveType(\"1\"); // false\r\n * isPrimitiveType(\"aa\"); // false\r\n * isPrimitiveType(1); // false\r\n * isPrimitiveType(Number(2)); // false\r\n * isPrimitiveType(\"\"); // false\r\n * isPrimitiveType(String(\"\")); // false\r\n * isPrimitiveType(true); // false\r\n * isPrimitiveType(false); // false\r\n * isPrimitiveType(\"true\"); // false\r\n * isPrimitiveType(\"false\"); // false\r\n * isPrimitiveType(BigInt(42)); // false\r\n * isPrimitiveType(Symbol.for(\"Hello\")); // false\r\n *\r\n * isPrimitiveType(\"string\"); // true\r\n * isPrimitiveType(\"number\"); // true\r\n * isPrimitiveType(\"boolean\"); // true\r\n * isPrimitiveType(\"undefined\"); // true\r\n * isPrimitiveType(\"symbol\"); // true\r\n * isPrimitiveType(\"bigint\"); // true\r\n * ```\r\n */\r\nexport var isPrimitiveType = function (theType) {\r\n return theType !== OBJECT && PRIMITIVE_TYPES.indexOf(theType) !== -1;\r\n};\r\n/**\r\n * Checks to see if the past value is a string value\r\n * @group Type Identity\r\n * @group String\r\n * @param value - The value to check\r\n * @returns\r\n * @example\r\n * ```ts\r\n * isString(\"\"); // true\r\n * isString(\"null\"); // true\r\n * isString(\"undefined\"); // true\r\n * isString(String(\"\")); // true\r\n *\r\n * isString(null); // false\r\n * isString(undefined); // false\r\n * isString(0); // false\r\n * ```\r\n */\r\nexport var isString = _createIs(STRING);\r\n/**\r\n * Checks to see if the past value is a function value\r\n * @group Type Identity\r\n * @param value - The value to check\r\n * @returns\r\n * @example\r\n * ```ts\r\n * function myFunction() { }\r\n * isFunction(null); // false\r\n * isFunction(undefined); // false\r\n * isFunction(\"null\"); // false\r\n * isFunction(\"undefined\"); // false\r\n * isFunction(\"1\"); // false\r\n * isFunction(\"aa\"); // false\r\n * isFunction(new Date()); // false\r\n * isFunction(1); // false\r\n * isFunction(\"\"); // false\r\n * isFunction(myFunction); // true\r\n * isFunction([]); // false\r\n * isFunction(new Array(1)); // false\r\n * ```\r\n */\r\nexport var isFunction = _createIs(FUNCTION);\r\n/**\r\n * Checks to see if the past value is an object value\r\n * @group Type Identity\r\n * @group Object\r\n * @typeParam T - The object type, defaults to any\r\n * @param value - The value to check\r\n * @returns\r\n */\r\nexport function isObject(value) {\r\n if (!value && isNullOrUndefined(value)) {\r\n return false;\r\n }\r\n return !!value && typeof value === OBJECT;\r\n}\r\n/**\r\n * Checks if the type of value is an Array.\r\n *\r\n * @group Type Identity\r\n * @group Array\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a Array, false otherwise.\r\n * @example\r\n * ```ts\r\n * import { isArray, isObject } from \"@nevware21/ts-utils\";\r\n *\r\n * function performAction(value: any) {\r\n * if (isArray(value) || isObject(value)) {\r\n * // Do something\r\n * } else {\r\n * // Do something else\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport var isArray = ArrCls.isArray;\r\n/**\r\n * Check if an object is of type Date\r\n * @group Type Identity\r\n * @example\r\n * ```ts\r\n * import { isDate } from \"@nevware21/ts-utils\";\r\n *\r\n * let _theDate = null;\r\n *\r\n * function getSetDate(newDate?: any) {\r\n * _theDate = isDate(newDate) ? newDate : new Date();\r\n *\r\n * return _theDate;\r\n * }\r\n * ```\r\n */\r\nexport var isDate = _createObjIs(\"Date\");\r\n/**\r\n * Checks if the type of value is a number.\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a number, false otherwise.\r\n */\r\nexport var isNumber = _createIs(NUMBER);\r\n/**\r\n * Checks if the type of value is a boolean.\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\nexport var isBoolean = _createIs(BOOLEAN);\r\n/**\r\n * Determines if a value is a regular expression object.\r\n * @group Type Identity\r\n * @param {*} value Reference to check.\r\n * @returns {boolean} True if `value` is a `RegExp`.\r\n */\r\nexport var isRegExp = _createObjIs(\"RegExp\");\r\n/**\r\n * Checks if the type of value is a File object.\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a File, false otherwise.\r\n */\r\nexport var isFile = _createObjIs(\"File\");\r\n/**\r\n * Checks if the type of value is a FormData object.\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a FormData, false otherwise.\r\n */\r\nexport var isFormData = _createObjIs(\"FormData\");\r\n/**\r\n * Checks if the type of value is a Blob object.\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a Blob, false otherwise.\r\n */\r\nexport var isBlob = _createObjIs(\"Blob\");\r\n/**\r\n * Checks if the type of value is a ArrayBuffer object.\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a ArrayBuffer, false otherwise.\r\n */\r\nexport var isArrayBuffer = _createObjIs(\"ArrayBuffer\");\r\n/**\r\n * Checks if the type of value is a Error object.\r\n * @group Type Identity\r\n * @group Error\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a Error, false otherwise.\r\n */\r\nexport var isError = _createObjIs(\"Error\");\r\n/**\r\n * Checks if the type of value is a PromiseLike instance (contains a then function).\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a PromiseLike, false otherwise.\r\n */\r\nexport function isPromiseLike(value) {\r\n return !!value && isFunction(value.then);\r\n}\r\n/**\r\n * Checks if the type of value is a PromiseLike instance (contains a then function).\r\n * This is an alias for {@link isPromiseLike}.\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a PromiseLike, false otherwise.\r\n */\r\nexport var isThenable = isPromiseLike;\r\n/**\r\n * Checks if the type of value is a Promise instance (contains then and catch functions).\r\n * @group Type Identity\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a Promise, false otherwise.\r\n */\r\nexport function isPromise(value) {\r\n return isPromiseLike(value) && isFunction(value.catch);\r\n}\r\n/**\r\n * Checks if the type of value does not evaluate to true value, handling some special\r\n * case usages of Boolean(true/false) and new Boolean(true/false).\r\n * @group Value Check\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is not truthy, false otherwise.\r\n */\r\nexport function isNotTruthy(value) {\r\n return !value || !safeGet(function () { return (value && (0 + value)); }, value);\r\n}\r\n/**\r\n * Checks if the type of value evaluates to true value, handling some special\r\n * case usages of Boolean(true/false) and new Boolean(true/false).\r\n * @group Value Check\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is not truthy, false otherwise.\r\n */\r\nexport function isTruthy(value) {\r\n // Objects created with no prototype (Object.create(null)) cannot be converted to primitives\r\n // Which causes this code to throw, additionally just using !! also fails for Boolean objects\r\n // !!(new Boolean(false)) evaluates to true\r\n return !(!value || safeGet(function () { return !(value && (0 + value)); }, !value));\r\n //return !(!value || !(value && (0 + value)));\r\n}\r\n//# sourceMappingURL=base.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { ObjClass } from \"../internal/constants\";\r\n/**\r\n * The objGetOwnPropertyDescriptor() method returns an object describing the configuration of a specific property on\r\n * a given object (that is, one directly present on an object and not in the object's prototype chain). The object\r\n * returned is mutable but mutating it has no effect on the original property's configuration.\r\n * @since 0.4.3\r\n * @group Object\r\n * @param target - Object that contains the property.\r\n * @param prop - Name of the property.\r\n * @returns A property descriptor of the given property if it exists on the object, otherwise undefined.\r\n *\r\n * @example\r\n * ```ts\r\n * o = {};\r\n * objDefineProp(o, 'qux', {\r\n * value: 8675309,\r\n * writable: false,\r\n * enumerable: false\r\n * });\r\n * d = objGetOwnPropertyDescriptor(o, 'qux');\r\n * // d is {\r\n * // value: 8675309,\r\n * // writable: false,\r\n * // enumerable: false,\r\n * // configurable: false\r\n * // }\r\n *\r\n * objGetOwnPropertyDescriptor('foo', 0);\r\n * // TypeError: \"foo\" is not an object // ES5 code\r\n *\r\n * objGetOwnPropertyDescriptor('foo', 0);\r\n * // Object returned by ES2015 code: {\r\n * // configurable: false,\r\n * // enumerable: true,\r\n * // value: \"f\",\r\n * // writable: false\r\n * // }\r\n * ```\r\n * Note: In ES5, if the first argument to this method is not an object (a primitive), then it will cause a TypeError. In ES2015, a non-object first argument will be coerced to an object at first.\r\n */\r\nexport var objGetOwnPropertyDescriptor = ObjClass.getOwnPropertyDescriptor;\r\n//# sourceMappingURL=get_own_prop_desc.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { ObjProto } from \"../internal/constants\";\r\n/**\r\n * The objHasOwnProperty() method returns a boolean indicating whether the object\r\n * has the specified property as its own property (as opposed to inheriting it).\r\n *\r\n * The objHasOwnProperty() method returns true if the specified property is a direct\r\n * property of the object — even if the value is null or undefined. The method returns\r\n * false if the property is inherited, or has not been declared at all. Unlike the in\r\n * operator, this method does not check for the specified property in the object's\r\n * prototype chain.\r\n *\r\n * The method can be called on most JavaScript objects, because most objects descend\r\n * from Object, and hence inherit its methods. For example Array is an Object, so you\r\n * can use objHasOwnProperty() method to check whether an index exists:\r\n * @group Object\r\n * @param obj - The object being evaluated\r\n * @param prop - The String or Symbol of the property to test\r\n * @returns `true` if the object has the specified property as own property; otherwise `false`\r\n * @example\r\n * ```ts\r\n * let example = {};\r\n * objHasOwnProperty(example, 'prop'); // false\r\n *\r\n * example.prop = 'exists';\r\n * objHasOwnProperty(example, 'prop'); // true - 'prop' has been defined\r\n *\r\n * example.prop = null;\r\n * objHasOwnProperty(example, 'prop'); // true - own property exists with value of null\r\n *\r\n * example.prop = undefined;\r\n * objHasOwnProperty(example, 'prop'); // true - own property exists with value of undefined\r\n * ```\r\n */\r\nexport function objHasOwnProperty(obj, prop) {\r\n return obj && ObjProto.hasOwnProperty.call(obj, prop);\r\n}\r\n//# sourceMappingURL=has_own_prop.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { ObjClass } from \"../internal/constants\";\r\nimport { objGetOwnPropertyDescriptor } from \"./get_own_prop_desc\";\r\nimport { objHasOwnProperty } from \"./has_own_prop\";\r\n/**\r\n * The objHasOwn() method returns a boolean indicating whether the object\r\n * has the specified property as its own property (as opposed to inheriting it).\r\n * If the property is inherited, or does not exist, the method returns false.\r\n *\r\n * The objHasOwn() method returns true if the specified property is a direct property\r\n * of the object — even if the property value is null or undefined. The method returns\r\n * false if the property is inherited, or has not been declared at all. Unlike the in operator,\r\n * this method does not check for the specified property in the object's prototype chain.\r\n *\r\n * It is recommended over {@link objHasOwnProperty} () because it works for objects created using\r\n * objCreate(null) and with objects that have overridden the inherited hasOwnProperty() method.\r\n * While it is possible to workaround these problems by calling Object.prototype.hasOwnProperty()\r\n * on an external object, Object.hasOwn() is more intuitive.\r\n *\r\n * @since 0.4.3\r\n * @group Object\r\n * @param obj - The object being evaluated\r\n * @param prop - The String or Symbol of the property to test\r\n * @returns `true` if the object has the specified property as own property; otherwise `false`\r\n * @example\r\n * ```ts\r\n * let example = {};\r\n * objHasOwn(example, 'prop'); // false\r\n *\r\n * example.prop = 'exists';\r\n * objHasOwn(example, 'prop'); // true - 'prop' has been defined\r\n *\r\n * example.prop = null;\r\n * objHasOwn(example, 'prop'); // true - own property exists with value of null\r\n *\r\n * example.prop = undefined;\r\n * objHasOwn(example, 'prop'); // true - own property exists with value of undefined\r\n * ```\r\n */\r\nexport var objHasOwn = ObjClass[\"hasOwn\"] || polyObjHasOwn;\r\n/**\r\n * The polyObjHasOwn() method is a polyfill for {@link objHasOwn} when the native\r\n * [Object.hasOwnreturns](https://caniuse.com/?search=hasOwn) is not supported, it returns a\r\n * boolean indicating whether the object has the specified property as its own property (as\r\n * opposed to inheriting it). If the property is inherited, or does not exist, the method\r\n * returns false.\r\n *\r\n * The objHasOwn() method returns true if the specified property is a direct property\r\n * of the object — even if the property value is null or undefined. The method returns\r\n * false if the property is inherited, or has not been declared at all. Unlike the in operator,\r\n * this method does not check for the specified property in the object's prototype chain.\r\n *\r\n * It is recommended over objHasOwnProperty() because it works for objects created using\r\n * objCreate(null) and with objects that have overridden the inherited hasOwnProperty() method.\r\n * While it is possible to workaround these problems by calling Object.prototype.hasOwnProperty()\r\n * on an external object, Object.hasOwn() is more intuitive.\r\n *\r\n * @since 0.4.3\r\n * @group Object\r\n * @group Polyfill\r\n * @param obj - The object being evaluated\r\n * @param prop - The String or Symbol of the property to test\r\n * @returns `true` if the object has the specified property as own property; otherwise `false`\r\n * @example\r\n * ```ts\r\n * let example = {};\r\n * polyObjHasOwn(example, 'prop'); // false\r\n *\r\n * example.prop = 'exists';\r\n * polyObjHasOwn(example, 'prop'); // true - 'prop' has been defined\r\n *\r\n * example.prop = null;\r\n * polyObjHasOwn(example, 'prop'); // true - own property exists with value of null\r\n *\r\n * example.prop = undefined;\r\n * polyObjHasOwn(example, 'prop'); // true - own property exists with value of undefined\r\n * ```\r\n */\r\nexport function polyObjHasOwn(obj, prop) {\r\n return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop);\r\n}\r\n//# sourceMappingURL=has_own.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { isObject } from \"../helpers/base\";\r\nimport { objHasOwn } from \"./has_own\";\r\n/**\r\n * Calls the provided `callbackFn` function once for each key in an object. This is equivelent to `arrForEach(Object.keys(theObject), callbackFn)` or\r\n * if not using the array helper `Object.keys(theObject).forEach(callbackFn)` except that this helper avoid creating a temporary of the object\r\n * keys before iterating over them and like the `arrForEach` helper you CAN stop or break the iteration by returning -1 from the `callbackFn` function.\r\n * @group Object\r\n * @typeParam T - The object type\r\n * @param callbackfn A function that accepts up to two arguments, the key name and the current value of the property represented by the key.\r\n * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined\r\n * the object will be used as the this value.\r\n * @example\r\n * ```ts\r\n * function performAction(target: T, source: any) {\r\n * if (!isNullOrUndefined(source)) {\r\n * objForEachKey(source, (key, value) => {\r\n * // Set the target with a reference to the same value with the same name\r\n * target[key] = value;\r\n * });\r\n * }\r\n *\r\n * return target;\r\n * }\r\n * ```\r\n */\r\nexport function objForEachKey(theObject, callbackfn, thisArg) {\r\n if (theObject && isObject(theObject)) {\r\n for (var prop in theObject) {\r\n if (objHasOwn(theObject, prop)) {\r\n if (callbackfn.call(thisArg || theObject, prop, theObject[prop]) === -1) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=for_each_key.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\n/**\r\n * Throw an error exception with the specified optional message\r\n * @group Error\r\n * @param message\r\n */\r\nexport function throwError(message) {\r\n throw new Error(message);\r\n}\r\n/**\r\n * Throw a type error with the specified optional message\r\n * @group Error\r\n * @param message\r\n */\r\nexport function throwTypeError(message) {\r\n throw new TypeError(message);\r\n}\r\n/**\r\n * Throw a RangeError with the specified optional message\r\n * @group Error\r\n * @param message\r\n */\r\nexport function throwRangeError(message) {\r\n throw new RangeError(message);\r\n}\r\n//# sourceMappingURL=throw.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { NULL_VALUE, ObjClass, __PROTO__ } from \"../internal/constants\";\r\nimport { isArray, isObject } from \"../helpers/base\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { objForEachKey } from \"./for_each_key\";\r\nimport { polyObjEntries, polyObjValues } from \"../polyfills/object\";\r\nvar _objFreeze = ObjClass[\"freeze\"];\r\nvar _doNothing = function (value) { return value; };\r\nvar _getProto = function (value) { return value[__PROTO__] || NULL_VALUE; };\r\n/**\r\n * The `objAssign()` method copies all enumerable own properties from one or more source objects\r\n * to a target object. It returns the modified target object.\r\n *\r\n * Properties in the target object are overwritten by properties in the sources if they have the\r\n * same key. Later sources' properties overwrite earlier ones.\r\n *\r\n * The objAssign() method only copies enumerable and own properties from a source object to a\r\n * target object. It uses `Get` on the source and `Set` on the target, so it will invoke\r\n * [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) and\r\n * [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set).\r\n * Therefore it assigns properties, versus copying or defining new properties. This may make it\r\n * unsuitable for merging new properties into a prototype if the merge sources contain getters.\r\n *\r\n * For copying property definitions (including their enumerability) into prototypes, use\r\n * {@link objGetOwnPropertyDescriptor} and {@link objDefineProp} instead.\r\n *\r\n * Both String and Symbol properties are copied.\r\n *\r\n * In case of an error, for example if a property is non-writable, a TypeError is raised, and\r\n * the target object is changed if any properties are added before the error is raised.\r\n * @group Object\r\n * @example\r\n * ```ts\r\n * const obj = { a: 1 };\r\n * const copy = objAssign({}, obj);\r\n * console.log(copy); // { a: 1 }\r\n *\r\n * const o1 = { a: 1 };\r\n * const o2 = { b: 2 };\r\n * const o3 = { c: 3 };\r\n *\r\n * const obj = objAssign(o1, o2, o3);\r\n * console.log(obj); // { a: 1, b: 2, c: 3 }\r\n * console.log(o1); // { a: 1, b: 2, c: 3 }, target object itself is changed.\r\n * ```\r\n */\r\nexport var objAssign = ObjClass[\"assign\"];\r\n/**\r\n * The `objKeys()` method returns an array of a given object's own enumerable property names, iterated in\r\n * the same order that a normal loop would.\r\n *\r\n * objKeys() returns an array whose elements are strings corresponding to the enumerable properties found\r\n * directly upon object. The ordering of the properties is the same as that given by looping over the\r\n * properties of the object manually.\r\n * @group Object\r\n * @param value - The object to obtain a copy of the keys from\r\n * @returns An array of the properties names for the value object.\r\n * @example\r\n * ```ts\r\n * // simple array\r\n * const arr = ['a', 'b', 'c'];\r\n * console.log(objKeys(arr)); // console: ['0', '1', '2']\r\n *\r\n * // array-like object\r\n * const obj = { 0: 'a', 1: 'b', 2: 'c' };\r\n * console.log(objKeys(obj)); // console: ['0', '1', '2']\r\n *\r\n * // array-like object with random key ordering\r\n * const anObj = { 100: 'a', 2: 'b', 7: 'c' };\r\n * console.log(objKeys(anObj)); // console: ['2', '7', '100']\r\n *\r\n * // getFoo is a property which isn't enumerable\r\n * const myObj = objCreate({}, {\r\n * getFoo: {\r\n * value() { return this.foo; }\r\n * }\r\n * });\r\n * myObj.foo = 1;\r\n * console.log(objKeys(myObj)); // console: ['foo']\r\n * ```\r\n */\r\nexport function objKeys(value) {\r\n if (!isObject(value) || value === NULL_VALUE) {\r\n throwTypeError(\"objKeys called on non-object\");\r\n }\r\n return ObjClass.keys(value);\r\n}\r\n/**\r\n * Perform a deep freeze on the object and all of it's contained values / properties by recursively calling\r\n * `objFreeze()` on all enumerable properties of the object and on each property returned.\r\n * @group Object\r\n * @param value - the object to be completly frozen.\r\n * @returns The originally passed in object.\r\n */\r\nexport function objDeepFreeze(value) {\r\n if (_objFreeze) {\r\n objForEachKey(value, function (key, value) {\r\n if (isArray(value) || isObject(value)) {\r\n _objFreeze(value);\r\n }\r\n });\r\n }\r\n return objFreeze(value);\r\n}\r\n/**\r\n * The `objFreeze()` method freezes an object. A frozen object can no longer be changed; freezing an object\r\n * prevents new properties from being added to it, existing properties from being removed, prevents changing the\r\n * enumerability, configurability, or writability of existing properties, and prevents the values of existing\r\n * properties from being changed. In addition, freezing an object also prevents its prototype from being changed.\r\n * `objFreeze()` returns the same object that was passed in.\r\n *\r\n * Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail,\r\n * either silently or by throwing a TypeError exception (most commonly, but not exclusively, when in strict mode).\r\n *\r\n * For data properties of a frozen object, values cannot be changed, the writable and configurable attributes are\r\n * set to false. Accessor properties (getters and setters) work the same (and still give the illusion that you are\r\n * changing the value). Note that values that are objects can still be modified, unless they are also frozen. As\r\n * an object, an array can be frozen; after doing so, its elements cannot be altered and no elements can be added\r\n * to or removed from the array.\r\n *\r\n * `objFreeze()` returns the same object that was passed into the function. It does not create a frozen copy.\r\n * @group Object\r\n * @param value - The object to freeze.\r\n * @returns The object that was passed to the function.\r\n */\r\nexport var objFreeze = _objFreeze || _doNothing;\r\n/**\r\n * The `objSeal()` method seals an object, preventing new properties from being added to it and marking all\r\n * existing properties as non-configurable. Values of present properties can still be changed as long as they\r\n * are writable.\r\n * @group Object\r\n * @param value - The object which should be sealed.\r\n * @returns The object being sealed.\r\n */\r\nexport var objSeal = ObjClass[\"seal\"] || _doNothing;\r\n/**\r\n * The objGetPrototypeOf() method returns the prototype (i.e. the value of the internal `Prototype` property)\r\n * of the specified value.\r\n * @since 0.4.4\r\n * @group Object\r\n * @param value - The object whose prototype is to be returned, which may be null.\r\n */\r\nexport var objGetPrototypeOf = ObjClass[\"getPrototypeOf\"] || _getProto;\r\n/**\r\n * Returns an array of key/values of the enumerable properties of an object\r\n * @since 0.9.7\r\n * @group Object\r\n * @group ArrayLike\r\n * @param value Object that contains the properties and methods.\r\n * @example\r\n * ```ts\r\n * objEntries({ Hello: \"Darkness\", my: \"old\", friend: \".\" });\r\n * // [ [ \"Hello\", \"Darkness\" ], [ \"my\", \"old\"], [ \"friend\", \".\" ] ]\r\n *\r\n * // Array-like object\r\n * objEntries({ 0: \"a\", 1: \"b\", 2: \"c\" }));\r\n * // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ]\r\n *\r\n * // Array-like object with random key ordering\r\n * objEntries({ 100: \"a\", 2: \"b\", 7: \"c\" });\r\n * // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ]*\r\n * ```\r\n */\r\nexport var objEntries = ObjClass.entries || polyObjEntries;\r\n/**\r\n * The objValues() returns an array whose elements are values of enumerable string-keyed properties found\r\n * directly upon object. This is the same as iterating with a for...in loop, except that a for...in loop\r\n * enumerates properties in the prototype chain as well. The order of the array returned by objValues()\r\n * is the same as that provided by a for...in loop.\r\n *\r\n * If you need the property keys, use objKeys() instead. If you need both the property keys and values, use objEntries() instead.\r\n * @since 0.9.7\r\n * @group Object\r\n * @group ArrayLike\r\n * @param value - The object that contains the properties and methods.\r\n * @returns An array containing the given object's own enumerable string-keyed property values.\r\n * @example\r\n * ```ts\r\n * objValues({ Hello: \"Darkness\", my: \"old\", friend: \".\" });\r\n * // [ \"Darkness\", \"old\", \".\" ]\r\n *\r\n * // Array-like object\r\n * objValues({ 0: \"a\", 1: \"b\", 2: \"c\" }));\r\n * // [ 'a', 'b', 'c']\r\n *\r\n * // Array-like object with random key ordering\r\n * objValues({ 100: \"a\", 2: \"b\", 7: \"c\" });\r\n * // [ 'b', 'c', 'a']\r\n * ```\r\n */\r\nexport var objValues = ObjClass.values || polyObjValues;\r\n//# sourceMappingURL=object.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { objForEachKey } from \"../object/for_each_key\";\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal Helper function to create a key and value mapped representation of the values\r\n * @param values - The source values\r\n * @param keyType - Identifies the value to populate against the key\r\n * @param valueType - Identifies the value to populate against the value\r\n * @param completeFn - The function to call to complete the map (used to freeze the instance)\r\n * @returns\r\n */\r\nexport function _createKeyValueMap(values, keyType, valueType, completeFn) {\r\n var theMap = {};\r\n objForEachKey(values, function (key, value) {\r\n theMap[key] = keyType ? value : key;\r\n theMap[value] = valueType ? value : key;\r\n });\r\n return completeFn(theMap);\r\n}\r\n//# sourceMappingURL=map.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { createEnumKeyMap } from \"../helpers/enum\";\r\n/**\r\n * @ignore\r\n * @internal\r\n */\r\nexport var _wellKnownSymbolMap = createEnumKeyMap({\r\n asyncIterator: 0 /* WellKnownSymbols.asyncIterator */,\r\n hasInstance: 1 /* WellKnownSymbols.hasInstance */,\r\n isConcatSpreadable: 2 /* WellKnownSymbols.isConcatSpreadable */,\r\n iterator: 3 /* WellKnownSymbols.iterator */,\r\n match: 4 /* WellKnownSymbols.match */,\r\n matchAll: 5 /* WellKnownSymbols.matchAll */,\r\n replace: 6 /* WellKnownSymbols.replace */,\r\n search: 7 /* WellKnownSymbols.search */,\r\n species: 8 /* WellKnownSymbols.species */,\r\n split: 9 /* WellKnownSymbols.split */,\r\n toPrimitive: 10 /* WellKnownSymbols.toPrimitive */,\r\n toStringTag: 11 /* WellKnownSymbols.toStringTag */,\r\n unscopables: 12 /* WellKnownSymbols.unscopables */\r\n});\r\n//# sourceMappingURL=well_known.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { UNDEFINED } from \"./constants\";\r\nvar GLOBAL_CONFIG_KEY = \"__tsUtils$gblCfg\";\r\nvar _globalCfg;\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper to get the current global value\r\n * @returns\r\n */\r\nexport function _getGlobalValue() {\r\n var result;\r\n if (typeof globalThis !== UNDEFINED) {\r\n result = globalThis;\r\n }\r\n if (!result && typeof self !== UNDEFINED) {\r\n result = self;\r\n }\r\n if (!result && typeof window !== UNDEFINED) {\r\n result = window;\r\n }\r\n if (!result && typeof global !== UNDEFINED) {\r\n result = global;\r\n }\r\n return result;\r\n}\r\n/**\r\n * @internal\r\n * @ignore\r\n * Gets/Sets the named value from the global config store, this is used to share configuration across\r\n * multiple modules. Primarily used for poly symbol and test hooks.\r\n * @returns The globally registered value.\r\n */\r\nexport function _getGlobalConfig() {\r\n if (!_globalCfg) {\r\n var gbl = _getGlobalValue() || {};\r\n _globalCfg = gbl[GLOBAL_CONFIG_KEY] = gbl[GLOBAL_CONFIG_KEY] || {};\r\n }\r\n return _globalCfg;\r\n}\r\n//# sourceMappingURL=global.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { StrCls } from \"../internal/constants\";\r\n/**\r\n * The asString() method returns a string representing the value by\r\n * explicitly using `String(`value`)`.\r\n *\r\n * @since 0.4.3\r\n * @group String\r\n * @group Conversion\r\n * @group Value\r\n * @param value - The value to get a string representation of\r\n * @example\r\n * ```ts\r\n * const arr = [ 1, 2, 3];\r\n * asString(arr); // \"1,2,3\"\r\n * asString(null); // \"null\"\r\n * asString(undefined); // \"undefined\"\r\n * asString(42); // \"42\"\r\n * asString(Symbol.for(\"Hello\")); // \"Symbol(Hello)\"\r\n * ```\r\n */\r\nexport var asString = StrCls;\r\n//# sourceMappingURL=as_string.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { EMPTY, NULL_VALUE, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { isError, isNumber, objToString } from \"./base\";\r\n/**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n * @group Error\r\n * @group Diagnostic\r\n * @param object - The object to be converted to a diagnostic string value\r\n * @param format - Identifies whether the JSON value should be formated\r\n * - `true` - Format with 4 spaces\r\n * - 'number' - The number of spaces to format with\r\n * - `false` (or not Truthy) - Do not format\r\n */\r\nexport function dumpObj(object, format) {\r\n var propertyValueDump = EMPTY;\r\n if (isError(object)) {\r\n propertyValueDump = \"{ stack: '\" + object.stack + \"', message: '\" + object.message + \"', name: '\" + object.name + \"'\";\r\n }\r\n else {\r\n try {\r\n propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE);\r\n }\r\n catch (e) {\r\n // Unable to convert object (probably circular)\r\n propertyValueDump = \" - \" + dumpObj(e, format);\r\n }\r\n }\r\n return objToString(object) + \": \" + propertyValueDump;\r\n}\r\n//# sourceMappingURL=diagnostics.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { asString } from \"../string/as_string\";\r\nimport { ArrProto, SLICE } from \"./constants\";\r\nvar _arrSlice = ArrProto[SLICE];\r\nvar _throwMissingFunction = function (funcName, thisArg) {\r\n throwTypeError(\"'\" + asString(funcName) + \"' not defined for \" + dumpObj(thisArg));\r\n};\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to run the named function on the passed first argument, this does not support polyfill\r\n * or prototype fallback, so the function must exist on the provided first argument.\r\n * If the first argument is null, undefined or the function does not exist an exception will be thrown\r\n * by the runtime\r\n * @param funcName - The function name to call on the first argument passed to the wrapped function\r\n * @returns A function which will call the funcName against the first passed argument and pass on the remaining arguments\r\n */\r\nexport var _unwrapInstFunction = function (funcName) {\r\n return function (thisArg) {\r\n return thisArg[funcName].apply(thisArg, _arrSlice.call(arguments, 1));\r\n };\r\n};\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to convert an expanded function back into an instance `this` function call\r\n * @param funcName - The function name to call on the first argument passed to the wrapped function\r\n * @param clsProto - The Class or class prototype to fallback to if the instance doesn't have the function.\r\n * @returns A function which will call the funcName against the first passed argument and pass on the remaining arguments\r\n */\r\nexport var _unwrapFunction = function (funcName, clsProto) {\r\n var clsFn = clsProto && clsProto[funcName];\r\n return function (thisArg) {\r\n var theFunc = (thisArg && thisArg[funcName]) || clsFn;\r\n if (theFunc) {\r\n return theFunc.apply(thisArg, _arrSlice.call(arguments, 1));\r\n }\r\n _throwMissingFunction(funcName, thisArg);\r\n };\r\n};\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to convert an expanded function back into an instance `this` function call\r\n * @param funcName - The function name to call on the first argument passed to the wrapped function\r\n * @param clsProto - The Class or class prototype to fallback to if the instance doesn't have the function.\r\n * @param polyFunc - The function to call if not available on the thisArg, act like the polyfill\r\n * @returns A function which will call the funcName against the first passed argument and pass on the remaining arguments\r\n */\r\nexport var _unwrapFunctionWithPoly = function (funcName, clsProto, polyFunc) {\r\n var clsFn = clsProto && clsProto[funcName];\r\n return function (thisArg) {\r\n var theFunc = (thisArg && thisArg[funcName]) || clsFn;\r\n if (theFunc || polyFunc) {\r\n var theArgs = arguments;\r\n return (theFunc || polyFunc).apply(thisArg, theFunc ? _arrSlice.call(theArgs, 1) : theArgs);\r\n }\r\n _throwMissingFunction(funcName, thisArg);\r\n };\r\n};\r\n/**\r\n * @internal\r\n * @ignore\r\n * Internal helper to lookup and return the named property from the first argument (which becomes the this)\r\n *\r\n * @since 0.4.2\r\n * @typeParam T - The type of the object which contains the propName\r\n * @param propName - The property name\r\n * @returns The value of the property\r\n */\r\nexport function _unwrapProp(propName) {\r\n return function (thisArg) {\r\n return thisArg[propName];\r\n };\r\n}\r\n//# sourceMappingURL=unwrapFunction.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { _wellKnownSymbolMap } from \"../symbol/well_known\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { POLYFILL_TAG, SYMBOL } from \"../internal/constants\";\r\nimport { objHasOwn } from \"../object/has_own\";\r\nimport { asString } from \"../string/as_string\";\r\nimport { _getGlobalConfig } from \"../internal/global\";\r\nimport { strStartsWith } from \"../string/starts_with\";\r\nimport { objKeys } from \"../object/object\";\r\nvar UNIQUE_REGISTRY_ID = \"_urid\";\r\nvar _polySymbols;\r\nfunction _globalSymbolRegistry() {\r\n if (!_polySymbols) {\r\n var gblCfg = _getGlobalConfig();\r\n _polySymbols = gblCfg.gblSym = gblCfg.gblSym || { k: {}, s: {} };\r\n }\r\n return _polySymbols;\r\n}\r\nvar _wellKnownSymbolCache = {};\r\n/**\r\n * Returns a new (polyfill) Symbol object for the provided description that's guaranteed to be unique.\r\n * Symbols are often used to add unique property keys to an object that won't collide with keys any\r\n * other code might add to the object, and which are hidden from any mechanisms other code will\r\n * typically use to access the object. That enables a form of weak encapsulation, or a weak form of\r\n * information hiding.\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param description - The description of the symbol\r\n * @returns A new polyfill version of a Symbol object\r\n */\r\nexport function polyNewSymbol(description) {\r\n var theSymbol = {\r\n description: asString(description),\r\n toString: function () { return SYMBOL + \"(\" + description + \")\"; }\r\n };\r\n // Tag the symbol so we know it a polyfill\r\n theSymbol[POLYFILL_TAG] = true;\r\n return theSymbol;\r\n}\r\n/**\r\n * Returns a Symbol object from the global symbol registry matching the given key if found.\r\n * Otherwise, returns a new symbol with this key.\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param key key to search for.\r\n */\r\nexport function polySymbolFor(key) {\r\n var registry = _globalSymbolRegistry();\r\n if (!objHasOwn(registry.k, key)) {\r\n var newSymbol_1 = polyNewSymbol(key);\r\n var regId_1 = objKeys(registry.s).length;\r\n newSymbol_1[UNIQUE_REGISTRY_ID] = function () { return regId_1 + \"_\" + newSymbol_1.toString(); };\r\n registry.k[key] = newSymbol_1;\r\n registry.s[newSymbol_1[UNIQUE_REGISTRY_ID]()] = asString(key);\r\n }\r\n return registry.k[key];\r\n}\r\n/**\r\n * Returns a key from the global symbol registry matching the given Symbol if found.\r\n * Otherwise, returns a undefined.\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param sym Symbol to find the key for.\r\n */\r\nexport function polySymbolKeyFor(sym) {\r\n if (!sym || !sym.toString || !strStartsWith(sym.toString(), SYMBOL)) {\r\n throwTypeError(sym + \" is not a symbol\");\r\n }\r\n var regId = sym[POLYFILL_TAG] && sym[UNIQUE_REGISTRY_ID] && sym[UNIQUE_REGISTRY_ID]();\r\n return regId ? _globalSymbolRegistry().s[regId] : undefined;\r\n}\r\n/**\r\n * Returns the polyfill version of a well-known global symbol, this will only return\r\n * known values.\r\n * @example\r\n * ```ts\r\n * // Always returns the polyfill version, even if Symbols are supported in the runtime\r\n * polyGetKnownSymbol(\"toStringTag\") === polyGetKnownSymbol(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) === polyGetKnownSymbol(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(\"toStringTag\") !== Symbol.toStringTag; // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== Symbol.toStringTag; // true\r\n * polyGetKnownSymbol(\"toStringTag\") !== polySymbolFor(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== polySymbolFor(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(\"toStringTag\") !== polyNewSymbol(\"toStringTag\"); // true\r\n * polyGetKnownSymbol(WellKnownSymbols.toStringTag) !== polyNewSymbol(\"toStringTag\"); // true\r\n * ```\r\n * @group Polyfill\r\n * @group Symbol\r\n * @param name - The property name to return (if it exists) for Symbol\r\n * @returns The value of the property if present\r\n */\r\nexport function polyGetKnownSymbol(name) {\r\n var result;\r\n var knownName = _wellKnownSymbolMap[name];\r\n if (knownName) {\r\n result = _wellKnownSymbolCache[knownName] = _wellKnownSymbolCache[knownName] || polyNewSymbol(SYMBOL + \".\" + knownName);\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=symbol.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { MathCls } from \"../internal/constants\";\r\n/**\r\n * The mathMin() function returns the lowest-valued number passed into it, or NaN if any\r\n * parameter isn't a number and can't be converted into one.\r\n *\r\n * If no arguments are given, the result is Infinity.\r\n *\r\n * If at least one of arguments cannot be converted to a number, the result is NaN.\r\n *\r\n * @since 0.4.2\r\n * @group Math\r\n * @param values - Zero or more numbers among which the lowest value will be selected and returned.\r\n * @returns The smallest of the given numbers. If any one or more of the parameters cannot\r\n * be converted into a number, NaN is returned. The result is Infinity if no parameters are provided.\r\n * @example\r\n * ```ts\r\n * const x = 10, y = -20;\r\n * const z = Math.min(x, y); // -20\r\n * ```\r\n */\r\nexport var mathMin = MathCls.min;\r\n/**\r\n * The `mathMax()` function returns the largest of the zero or more numbers given as input\r\n * parameters, or NaN if any parameter isn't a number and can't be converted into one.\r\n *\r\n * If no arguments are given, the result is -Infinity.\r\n *\r\n * If at least one of arguments cannot be converted to a number, the result is NaN.\r\n *\r\n * @since 0.4.2\r\n * @group Math\r\n * @param values - Zero or more numbers among which the largest value will be selected and returned.\r\n * @returns The largest of the given numbers. If any one or more of the parameters cannot be\r\n * converted into a number, NaN is returned. The result is -Infinity if no parameters are provided.\r\n * @example\r\n * ```ts\r\n * mathMax(10, 20); // 20\r\n * mathMax(-10, -20); // -10\r\n * mathMax(-10, 20); // 20\r\n * ```\r\n */\r\nexport var mathMax = MathCls.max;\r\n//# sourceMappingURL=min_max.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { SLICE, StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n/**\r\n * The `strSlice()` method extracts a section of a string and returns it as a new string, without\r\n * modifying the original string.\r\n * `strSlice()` extracts the text from one string and returns a new string. Changes to the text in one\r\n * string do not affect the other string.\r\n * `strSlice()` extracts up to but not including endIndex. str.slice(1, 4) extracts the second character\r\n * through the fourth character (characters indexed 1, 2, and 3).\r\n * As an example, strSlice(2, -1) extracts the third character through the second to last character\r\n * in the string.\r\n * @group String\r\n * @param value - The value to haveextract a number\r\n * @param beginIndex - The zero-based index at which to begin extraction.\r\n * If `beginIndex` is negative, `strSlice()` begins extraction from `value.length + beginIndex`.\r\n * (E.g. `strSlice(\"test\", -2)` returns \"st\")\r\n * If `beginIndex` is omitted, undefined, or cannot be converted to a number (using Number(`beginIndex`)),\r\n * strSlice() begins extraction from the beginning of the string. (E.g. `strSlice(\"test\")` returns \"test\")\r\n * If `beginIndex` is greater than or equal to `value.length`, an empty string is returned.\r\n * (E.g. `strSlice(\"test\", 4)` returns \"\")\r\n * @param endIndex - The index of the first character to exclude from the returned substring.\r\n * If `endIndex` is omitted, undefined, or cannot be converted to a number (using Number(`endIndex`))\r\n * strSlice() extracts to the end of the string. (E.g. `strSlice(\"test\", 2)` returns \"st\")\r\n * If `endIndex` is greater than `value.length`, strSlice() also extracts to the end of the string.\r\n * (E.g. strSlice(\"test\", 2, 10)` returns \"st\")\r\n * If `endIndex` is negative, `strSlice()` treats it as `value.length + endIndex`. (E.g, if `endIndex`\r\n * is -2, it is treated as `value.length - 2` and `strSlice(\"test\", 1, -2)` returns \"e\") .\r\n * If `endIndex` represents a position that is before the one represented by startIndex, `strSlice()`\r\n * returns \"\". (E.g `strSlice(\"test\", 2, -10)`, strSlice(\"test\", -1, -2)` or `strSlice(\"test\", 3, 2)`).\r\n * @returns A new string containing the extracted section of the string.\r\n */\r\nexport var strSlice = _unwrapFunction(SLICE, StrProto);\r\n//# sourceMappingURL=slice.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { isNullOrUndefined, isUndefined } from \"../helpers/base\";\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nimport { throwTypeError } from \"../helpers/throw\";\r\nimport { EMPTY, LENGTH, StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction, _unwrapFunctionWithPoly } from \"../internal/unwrapFunction\";\r\nimport { mathMax } from \"../math/min_max\";\r\nimport { strSlice } from \"./slice\";\r\n/**\r\n * The `strSubstring()` method returns the part of the string between the start and end indexes, or to the end of the string.\r\n *\r\n * `strSubstring()` extracts characters from indexStart up to but not including indexEnd. In particular:\r\n * - If `indexEnd` is omitted, strSubstring() extracts characters to the end of the string.\r\n * - If `indexStart` is equal to indexEnd, strSubstring() returns an empty string.\r\n * - If `indexStart` is greater than indexEnd, then the effect of strSubstring() is as if the two arguments were swapped; see example below.\r\n *\r\n * Any argument value that is less than 0 or greater than `value.length` is treated as if it were 0 and `value.length`, respectively.\r\n *\r\n * Any argument value that is NaN is treated as if it were 0.\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param indexStart - The index of the first character to include in the returned substring.\r\n * @param indexEnd - The index of the first character to exclude from the returned substring.\r\n * @return A new string containing the specified part of the given string\r\n * @example\r\n * ```ts\r\n * const anyString = 'Nevware21';\r\n * // Displays 'N'\r\n * console.log(strSubstring(anyString, 0, 1));\r\n * console.log(strSubstring(anyString, 1, 0));\r\n *\r\n * // Displays 'Nevwar'\r\n * console.log(strSubstring(anyString, 0, 6));\r\n *\r\n * // Displays 'are21'\r\n * console.log(strSubstring(anyString, 4));\r\n *\r\n * // Displays 'are'\r\n * console.log(strSubstring(anyString, 4, 7));\r\n *\r\n * // Displays '21'\r\n * console.log(strSubstring(anyString, 7, 4));\r\n *\r\n * // Displays 'Nevware'\r\n * console.log(strSubstring(anyString, 0, 7));\r\n *\r\n * // Displays 'Nevware21'\r\n * console.log(strSubstring(anyString, 0, 10));\r\n * ```\r\n */\r\nexport var strSubstring = _unwrapFunction(\"substring\", StrProto);\r\n/**\r\n * The strSubstr() method returns a portion of the string, starting at the specified index and extending for a given\r\n * number of characters afterwards.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param start - The index of the first character to include in the returned substring.\r\n * @param length - The number of characters to extract.\r\n * @returns A new string containing the specified part of the given string.\r\n */\r\nexport var strSubstr = _unwrapFunctionWithPoly(\"substr\", StrProto, polyStrSubstr);\r\n/**\r\n * The polyStrSubstr() method returns a portion of the string, starting at the specified index and extending for a given\r\n * number of characters afterwards.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @group Polyfill\r\n * @param value - The string value to return the substring from.\r\n * @param start - The index of the first character to include in the returned substring.\r\n * @param length - The number of characters to extract.\r\n * @returns A new string containing the specified part of the given string.\r\n */\r\nexport function polyStrSubstr(value, start, length) {\r\n if (isNullOrUndefined(value)) {\r\n throwTypeError(\"'polyStrSubstr called with invalid \" + dumpObj(value));\r\n }\r\n if (length < 0) {\r\n return EMPTY;\r\n }\r\n // If start is omitted or undefined, its treated as zero\r\n start = start || 0;\r\n if (start < 0) {\r\n start = mathMax(start + value[LENGTH], 0);\r\n }\r\n if (isUndefined(length)) {\r\n return strSlice(value, start);\r\n }\r\n return strSlice(value, start, start + length);\r\n}\r\n/**\r\n * Returns a substring of the string starting from the left.\r\n *\r\n * `strLeft()` extracts the number of characters from left of the string up to the count. In particular:\r\n * - If `count` is less than zero, strLeft() returns an empty string.\r\n * - If `count` is less than `value.length', strLeft() returns a new string with the `count` number of characters from the left of the string.\r\n * - If `count` is greater than `value.length`, then the value original value is returned.\r\n *\r\n * Any argument value that is NaN is treated as if it were 0.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param count - The number of characters to extract\r\n * @returns The substring based on the count number of characters from the right\r\n * @example\r\n * ```ts\r\n * strLeft(\"Nevware21\", -1); // \"\"\r\n * strLeft(\"Nevware21\", 0); // \"\"\r\n * strLeft(\"Nevware21\", 1); // \"N\"\r\n * strLeft(\"Nevware21\", 3); // \"Nev\"\r\n * strLeft(\"Nevware21\", 21); // \"Nevware21\"\r\n * ```\r\n */\r\nexport function strLeft(value, count) {\r\n return strSubstring(value, 0, count);\r\n}\r\n/**\r\n * Returns a substring of the string starting from the right.\r\n *\r\n * `strRight()` extracts the number of characters from right of the string up to the count. In particular:\r\n * - If `count` is less than zero, strRight() returns an empty string.\r\n * - If `count` is less than `value.length', strRight() returns a new string with the `count` number of characters from the right of the string.\r\n * - If `count` is greater than `value.length`, then the value original value is returned.\r\n *\r\n * Any argument value that is NaN is treated as if it were 0.\r\n *\r\n * @since 0.4.2\r\n * @group String\r\n * @param value - The string value to return the substring from.\r\n * @param count - The number of characters to extract\r\n * @returns The substring based on the count number of characters from the right\r\n * @example\r\n * ```ts\r\n * strRight(\"Nevware21\", -1); // \"\"\r\n * strRight(\"Nevware21\", 0); // \"\"\r\n * strRight(\"Nevware21\", 1); // \"1\"\r\n * strRight(\"Nevware21\", 3); // \"e21\"\r\n * strRight(\"Nevware21\", 21); // \"Nevware21\"\r\n * ```\r\n */\r\nexport function strRight(value, count) {\r\n var len = value[LENGTH];\r\n if (count <= 0) {\r\n return EMPTY;\r\n }\r\n return len > count ? strSubstring(value, len - count) : value;\r\n}\r\n//# sourceMappingURL=substring.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { ObjClass, VALUE } from \"../internal/constants\";\r\nimport { isFunction, isUndefined } from \"../helpers/base\";\r\nimport { objForEachKey } from \"./for_each_key\";\r\nimport { objGetOwnPropertyDescriptor } from \"./get_own_prop_desc\";\r\n/**\r\n * @internal\r\n * @ignore\r\n * Mapping from ObjDefinePropDescriptor key to PropertyDescriptor key\r\n */\r\nvar propMap = {\r\n e: \"enumerable\",\r\n c: \"configurable\",\r\n v: VALUE,\r\n w: \"writable\",\r\n g: \"get\",\r\n s: \"set\"\r\n};\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper to convert ObjDefinePropDescriptor into PropertyDescriptor\r\n * @param value - The prop descriptor to convert\r\n * @returns\r\n */\r\nfunction _createProp(value) {\r\n var prop = {};\r\n prop[propMap[\"c\"]] = true;\r\n prop[propMap[\"e\"]] = true;\r\n if (value.l) {\r\n // Asign a getter function to return the value when requested\r\n prop.get = function () { return value.l.v; };\r\n // If it has a setter then expose it as well\r\n var desc = objGetOwnPropertyDescriptor(value.l, \"v\");\r\n if (desc && desc.set) {\r\n prop.set = function (newValue) {\r\n value.l.v = newValue;\r\n };\r\n }\r\n }\r\n objForEachKey(value, function (key, value) {\r\n prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;\r\n });\r\n return prop;\r\n}\r\n/**\r\n * Defines a new property directly on an object, or modifies an existing property on an object, and returns the object.\r\n * This is a wrapper for [Object.defineProperty](https://developer.mozilla.org/en-US/docs/web/javascript/reference/global_objects/object/defineproperty)\r\n *\r\n * This method allows a precise addition to or modification of a property on an object. Normal property addition through\r\n * assignment creates properties which show up during property enumeration (for...in loop or objKeys method), whose\r\n * values may be changed, and which may be deleted. This method allows these extra details to be changed from their\r\n * defaults. By default, properties added using objDefineProp() are not writable, not enumerable, and not configurable.\r\n *\r\n * Property descriptors present in objects come in two main flavors: data descriptors and accessor descriptors. A data\r\n * descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property\r\n * described by a getter-setter pair of functions. A descriptor must be one of these two flavors; it cannot be both.\r\n *\r\n * This is an alias for Object.defineProperty\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param key - The name or Symbol of the property to be defined or modified.\r\n * @param descriptor - The descriptor for the property being defined or modified.\r\n */\r\nexport var objDefineProp = ObjClass[\"defineProperty\"];\r\n/**\r\n * The objDefineProperties() method defines new or modifies existing properties directly on an object, returning the object.\r\n * This is a wrapper for [Object.defineProperties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties)\r\n * @since 0.6.0\r\n * @group Object\r\n * @param target - The object on which to define or modify properties.\r\n * @param props - An object whose keys represent the names of properties to be defined or modified and whose values are\r\n * objects describing those properties. Each value in props must be either a data descriptor or an accessor descriptor;\r\n * it cannot be both (see {@link ObjDefinePropDescriptorMap} for more details).\r\n * @returns\r\n */\r\nexport var objDefineProperties = ObjClass[\"defineProperties\"];\r\n/**\r\n * Try to define a get object property accessor for the target object, if a function is past as the value this will\r\n * be assumed to be a getter function and NOT the value.\r\n * @deprecated It is recommended that you use {@link objDefine} instead {@link objDefineGet} or {@link objDefineAccessors}\r\n * as it provides a deterministic way for identifying whether the value is a value or a function rather than wrapping any\r\n * function value in another function.\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param key - The name of the property to be defined or modified\r\n * @param value - The value or a function that returns the value\r\n * @param configurable - Can the value be changed, defaults to true.\r\n * @param enumerable - Should this get property be enumerable, defaults to true.\r\n * @returns The object that was passed to the function\r\n */\r\nexport function objDefineGet(target, key, value, configurable, enumerable) {\r\n var _a;\r\n return objDefineProp(target, key, _createProp((_a = {\r\n e: enumerable,\r\n c: configurable\r\n },\r\n _a[isFunction(value) ? \"g\" : \"v\"] = value,\r\n _a)));\r\n}\r\n/**\r\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with\r\n * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded\r\n * and executed in an ES3 container, providing basic IE8 compatibility.\r\n * @deprecated It is recommended that you use {@link objDefine} instead {@link objDefineAccessors} as this internally creates\r\n * the {@link ObjDefinePropDescriptor} definition based on your provided arguments. And only using a minimum set of functions\r\n * reduces your overall bundle size.\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param prop - The name of the property to be defined or modified.\r\n * @param getProp - The getter function to wire against the getter.\r\n * @param setProp - The setter function to wire against the setter.\r\n * @param configurable - Can the value be changed, defaults to true\r\n * @param enumerable - Should this get property be enumerable, defaults to true.\r\n * @returns The object that was passed to the function\r\n */\r\nexport function objDefineAccessors(target, prop, getProp, setProp, configurable, enumerable) {\r\n var desc = {\r\n e: enumerable,\r\n c: configurable\r\n };\r\n if (getProp) {\r\n desc.g = getProp;\r\n }\r\n if (setProp) {\r\n desc.s = setProp;\r\n }\r\n return objDefineProp(target, prop, _createProp(desc));\r\n}\r\n/**\r\n * The objDefine() method defines a new or modifies an existing single property accessors for the target object based\r\n * on the configuration defined for the propDesc argument of type {@link ObjDefinePropDescriptor}. This will call\r\n * {@link objDefineProp} after creating the required PropertyDescriptor populating defaults for the propDesc values.\r\n * Note, the default values (true) for `configurable` and `enumerable` are different from the defaults provided by objDefineProp.\r\n * @since 0.6.0\r\n * @group Object\r\n * @param target - The object on which to define the property.\r\n * @param key - The name of the property to be defined or modified\r\n * @param propDesc - An object which defines the Property Descriptor mappings for the mapping.\r\n * @returns The target object.\r\n */\r\nexport function objDefine(target, key, propDesc) {\r\n return objDefineProp(target, key, _createProp(propDesc));\r\n}\r\n/**\r\n * The objDefineProps() method defines new or modifies existing properties directly for the target object using the keys\r\n * and configuration from the propDescMap argument. This will call {@link objDefineProperties} after creating the required\r\n * PropertyDescriptorMap from the propDescMap values.\r\n * Note, the default values (true) for `configurable` and `enumerable` are different from the defaults provided by objDefineProperties.\r\n * @since 0.6.0\r\n * @group Object\r\n * @param target - The object on which to define or modify properties.\r\n * @param propDescMap - An object whose keys represent the names of properties to be defined or modified and whose values are\r\n * objects describing those properties. Each value in props must be either a data descriptor or an accessor descriptor;\r\n * it cannot be both (see {@link ObjDefinePropDescriptorMap} for more details).\r\n * @returns The target object.\r\n */\r\nexport function objDefineProps(target, propDescMap) {\r\n var props = {};\r\n objForEachKey(propDescMap, function (key, value) {\r\n props[key] = _createProp(value);\r\n });\r\n return objDefineProperties(target, props);\r\n}\r\n//# sourceMappingURL=define.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { NULL_VALUE } from \"../internal/constants\";\r\nimport { _getGlobalConfig } from \"../internal/global\";\r\nimport { objDefineProp } from \"../object/define\";\r\n/**\r\n * @internal\r\n * Internal flag which is set by the public {@link setBypassLazyCache}, should not be externally exported\r\n */\r\nexport var _globalLazyTestHooks;\r\nvar _fetchLazyTestHooks = function () {\r\n _globalLazyTestHooks = _getGlobalConfig();\r\n _fetchLazyTestHooks = NULL_VALUE;\r\n};\r\n/**\r\n * Create and return an readonly {@link ILazyValue} instance which will cache and return the value returned\r\n * by the callback function. The callback function will only be called once, multiple access of the value\r\n * does not cause re-execution of the callback as the result from the first call is cached internally.\r\n * @since 0.4.5\r\n * @group Lazy\r\n * @param cb - The callback function to fetch the value to be lazily evaluated and cached\r\n * @returns A new readonly {@link ILazyValue} instance which wraps the callback and will be used to cache\r\n * the result of the callback\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * let cachedValue = getLazy(() => callSomeExpensiveFunction());\r\n * let theValue;\r\n *\r\n * // Just checking if there is an object still does not cause the evaluation\r\n * if (cachedValue) {\r\n * // This will cause the evaluation to occur and the result will be cached\r\n * theValue = cachedValue.v;\r\n * }\r\n *\r\n * // Accessing the value again will not cause the re-evaluation to occur, it will just return the same\r\n * // result value again.\r\n * theValue === cachedValue.v; // true\r\n *\r\n * ```\r\n */\r\nexport function getLazy(cb) {\r\n var lazyValue = {};\r\n _fetchLazyTestHooks && _fetchLazyTestHooks();\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n objDefineProp(lazyValue, \"v\", {\r\n configurable: true,\r\n get: function () {\r\n var result = cb();\r\n if (!_globalLazyTestHooks.lzy) {\r\n // Just replace the value\r\n objDefineProp(lazyValue, \"v\", {\r\n value: result\r\n });\r\n if (lazyValue.b) {\r\n delete lazyValue.b;\r\n }\r\n }\r\n if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) {\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n }\r\n return result;\r\n }\r\n });\r\n return lazyValue;\r\n}\r\n/**\r\n * Test Hook function used to cause the internal caching of objects to be bypassed, this should never\r\n * be enabled for production as it has additional performance impact caused by the repetitive creation\r\n * of the lazy wrappers.\r\n * @group Lazy\r\n * @since 0.5.0\r\n * @param newValue - When `true` will cause all new lazy implementations to bypass the cached lookup.\r\n */\r\nexport function setBypassLazyCache(newValue) {\r\n _fetchLazyTestHooks && _fetchLazyTestHooks();\r\n _globalLazyTestHooks.lzy = newValue;\r\n}\r\n/**\r\n * Create and return a writable {@link ILazyValue} instance which will cache and return the value returned\r\n * by the callback function. The callback function will only be called once, multiple access of the value\r\n * does not cause re-execution of the callback as the result from the first call is cached internally. The\r\n * value may be set as many times as required, if the callback has not been called when you set the value\r\n * it will never get called.\r\n * @since 0.9.4\r\n * @group Lazy\r\n * @param cb - The callback function to fetch the value to be lazily evaluated and cached\r\n * @returns A new writable {@link ILazyValue} instance which wraps the callback and will be used to cache\r\n * the result of the callback\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * let cachedValue = getWritableLazy(() => callSomeExpensiveFunction());\r\n * let theValue;\r\n *\r\n * // Just checking if there is an object still does not cause the evaluation\r\n * if (cachedValue) {\r\n * // This will cause the evaluation to occur and the result will be cached\r\n * theValue = cachedValue.v;\r\n * }\r\n *\r\n * // Accessing the value again will not cause the re-evaluation to occur, it will just return the same\r\n * // result value again.\r\n * theValue === cachedValue.v; // true\r\n *\r\n * // Setting the value\r\n * let cachedValue = getWritableLazy(() => callSomeExpensiveFunction());\r\n * let theValue = \"new Value\";\r\n *\r\n * // Just checking if there is an object still does not cause the evaluation\r\n * if (cachedValue) {\r\n * // This will set the value to be set explicitly and the callback\r\n * // will now never occur and the result will be cached\r\n * cachedValue.v = theValue;\r\n * }\r\n *\r\n * // Accessing the value again will cause the previously set value to be returned.\r\n * theValue === cachedValue.v; // true\r\n * ```\r\n */\r\nexport function getWritableLazy(cb) {\r\n var lazyValue = {};\r\n _fetchLazyTestHooks && _fetchLazyTestHooks();\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n var _setValue = function (newValue) {\r\n // Just replace the value\r\n objDefineProp(lazyValue, \"v\", {\r\n value: newValue,\r\n writable: true\r\n });\r\n if (lazyValue.b) {\r\n delete lazyValue.b;\r\n }\r\n };\r\n objDefineProp(lazyValue, \"v\", {\r\n configurable: true,\r\n get: function () {\r\n var result = cb();\r\n if (!_globalLazyTestHooks.lzy) {\r\n // Just replace the value\r\n _setValue(result);\r\n }\r\n if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) {\r\n lazyValue.b = _globalLazyTestHooks.lzy;\r\n }\r\n return result;\r\n },\r\n set: _setValue\r\n });\r\n return lazyValue;\r\n}\r\n//# sourceMappingURL=lazy.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { getLazy } from \"./lazy\";\r\nimport { safeGet } from \"./safe_get\";\r\n/**\r\n * Create and return an readonly {@link ILazyValue} instance which will cache and return the value returned\r\n * by the callback function. The callback function will only be called once, multiple access of the value\r\n * does not cause re-execution of the callback as the result from the first call is cached internally.\r\n * If the callback throws the default value will be returned.\r\n * @since 0.9.5\r\n * @group Lazy\r\n * @group Safe\r\n * @param cb - The callback function to fetch the value to be lazily evaluated and cached\r\n * @param defValue - The default value to return when an exception is thrown\r\n * @returns A new readonly {@link ILazyValue} instance which wraps the callback and will be used to cache\r\n * the result of the callback\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * let cachedValue = safeGetLazy(() => callSomeExpensiveFunctionWhichMightThrow(), \"someDefaultValue\");\r\n * let theValue;\r\n *\r\n * // Just checking if there is an object still does not cause the evaluation\r\n * if (cachedValue) {\r\n * // This will cause the evaluation to occur and the result will be cached\r\n * theValue = cachedValue.v;\r\n * }\r\n *\r\n * // Accessing the value again will not cause the re-evaluation to occur, it will just return the same\r\n * // result value again.\r\n * theValue === cachedValue.v; // true\r\n *\r\n * ```\r\n */\r\nexport function safeGetLazy(cb, defValue) {\r\n return getLazy(function () { return safeGet(cb, defValue); });\r\n}\r\n//# sourceMappingURL=safe_lazy.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\n/**\r\n * Function to safely execute a callback function, if the function throws the provided default\r\n * value will be returned.\r\n * @since 0.9.5\r\n * @group Safe\r\n * @param cb - Callback function be wrapped with an exception\r\n * @param defValue - The default value to return when an exception is thrown\r\n * @returns The result of the callback function or the default if an exception occurred calling the callback\r\n * function.\r\n * @example\r\n * ```ts\r\n * let theExpression = \"{ invalid: json value\";\r\n *\r\n * let result = safeGet(() => {\r\n * return JSON.parse(theExpression);\r\n * }, {});\r\n *\r\n * // result === {};\r\n * ```\r\n */\r\nexport function safeGet(cb, defValue) {\r\n var result = defValue;\r\n try {\r\n result = cb();\r\n }\r\n catch (e) {\r\n // Do nothing\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=safe_get.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { NULL_VALUE, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { _getGlobalValue } from \"../internal/global\";\r\nimport { safeGetLazy } from \"./safe_lazy\";\r\nimport { _globalLazyTestHooks } from \"./lazy\";\r\nvar WINDOW = \"window\";\r\nvar _cachedGlobal;\r\nvar _cachedWindow;\r\nvar _cachedDocument;\r\nvar _cachedNavigator;\r\nvar _cachedHistory;\r\nvar _isWebWorker;\r\nvar _isNode;\r\n/**\r\n * Create and return an readonly {@link ILazyValue} instance which will cache and return the named global\r\n * value if available, will return `null` if the named global object is not available or if the runtime\r\n * throws an exception when attempting to access the global object.\r\n * Unlike {@link getInst} the value is cached after the first access, so if the global value changes after\r\n * the initial fetch the original cached value is still returned.\r\n * @since 0.9.5\r\n * @group Environment\r\n * @group Lazy\r\n * @group Safe\r\n * @param name The name of the global object to get.\r\n * @returns A new readonly {@link ILazyValue} instance which will lazily attempt to return the globally\r\n * available named instance.\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * window.myGlobal = \"Hello\";\r\n * let cachedValue = lazySafeGetInst(\"myGlobal\");\r\n * // cachedValue.v === \"Hello\"\r\n *\r\n * window.myGlobal = \"Darkness\";\r\n * // cachedValue.v === \"Hello\"\r\n *\r\n * let promiseCls = lazySafeGetInst(\"Promise\");\r\n * // null if Promise is not supported in the runtime\r\n * // otherwise the Promise class.\r\n * ```\r\n */\r\nexport var lazySafeGetInst = function (name) { return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE); };\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions. And this caches the lookup of the global as in some environments\r\n * this can be an expensive operation.\r\n * @group Environment\r\n * @param useCached - [Optional] used for testing to bypass the cached lookup, when `true` this will\r\n * cause the cached global to be reset.\r\n */\r\nexport var getGlobal = function (useCached) {\r\n (!_cachedGlobal || useCached === false || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE));\r\n return _cachedGlobal.v;\r\n};\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @group Environment\r\n * @param name The globally named object\r\n * @param useCached - [Optional] used for testing to bypass the cached lookup, when `true` this will\r\n * cause the cached global to be reset.\r\n * @example\r\n * ```ts\r\n * // This does not cause the evaluation to occur\r\n * window.myGlobal = \"Hello\";\r\n * let cachedValue = getInst(\"myGlobal\");\r\n * // cachedValue === \"Hello\"\r\n *\r\n * window.myGlobal = \"Darkness\";\r\n * // getInst(\"myGlobal\") === \"Darkness\"\r\n *\r\n * let promiseCls = getInst(\"Promise\");\r\n * // May throw if the global is not supported by the runtime\r\n * // otherwise the Promise class.\r\n * ```\r\n */\r\nexport var getInst = function (name, useCached) {\r\n var gbl = (!_cachedGlobal || useCached === false) ? getGlobal(useCached) : _cachedGlobal.v;\r\n if (gbl && gbl[name]) {\r\n return gbl[name];\r\n }\r\n // Test workaround, for environments where .window (when global == window) doesn't return the base window\r\n if (name === WINDOW && _cachedWindow) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return _cachedWindow.v;\r\n }\r\n return NULL_VALUE;\r\n};\r\n/**\r\n * Identify whether the runtime contains a `document` object\r\n * @group Environment\r\n * @returns - True if a `document` exists\r\n */\r\nexport var hasDocument = function () { return !!getDocument(); };\r\n/**\r\n * Return the global `document` instance.\r\n * @group Environment\r\n * @returns\r\n */\r\nexport var getDocument = function () {\r\n (!_cachedDocument || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst(\"document\"));\r\n return _cachedDocument.v;\r\n};\r\n/**\r\n * Identify whether the runtime contains a `window` object\r\n * @group Environment\r\n * @returns\r\n */\r\nexport var hasWindow = function () { return !!getWindow(); };\r\n/**\r\n * Return the global `window` instance.\r\n * @group Environment\r\n * @returns\r\n */\r\nexport var getWindow = function () {\r\n (!_cachedWindow || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW));\r\n return _cachedWindow.v;\r\n};\r\n/**\r\n * Identify whether the runtimne contains a `navigator` object\r\n * @group Environment\r\n * @returns\r\n */\r\nexport var hasNavigator = function () { return !!getNavigator(); };\r\n/**\r\n * Returns the global `navigator` instance\r\n * @group Environment\r\n * @returns\r\n */\r\nexport var getNavigator = function () {\r\n (!_cachedNavigator || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst(\"navigator\"));\r\n return _cachedNavigator.v;\r\n};\r\n/**\r\n * Identifies whether the runtime contains a `history` object\r\n * @group Environment\r\n * @returns\r\n */\r\nexport var hasHistory = function () { return !!getHistory(); };\r\n/**\r\n * Returns the global `history` instance\r\n * @group Environment\r\n * @returns\r\n */\r\nexport var getHistory = function () {\r\n (!_cachedHistory || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedHistory.b)) && (_cachedHistory = lazySafeGetInst(\"history\"));\r\n return _cachedHistory.v;\r\n};\r\n/**\r\n * Simple method to determine if we are running in a node environment\r\n * @group Environment\r\n * @returns True if you are\r\n */\r\nexport var isNode = function () {\r\n !_isNode && (_isNode = safeGetLazy(function () { return !!(process && (process.versions || {}).node); }, false));\r\n return _isNode.v;\r\n};\r\n/**\r\n * Helper to identify if you are running as a Dedicated, Shared or Service worker\r\n * @group Environment\r\n * @returns True if the environment you are in looks like a Web Worker\r\n */\r\nexport var isWebWorker = function () {\r\n !_isWebWorker && (_isWebWorker = safeGetLazy(function () { return !!(self && self instanceof WorkerGlobalScope); }, false));\r\n return _isWebWorker.v;\r\n};\r\n//# sourceMappingURL=environment.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { NULL_VALUE, SYMBOL, UNDEF_VALUE } from \"../internal/constants\";\r\nimport { polyGetKnownSymbol, polyNewSymbol, polySymbolFor, polySymbolKeyFor } from \"../polyfills/symbol\";\r\nimport { _wellKnownSymbolMap } from \"./well_known\";\r\nimport { _createIs } from \"../helpers/base\";\r\nimport { _globalLazyTestHooks } from \"../helpers/lazy\";\r\nimport { safeGetLazy } from \"../helpers/safe_lazy\";\r\nimport { lazySafeGetInst } from \"../helpers/environment\";\r\nvar _symbol;\r\nvar _symbolFor;\r\nvar _symbolKeyFor;\r\nfunction _getSymbolValue(name) {\r\n return safeGetLazy(function () {\r\n return (_symbol.v ? _symbol.v[name] : UNDEF_VALUE);\r\n }, UNDEF_VALUE);\r\n}\r\n/**\r\n * Checks if the type of value is a symbol.\r\n * @group Symbol\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a symbol, false otherwise.\r\n */\r\nexport var isSymbol = _createIs(\"symbol\");\r\n/**\r\n * Helper to identify whether the runtime support the Symbols either via native or an installed polyfill\r\n * @group Symbol\r\n * @returns true if Symbol's are support otherwise false\r\n */\r\nexport function hasSymbol() {\r\n return !!getSymbol();\r\n}\r\n/**\r\n * If Symbols are supported then attempt to return the named Symbol\r\n * @group Symbol\r\n * @returns The value of the named Symbol (if available)\r\n */\r\nexport function getSymbol() {\r\n var resetCache = !_symbol || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_symbol.b);\r\n resetCache && (_symbol = lazySafeGetInst(SYMBOL));\r\n (!_symbolFor || resetCache) && (_symbolFor = _getSymbolValue(\"for\"));\r\n (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _getSymbolValue(\"keyFor\"));\r\n return _symbol.v;\r\n}\r\n/**\r\n * If Symbols are supported then get the property of the global Symbol, if Symbol's are\r\n * not supported and noPoly is true it returns null. Used to access the well known symbols.\r\n * @group Symbol\r\n * @param name - The property name to return (if it exists) for Symbol\r\n * @param noPoly - Flag indicating whether to return a polyfill if symbols are not supported.\r\n * @returns The value of the property if present\r\n * @example\r\n * ```ts\r\n * // If Symbol is supported in the runtime\r\n * getKnownSymbol(\"toStringTag\") === Symbol.toStringTag; // true\r\n * getKnownSymbol(WellKnownSymbols.toStringTag) === Symbol.toStringTag; // true\r\n * ```\r\n */\r\nexport function getKnownSymbol(name, noPoly) {\r\n var knownName = _wellKnownSymbolMap[name];\r\n // Cause lazy symbol to get initialized\r\n (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();\r\n return _symbol.v ? _symbol.v[knownName || name] : (!noPoly ? polyGetKnownSymbol(name) : UNDEF_VALUE);\r\n}\r\n/**\r\n * Returns a new unique Symbol value. If noPoly is true and symbols are not supported\r\n * then this will return null.\r\n * @group Symbol\r\n * @param description Description of the new Symbol object.\r\n * @param noPoly - Flag indicating whether to return a polyfil if symbols are not supported.\r\n * @returns The new symbol\r\n */\r\nexport function newSymbol(description, noPoly) {\r\n // Cause lazy _symbol to get initialized\r\n (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();\r\n return _symbol.v ? _symbol.v(description) : (!noPoly ? polyNewSymbol(description) : NULL_VALUE);\r\n}\r\n/**\r\n * Returns a Symbol object from the global symbol registry matching the given key if found.\r\n * Otherwise, returns a new symbol with this key. This will always return a polyfill if symbols\r\n * are not supported.\r\n * @group Symbol\r\n * @param key key to search for.\r\n */\r\nexport function symbolFor(key) {\r\n // Cause lazy symbol to get initialized\r\n (!_symbolFor || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();\r\n return (_symbolFor.v || polySymbolFor)(key);\r\n}\r\n/**\r\n * Returns a key from the global symbol registry matching the given Symbol if found.\r\n * Otherwise, returns a undefined. This will always attempt to lookup the polyfill\r\n * implementation if symbols are not supported\r\n * @group Symbol\r\n * @param sym Symbol to find the key for.\r\n */\r\nexport function symbolKeyFor(sym) {\r\n // Cause lazy symbol to get initialized\r\n (!_symbolKeyFor || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();\r\n return (_symbolKeyFor.v || polySymbolKeyFor)(sym);\r\n}\r\n//# sourceMappingURL=symbol.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { getLazy } from \"../helpers/lazy\";\r\nimport { DONE, VALUE } from \"../internal/constants\";\r\nimport { getKnownSymbol } from \"../symbol/symbol\";\r\nimport { isIterator } from \"./iterator\";\r\nvar _iterSymbol;\r\n/**\r\n * Calls the provided `callbackFn` function once for each element in the iterator or iterator returned by\r\n * the iterable and processed in the same order as returned by the iterator. As with the {@link arrForEach}\r\n * you CAN stop / break the iteration by returning -1 from the`callbackFn` function.\r\n *\r\n * The order of processing is not reset if you add or remove elements to the iterator, the actual behavior\r\n * will depend on the iterator imeplementation.\r\n *\r\n * If the passed `iter` is both an Iterable and Iterator the Iterator interface takes preceedence.\r\n * @remarks\r\n * If Symbols are NOT supported then the iterable MUST be using the same polyFill for the well know symbols,\r\n * if you are targetting a mixed environment you SHOULD either\r\n * - only use the polyfill Symbol's provided by this library\r\n * - ensure that you add any symbol polyfills BEFORE these utilities\r\n * iterForOf expects a `synchronous` function.\r\n * iterForOf does not wait for promises. Make sure you are aware of the implications while using\r\n * promises (or async functions) as forEach callback.\r\n *\r\n * @since 0.4.2\r\n * @group Iterator\r\n * @typeParam T - Identifies the element type of the iterator\r\n * @param callbackfn A `synchronous` function that accepts up to three arguments. iterForOf calls the\r\n * callbackfn function one time for each element returned by the iterator.\r\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is\r\n * omitted, null or undefined the iterator will be used as the this value.\r\n * @throws Any exception thrown while processing the iterator\r\n * @example\r\n * ```ts\r\n * const items = {\r\n * 'item1': 'value1',\r\n * 'item2': 'value2',\r\n * 'item3': 'value3\r\n * };\r\n * const copyItems = [];\r\n *\r\n * iterForOf(items, (item) => {\r\n * copyItems.push(item);\r\n * // May return -1 to abort the iteration\r\n * });\r\n * ```\r\n */\r\nexport function iterForOf(iter, callbackfn, thisArg) {\r\n if (iter) {\r\n if (!isIterator(iter)) {\r\n !_iterSymbol && (_iterSymbol = getLazy(function () { return getKnownSymbol(3 /* WellKnownSymbols.iterator */); }));\r\n iter = iter[_iterSymbol.v] ? iter[_iterSymbol.v]() : null;\r\n }\r\n if (isIterator(iter)) {\r\n var err = void 0;\r\n var iterResult = void 0;\r\n try {\r\n var count = 0;\r\n while (!(iterResult = iter.next())[DONE]) {\r\n if (callbackfn.call(thisArg || iter, iterResult[VALUE], count, iter) === -1) {\r\n break;\r\n }\r\n count++;\r\n }\r\n }\r\n catch (failed) {\r\n err = { e: failed };\r\n if (iter.throw) {\r\n iterResult = null;\r\n iter.throw(err);\r\n }\r\n }\r\n finally {\r\n try {\r\n if (iterResult && !iterResult[DONE]) {\r\n iter.return && iter.return(iterResult);\r\n }\r\n }\r\n finally {\r\n if (err) {\r\n // eslint-disable-next-line no-unsafe-finally\r\n throw err.e;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=forOf.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { getKnownSymbol } from \"../symbol/symbol\";\r\nimport { isFunction, isStrictNullOrUndefined } from \"../helpers/base\";\r\n/**\r\n * Checks if the type of value looks like an iterator instance (contains a next function).\r\n *\r\n * @since 0.4.0\r\n * @group Type Identity\r\n * @group Iterator\r\n * @typeParam T - Identifies the return type of the iterator defaults to any\r\n * @param value - The value to be checked\r\n * @returns {boolean} True if the value is an Iterator, otherwise false\r\n * @example\r\n * ```ts\r\n * isIterator(null); // false\r\n * isIterator(undefined); // false\r\n * isIterator(\"null\"); // false (Strings are iterable but not iterators)\r\n * isIterator([]); // false (Arrays are iterable but not iterators)\r\n * isIterator({\r\n * next: function() { return true }\r\n * }); // true, iterators must contain a \"next\" function\r\n * ```\r\n */\r\nexport function isIterator(value) {\r\n return !!value && isFunction(value.next);\r\n}\r\n/**\r\n * Checks if the value looks like it is iterable, contains a [symbol.iterator].\r\n *\r\n * @since 0.4.0\r\n * @group Type Identity\r\n * @group Iterator\r\n * @typeParam T - Identifies the return type of the iterator\r\n * @param value - The value to be checked\r\n * @returns {boolean} True if the value is an Iterable, otherwise false\r\n * @example\r\n * ```ts\r\n * isIterable(null); // false\r\n * isIterable(undefined); // false\r\n * isIterable(\"null\"); // true (Strings are iterable)\r\n * isIterable([]); // true (Arrays are iterable)\r\n * ```\r\n */\r\nexport function isIterable(value) {\r\n return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(3 /* WellKnownSymbols.iterator */)]);\r\n}\r\n//# sourceMappingURL=iterator.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2023 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { _unwrapInstFunction } from \"../internal/unwrapFunction\";\r\n/**\r\n * The `fnApply` function calls the specified `fn` function with the given `thisArg` as the `this` value,\r\n * and the optional `argArray` arguments provided as an array (or an Array-Like Object).\r\n *\r\n * Normally, when calling a function, the value of `this` inside the function is the object that the\r\n * function was accessed on. With `fnApply()`, you can assign an arbitrary value as this when calling an\r\n * existing function, without first attaching the function to the object as a property. This allows you\r\n * to use methods of one object as generic utility functions.\r\n *\r\n * You can also use any kind of object which is ArrayLike as the second parameter. In practice, this means\r\n * that it needs to have a length property, and integer (\"index\") properties in the range (0..length - 1).\r\n * For example, you could use a NodeList, or a custom object like `{ 'length': 2, '0': 'eat', '1': 'bananas' }`.\r\n * You can also use `arguments`.\r\n *\r\n * @since 0.9.8\r\n * @group Function\r\n *\r\n * @param fn - The function to be called\r\n * @param thisArg - The value of `this` provided for the call to `fn`. If the function is not in strict mode,\r\n * `null` and `undefined` will be replaced with the global object, and primitive values will be converted to objects.\r\n * @param argArray - An array-like object, specifying the arguments with which `fn` should be called, or `null` or\r\n * `undefined` if no arguments should be provided to the function.\r\n * @returns The result of calling the function with the specified `this` value and arguments.\r\n * @example\r\n * ```ts\r\n * // min / max number in an array\r\n * let max = fnApply(Math.max, null, [ 21, 42, 84, 168, 7, 3 ]);\r\n * // 168\r\n *\r\n * let min = fnApply(Math.min, null, [ 21, 42, 84, 168, 7, 3 ]);\r\n * // 3\r\n *\r\n * const module1 = {\r\n * prefix: \"Hello\",\r\n * x: 21,\r\n * getX() {\r\n * return this.x;\r\n * },\r\n * log(value: string) {\r\n * return this.prefix + \" \" + value + \" : \" + this.x\r\n * }\r\n * };\r\n *\r\n * // The 'this' parameter of 'getX' is bound to 'module'.\r\n * module1.getX(); // 21\r\n * module1.log(\"Darkness\"); // Hello Darkness : 21\r\n *\r\n * // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.\r\n * let module2 = {\r\n * prefix: \"my\",\r\n * x: 42\r\n * };\r\n *\r\n * // Call the function of module1 with module2 as it's this\r\n * fnApply(module1.getX, module2); // 42\r\n * fnApply(module1.log, module2, [ \"friend\" ]); // my friend : 42\r\n * ```\r\n */\r\nexport var fnApply = _unwrapInstFunction(\"apply\");\r\n//# sourceMappingURL=fnApply.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { LENGTH } from \"../internal/constants\";\r\n/**\r\n * Calls the provided `callbackFn` function once for each element in an array in ascending index order. It is not invoked for index properties\r\n * that have been deleted or are uninitialized. And unlike the ES6 forEach() you CAN stop or break the iteration by returning -1 from the\r\n * `callbackFn` function.\r\n *\r\n * The range (number of elements) processed by arrForEach() is set before the first call to the `callbackFn`. Any elements added beyond the range\r\n * or elements which as assigned to indexes already processed will not be visited by the `callbackFn`.\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the element type of the array\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param callbackfn A `synchronous` function that accepts up to three arguments. arrForEach calls the callbackfn function one time for each element in the array.\r\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined\r\n * the array will be used as the this value.\r\n * @remarks\r\n * arrForEach expects a `synchronous` function.\r\n * arrForEach does not wait for promises. Make sure you are aware of the implications while using promises (or async functions) as forEach callback.\r\n * @example\r\n * ```ts\r\n * const items = ['item1', 'item2', 'item3'];\r\n * const copyItems = [];\r\n *\r\n * // before using for loop\r\n * for (let i = 0; i < items.length; i++) {\r\n * copyItems.push(items[i]);\r\n * }\r\n *\r\n * // before using forEach()\r\n * items.forEach((item) => {\r\n * copyItems.push(item);\r\n * });\r\n *\r\n * // after\r\n * arrForEach(items, (item) => {\r\n * copyItems.push(item);\r\n * // May return -1 to abort the iteration\r\n * });\r\n *\r\n * // Also supports input as an array like object\r\n * const items = { length: 3, 0: 'item1', 1: 'item2', 2: 'item3' };\r\n * ```\r\n */\r\nexport function arrForEach(theArray, callbackfn, thisArg) {\r\n if (theArray) {\r\n var len = theArray[LENGTH] >>> 0;\r\n for (var idx = 0; idx < len; idx++) {\r\n if (idx in theArray) {\r\n if (callbackfn.call(thisArg || theArray, theArray[idx], idx, theArray) === -1) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=forEach.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { ArrProto, INDEX_OF, LAST_INDEX_OF } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n/**\r\n * The arrIndexOf() method returns the first index at which a given element can be found in the array,\r\n * or -1 if it is not present.\r\n * `arrIndexOf()` compares searchElement to elements of the Array using strict equality (the same\r\n * method used by the === or triple-equals operator).\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the type of array elements\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param searchElement - The element to locate in the array.\r\n * @param fromIndex - The index to start the search at. If the index is greater than or equal to\r\n * the array's length, -1 is returned, which means the array will not be searched. If the provided\r\n * index value is a negative number, it is taken as the offset from the end of the array.\r\n * Note: if the provided index is negative, the array is still searched from front to back. If the\r\n * provided index is 0, then the whole array will be searched. Default: 0 (entire array is searched).\r\n * @return The first index of the element in the array; -1 if not found.\r\n * @example\r\n * ```ts\r\n * const array = [2, 9, 9];\r\n * arrIndexOf(array, 2); // 0\r\n * arrIndexOf(array, 7); // -1\r\n * arrIndexOf(array, 9, 2); // 2\r\n * arrIndexOf(array, 2, -1); // -1\r\n * arrIndexOf(array, 2, -3); // 0\r\n *\r\n * let indices: number[] = [];\r\n * const array = ['a', 'b', 'a', 'c', 'a', 'd'];\r\n * const element = 'a';\r\n * let idx = arrIndexOf(array, element);\r\n * while (idx !== -1) {\r\n * indices.push(idx);\r\n * idx = arrIndexOf(array, element, idx + 1);\r\n * }\r\n * console.log(indices);\r\n * // [0, 2, 4]\r\n *\r\n * function updateVegetablesCollection (veggies, veggie) {\r\n * if (arrIndexOf(veggies, veggie) === -1) {\r\n * veggies.push(veggie);\r\n * console.log('New veggies collection is : ' + veggies);\r\n * } else {\r\n * console.log(veggie + ' already exists in the veggies collection.');\r\n * }\r\n * }\r\n *\r\n * let veggies = ['potato', 'tomato', 'chillies', 'green-pepper'];\r\n *\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // New veggies collection is : potato,tomato,chillies,green-pepper,spinach\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // spinach already exists in the veggies collection.\r\n *\r\n * // Array Like\r\n * let arrayLike = {\r\n * length: 3,\r\n * 0: \"potato\",\r\n * 1: \"tomato\",\r\n * 2: \"chillies\",\r\n * 3: \"green-pepper\" // Not checked as index is > length\r\n * };\r\n *\r\n * arrIndexOf(arrayLike, \"potato\"); // 0\r\n * arrIndexOf(arrayLike, \"tomato\"); // 1\r\n * arrIndexOf(arrayLike, \"chillies\"); 2\r\n * arrIndexOf(arrayLike, \"green-pepper\"); // -1\r\n * ```\r\n */\r\nexport var arrIndexOf = _unwrapFunction(INDEX_OF, ArrProto);\r\n/**\r\n * The arrLastIndexOf() method returns the last index at which a given element can be found in the array,\r\n * or -1 if it is not present.\r\n * `arrLastIndexOf()` compares searchElement to elements of the Array using strict equality (the same\r\n * method used by the === or triple-equals operator). [NaN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN)\r\n * values are never compared as equal, so arrLastIndexOf() always returns -1 when searchElement is NaN.\r\n *\r\n * The arrLastIndexOf() method skips empty slots in sparse arrays.\r\n *\r\n * The arrLastIndexOf() method is generic. It only expects the this value to have a length property and integer-keyed properties.\r\n *\r\n * @since 0.8.0\r\n * @group Array\r\n * @group ArrayLike\r\n * @typeParam T - Identifies the type of array elements\r\n * @param theArray - The array or array like object of elements to be searched.\r\n * @param searchElement - The element to locate in the array.\r\n * @param fromIndex - Zero-based index at which to start searching backwards, converted to an integer.\r\n * - Negative index counts back from the end of the array — if fromIndex < 0, fromIndex + array.length is used.\r\n * - If fromIndex < -array.length, the array is not searched and -1 is returned. You can think of it conceptually\r\n * as starting at a nonexistent position before the beginning of the array and going backwards from there. There\r\n * are no array elements on the way, so searchElement is never found.\r\n * - If fromIndex >= array.length or fromIndex is omitted, array.length - 1 is used, causing the entire array to\r\n * be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements.\r\n * @return The first index of the element in the array; -1 if not found.\r\n * @example\r\n * ```ts\r\n * const numbers = [2, 5, 9, 2];\r\n * arrLastIndexOf(numbers, 2); // 3\r\n * arrLastIndexOf(numbers, 7); // -1\r\n * arrLastIndexOf(numbers, 2, 3); // 3\r\n * arrLastIndexOf(numbers, 2, 2); // 0\r\n * arrLastIndexOf(numbers, 2, -2); // 0\r\n * arrLastIndexOf(numbers, 2, -1); // 3\r\n *\r\n * let indices: number[] = [];\r\n * const array = [\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"];\r\n * const element = \"a\";\r\n * let idx = arrLastIndexOf(array, element);\r\n * while (idx !== -1) {\r\n * indices.push(idx);\r\n * idx = arrLastIndexOf(array, element, idx ? idx - 1 : -(array.length + 1));\r\n * }\r\n * console.log(indices);\r\n * // [4, 2, 0]\r\n *\r\n * function updateVegetablesCollection (veggies, veggie) {\r\n * if (arrLastIndexOf(veggies, veggie) === -1) {\r\n * veggies.push(veggie);\r\n * console.log('New veggies collection is : ' + veggies);\r\n * } else {\r\n * console.log(veggie + ' already exists in the veggies collection.');\r\n * }\r\n * }\r\n *\r\n * let veggies = ['potato', 'tomato', 'chillies', 'green-pepper'];\r\n *\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // New veggies collection is : potato,tomato,chillies,green-pepper,spinach\r\n * updateVegetablesCollection(veggies, 'spinach');\r\n * // spinach already exists in the veggies collection.\r\n *\r\n * // Array Like\r\n * let arrayLike = {\r\n * length: 3,\r\n * 0: \"potato\",\r\n * 1: \"tomato\",\r\n * 2: \"chillies\",\r\n * 3: \"green-pepper\" // Not checked as index is > length\r\n * };\r\n *\r\n * arrLastIndexOf(arrayLike, \"potato\"); // 0\r\n * arrLastIndexOf(arrayLike, \"tomato\"); // 1\r\n * arrLastIndexOf(arrayLike, \"chillies\"); 2\r\n * arrLastIndexOf(arrayLike, \"green-pepper\"); // -1\r\n * ```\r\n */\r\nexport var arrLastIndexOf = _unwrapFunction(LAST_INDEX_OF, ArrProto);\r\n//# sourceMappingURL=indexOf.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { getLazy } from \"../helpers/lazy\";\r\nimport { ObjClass, __PROTO__ } from \"../internal/constants\";\r\nimport { objForEachKey } from \"./for_each_key\";\r\nvar _isProtoArray;\r\n/**\r\n * The objSetPrototypeOf() method sets the prototype (i.e., the internal [Prototype] property) of a specified\r\n * object to another object or null.\r\n * @group Object\r\n * @param obj - The object which is to have it's prototype set.\r\n * @param proto - The object's new prototype (an object or null)\r\n * @returns The specified object.\r\n */\r\nexport function objSetPrototypeOf(obj, proto) {\r\n var fn = ObjClass[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d, b) {\r\n !_isProtoArray && (_isProtoArray = getLazy(function () {\r\n var _a;\r\n return ((_a = {}, _a[__PROTO__] = [], _a) instanceof Array);\r\n }));\r\n _isProtoArray.v ? d[__PROTO__] = b : objForEachKey(b, function (key, value) { return d[key] = value; });\r\n };\r\n return fn(obj, proto);\r\n}\r\n//# sourceMappingURL=set_proto.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { ArrProto, SLICE } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n/**\r\n * The arrSlice() method returns a shallow copy of a portion of an array into a new array object\r\n * selected from start to end (end not included) where start and end represent the index of items\r\n * in that array. The original array will not be modified.\r\n *\r\n * The `arrSlice()` method is a copying method. It does not alter this but instead returns a shallow\r\n * copy that contains some of the same elements as the ones from the original array.\r\n *\r\n * The `arrSlice()` method preserves empty slots. If the sliced portion is sparse, the returned arra\r\n * is sparse as well.\r\n *\r\n * The `arrSlice()` method is generic. It only expects the this value to have a length property and\r\n * integer-keyed properties.\r\n *\r\n * For both start and end, a negative index can be used to indicate an offset from the end of the array.\r\n * For example, -2 refers to the second to last element of the array.\r\n * @since 0.9.3\r\n * @group Array\r\n * @group ArrayLike\r\n * @param start Zero-based index at which to start extraction, converted to an integer.\r\n * - Negative index counts back from the end of the array — if start < 0, start + array.length is used.\r\n * - If start < -array.length or start is omitted, 0 is used.\r\n * - If start >= array.length, nothing is extracted.\r\n * @param end Zero-based index at which to end extraction, converted to an integer. slice() extracts\r\n * up to but not including end.\r\n * - Negative index counts back from the end of the array — if end < 0, end + array.length is used.\r\n * - If end < -array.length, 0 is used.\r\n * - If end >= array.length or end is omitted, array.length is used, causing all elements until the\r\n * end to be extracted.\r\n * - If end is positioned before or at start after normalization, nothing is extracted.\r\n * @example\r\n * ```ts\r\n * const lyrics = [\"Hello\", \"Darkness\", \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\", \"talk\" ];\r\n *\r\n * arrSlice(lyrics); // [ \"Hello\", \"Darkness\", \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\", \"talk\" ]\r\n * arrSlice(lyrics, 1, 3); // [ \"Darkness\", \"my\" ]\r\n * arrSlicw(lyrics, 2); // [ \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\", \"talk\" ]\r\n * arrSlice(lyrics, 2, 4); // [ \"my\", \"old\" ]\r\n * arrSlice(lyrics, 1, 5); // [ \"Darkness\", \"my\", \"old\", \"friend.\" ]\r\n * arrSlice(lyrics, -2); // [ \"to\", \"talk\" ]\r\n * arrSlice(lyrics, 2, -1); // [ \"my\", \"old\", \"friend.\", \"I've\", \"come\", \"to\" ]\r\n * ```\r\n */\r\nexport var arrSlice = _unwrapFunction(SLICE, ArrProto);\r\n//# sourceMappingURL=slice.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2023 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { _unwrapInstFunction } from \"../internal/unwrapFunction\";\r\n/**\r\n * The `fnCall` function calls the function with the given `thisArg` as the `this` value and with\r\n * al of the `_args` provided as it's `arguments.\r\n *\r\n * > This is almost identical to `fnApply`, except that the function arguments are passed to `fnCall`\r\n * individually as a list, while with `fnApply` that are combined into a single array argument.\r\n *\r\n * Normally, when calling a function, the value of `this` inside the function is the object that the\r\n * function was accessed on. With `fnCall()`, you can pass an arbitrary value as the `this` when calling an\r\n * existing function, without first attaching the function to the object as a property. This allows you\r\n * to use methods of one object as generic utility functions.\r\n *\r\n * @since 0.9.8\r\n * @group Function\r\n *\r\n * @param fn - The function to be called\r\n * @param thisArg - The value of `this` provided for the call to `fn`. If the function is not in strict mode,\r\n * `null` and `undefined` will be replaced with the global object, and primitive values will be converted to objects.\r\n * @param _args - The zero or more arguments to be passed to the `fn` function.\r\n * @returns The result of calling the function with the specified `this` value and arguments.\r\n * @example\r\n * ```ts\r\n * // min / max number in an array\r\n * let max = fnCall(Math.max, null, 21, 42, 84, 168, 7, 3);\r\n * // 168\r\n *\r\n * let min = fnCall(Math.min, null, 21, 42, 84, 168, 7, 3);\r\n * // 3\r\n *\r\n * const module1 = {\r\n * prefix: \"Hello\",\r\n * x: 21,\r\n * getX() {\r\n * return this.x;\r\n * },\r\n * log(value: string) {\r\n * return this.prefix + \" \" + value + \" : \" + this.x\r\n * }\r\n * };\r\n *\r\n * // The 'this' parameter of 'getX' is bound to 'module'.\r\n * module1.getX(); // 21\r\n * module1.log(\"Darkness\"); // Hello Darkness : 21\r\n *\r\n * // Create a new function 'boundGetX' with the 'this' parameter bound to 'module'.\r\n * let module2 = {\r\n * prefix: \"my\",\r\n * x: 42\r\n * };\r\n *\r\n * // Call the function of module1 with module2 as it's this\r\n * fnCall(module1.getX, module2); // 42\r\n * fnCall(module1.log, module2, \"friend\"); // my friend : 42\r\n * ```\r\n */\r\nexport var fnCall = _unwrapInstFunction(\"call\");\r\n//# sourceMappingURL=fnCall.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { FUNCTION, ObjClass, OBJECT, PROTOTYPE } from \"../internal/constants\";\r\nimport { dumpObj } from \"../helpers/diagnostics\";\r\nvar _objCreate = ObjClass[\"create\"];\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @group Object\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\nexport var objCreate = _objCreate || polyObjCreate;\r\n/**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @group Polyfill\r\n * @group Object\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\nexport function polyObjCreate(obj) {\r\n if (!obj) {\r\n return {};\r\n }\r\n var type = typeof obj;\r\n if (type !== OBJECT && type !== FUNCTION) {\r\n throw new TypeError(\"Prototype must be an Object or function: \" + dumpObj(obj));\r\n }\r\n function tempFunc() { }\r\n tempFunc[PROTOTYPE] = obj;\r\n return new tempFunc();\r\n}\r\n//# sourceMappingURL=create.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { arrSlice } from \"../array/slice\";\r\nimport { fnApply } from \"../funcs/fnApply\";\r\nimport { CONSTRUCTOR, NAME, NULL_VALUE, PROTOTYPE } from \"../internal/constants\";\r\nimport { objCreate } from \"../object/create\";\r\nimport { objDefine } from \"../object/define\";\r\nimport { objGetPrototypeOf } from \"../object/object\";\r\nimport { objSetPrototypeOf } from \"../object/set_proto\";\r\n/**\r\n * @internal\r\n * @ignore\r\n */\r\nvar _createCustomError = function (name, d, b) {\r\n _safeDefineName(d, name);\r\n d = objSetPrototypeOf(d, b);\r\n function __() {\r\n this.constructor = d;\r\n _safeDefineName(this, name);\r\n }\r\n d[PROTOTYPE] = b === NULL_VALUE ? objCreate(b) : (__[PROTOTYPE] = b[PROTOTYPE], new __());\r\n return d;\r\n};\r\nvar _safeSetName = function (baseClass, name) {\r\n try {\r\n name && (baseClass[NAME] = name);\r\n //name && (baseClass[PROTOTYPE][NAME] = name);\r\n }\r\n catch (e) {\r\n // Do nothing\r\n }\r\n};\r\nvar _safeDefineName = function (target, name) {\r\n try {\r\n objDefine(target, NAME, { v: name, c: true, e: false });\r\n }\r\n catch (e) {\r\n // Do nothing\r\n }\r\n};\r\n/**\r\n * Create a Custom Error class which may be used to throw custom errors.\r\n * @group Error\r\n * @param name - The name of the Custom Error\r\n * @param constructCb - [Optional] An optional callback function to call when a\r\n * new Customer Error instance is being created.\r\n * @param errorBase - [Optional] (since v0.9.6) The error class to extend for this class, defaults to Error.\r\n * @returns A new Error `class`\r\n * @example\r\n * ```ts\r\n * import { createCustomError, isError } from \"@nevware21/ts-utils\";\r\n *\r\n * // For an error that just contains a message\r\n * let myCustomErrorError = createCustomError(\"MessageError\");\r\n *\r\n * try {\r\n * throw new myCustomErrorError(\"Error Message!\");\r\n * } catch(e) {\r\n * // e.name === MessageError\r\n * // isError(e) === true;\r\n * // Object.prototype.toString.call(e) === \"[object Error]\";\r\n * }\r\n *\r\n * // Or a more complex error object\r\n * interface MyCriticalErrorConstructor extends CustomErrorConstructor {\r\n * new(message: string, file: string, line: number, col: number): MyCriticalError;\r\n * (message: string, file: string, line: number, col: number): MyCriticalError;\r\n * }\r\n *\r\n * interface MyCriticalError extends Error {\r\n * readonly errorId: number;\r\n * readonly args: any[]; // Holds all of the arguments passed during construction\r\n * }\r\n *\r\n * let _totalErrors = 0;\r\n * let myCustomError = createCustomError(\"CriticalError\", (self, args) => {\r\n * _totalErrors++;\r\n * self.errorId = _totalErrors;\r\n * self.args = args;\r\n * });\r\n *\r\n * try {\r\n * throw new myCustomError(\"Not Again!\");\r\n * } catch(e) {\r\n * // e.name === CriticalError\r\n * // isError(e) === true;\r\n * // Object.prototype.toString.call(e) === \"[object Error]\";\r\n * }\r\n *\r\n * // ----------------------------------------------------------\r\n * // Extending another custom error class\r\n * // ----------------------------------------------------------\r\n *\r\n * let AppError = createCustomError(\"ApplicationError\");\r\n * let theAppError = new appError();\r\n *\r\n * isError(theAppError); // true\r\n * theAppError instanceof Error; // true\r\n * theAppError instanceof AppError; // true\r\n *\r\n * let StartupError = createCustomError(\"StartupError\", null, AppError);\r\n * let theStartupError = new StartupError();\r\n *\r\n * isError(theStartupError); // true\r\n * theStartupError instanceof Error; // true\r\n * theStartupError instanceof AppError; // true\r\n * theStartupError instanceof StartupError; // true\r\n * ```\r\n */\r\nexport function createCustomError(name, constructCb, errorBase) {\r\n var theBaseClass = errorBase || Error;\r\n var orgName = theBaseClass[PROTOTYPE][NAME];\r\n var captureFn = Error.captureStackTrace;\r\n return _createCustomError(name, function () {\r\n var _this = this;\r\n try {\r\n _safeSetName(theBaseClass, name);\r\n var _self = fnApply(theBaseClass, _this, arrSlice(arguments)) || _this;\r\n if (_self !== _this) {\r\n // Looks like runtime error constructor reset the prototype chain, so restore it\r\n var orgProto = objGetPrototypeOf(_this);\r\n if (orgProto !== objGetPrototypeOf(_self)) {\r\n objSetPrototypeOf(_self, orgProto);\r\n }\r\n }\r\n // Make sure we only capture our stack details\r\n captureFn && captureFn(_self, _this[CONSTRUCTOR]);\r\n // Run the provided construction function\r\n constructCb && constructCb(_self, arguments);\r\n return _self;\r\n }\r\n finally {\r\n _safeSetName(theBaseClass, orgName);\r\n }\r\n }, theBaseClass);\r\n}\r\n/**\r\n * @internal\r\n * @ignore\r\n */\r\nvar _unsupportedError;\r\n/**\r\n * Throw a custom `UnsupportedError` Error instance with the given message.\r\n * @group Error\r\n * @param message - The message to include in the exception\r\n * @example\r\n * ```ts\r\n * import { throwUnsupported } from \"@nevware21/ts-utils\";\r\n *\r\n * if (!window) {\r\n * throwUnsupported(\"A window is needed for this operation\");\r\n * }\r\n * ```\r\n */\r\nexport function throwUnsupported(message) {\r\n if (!_unsupportedError) {\r\n // Lazily create the class\r\n _unsupportedError = createCustomError(\"UnsupportedError\");\r\n }\r\n throw new _unsupportedError(message);\r\n}\r\n//# sourceMappingURL=customError.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { fnCall } from \"../funcs/fnCall\";\r\nimport { getWindow, hasWindow } from \"../helpers/environment\";\r\nimport { CONSTRUCTOR, FUNCTION, ObjClass, OBJECT, PROTOTYPE } from \"../internal/constants\";\r\nimport { objHasOwnProperty } from \"./has_own_prop\";\r\nimport { objGetPrototypeOf } from \"./object\";\r\n// Use to cache the result of Object.cont\r\nvar _fnToString;\r\nvar _objCtrFnString;\r\nvar _gblWindow;\r\n/**\r\n * Checks to see if the past value is a plain object (not a class/array) value.\r\n * Object are considered to be \"plain\" if they are created with no prototype `Object.create(null)`\r\n * or by using the Object global (native) function, all other \"objects\" ar\r\n * @since 0.4.4\r\n * @group Type Identity\r\n * @group Object\r\n * @param value - The value to check\r\n * @returns true if `value` is a normal plain object\r\n * @example\r\n * ```ts\r\n * console.log(isPlainObject({ 0: 'a', 1: 'b', 2: 'c' })); // true\r\n * console.log(isPlainObject({ 100: 'a', 2: 'b', 7: 'c' })); // true\r\n * console.log(isPlainObject(objCreate(null))); // true\r\n *\r\n * const myObj = objCreate({}, {\r\n * getFoo: {\r\n * value() { return this.foo; }\r\n * }\r\n * });\r\n * myObj.foo = 1;\r\n * console.log(isPlainObject(myObj)); // true\r\n *\r\n * console.log(isPlainObject(['a', 'b', 'c'])); // false\r\n * console.log(isPlainObject(new Date())); // false\r\n * console.log(isPlainObject(new Error(\"An Error\"))); // false\r\n * console.log(isPlainObject(null)); // false\r\n * console.log(isPlainObject(undefined)); // false\r\n * console.log(isPlainObject(\"null\")); // false\r\n * console.log(isPlainObject(\"undefined\")); // false\r\n * console.log(isPlainObject(\"1\")); // false\r\n * console.log(isPlainObject(\"aa\")); // false\r\n * ```\r\n */\r\nexport function isPlainObject(value) {\r\n if (!value || typeof value !== OBJECT) {\r\n return false;\r\n }\r\n if (!_gblWindow) {\r\n // Lazily cache the current global window value and default it to \"true\" (so we bypass this check in the future)\r\n _gblWindow = hasWindow() ? getWindow() : true;\r\n }\r\n var result = false;\r\n if (value !== _gblWindow) {\r\n if (!_objCtrFnString) {\r\n // Lazily caching what the runtime reports as the object function constructor (as a string)\r\n // Using an current function lookup to find what this runtime calls a \"native\" function\r\n _fnToString = Function[PROTOTYPE].toString;\r\n _objCtrFnString = fnCall(_fnToString, ObjClass);\r\n }\r\n try {\r\n var proto = objGetPrototypeOf(value);\r\n // No prototype so looks like an object created with Object.create(null)\r\n result = !proto;\r\n if (!result) {\r\n if (objHasOwnProperty(proto, CONSTRUCTOR)) {\r\n proto = proto[CONSTRUCTOR];\r\n }\r\n result = proto && typeof proto === FUNCTION && _fnToString.call(proto) === _objCtrFnString;\r\n }\r\n }\r\n catch (ex) {\r\n // Something went wrong, so it's not an object we are playing with\r\n }\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=is_plain_object.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { utcNow } from \"./date\";\r\nimport { lazySafeGetInst } from \"./environment\";\r\nimport { _globalLazyTestHooks } from \"./lazy\";\r\nvar _perf;\r\n/**\r\n * Identify whether the runtimne contains a `performance` object\r\n *\r\n * @since 0.4.4\r\n * @group Environment\r\n * @returns\r\n */\r\nexport function hasPerformance() {\r\n return !!getPerformance();\r\n}\r\n/**\r\n * Returns the global `performance` Object if available, which can be used to\r\n * gather performance information about the current document. It serves as the\r\n * point of exposure for the Performance Timeline API, the High Resolution Time\r\n * API, the Navigation Timing API, the User Timing API, and the Resource Timing API.\r\n *\r\n * @since 0.4.4\r\n * @group Environment\r\n * @returns The global performance object if available.\r\n */\r\nexport function getPerformance() {\r\n (!_perf || (!_perf.b && _globalLazyTestHooks && _globalLazyTestHooks.lzy)) && (_perf = lazySafeGetInst(\"performance\"));\r\n return _perf.v;\r\n}\r\n/**\r\n * Returns the number of milliseconds that has elapsed since the time origin, if\r\n * the runtime does not support the `performance` API it will fallback to return\r\n * the number of milliseconds since the unix epoch.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @returns The number of milliseconds as a `DOMHighResTimeStamp` double value or\r\n * an integer depending on the runtime.\r\n * @example\r\n * ```ts\r\n * let now = perfNow();\r\n * ```\r\n */\r\nexport function perfNow() {\r\n var perf = getPerformance();\r\n if (perf && perf.now) {\r\n return perf.now();\r\n }\r\n return utcNow();\r\n}\r\n/**\r\n * Return the number of milliseconds that have elapsed since the provided `startTime`\r\n * the `startTime` MUST be obtained from {@link perfNow} to ensure the correct elapsed\r\n * value is returned.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @param startTime - The startTime obtained from `perfNow`\r\n * @returns The number of milliseconds that have elapsed since the startTime.\r\n * @example\r\n * ```ts\r\n * let start = perfNow();\r\n * // Do some work\r\n * let totalTime = elapsedTime(start);\r\n * ```\r\n */\r\nexport function elapsedTime(startTime) {\r\n return perfNow() - startTime;\r\n}\r\n//# sourceMappingURL=perf.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\n/**\r\n * Return the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.\r\n *\r\n * To offer protection against timing attacks and fingerprinting, the precision of dateNow()\r\n * might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision\r\n * preference is enabled by default and defaults to 20µs in Firefox 59; in 60 it will be 2ms.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n *\r\n * @returns A Number representing the milliseconds elapsed since the UNIX epoch.\r\n * @example\r\n * ```ts\r\n * let now = utcNow();\r\n * ```\r\n */\r\nexport function utcNow() {\r\n return (Date.now || polyUtcNow)();\r\n}\r\n/**\r\n * Polyfill fallback to return the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.\r\n *\r\n * To offer protection against timing attacks and fingerprinting, the precision of dateNow()\r\n * might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision\r\n * preference is enabled by default and defaults to 20µs in Firefox 59; in 60 it will be 2ms.\r\n *\r\n * @since 0.4.4\r\n * @group Timer\r\n * @group Polyfill\r\n *\r\n * @returns A Number representing the milliseconds elapsed since the UNIX epoch.\r\n * @example\r\n * ```ts\r\n * let now = polyUtcNow();\r\n * ```\r\n*/\r\nexport function polyUtcNow() {\r\n return new Date().getTime();\r\n}\r\n//# sourceMappingURL=date.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { INDEX_OF, LAST_INDEX_OF, StrProto } from \"../internal/constants\";\r\nimport { _unwrapFunction } from \"../internal/unwrapFunction\";\r\n/**\r\n * The `strIndexOf()` method, given two arguments: the string and a substring to search for, searches\r\n * the entire calling string, and returns the index of the first occurrence of the specified substring.\r\n * Given a thrid argument: a number, the method returns the first occurrence of the specified substring\r\n * at an index greater than or equal to the specified number.\r\n * @group String\r\n * @param value - The value to be checked for the seeach string\r\n * @param searchString - The substring to search for in the value\r\n * @param position - The starting position to search from\r\n * @example\r\n * ```ts\r\n * strIndexOf('hello world', '') // returns 0\r\n * strIndexOf('hello world', '', 0) // returns 0\r\n * strIndexOf('hello world', '', 3) // returns 3\r\n * strIndexOf('hello world', '', 8) // returns 8\r\n *\r\n * // However, if the thrid argument is greater than the length of the string\r\n * strIndexOf('hello world', '', 11) // returns 11\r\n * strIndexOf('hello world', '', 13) // returns 11\r\n * strIndexOf('hello world', '', 22) // returns 11\r\n *\r\n * strIndexOf('Blue Whale', 'Blue') // returns 0\r\n * strIndexOf('Blue Whale', 'Blute') // returns -1\r\n * strIndexOf('Blue Whale', 'Whale', 0) // returns 5\r\n * strIndexOf('Blue Whale', 'Whale', 5) // returns 5\r\n * strIndexOf('Blue Whale', 'Whale', 7) // returns -1\r\n * strIndexOf('Blue Whale', '') // returns 0\r\n * strIndexOf('Blue Whale', '', 9) // returns 9\r\n * strIndexOf('Blue Whale', '', 10) // returns 10\r\n * strIndexOf('Blue Whale', '', 11) // returns 10\r\n * ```\r\n */\r\nexport var strIndexOf = _unwrapFunction(INDEX_OF, StrProto);\r\n/**\r\n * The `strLastIndexOf()` method, given two arguments: the string and a substring to search for, searches\r\n * the entire calling string, and returns the index of the last occurrence of the specified substring.\r\n * Given a third argument: a number, the method returns the last occurrence of the specified substring\r\n * at an index less than or equal to the specified number.\r\n * @group String\r\n * @param value - The value to be checked for the seeach string\r\n * @param searchString - The substring to search for in the value\r\n * @param position - The starting position to search from\r\n * @example\r\n * ```ts\r\n * strLastIndexOf('canal', 'a'); // returns 3\r\n * strLastIndexOf('canal', 'a', 2); // returns 1\r\n * strLastIndexOf('canal', 'a', 0); // returns -1\r\n * strLastIndexOf('canal', 'x'); // returns -1\r\n * strLastIndexOf('canal', 'c', -5); // returns 0\r\n * strLastIndexOf('canal', 'c', 0); // returns 0\r\n * strLastIndexOf('canal', ''); // returns 5\r\n * strLastIndexOf('canal', '', 2); // returns 2\r\n * ```\r\n */\r\nexport var strLastIndexOf = _unwrapFunction(LAST_INDEX_OF, StrProto);\r\n//# sourceMappingURL=index_of.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { NULL_VALUE } from \"../internal/constants\";\r\nimport { objDefineProp } from \"../object/define\";\r\nvar REF = \"ref\";\r\nvar UNREF = \"un\" + REF;\r\nvar HAS_REF = \"hasRef\";\r\nvar ENABLED = \"enabled\";\r\n/**\r\n * @ignore\r\n * @internal\r\n * Internal function to create and manage an ITimerHandler implementation, the object returned from this function\r\n * it directly used / returned by the pulic functions used to create timers (idle, interval and timeout)\r\n * @param startTimer - Should the timer be started as part of creating the handler\r\n * @param refreshFn - The function used to create/start or refresh the timer\r\n * @param cancelFn - The function used to cancel the timer.\r\n * @returns The new ITimerHandler instance\r\n */\r\nexport function _createTimerHandler(startTimer, refreshFn, cancelFn) {\r\n var _a;\r\n var ref = true;\r\n var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE;\r\n var theTimerHandler;\r\n var _unref = function () {\r\n ref = false;\r\n timerId && timerId[UNREF] && timerId[UNREF]();\r\n return theTimerHandler;\r\n };\r\n var _ref = function () {\r\n ref = true;\r\n timerId && timerId[REF] && timerId[REF]();\r\n return theTimerHandler;\r\n };\r\n var _hasRef = function () {\r\n if (timerId && timerId[HAS_REF]) {\r\n return timerId[HAS_REF]();\r\n }\r\n return ref;\r\n };\r\n var _refresh = function () {\r\n timerId = refreshFn(timerId);\r\n if (!ref) {\r\n _unref();\r\n }\r\n return theTimerHandler;\r\n };\r\n var _cancel = function () {\r\n timerId && cancelFn(timerId);\r\n timerId = NULL_VALUE;\r\n };\r\n var _setEnabled = function (value) {\r\n !value && timerId && _cancel();\r\n value && !timerId && _refresh();\r\n };\r\n theTimerHandler = (_a = {\r\n cancel: _cancel,\r\n refresh: _refresh\r\n },\r\n _a[HAS_REF] = _hasRef,\r\n _a[REF] = _ref,\r\n _a[UNREF] = _unref,\r\n _a[ENABLED] = false,\r\n _a);\r\n objDefineProp(theTimerHandler, ENABLED, {\r\n get: function () { return !!timerId; },\r\n set: _setEnabled\r\n });\r\n return {\r\n h: theTimerHandler,\r\n dn: function () {\r\n timerId = NULL_VALUE;\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=handler.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { getGlobal, objAssign, objCreate, objDefineProp, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\r\nimport { ObjClass, ObjProto, strDefault, strShimFunction, strShimPrototype } from \"./Constants\";\r\n// Most of these functions have been directly shamelessly \"lifted\" from the https://github.com/@microsoft/tslib and\r\n// modified to be ES5 compatible and applying several minification and tree-shaking techniques so that Application Insights\r\n// can successfully use TypeScript \"importHelpers\" which imports tslib during compilation but it will use these at runtime\r\n// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require\r\n// them.\r\nexport var SymbolObj = (getGlobal() || {})[\"Symbol\"];\r\nexport var ReflectObj = (getGlobal() || {})[\"Reflect\"];\r\nexport var __hasReflect = !!ReflectObj;\r\nvar strDecorate = \"decorate\";\r\nvar strMetadata = \"metadata\";\r\nvar strGetOwnPropertySymbols = \"getOwnPropertySymbols\";\r\nvar strIterator = \"iterator\";\r\nvar strHasOwnProperty = \"hasOwnProperty\";\r\nexport var __objAssignFnImpl = function (t) {\r\n // tslint:disable-next-line: ban-comma-operator\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) {\r\n if (ObjProto[strHasOwnProperty].call(s, p)) {\r\n t[p] = s[p];\r\n }\r\n }\r\n }\r\n return t;\r\n};\r\nexport var __assignFn = objAssign || __objAssignFnImpl;\r\n// tslint:disable-next-line: only-arrow-functions\r\nvar extendStaticsFn = function (d, b) {\r\n extendStaticsFn = ObjClass[\"setPrototypeOf\"] ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n ({ __proto__: [] } instanceof Array && function (d, b) {\r\n d.__proto__ = b;\r\n }) ||\r\n // tslint:disable-next-line: only-arrow-functions\r\n function (d, b) {\r\n for (var p in b) {\r\n if (b[strHasOwnProperty](p)) {\r\n d[p] = b[p];\r\n }\r\n }\r\n };\r\n return extendStaticsFn(d, b);\r\n};\r\nexport function __extendsFn(d, b) {\r\n if (typeof b !== strShimFunction && b !== null) {\r\n throwTypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n }\r\n extendStaticsFn(d, b);\r\n function __() {\r\n this.constructor = d;\r\n }\r\n // tslint:disable-next-line: ban-comma-operator\r\n d[strShimPrototype] = b === null ? objCreate(b) : (__[strShimPrototype] = b[strShimPrototype], new __());\r\n}\r\nexport function __restFn(s, e) {\r\n var t = {};\r\n for (var k in s) {\r\n if (objHasOwnProperty(s, k) && e.indexOf(k) < 0) {\r\n t[k] = s[k];\r\n }\r\n }\r\n if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) {\r\n for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && ObjProto[\"propertyIsEnumerable\"].call(s, p[i])) {\r\n t[p[i]] = s[p[i]];\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\nexport function __decorateFn(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass[\"getOwnPropertyDescriptor\"](target, key) : desc, d;\r\n if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) {\r\n r = ReflectObj[strDecorate](decorators, target, key, desc);\r\n }\r\n else {\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n // eslint-disable-next-line no-cond-assign\r\n if (d = decorators[i]) {\r\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n }\r\n }\r\n }\r\n // tslint:disable-next-line:ban-comma-operator\r\n return c > 3 && r && objDefineProp(target, key, r), r;\r\n}\r\nexport function __paramFn(paramIndex, decorator) {\r\n return function (target, key) {\r\n decorator(target, key, paramIndex);\r\n };\r\n}\r\nexport function __metadataFn(metadataKey, metadataValue) {\r\n if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) {\r\n return ReflectObj[strMetadata](metadataKey, metadataValue);\r\n }\r\n}\r\nexport function __exportStarFn(m, o) {\r\n for (var p in m) {\r\n if (p !== strDefault && !objHasOwnProperty(o, p)) {\r\n __createBindingFn(o, m, p);\r\n }\r\n }\r\n}\r\nexport function __createBindingFn(o, m, k, k2) {\r\n if (k2 === undefined) {\r\n k2 = k;\r\n }\r\n if (!!objDefineProp) {\r\n objDefineProp(o, k2, {\r\n enumerable: true,\r\n get: function () {\r\n return m[k];\r\n }\r\n });\r\n }\r\n else {\r\n o[k2] = m[k];\r\n }\r\n}\r\nexport function __valuesFn(o) {\r\n var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0;\r\n if (m) {\r\n return m.call(o);\r\n }\r\n if (o && typeof o.length === \"number\") {\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) {\r\n o = void 0;\r\n }\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }\r\n throwTypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\nexport function __readFn(o, n) {\r\n var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]];\r\n if (!m) {\r\n return o;\r\n }\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\r\n ar.push(r.value);\r\n }\r\n }\r\n catch (error) {\r\n e = {\r\n error: error\r\n };\r\n }\r\n finally {\r\n try {\r\n // tslint:disable-next-line:no-conditional-assignment\r\n if (r && !r.done && (m = i[\"return\"])) {\r\n m.call(i);\r\n }\r\n }\r\n finally {\r\n if (e) {\r\n // eslint-disable-next-line no-unsafe-finally\r\n throw e.error;\r\n }\r\n }\r\n }\r\n return ar;\r\n}\r\n/** @deprecated */\r\nexport function __spreadArraysFn() {\r\n var theArgs = arguments;\r\n // Calculate new total size\r\n for (var s = 0, i = 0, il = theArgs.length; i < il; i++) {\r\n s += theArgs[i].length;\r\n }\r\n // Create new full array\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\r\n for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) {\r\n r[k] = a[j];\r\n }\r\n }\r\n return r;\r\n}\r\nexport function __spreadArrayFn(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {\r\n to[j] = from[i];\r\n }\r\n return to;\r\n}\r\nexport function __makeTemplateObjectFn(cooked, raw) {\r\n if (objDefineProp) {\r\n objDefineProp(cooked, \"raw\", { value: raw });\r\n }\r\n else {\r\n cooked.raw = raw;\r\n }\r\n return cooked;\r\n}\r\nexport function __importStarFn(mod) {\r\n if (mod && mod.__esModule) {\r\n return mod;\r\n }\r\n var result = {};\r\n if (mod != null) {\r\n for (var k in mod) {\r\n if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) {\r\n __createBindingFn(result, mod, k);\r\n }\r\n }\r\n }\r\n // Set default module\r\n if (!!objDefineProp) {\r\n objDefineProp(result, strDefault, { enumerable: true, value: mod });\r\n }\r\n else {\r\n result[strDefault] = mod;\r\n }\r\n return result;\r\n}\r\nexport function __importDefaultFn(mod) {\r\n return (mod && mod.__esModule) ? mod : { strDefault: mod };\r\n}\r\n//# sourceMappingURL=TsLibShims.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar _a;\r\nimport { getGlobal, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\r\n;\r\nvar UNDEFINED = \"undefined\";\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Constructor = 'constructor';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Prototype = 'prototype';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strFunction = 'function';\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */\r\nvar DynInstFuncTable = '_dynInstFuncs';\r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */\r\nvar DynProxyTag = '_isDynProxy';\r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */\r\nvar DynClassName = '_dynClass';\r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */\r\nvar DynClassNamePrefix = '_dynCls$';\r\n/**\r\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\r\n * @ignore\r\n */\r\nvar DynInstChkTag = '_dynInstChk';\r\n/**\r\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same\r\n * tag name as the function level but a different const name for readability only.\r\n */\r\nvar DynAllowInstChkTag = DynInstChkTag;\r\n/**\r\n * The global (imported) instances where the global performance options are stored\r\n */\r\nvar DynProtoDefaultOptions = '_dfOpts';\r\n/**\r\n * Value used as the name of a class when it cannot be determined\r\n * @ignore\r\n */\r\nvar UnknownValue = '_unknown_';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar str__Proto = \"__proto__\";\r\n/**\r\n * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist\r\n */\r\nvar DynProtoBaseProto = \"_dyn\" + str__Proto;\r\n/**\r\n * Runtime Global holder for dynamicProto settings\r\n */\r\nvar DynProtoGlobalSettings = \"__dynProto$Gbl\";\r\n/**\r\n * Track the current prototype for IE8 as you can't look back to get the prototype\r\n */\r\nvar DynProtoCurrent = \"_dynInstProto\";\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strUseBaseInst = 'useBaseInst';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strSetInstFuncs = 'setInstFuncs';\r\nvar Obj = Object;\r\n/**\r\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nvar _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\r\n/**\r\n * Pre-lookup to check for the existence of this function\r\n */\r\nvar _objGetOwnProps = Obj[\"getOwnPropertyNames\"];\r\n// Since 1.1.7 moving these to the runtime global to work around mixed version and module issues\r\n// See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details\r\nvar _gbl = getGlobal();\r\nvar _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {\r\n o: (_a = {},\r\n _a[strSetInstFuncs] = true,\r\n _a[strUseBaseInst] = true,\r\n _a),\r\n n: 1000 // Start new global index @ 1000 so we \"fix\" some cases when mixed with 1.1.6 or earlier\r\n});\r\n/**\r\n * Helper used to check whether the target is an Object prototype or Array prototype\r\n * @ignore\r\n */\r\nfunction _isObjectOrArrayPrototype(target) {\r\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */\r\nfunction _isObjectArrayOrFunctionPrototype(target) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */\r\nfunction _getObjProto(target) {\r\n var newProto;\r\n if (target) {\r\n // This method doesn't exist in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\r\n // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class\r\n newProto = target[DynProtoBaseProto] || curProto;\r\n if (!objHasOwnProperty(target, DynProtoBaseProto)) {\r\n // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it\r\n // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class)\r\n delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy\r\n newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];\r\n target[DynProtoCurrent] = curProto;\r\n }\r\n }\r\n return newProto;\r\n}\r\n/**\r\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\r\n * are not enumerable.\r\n * @param target\r\n */\r\nfunction _forEachProp(target, func) {\r\n var props = [];\r\n if (_objGetOwnProps) {\r\n props = _objGetOwnProps(target);\r\n }\r\n else {\r\n for (var name_1 in target) {\r\n if (typeof name_1 === \"string\" && objHasOwnProperty(target, name_1)) {\r\n props.push(name_1);\r\n }\r\n }\r\n }\r\n if (props && props.length > 0) {\r\n for (var lp = 0; lp < props.length; lp++) {\r\n func(props[lp]);\r\n }\r\n }\r\n}\r\n/**\r\n * Helper function to check whether the provided function name is a potential candidate for dynamic\r\n * callback and prototype generation.\r\n * @param target The target object, may be a prototype or class object\r\n * @param funcName The function name\r\n * @param skipOwn Skips the check for own property\r\n * @ignore\r\n */\r\nfunction _isDynamicCandidate(target, funcName, skipOwn) {\r\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)));\r\n}\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message) {\r\n throwTypeError(\"DynamicProto: \" + message);\r\n}\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does\r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget) {\r\n // Get the base proto\r\n var instFuncs = {};\r\n // Save any existing instance functions\r\n _forEachProp(thisTarget, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\r\n // Create an instance callback for passing the base function to the caller\r\n instFuncs[name] = thisTarget[name];\r\n }\r\n });\r\n return instFuncs;\r\n}\r\n/**\r\n * Returns whether the value is included in the array\r\n * @param values The array of values\r\n * @param value The value\r\n */\r\nfunction _hasVisited(values, value) {\r\n for (var lp = values.length - 1; lp >= 0; lp--) {\r\n if (values[lp] === value) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\r\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\r\n * @param target The current instance\r\n * @ignore\r\n */\r\nfunction _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {\r\n function _instFuncProxy(target, funcHost, funcName) {\r\n var theFunc = funcHost[funcName];\r\n if (theFunc[DynProxyTag] && useBaseInst) {\r\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\r\n }\r\n }\r\n return function () {\r\n // eslint-disable-next-line prefer-rest-params\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = {};\r\n _forEachProp(instFuncs, function (name) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\r\n });\r\n // Get the base prototype functions\r\n var baseProto = _getObjProto(classProto);\r\n var visited = [];\r\n // Don't include base object functions for Object, Array or Function\r\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\r\n // look for prototype functions\r\n _forEachProp(baseProto, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \r\n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\r\n // the Object prototype methods while bypassing the check\r\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\r\n }\r\n });\r\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(baseProto);\r\n baseProto = _getObjProto(baseProto);\r\n }\r\n return baseFuncs;\r\n}\r\nfunction _getInstFunc(target, funcName, proto, currentDynProtoProxy) {\r\n var instFunc = null;\r\n // We need to check whether the class name is defined directly on this prototype otherwise\r\n // it will walk the proto chain and return any parent proto classname.\r\n if (target && objHasOwnProperty(proto, DynClassName)) {\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];\r\n if (!instFunc) {\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\r\n // We have the instance function, lets check it we can speed up further calls\r\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\r\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\r\n // If the instance already has an instance function we can't replace it\r\n var canAddInst = !objHasOwnProperty(target, funcName);\r\n // Get current prototype\r\n var objProto = _getObjProto(target);\r\n var visited = [];\r\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\r\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\r\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\r\n var protoFunc = objProto[funcName];\r\n if (protoFunc) {\r\n canAddInst = (protoFunc === currentDynProtoProxy);\r\n break;\r\n }\r\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\r\n visited.push(objProto);\r\n objProto = _getObjProto(objProto);\r\n }\r\n try {\r\n if (canAddInst) {\r\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\r\n // so it's safe to directly assign for any subsequent calls (for better performance)\r\n target[funcName] = instFunc;\r\n }\r\n // Block further attempts to set the instance function for any\r\n instFunc[DynInstChkTag] = 1;\r\n }\r\n catch (e) {\r\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\r\n // And set a flag so we don't try again for any function\r\n instFuncTable[DynAllowInstChkTag] = false;\r\n }\r\n }\r\n }\r\n return instFunc;\r\n}\r\nfunction _getProtoFunc(funcName, proto, currentDynProtoProxy) {\r\n var protoFunc = proto[funcName];\r\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\r\n if (protoFunc === currentDynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n if (typeof protoFunc !== strFunction) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n return protoFunc;\r\n}\r\n/**\r\n * Add the required dynamic prototype methods to the the class prototype\r\n * @param proto - The class prototype\r\n * @param className - The instance classname\r\n * @param target - The target instance\r\n * @param baseInstFuncs - The base instance functions\r\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\r\n * @ignore\r\n */\r\nfunction _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {\r\n function _createDynamicPrototype(proto, funcName) {\r\n var dynProtoProxy = function () {\r\n // Use the instance or prototype function\r\n var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\r\n // eslint-disable-next-line prefer-rest-params\r\n return instFunc.apply(this, arguments);\r\n };\r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n dynProtoProxy[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};\r\n var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet\r\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\r\n }\r\n _forEachProp(target, function (name) {\r\n // Only add overridden functions\r\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {\r\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\r\n instFuncs_1[name] = target[name];\r\n delete target[name];\r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto, thisTarget) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\r\n var visited = [];\r\n var thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(thisProto);\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n return false;\r\n }\r\n // If objGetPrototypeOf doesn't exist then just assume everything is ok.\r\n return true;\r\n}\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target\r\n * @param unknownValue\r\n * @ignore\r\n */\r\nfunction _getObjName(target, unknownValue) {\r\n if (objHasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue;\r\n }\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is\r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass - This is the current class instance which contains the prototype for the current class\r\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\r\n * @param options - Additional options to configure how the dynamic prototype operates\r\n */\r\nexport default function dynamicProto(theClass, target, delegateFunc, options) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!objHasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n var classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] not in hierarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (objHasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n }\r\n else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _gblInst.n;\r\n _gblInst.n++;\r\n classProto[DynClassName] = className;\r\n }\r\n var perfOptions = dynamicProto[DynProtoDefaultOptions];\r\n var useBaseInst = !!perfOptions[strUseBaseInst];\r\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\r\n useBaseInst = !!options[strUseBaseInst];\r\n }\r\n // Get the current instance functions\r\n var instFuncs = _getInstanceFuncs(target);\r\n // Get all of the functions for any base instance (before they are potentially overridden)\r\n var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\r\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\r\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\r\n delegateFunc(target, baseFuncs);\r\n // Don't allow setting instance functions for older IE instances\r\n var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];\r\n if (setInstanceFunc && options) {\r\n setInstanceFunc = !!options[strSetInstFuncs];\r\n }\r\n // Populate the Prototype for any overridden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\r\n}\r\n/**\r\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\r\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\r\n * their internal usage of dynamic proto.\r\n */\r\ndynamicProto[DynProtoDefaultOptions] = _gblInst.o;\r\n//# sourceMappingURL=DynamicProto.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 9\r\nexport var _DYN_BLK_VAL = \"blkVal\"; // Count: 5\r\nexport var _DYN_LENGTH = \"length\"; // Count: 43\r\nexport var _DYN_RD_ONLY = \"rdOnly\"; // Count: 4\r\nexport var _DYN_NOTIFY = \"notify\"; // Count: 4\r\nexport var _DYN_WARN_TO_CONSOLE = \"warnToConsole\"; // Count: 4\r\nexport var _DYN_THROW_INTERNAL = \"throwInternal\"; // Count: 5\r\nexport var _DYN_SET_DF = \"setDf\"; // Count: 6\r\nexport var _DYN_WATCH = \"watch\"; // Count: 9\r\nexport var _DYN_LOGGER = \"logger\"; // Count: 21\r\nexport var _DYN_APPLY = \"apply\"; // Count: 7\r\nexport var _DYN_PUSH = \"push\"; // Count: 31\r\nexport var _DYN_SPLICE = \"splice\"; // Count: 8\r\nexport var _DYN_HDLR = \"hdlr\"; // Count: 6\r\nexport var _DYN_CANCEL = \"cancel\"; // Count: 5\r\nexport var _DYN_INITIALIZE = \"initialize\"; // Count: 4\r\nexport var _DYN_IDENTIFIER = \"identifier\"; // Count: 8\r\nexport var _DYN_IS_INITIALIZED = \"isInitialized\"; // Count: 10\r\nexport var _DYN_GET_PLUGIN = \"getPlugin\"; // Count: 6\r\nexport var _DYN_POLL_INTERNAL_LOGS = \"pollInternalLogs\"; // Count: 2\r\nexport var _DYN_NAME = \"name\"; // Count: 11\r\nexport var _DYN_TIME = \"time\"; // Count: 6\r\nexport var _DYN_PROCESS_NEXT = \"processNext\"; // Count: 15\r\nexport var _DYN_GET_PROCESS_TEL_CONT0 = \"getProcessTelContext\"; // Count: 2\r\nexport var _DYN_GET_NOTIFY_MGR = \"getNotifyMgr\"; // Count: 5\r\nexport var _DYN_ADD_NOTIFICATION_LIS1 = \"addNotificationListener\"; // Count: 4\r\nexport var _DYN_REMOVE_NOTIFICATION_2 = \"removeNotificationListener\"; // Count: 4\r\nexport var _DYN_ENABLED = \"enabled\"; // Count: 6\r\nexport var _DYN_STOP_POLLING_INTERNA3 = \"stopPollingInternalLogs\"; // Count: 2\r\nexport var _DYN_UNLOAD = \"unload\"; // Count: 9\r\nexport var _DYN_ON_COMPLETE = \"onComplete\"; // Count: 5\r\nexport var _DYN_VERSION = \"version\"; // Count: 6\r\nexport var _DYN_LOGGING_LEVEL_CONSOL4 = \"loggingLevelConsole\"; // Count: 2\r\nexport var _DYN_CREATE_NEW = \"createNew\"; // Count: 7\r\nexport var _DYN_TEARDOWN = \"teardown\"; // Count: 9\r\nexport var _DYN_MESSAGE_ID = \"messageId\"; // Count: 4\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 6\r\nexport var _DYN_IS_ASYNC = \"isAsync\"; // Count: 6\r\nexport var _DYN_DIAG_LOG = \"diagLog\"; // Count: 10\r\nexport var _DYN__DO_TEARDOWN = \"_doTeardown\"; // Count: 4\r\nexport var _DYN_UPDATE = \"update\"; // Count: 6\r\nexport var _DYN_GET_NEXT = \"getNext\"; // Count: 12\r\nexport var _DYN_SET_NEXT_PLUGIN = \"setNextPlugin\"; // Count: 5\r\nexport var _DYN_USER_AGENT = \"userAgent\"; // Count: 5\r\nexport var _DYN_SPLIT = \"split\"; // Count: 6\r\nexport var _DYN_NODE_TYPE = \"nodeType\"; // Count: 3\r\nexport var _DYN_REPLACE = \"replace\"; // Count: 8\r\nexport var _DYN_LOG_INTERNAL_MESSAGE = \"logInternalMessage\"; // Count: 2\r\nexport var _DYN_TYPE = \"type\"; // Count: 14\r\nexport var _DYN_HANDLER = \"handler\"; // Count: 5\r\nexport var _DYN_IS_CHILD_EVT = \"isChildEvt\"; // Count: 3\r\nexport var _DYN_GET_CTX = \"getCtx\"; // Count: 6\r\nexport var _DYN_SET_CTX = \"setCtx\"; // Count: 10\r\nexport var _DYN_COMPLETE = \"complete\"; // Count: 3\r\nexport var _DYN_TRACE_ID = \"traceId\"; // Count: 5\r\nexport var _DYN_SPAN_ID = \"spanId\"; // Count: 5\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 6\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, createCustomError, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nvar aggregationErrorType;\r\n/**\r\n * Throws an Aggregation Error which includes all of the errors that led to this error occurring\r\n * @param message - The message describing the aggregation error (the sourceError details are added to this)\r\n * @param sourceErrors - An array of the errors that caused this situation\r\n */\r\nexport function throwAggregationError(message, sourceErrors) {\r\n if (!aggregationErrorType) {\r\n aggregationErrorType = createCustomError(\"AggregationError\", function (self, args) {\r\n if (args[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n // Save the provided errors\r\n self.errors = args[1];\r\n }\r\n });\r\n }\r\n var theMessage = message || \"One or more errors occurred.\";\r\n arrForEach(sourceErrors, function (srcError, idx) {\r\n theMessage += \"\\n\".concat(idx, \" > \").concat(dumpObj(srcError));\r\n });\r\n throw new aggregationErrorType(theMessage, sourceErrors || []);\r\n}\r\n//# sourceMappingURL=AggregationError.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n// ###################################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE/ES5 this will export a mutable variables that someone could change ###\r\n// ###################################################################################################################################################\r\nexport var UNDEFINED_VALUE = undefined;\r\nexport var STR_EMPTY = \"\";\r\nexport var STR_CHANNELS = \"channels\";\r\nexport var STR_CORE = \"core\";\r\nexport var STR_CREATE_PERF_MGR = \"createPerfMgr\";\r\nexport var STR_DISABLED = \"disabled\";\r\nexport var STR_EXTENSION_CONFIG = \"extensionConfig\";\r\nexport var STR_EXTENSIONS = \"extensions\";\r\nexport var STR_PROCESS_TELEMETRY = \"processTelemetry\";\r\nexport var STR_PRIORITY = \"priority\";\r\nexport var STR_EVENTS_SENT = \"eventsSent\";\r\nexport var STR_EVENTS_DISCARDED = \"eventsDiscarded\";\r\nexport var STR_EVENTS_SEND_REQUEST = \"eventsSendRequest\";\r\nexport var STR_PERF_EVENT = \"perfEvent\";\r\nexport var STR_GET_PERF_MGR = \"getPerfMgr\";\r\nexport var STR_DOMAIN = \"domain\";\r\nexport var STR_PATH = \"path\";\r\nexport var STR_NOT_DYNAMIC_ERROR = \"Not dynamic - \";\r\n//# sourceMappingURL=InternalConstants.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { ObjAssign, ObjClass } from \"@microsoft/applicationinsights-shims\";\r\nimport { arrForEach, asString as asString21, isArray, isBoolean, isError, isFunction, isNullOrUndefined, isObject, isPlainObject, isString, isUndefined, objDeepFreeze, objDefine, objForEachKey, objHasOwn, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_LENGTH, _DYN_NAME, _DYN_REPLACE } from \"../__DynamicConstants\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\n// RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly\r\n// Added to help with minification\r\nvar strGetPrototypeOf = \"getPrototypeOf\";\r\nvar rCamelCase = /-([a-z])/g;\r\nvar rNormalizeInvalid = /([^\\w\\d_$])/g;\r\nvar rLeadingNumeric = /^(\\d+[\\w\\d_$])/;\r\nexport var _getObjProto = Object[strGetPrototypeOf];\r\nexport function isNotUndefined(value) {\r\n return !isUndefined(value);\r\n}\r\nexport function isNotNullOrUndefined(value) {\r\n return !isNullOrUndefined(value);\r\n}\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * This is a simplified version\r\n * @param name - The name to validate\r\n */\r\nexport function normalizeJsName(name) {\r\n var value = name;\r\n if (value && isString(value)) {\r\n // CamelCase everything after the \"-\" and remove the dash\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rCamelCase, function (_all, letter) {\r\n return letter.toUpperCase();\r\n });\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rNormalizeInvalid, \"_\");\r\n value = value[_DYN_REPLACE /* @min:%2ereplace */](rLeadingNumeric, function (_all, match) {\r\n return \"_\" + match;\r\n });\r\n }\r\n return value;\r\n}\r\n/**\r\n * A simple wrapper (for minification support) to check if the value contains the search string.\r\n * @param value - The string value to check for the existence of the search value\r\n * @param search - The value search within the value\r\n */\r\nexport function strContains(value, search) {\r\n if (value && search) {\r\n return strIndexOf(value, search) !== -1;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\nexport function toISOString(date) {\r\n return date && date.toISOString() || \"\";\r\n}\r\nexport var deepFreeze = objDeepFreeze;\r\n/**\r\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\r\n */\r\nexport function getExceptionName(object) {\r\n if (isError(object)) {\r\n return object[_DYN_NAME /* @min:%2ename */];\r\n }\r\n return STR_EMPTY;\r\n}\r\n/**\r\n * Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk\r\n * function will only be called if the new value is no equal to the original value.\r\n * @param target - The target object\r\n * @param field - The key of the target\r\n * @param value - The value to set\r\n * @param valChk - [Optional] Callback to check the value that if supplied will be called check if the new value can be set\r\n * @param srcChk - [Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)\r\n * @returns The existing or new value, depending what was set\r\n */\r\nexport function setValue(target, field, value, valChk, srcChk) {\r\n var theValue = value;\r\n if (target) {\r\n theValue = target[field];\r\n if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {\r\n theValue = value;\r\n target[field] = theValue;\r\n }\r\n }\r\n return theValue;\r\n}\r\n/**\r\n * Returns the current value from the target object if not null or undefined otherwise sets the new value and returns it\r\n * @param target - The target object to return or set the default value\r\n * @param field - The key for the field to set on the target\r\n * @param defValue - [Optional] The value to set if not already present, when not provided a empty object will be added\r\n */\r\nexport function getSetValue(target, field, defValue) {\r\n var theValue;\r\n if (target) {\r\n theValue = target[field];\r\n if (!theValue && isNullOrUndefined(theValue)) {\r\n // Supports having the default as null\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n target[field] = theValue;\r\n }\r\n }\r\n else {\r\n // Expanded for performance so we only check defValue if required\r\n theValue = !isUndefined(defValue) ? defValue : {};\r\n }\r\n return theValue;\r\n}\r\nfunction _createProxyFunction(source, funcName) {\r\n var srcFunc = null;\r\n var src = null;\r\n if (isFunction(source)) {\r\n srcFunc = source;\r\n }\r\n else {\r\n src = source;\r\n }\r\n return function () {\r\n // Capture the original arguments passed to the method\r\n var originalArguments = arguments;\r\n if (srcFunc) {\r\n src = srcFunc();\r\n }\r\n if (src) {\r\n return src[funcName][_DYN_APPLY /* @min:%2eapply */](src, originalArguments);\r\n }\r\n };\r\n}\r\n/**\r\n * Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from\r\n * the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential\r\n * implementation issues by assigning prototype functions as instance ones\r\n *\r\n * This method is the primary method used to \"update\" the snippet proxy with the ultimate implementations.\r\n *\r\n * Special ES3 Notes:\r\n * Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the\r\n * properties of \"referenced\" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the\r\n * same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param chkSet - An optional callback to determine whether a specific property/function should be proxied\r\n */\r\nexport function proxyAssign(target, source, chkSet) {\r\n if (target && source && isObject(target) && isObject(source)) {\r\n var _loop_1 = function (field) {\r\n if (isString(field)) {\r\n var value = source[field];\r\n if (isFunction(value)) {\r\n if (!chkSet || chkSet(field, true, source, target)) {\r\n // Create a proxy function rather than just copying the (possible) prototype to the new object as an instance function\r\n target[field] = _createProxyFunction(source, field);\r\n }\r\n }\r\n else if (!chkSet || chkSet(field, false, source, target)) {\r\n if (objHasOwn(target, field)) {\r\n // Remove any previous instance property\r\n delete target[field];\r\n }\r\n objDefine(target, field, {\r\n g: function () {\r\n return source[field];\r\n },\r\n s: function (theValue) {\r\n source[field] = theValue;\r\n }\r\n });\r\n }\r\n }\r\n };\r\n // effectively apply/proxy full source to the target instance\r\n for (var field in source) {\r\n _loop_1(field);\r\n }\r\n }\r\n return target;\r\n}\r\n/**\r\n * Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method.\r\n *\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param name - The function name that will be added on the target\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param theFunc - The function name on the source that will be proxied on the target\r\n * @param overwriteTarget - If `false` this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\r\n */\r\nexport function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {\r\n if (target && name && source) {\r\n if (overwriteTarget !== false || isUndefined(target[name])) {\r\n target[name] = _createProxyFunction(source, theFunc);\r\n }\r\n }\r\n}\r\n/**\r\n * Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.\r\n *\r\n * @param target - The target object to be assigned with the source properties and functions\r\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\r\n * @param functionsToProxy - An array of function names that will be proxied on the target\r\n * @param overwriteTarget - If false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\r\n */\r\nexport function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {\r\n if (target && source && isObject(target) && isArray(functionsToProxy)) {\r\n arrForEach(functionsToProxy, function (theFuncName) {\r\n if (isString(theFuncName)) {\r\n proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget);\r\n }\r\n });\r\n }\r\n return target;\r\n}\r\n/**\r\n * Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults.\r\n * Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance\r\n * @param defaults - Simple helper\r\n */\r\nexport function createClassFromInterface(defaults) {\r\n return /** @class */ (function () {\r\n function class_1() {\r\n var _this = this;\r\n if (defaults) {\r\n objForEachKey(defaults, function (field, value) {\r\n _this[field] = value;\r\n });\r\n }\r\n }\r\n return class_1;\r\n }());\r\n}\r\n/**\r\n * A helper function to assist with JIT performance for objects that have properties added / removed dynamically\r\n * this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this\r\n * function after you have finished \"updating\" the object, calling this within loops reduces or defeats the benefits.\r\n * This helps when iterating using for..in, objKeys() and objForEach()\r\n * @param theObject - The object to be optimized if possible\r\n */\r\nexport function optimizeObject(theObject) {\r\n // V8 Optimization to cause the JIT compiler to create a new optimized object for looking up the own properties\r\n // primarily for object with <= 19 properties for >= 20 the effect is reduced or non-existent\r\n if (theObject && ObjAssign) {\r\n theObject = ObjClass(ObjAssign({}, theObject));\r\n }\r\n return theObject;\r\n}\r\nexport function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {\r\n // Variables\r\n var theArgs = arguments;\r\n var extended = theArgs[0] || {};\r\n var argLen = theArgs[_DYN_LENGTH /* @min:%2elength */];\r\n var deep = false;\r\n var idx = 1;\r\n // Check for \"Deep\" flag\r\n if (argLen > 0 && isBoolean(extended)) {\r\n deep = extended;\r\n extended = theArgs[idx] || {};\r\n idx++;\r\n }\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if (!isObject(extended)) {\r\n extended = {};\r\n }\r\n // Loop through each remaining object and conduct a merge\r\n for (; idx < argLen; idx++) {\r\n var arg = theArgs[idx];\r\n var isArgArray = isArray(arg);\r\n var isArgObj = isObject(arg);\r\n for (var prop in arg) {\r\n var propOk = (isArgArray && (prop in arg)) || (isArgObj && objHasOwn(arg, prop));\r\n if (!propOk) {\r\n continue;\r\n }\r\n var newValue = arg[prop];\r\n var isNewArray = void 0;\r\n // If deep merge and property is an object, merge properties\r\n if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {\r\n // Grab the current value of the extended object\r\n var clone = extended[prop];\r\n if (isNewArray) {\r\n if (!isArray(clone)) {\r\n // We can't \"merge\" an array with a non-array so overwrite the original\r\n clone = [];\r\n }\r\n }\r\n else if (!isPlainObject(clone)) {\r\n // We can't \"merge\" an object with a non-object\r\n clone = {};\r\n }\r\n // Never move the original objects always clone them\r\n newValue = objExtend(deep, clone, newValue);\r\n }\r\n // Assign the new (or previous) value (unless undefined)\r\n if (newValue !== undefined) {\r\n extended[prop] = newValue;\r\n }\r\n }\r\n }\r\n return extended;\r\n}\r\nexport var asString = asString21;\r\nexport function isFeatureEnabled(feature, cfg) {\r\n var rlt = false;\r\n var ft = cfg && cfg.featureOptIn && cfg.featureOptIn[feature];\r\n if (feature && ft) {\r\n var mode = ft.mode;\r\n // NOTE: None will be considered as true\r\n rlt = (mode == 3 /* FeatureOptInMode.enable */) || (mode == 1 /* FeatureOptInMode.none */);\r\n }\r\n return rlt;\r\n}\r\n//# sourceMappingURL=HelperFuncs.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { getGlobal, strShimObject, strShimPrototype, strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\nimport { getDocument, getInst, getNavigator, getPerformance, hasNavigator, isFunction, isString, isUndefined, strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_NAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE, _DYN_USER_AGENT } from \"../__DynamicConstants\";\r\nimport { strContains } from \"./HelperFuncs\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\n/**\r\n * This file exists to hold environment utilities that are required to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only use defined methods (functions) in this class so that users of these\r\n * functions/properties only need to include those that are used within their own modules.\r\n */\r\nvar strDocumentMode = \"documentMode\";\r\nvar strLocation = \"location\";\r\nvar strConsole = \"console\";\r\nvar strJSON = \"JSON\";\r\nvar strCrypto = \"crypto\";\r\nvar strMsCrypto = \"msCrypto\";\r\nvar strReactNative = \"ReactNative\";\r\nvar strMsie = \"msie\";\r\nvar strTrident = \"trident/\";\r\nvar strXMLHttpRequest = \"XMLHttpRequest\";\r\nvar _isTrident = null;\r\nvar _navUserAgentCheck = null;\r\nvar _enableMocks = false;\r\nvar _useXDomainRequest = null;\r\nvar _beaconsSupported = null;\r\nfunction _hasProperty(theClass, property) {\r\n var supported = false;\r\n if (theClass) {\r\n try {\r\n supported = property in theClass;\r\n if (!supported) {\r\n var proto = theClass[strShimPrototype];\r\n if (proto) {\r\n supported = property in proto;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n if (!supported) {\r\n try {\r\n var tmp = new theClass();\r\n supported = !isUndefined(tmp[property]);\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n }\r\n }\r\n return supported;\r\n}\r\n/**\r\n * Enable the lookup of test mock objects if requested\r\n * @param enabled\r\n */\r\nexport function setEnableEnvMocks(enabled) {\r\n _enableMocks = enabled;\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation(checkForMock) {\r\n if (checkForMock && _enableMocks) {\r\n var mockLocation = getInst(\"__mockLocation\");\r\n if (mockLocation) {\r\n return mockLocation;\r\n }\r\n }\r\n if (typeof location === strShimObject && location) {\r\n return location;\r\n }\r\n return getInst(strLocation);\r\n}\r\n/**\r\n * Returns the global console object\r\n */\r\nexport function getConsole() {\r\n if (typeof console !== strShimUndefined) {\r\n return console;\r\n }\r\n return getInst(strConsole);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getInst(strJSON);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getCrypto() {\r\n return getInst(strCrypto);\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getMsCrypto() {\r\n return getInst(strMsCrypto);\r\n}\r\n/**\r\n * Returns whether the environment is reporting that we are running in a React Native Environment\r\n */\r\nexport function isReactNative() {\r\n // If running in React Native, navigator.product will be populated\r\n var nav = getNavigator();\r\n if (nav && nav.product) {\r\n return nav.product === strReactNative;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Identifies whether the current environment appears to be IE\r\n */\r\nexport function isIE() {\r\n var nav = getNavigator();\r\n if (nav && (nav[_DYN_USER_AGENT /* @min:%2euserAgent */] !== _navUserAgentCheck || _isTrident === null)) {\r\n // Added to support test mocking of the user agent\r\n _navUserAgentCheck = nav[_DYN_USER_AGENT /* @min:%2euserAgent */];\r\n var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));\r\n }\r\n return _isTrident;\r\n}\r\n/**\r\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\r\n */\r\nexport function getIEVersion(userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n if (!userAgentStr) {\r\n var navigator_1 = getNavigator() || {};\r\n userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() : STR_EMPTY;\r\n }\r\n var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n // Also check for documentMode in case X-UA-Compatible meta tag was included in HTML.\r\n if (strContains(ua, strMsie)) {\r\n var doc = getDocument() || {};\r\n return Math.max(parseInt(ua[_DYN_SPLIT /* @min:%2esplit */](strMsie)[1]), (doc[strDocumentMode] || 0));\r\n }\r\n else if (strContains(ua, strTrident)) {\r\n var tridentVer = parseInt(ua[_DYN_SPLIT /* @min:%2esplit */](strTrident)[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\r\n}\r\nexport function isSafari(userAgentStr) {\r\n if (!userAgentStr || !isString(userAgentStr)) {\r\n var navigator_2 = getNavigator() || {};\r\n userAgentStr = navigator_2 ? (navigator_2.userAgent || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]() : STR_EMPTY;\r\n }\r\n var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n return (strIndexOf(ua, \"safari\") >= 0);\r\n}\r\n/**\r\n * Checks if HTML5 Beacons are supported in the current environment.\r\n * @param useCached - [Optional] used for testing to bypass the cached lookup, when `true` this will\r\n * cause the cached global to be reset.\r\n * @returns True if supported, false otherwise.\r\n */\r\nexport function isBeaconsSupported(useCached) {\r\n if (_beaconsSupported === null || useCached === false) {\r\n _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);\r\n }\r\n return _beaconsSupported;\r\n}\r\n/**\r\n * Checks if the Fetch API is supported in the current environment.\r\n * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isFetchSupported(withKeepAlive) {\r\n var isSupported = false;\r\n try {\r\n isSupported = !!getInst(\"fetch\");\r\n var request = getInst(\"Request\");\r\n if (isSupported && withKeepAlive && request) {\r\n isSupported = _hasProperty(request, \"keepalive\");\r\n }\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\nexport function useXDomainRequest() {\r\n if (_useXDomainRequest === null) {\r\n _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);\r\n if (_useXDomainRequest && isXhrSupported()) {\r\n _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), \"withCredentials\");\r\n }\r\n }\r\n return _useXDomainRequest;\r\n}\r\n/**\r\n * Checks if XMLHttpRequest is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isXhrSupported() {\r\n var isSupported = false;\r\n try {\r\n var xmlHttpRequest = getInst(strXMLHttpRequest);\r\n isSupported = !!xmlHttpRequest;\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\nfunction _getNamedValue(values, name) {\r\n if (values) {\r\n for (var i = 0; i < values[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var value = values[i];\r\n if (value[_DYN_NAME /* @min:%2ename */]) {\r\n if (value[_DYN_NAME /* @min:%2ename */] === name) {\r\n return value;\r\n }\r\n }\r\n }\r\n }\r\n return {};\r\n}\r\n/**\r\n * Helper function to fetch the named meta-tag from the page.\r\n * @param name\r\n */\r\nexport function findMetaTag(name) {\r\n var doc = getDocument();\r\n if (doc && name) {\r\n // Look for a meta-tag\r\n return _getNamedValue(doc.querySelectorAll(\"meta\"), name).content;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper function to fetch the named server timing value from the page response (first navigation event).\r\n * @param name\r\n */\r\nexport function findNamedServerTiming(name) {\r\n var value;\r\n var perf = getPerformance();\r\n if (perf) {\r\n // Try looking for a server-timing header\r\n var navPerf = perf.getEntriesByType(\"navigation\") || [];\r\n value = _getNamedValue((navPerf[_DYN_LENGTH /* @min:%2elength */] > 0 ? navPerf[0] : {}).serverTiming, name).description;\r\n }\r\n return value;\r\n}\r\n// TODO: should reuse this method for analytics plugin\r\nexport function dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n return true;\r\n }\r\n return false;\r\n}\r\nexport function createCustomDomEvent(eventName, details) {\r\n var event = null;\r\n var detail = { detail: details || null };\r\n if (isFunction(CustomEvent)) { // Use CustomEvent constructor when available\r\n event = new CustomEvent(eventName, detail);\r\n }\r\n else { // CustomEvent has no constructor in IE\r\n var doc = getDocument();\r\n if (doc && doc.createEvent) {\r\n event = doc.createEvent(\"CustomEvent\");\r\n event.initCustomEvent(eventName, true, true, detail);\r\n }\r\n }\r\n return event;\r\n}\r\nexport function sendCustomEvent(evtName, cfg, customDetails) {\r\n var global = getGlobal();\r\n if (global && global.CustomEvent) {\r\n try {\r\n var details = { cfg: cfg || null, customDetails: customDetails || null };\r\n return dispatchEvent(global, createCustomDomEvent(evtName, details));\r\n }\r\n catch (e) {\r\n // eslint-disable-next-line no-empty\r\n }\r\n }\r\n return false;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { utcNow } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { getCrypto, getMsCrypto, isIE } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nvar UInt32Mask = 0x100000000;\r\nvar MaxUInt32 = 0xffffffff;\r\nvar SEED1 = 123456789;\r\nvar SEED2 = 987654321;\r\n// MWC based Random generator (for IE)\r\nvar _mwcSeeded = false;\r\nvar _mwcW = SEED1;\r\nvar _mwcZ = SEED2;\r\n// Takes any integer\r\nfunction _mwcSeed(seedValue) {\r\n if (seedValue < 0) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n seedValue >>>= 0;\r\n }\r\n _mwcW = (SEED1 + seedValue) & MaxUInt32;\r\n _mwcZ = (SEED2 - seedValue) & MaxUInt32;\r\n _mwcSeeded = true;\r\n}\r\nfunction _autoSeedMwc() {\r\n // Simple initialization using default Math.random() - So we inherit any entropy from the browser\r\n // and bitwise XOR with the current milliseconds\r\n try {\r\n var now = utcNow() & 0x7fffffff;\r\n _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);\r\n }\r\n catch (e) {\r\n // Don't crash if something goes wrong\r\n }\r\n}\r\n/**\r\n * Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum.\r\n * So maxValue(16) will produce a number from 0..16 (range of 17)\r\n * @param maxValue\r\n */\r\nexport function randomValue(maxValue) {\r\n if (maxValue > 0) {\r\n return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;\r\n }\r\n return 0;\r\n}\r\n/**\r\n * generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function random32(signed) {\r\n var value = 0;\r\n var c = getCrypto() || getMsCrypto();\r\n if (c && c.getRandomValues) {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;\r\n }\r\n if (value === 0 && isIE()) {\r\n // For IE 6, 7, 8 (especially on XP) Math.random is not very random\r\n if (!_mwcSeeded) {\r\n // Set the seed for the Mwc algorithm\r\n _autoSeedMwc();\r\n }\r\n // Don't use Math.random for IE\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = mwcRandom32() & MaxUInt32;\r\n }\r\n if (value === 0) {\r\n // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF)\r\n value = Math.floor((UInt32Mask * Math.random()) | 0);\r\n }\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Seed the MWC random number generator with the specified seed or a random value\r\n * @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen\r\n */\r\nexport function mwcRandomSeed(value) {\r\n if (!value) {\r\n _autoSeedMwc();\r\n }\r\n else {\r\n _mwcSeed(value);\r\n }\r\n}\r\n/**\r\n * Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry)\r\n * instead of Math.random() defaults to un-signed.\r\n * Used as a replacement random generator for IE to avoid issues with older IE instances.\r\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\r\n */\r\nexport function mwcRandom32(signed) {\r\n _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;\r\n _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;\r\n var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;\r\n if (!signed) {\r\n // Make sure we end up with a positive number and not -ve one.\r\n value >>>= 0;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Generate random base64 id string.\r\n * The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)\r\n * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22\r\n */\r\nexport function newId(maxLength) {\r\n if (maxLength === void 0) { maxLength = 22; }\r\n var base64chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n // Start with an initial random number, consuming the value in reverse byte order\r\n var number = random32() >>> 0; // Make sure it's a +ve number\r\n var chars = 0;\r\n var result = STR_EMPTY;\r\n while (result[_DYN_LENGTH /* @min:%2elength */] < maxLength) {\r\n chars++;\r\n result += base64chars.charAt(number & 0x3F);\r\n number >>>= 6; // Zero fill with right shift\r\n if (chars === 5) {\r\n // 5 base64 characters === 30 bits so we don't have enough bits for another base64 char\r\n // So add on another 30 bits and make sure it's +ve\r\n number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;\r\n chars = 0; // We need to reset the number every 5 chars (30 bits)\r\n }\r\n }\r\n return result;\r\n}\r\n//# sourceMappingURL=RandomHelper.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nimport { _DYN_NODE_TYPE } from \"../__DynamicConstants\";\r\nimport { normalizeJsName } from \"./HelperFuncs\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nimport { newId } from \"./RandomHelper\";\r\nvar version = '3.0.3';\r\nvar instanceName = \".\" + newId(6);\r\nvar _dataUid = 0;\r\n// Accepts only:\r\n// - Node\r\n// - Node.ELEMENT_NODE\r\n// - Node.DOCUMENT_NODE\r\n// - Object\r\n// - Any\r\nfunction _canAcceptData(target) {\r\n return target[_DYN_NODE_TYPE /* @min:%2enodeType */] === 1 || target[_DYN_NODE_TYPE /* @min:%2enodeType */] === 9 || !(+target[_DYN_NODE_TYPE /* @min:%2enodeType */]);\r\n}\r\nfunction _getCache(data, target) {\r\n var theCache = target[data.id];\r\n if (!theCache) {\r\n theCache = {};\r\n try {\r\n if (_canAcceptData(target)) {\r\n objDefine(target, data.id, {\r\n e: false,\r\n v: theCache\r\n });\r\n }\r\n }\r\n catch (e) {\r\n // Not all environments allow extending all objects, so just ignore the cache in those cases\r\n }\r\n }\r\n return theCache;\r\n}\r\nexport function createUniqueNamespace(name, includeVersion) {\r\n if (includeVersion === void 0) { includeVersion = false; }\r\n return normalizeJsName(name + (_dataUid++) + (includeVersion ? \".\" + version : STR_EMPTY) + instanceName);\r\n}\r\nexport function createElmNodeData(name) {\r\n var data = {\r\n id: createUniqueNamespace(\"_aiData-\" + (name || STR_EMPTY) + \".\" + version),\r\n accept: function (target) {\r\n return _canAcceptData(target);\r\n },\r\n get: function (target, name, defValue, addDefault) {\r\n var theCache = target[data.id];\r\n if (!theCache) {\r\n if (addDefault) {\r\n // Side effect is adds the cache\r\n theCache = _getCache(data, target);\r\n theCache[normalizeJsName(name)] = defValue;\r\n }\r\n return defValue;\r\n }\r\n return theCache[normalizeJsName(name)];\r\n },\r\n kill: function (target, name) {\r\n if (target && target[name]) {\r\n try {\r\n delete target[name];\r\n }\r\n catch (e) {\r\n // Just cleaning up, so if this fails -- ignore\r\n }\r\n }\r\n }\r\n };\r\n return data;\r\n}\r\n//# sourceMappingURL=DataCacheHelper.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { asString, isArray, isDefined, isNullOrUndefined, isObject, isPlainObject, isUndefined, objForEachKey, objHasOwn } from \"@nevware21/ts-utils\";\r\nimport { _DYN_BLK_VAL, _DYN_LENGTH, _DYN_RD_ONLY } from \"../__DynamicConstants\";\r\nfunction _isConfigDefaults(value) {\r\n return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, \"v\") || objHasOwn(value, \"mrg\") || objHasOwn(value, \"ref\") || value.set));\r\n}\r\nfunction _getDefault(dynamicHandler, theConfig, cfgDefaults) {\r\n var defValue;\r\n var isDefaultValid = cfgDefaults.dfVal || isDefined;\r\n // There is a fallback config key so try and grab that first\r\n if (theConfig && cfgDefaults.fb) {\r\n var fallbacks = cfgDefaults.fb;\r\n if (!isArray(fallbacks)) {\r\n fallbacks = [fallbacks];\r\n }\r\n for (var lp = 0; lp < fallbacks[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var fallback = fallbacks[lp];\r\n var fbValue = theConfig[fallback];\r\n if (isDefaultValid(fbValue)) {\r\n defValue = fbValue;\r\n }\r\n else if (dynamicHandler) {\r\n // Needed to ensure that the fallback value (and potentially) new field is also dynamic even if null/undefined\r\n fbValue = dynamicHandler.cfg[fallback];\r\n if (isDefaultValid(fbValue)) {\r\n defValue = fbValue;\r\n }\r\n // Needed to ensure that the fallback value (and potentially) new field is also dynamic even if null/undefined\r\n dynamicHandler.set(dynamicHandler.cfg, asString(fallback), fbValue);\r\n }\r\n if (isDefaultValid(defValue)) {\r\n // We have a valid default so break out of the look\r\n break;\r\n }\r\n }\r\n }\r\n // If the value is still not defined and we have a default value then use that\r\n if (!isDefaultValid(defValue) && isDefaultValid(cfgDefaults.v)) {\r\n defValue = cfgDefaults.v;\r\n }\r\n return defValue;\r\n}\r\n/**\r\n * Recursively resolve the default value\r\n * @param dynamicHandler\r\n * @param theConfig\r\n * @param cfgDefaults\r\n * @returns\r\n */\r\nfunction _resolveDefaultValue(dynamicHandler, theConfig, cfgDefaults) {\r\n var theValue = cfgDefaults;\r\n if (cfgDefaults && _isConfigDefaults(cfgDefaults)) {\r\n theValue = _getDefault(dynamicHandler, theConfig, cfgDefaults);\r\n }\r\n if (theValue) {\r\n if (_isConfigDefaults(theValue)) {\r\n theValue = _resolveDefaultValue(dynamicHandler, theConfig, theValue);\r\n }\r\n var newValue_1;\r\n if (isArray(theValue)) {\r\n newValue_1 = [];\r\n newValue_1[_DYN_LENGTH /* @min:%2elength */] = theValue[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n else if (isPlainObject(theValue)) {\r\n newValue_1 = {};\r\n }\r\n if (newValue_1) {\r\n objForEachKey(theValue, function (key, value) {\r\n if (value && _isConfigDefaults(value)) {\r\n value = _resolveDefaultValue(dynamicHandler, theConfig, value);\r\n }\r\n newValue_1[key] = value;\r\n });\r\n theValue = newValue_1;\r\n }\r\n }\r\n return theValue;\r\n}\r\n/**\r\n * Applies the default value on the config property and makes sure that it's dynamic\r\n * @param theConfig\r\n * @param name\r\n * @param defaultValue\r\n */\r\nexport function _applyDefaultValue(dynamicHandler, theConfig, name, defaultValue) {\r\n // Resolve the initial config value from the provided value or use the defined default\r\n var isValid;\r\n var setFn;\r\n var defValue;\r\n var cfgDefaults = defaultValue;\r\n var mergeDf;\r\n var reference;\r\n var readOnly;\r\n var blkDynamicValue;\r\n if (_isConfigDefaults(cfgDefaults)) {\r\n // looks like a IConfigDefault\r\n isValid = cfgDefaults.isVal;\r\n setFn = cfgDefaults.set;\r\n readOnly = cfgDefaults[_DYN_RD_ONLY /* @min:%2erdOnly */];\r\n blkDynamicValue = cfgDefaults[_DYN_BLK_VAL /* @min:%2eblkVal */];\r\n mergeDf = cfgDefaults.mrg;\r\n reference = cfgDefaults.ref;\r\n if (!reference && isUndefined(reference)) {\r\n reference = !!mergeDf;\r\n }\r\n defValue = _getDefault(dynamicHandler, theConfig, cfgDefaults);\r\n }\r\n else {\r\n defValue = defaultValue;\r\n }\r\n if (blkDynamicValue) {\r\n // Mark the property so that any value assigned will be blocked from conversion, we need to do this\r\n // before assigning or fetching the value to ensure it's not converted\r\n dynamicHandler[_DYN_BLK_VAL /* @min:%2eblkVal */](theConfig, name);\r\n }\r\n // Set the value to the default value;\r\n var theValue;\r\n var usingDefault = true;\r\n var cfgValue = theConfig[name];\r\n // try and get and user provided values\r\n if (cfgValue || !isNullOrUndefined(cfgValue)) {\r\n // Use the defined theConfig[name] value\r\n theValue = cfgValue;\r\n usingDefault = false;\r\n // The values are different and we have a special default value check, which is used to\r\n // override config values like empty strings to continue using the default\r\n if (isValid && theValue !== defValue && !isValid(theValue)) {\r\n theValue = defValue;\r\n usingDefault = true;\r\n }\r\n if (setFn) {\r\n theValue = setFn(theValue, defValue, theConfig);\r\n usingDefault = theValue === defValue;\r\n }\r\n }\r\n if (!usingDefault) {\r\n if (isPlainObject(theValue) || isArray(defValue)) {\r\n // we are using the user supplied value and it's an object\r\n if (mergeDf && defValue && (isPlainObject(defValue) || isArray(defValue))) {\r\n // Resolve/apply the defaults\r\n objForEachKey(defValue, function (dfName, dfValue) {\r\n // Sets the value and makes it dynamic (if it doesn't already exist)\r\n _applyDefaultValue(dynamicHandler, theValue, dfName, dfValue);\r\n });\r\n }\r\n }\r\n }\r\n else if (defValue) {\r\n // Just resolve the default\r\n theValue = _resolveDefaultValue(dynamicHandler, theConfig, defValue);\r\n }\r\n else {\r\n theValue = defValue;\r\n }\r\n // if (theValue && usingDefault && (isPlainObject(theValue) || isArray(theValue))) {\r\n // theValue = _cfgDeepCopy(theValue);\r\n // }\r\n // Needed to ensure that the (potentially) new field is dynamic even if null/undefined\r\n dynamicHandler.set(theConfig, name, theValue);\r\n if (reference) {\r\n dynamicHandler.ref(theConfig, name);\r\n }\r\n if (readOnly) {\r\n dynamicHandler[_DYN_RD_ONLY /* @min:%2erdOnly */](theConfig, name);\r\n }\r\n}\r\n//# sourceMappingURL=ConfigDefaults.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { isArray, isPlainObject, objForEachKey, symbolFor, throwTypeError } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\n// Using Symbol.for so that if the same symbol was already created it would be returned\r\n// To handle multiple instances using potentially different versions we are not using\r\n// createUniqueNamespace()\r\nexport var CFG_HANDLER_LINK = symbolFor(\"[[ai_dynCfg_1]]\");\r\n/**\r\n * @internal\r\n * @ignore\r\n * The symbol to tag objects / arrays with if they should not be converted\r\n */\r\nvar BLOCK_DYNAMIC = symbolFor(\"[[ai_blkDynCfg_1]]\");\r\n/**\r\n * @internal\r\n * @ignore\r\n * The symbol to tag objects to indicate that when included into the configuration that\r\n * they should be converted into a trackable dynamic object.\r\n */\r\nvar FORCE_DYNAMIC = symbolFor(\"[[ai_frcDynCfg_1]]\");\r\nexport function _cfgDeepCopy(source) {\r\n if (source) {\r\n var target_1;\r\n if (isArray(source)) {\r\n target_1 = [];\r\n target_1[_DYN_LENGTH /* @min:%2elength */] = source[_DYN_LENGTH /* @min:%2elength */];\r\n }\r\n else if (isPlainObject(source)) {\r\n target_1 = {};\r\n }\r\n if (target_1) {\r\n // Copying index values by property name as the extensionConfig can be an array or object\r\n objForEachKey(source, function (key, value) {\r\n // Perform a deep copy of the object\r\n target_1[key] = _cfgDeepCopy(value);\r\n });\r\n return target_1;\r\n }\r\n }\r\n return source;\r\n}\r\n/**\r\n * @internal\r\n * Get the dynamic config handler if the value is already dynamic\r\n * @param value\r\n * @returns\r\n */\r\nexport function getDynamicConfigHandler(value) {\r\n if (value) {\r\n var handler = value[CFG_HANDLER_LINK] || value;\r\n if (handler.cfg && (handler.cfg === value || handler.cfg[CFG_HANDLER_LINK] === handler)) {\r\n return handler;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Mark the provided value so that if it's included into the configuration it will NOT have\r\n * its properties converted into a dynamic (reactive) object. If the object is not a plain object\r\n * or an array (ie. a class) this function has not affect as only Objects and Arrays are converted\r\n * into dynamic objects in the dynamic configuration.\r\n *\r\n * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.\r\n *\r\n * You should only need to use this function, if you are creating dynamic \"classes\" from objects\r\n * which confirm to the require interface. A common case for this is during unit testing where it's\r\n * easier to create mock extensions.\r\n *\r\n * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and\r\n * if there is an exception adding the property to the value (because its frozen etc) the\r\n * exception will be swallowed\r\n *\r\n * @example\r\n * ```ts\r\n * // This is a valid \"extension\", but it is technically an object\r\n * // So when included in the config.extensions it WILL be cloned and then\r\n * // converted into a dynamic object, where all of its properties will become\r\n * // get/set object properties and will be tracked. While this WILL still\r\n * // function, when attempt to use a mocking framework on top of this the\r\n * // functions are now technically get accessors which return a function\r\n * // and this can cause some mocking frameworks to fail.\r\n * let mockChannel = {\r\n * pause: () => { },\r\n* resume: () => { },\r\n* teardown: () => { },\r\n* flush: (async: any, callBack: any) => { },\r\n* processTelemetry: (env: any) => { },\r\n* setNextPlugin: (next: any) => { },\r\n* initialize: (config: any, core: any, extensions: any) => { },\r\n* identifier: \"testChannel\",\r\n* priority: 1003\r\n* };\r\n * ```\r\n * @param value - The object that you want to block from being converted into a\r\n * trackable dynamic object\r\n * @returns The original value\r\n */\r\nexport function blockDynamicConversion(value) {\r\n if (value && (isPlainObject(value) || isArray(value))) {\r\n try {\r\n value[BLOCK_DYNAMIC] = true;\r\n }\r\n catch (e) {\r\n // Don't throw for this case as it's an ask only\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * This is the reverse case of {@link blockDynamicConversion} in that this will tag an\r\n * object to indicate that it should always be converted into a dynamic trackable object\r\n * even when not an object or array. So all properties of this object will become\r\n * get / set accessor functions.\r\n *\r\n * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.\r\n *\r\n * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and\r\n * if there is an exception adding the property to the value (because its frozen etc) the\r\n * exception will be swallowed.\r\n * @param value - The object that should be tagged and converted if included into a dynamic\r\n * configuration.\r\n * @returns The original value\r\n */\r\nexport function forceDynamicConversion(value) {\r\n if (value) {\r\n try {\r\n value[FORCE_DYNAMIC] = true;\r\n }\r\n catch (e) {\r\n // Don't throw for this case as it's an ask only\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * @internal\r\n * @ignore\r\n * Helper function to check whether an object can or should be converted into a dynamic\r\n * object.\r\n * @param value - The object to check whether it should be converted\r\n * @returns `true` if the value should be converted otherwise `false`.\r\n */\r\nexport function _canMakeDynamic(getFunc, state, value) {\r\n var result = false;\r\n // Object must exist and be truthy\r\n if (value && !getFunc[state.blkVal]) {\r\n // Tagged as always convert\r\n result = value[FORCE_DYNAMIC];\r\n // Check that it's not explicitly tagged as blocked\r\n if (!result && !value[BLOCK_DYNAMIC]) {\r\n // Only convert plain objects or arrays by default\r\n result = isPlainObject(value) || isArray(value);\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Throws an invalid access exception\r\n * @param message - The message to include in the exception\r\n */\r\nexport function throwInvalidAccess(message) {\r\n throwTypeError(\"InvalidAccess:\" + message);\r\n}\r\n//# sourceMappingURL=DynamicSupport.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, arrIndexOf, dumpObj, isArray, objDefine, objDefineProp, objForEachKey, objGetOwnPropertyDescriptor } from \"@nevware21/ts-utils\";\r\nimport { UNDEFINED_VALUE } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_APPLY, _DYN_HDLR, _DYN_LOGGER, _DYN_PUSH, _DYN_SPLICE, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\nimport { CFG_HANDLER_LINK, _canMakeDynamic, blockDynamicConversion, throwInvalidAccess } from \"./DynamicSupport\";\r\nvar arrayMethodsToPatch = [\r\n \"push\",\r\n \"pop\",\r\n \"shift\",\r\n \"unshift\",\r\n \"splice\"\r\n];\r\nexport var _throwDynamicError = function (logger, name, desc, e) {\r\n logger && logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](3 /* eLoggingSeverity.DEBUG */, 108 /* _eInternalMessageId.DynamicConfigException */, \"\".concat(desc, \" [\").concat(name, \"] failed - \") + dumpObj(e));\r\n};\r\nfunction _patchArray(state, target, name) {\r\n if (isArray(target)) {\r\n // Monkey Patch the methods that might change the array\r\n arrForEach(arrayMethodsToPatch, function (method) {\r\n var orgMethod = target[method];\r\n target[method] = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var result = orgMethod[_DYN_APPLY /* @min:%2eapply */](this, args);\r\n // items may be added, removed or moved so need to make some new dynamic properties\r\n _makeDynamicObject(state, target, name, \"Patching\");\r\n return result;\r\n };\r\n });\r\n }\r\n}\r\nfunction _getOwnPropGetter(target, name) {\r\n var propDesc = objGetOwnPropertyDescriptor(target, name);\r\n return propDesc && propDesc.get;\r\n}\r\nfunction _createDynamicProperty(state, theConfig, name, value) {\r\n // Does not appear to be dynamic so lets make it so\r\n var detail = {\r\n n: name,\r\n h: [],\r\n trk: function (handler) {\r\n if (handler && handler.fn) {\r\n if (arrIndexOf(detail.h, handler) === -1) {\r\n // Add this handler to the collection that should be notified when the value changes\r\n detail.h[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n state.trk(handler, detail);\r\n }\r\n },\r\n clr: function (handler) {\r\n var idx = arrIndexOf(detail.h, handler);\r\n if (idx !== -1) {\r\n detail.h[_DYN_SPLICE /* @min:%2esplice */](idx, 1);\r\n }\r\n }\r\n };\r\n // Flag to optimize lookup response time by avoiding additional function calls\r\n var checkDynamic = true;\r\n var isObjectOrArray = false;\r\n function _getProperty() {\r\n if (checkDynamic) {\r\n isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value);\r\n // Make sure that if it's an object that we make it dynamic\r\n if (value && !value[CFG_HANDLER_LINK] && isObjectOrArray) {\r\n // It doesn't look like it's already dynamic so lets make sure it's converted the object into a dynamic Config as well\r\n value = _makeDynamicObject(state, value, name, \"Converting\");\r\n }\r\n // If it needed to be converted it now has been\r\n checkDynamic = false;\r\n }\r\n // If there is an active handler then add it to the tracking set of handlers\r\n var activeHandler = state.act;\r\n if (activeHandler) {\r\n detail.trk(activeHandler);\r\n }\r\n return value;\r\n }\r\n // Tag this getter as our dynamic property and provide shortcut for notifying a change\r\n _getProperty[state.prop] = {\r\n chng: function () {\r\n state.add(detail);\r\n }\r\n };\r\n function _setProperty(newValue) {\r\n if (value !== newValue) {\r\n if (!!_getProperty[state.ro] && !state.upd) {\r\n // field is marked as readonly so return false\r\n throwInvalidAccess(\"[\" + name + \"] is read-only:\" + dumpObj(theConfig));\r\n }\r\n if (checkDynamic) {\r\n isObjectOrArray = isObjectOrArray || _canMakeDynamic(_getProperty, state, value);\r\n checkDynamic = false;\r\n }\r\n // The value must be a plain object or an array to enforce the reference (in-place updates)\r\n var isReferenced = isObjectOrArray && _getProperty[state.rf];\r\n if (isObjectOrArray) {\r\n // We are about to replace a plain object or an array\r\n if (isReferenced) {\r\n // Reassign the properties from the current value to the same properties from the newValue\r\n // This will set properties not in the newValue to undefined\r\n objForEachKey(value, function (key) {\r\n value[key] = newValue ? newValue[key] : UNDEFINED_VALUE;\r\n });\r\n // Now assign / re-assign value with all of the keys from newValue\r\n try {\r\n objForEachKey(newValue, function (key, theValue) {\r\n _setDynamicProperty(state, value, key, theValue);\r\n });\r\n // Now drop newValue so when we assign value later it keeps the existing reference\r\n newValue = value;\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"Assigning\", e);\r\n // Mark as not an object or array so we don't try and do this again\r\n isObjectOrArray = false;\r\n }\r\n }\r\n else if (value && value[CFG_HANDLER_LINK]) {\r\n // As we are replacing the value, if it's already dynamic then we need to notify the listeners\r\n // for every property it has already\r\n objForEachKey(value, function (key) {\r\n // Check if the value is dynamic\r\n var getter = _getOwnPropGetter(value, key);\r\n if (getter) {\r\n // And if it is tell it's listeners that the value has changed\r\n var valueState = getter[state.prop];\r\n valueState && valueState.chng();\r\n }\r\n });\r\n }\r\n }\r\n if (newValue !== value) {\r\n var newIsObjectOrArray = newValue && _canMakeDynamic(_getProperty, state, newValue);\r\n if (!isReferenced && newIsObjectOrArray) {\r\n // As the newValue is an object/array lets preemptively make it dynamic\r\n newValue = _makeDynamicObject(state, newValue, name, \"Converting\");\r\n }\r\n // Now assign the internal \"value\" to the newValue\r\n value = newValue;\r\n isObjectOrArray = newIsObjectOrArray;\r\n }\r\n // Cause any listeners to be scheduled for notification\r\n state.add(detail);\r\n }\r\n }\r\n objDefine(theConfig, detail.n, { g: _getProperty, s: _setProperty });\r\n}\r\nexport function _setDynamicProperty(state, target, name, value) {\r\n if (target) {\r\n // To be a dynamic property it needs to have a get function\r\n var getter = _getOwnPropGetter(target, name);\r\n var isDynamic = getter && !!getter[state.prop];\r\n if (!isDynamic) {\r\n _createDynamicProperty(state, target, name, value);\r\n }\r\n else {\r\n // Looks like it's already dynamic just assign the new value\r\n target[name] = value;\r\n }\r\n }\r\n return target;\r\n}\r\nexport function _setDynamicPropertyState(state, target, name, flags) {\r\n if (target) {\r\n // To be a dynamic property it needs to have a get function\r\n var getter = _getOwnPropGetter(target, name);\r\n var isDynamic = getter && !!getter[state.prop];\r\n var inPlace = flags && flags[0 /* _eSetDynamicPropertyFlags.inPlace */];\r\n var rdOnly = flags && flags[1 /* _eSetDynamicPropertyFlags.readOnly */];\r\n var blkProp = flags && flags[2 /* _eSetDynamicPropertyFlags.blockDynamicProperty */];\r\n if (!isDynamic) {\r\n if (blkProp) {\r\n try {\r\n // Attempt to mark the target as blocked from conversion\r\n blockDynamicConversion(target);\r\n }\r\n catch (e) {\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"Blocking\", e);\r\n }\r\n }\r\n try {\r\n // Make sure it's dynamic so that we can tag the property as per the state\r\n _setDynamicProperty(state, target, name, target[name]);\r\n getter = _getOwnPropGetter(target, name);\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, \"State\", e);\r\n }\r\n }\r\n // Assign the optional flags if true\r\n if (inPlace) {\r\n getter[state.rf] = inPlace;\r\n }\r\n if (rdOnly) {\r\n getter[state.ro] = rdOnly;\r\n }\r\n if (blkProp) {\r\n getter[state.blkVal] = true;\r\n }\r\n }\r\n return target;\r\n}\r\nexport function _makeDynamicObject(state, target, name, desc) {\r\n try {\r\n // Assign target with new value properties (converting into dynamic properties in the process)\r\n objForEachKey(target, function (key, value) {\r\n // Assign and/or make the property dynamic\r\n _setDynamicProperty(state, target, key, value);\r\n });\r\n if (!target[CFG_HANDLER_LINK]) {\r\n // Link the config back to the dynamic config details\r\n objDefineProp(target, CFG_HANDLER_LINK, {\r\n get: function () {\r\n return state[_DYN_HDLR /* @min:%2ehdlr */];\r\n }\r\n });\r\n _patchArray(state, target, name);\r\n }\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError((state.hdlr || {})[_DYN_LOGGER /* @min:%2elogger */], name, desc, e);\r\n }\r\n return target;\r\n}\r\n//# sourceMappingURL=DynamicProperty.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, arrIndexOf, dumpObj, newSymbol, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { throwAggregationError } from \"../JavaScriptSDK/AggregationError\";\r\nimport { _DYN_BLK_VAL, _DYN_CANCEL, _DYN_HDLR, _DYN_LENGTH, _DYN_LOGGER, _DYN_NOTIFY, _DYN_PUSH, _DYN_RD_ONLY, _DYN_SET_DF, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\nvar symPrefix = \"[[ai_\";\r\nvar symPostfix = \"]]\";\r\nexport function _createState(cfgHandler) {\r\n var _a;\r\n var dynamicPropertySymbol = newSymbol(symPrefix + \"get\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyReadOnly = newSymbol(symPrefix + \"ro\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyReferenced = newSymbol(symPrefix + \"rf\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyBlockValue = newSymbol(symPrefix + \"blkVal\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyDetail = newSymbol(symPrefix + \"dtl\" + cfgHandler.uid + symPostfix);\r\n var _waitingHandlers = null;\r\n var _watcherTimer = null;\r\n var theState;\r\n function _useHandler(activeHandler, callback) {\r\n var prevWatcher = theState.act;\r\n try {\r\n theState.act = activeHandler;\r\n if (activeHandler && activeHandler[dynamicPropertyDetail]) {\r\n // Clear out the previously tracked details for this handler, so that access are re-evaluated\r\n arrForEach(activeHandler[dynamicPropertyDetail], function (detail) {\r\n detail.clr(activeHandler);\r\n });\r\n activeHandler[dynamicPropertyDetail] = [];\r\n }\r\n callback({\r\n cfg: cfgHandler.cfg,\r\n set: cfgHandler.set.bind(cfgHandler),\r\n setDf: cfgHandler[_DYN_SET_DF /* @min:%2esetDf */].bind(cfgHandler),\r\n ref: cfgHandler.ref.bind(cfgHandler),\r\n rdOnly: cfgHandler[_DYN_RD_ONLY /* @min:%2erdOnly */].bind(cfgHandler)\r\n });\r\n }\r\n catch (e) {\r\n var logger = cfgHandler[_DYN_LOGGER /* @min:%2elogger */];\r\n if (logger) {\r\n // Don't let one individual failure break everyone\r\n logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](1 /* eLoggingSeverity.CRITICAL */, 107 /* _eInternalMessageId.ConfigWatcherException */, dumpObj(e));\r\n }\r\n // Re-throw the exception so that any true \"error\" is reported back to the called\r\n throw e;\r\n }\r\n finally {\r\n theState.act = prevWatcher || null;\r\n }\r\n }\r\n function _notifyWatchers() {\r\n if (_waitingHandlers) {\r\n var notifyHandlers = _waitingHandlers;\r\n _waitingHandlers = null;\r\n // Stop any timer as we are running them now anyway\r\n _watcherTimer && _watcherTimer[_DYN_CANCEL /* @min:%2ecancel */]();\r\n _watcherTimer = null;\r\n var watcherFailures_1 = [];\r\n // Now run the handlers\r\n arrForEach(notifyHandlers, function (handler) {\r\n if (handler) {\r\n if (handler[dynamicPropertyDetail]) {\r\n arrForEach(handler[dynamicPropertyDetail], function (detail) {\r\n // Clear out this handler from previously tracked details, so that access are re-evaluated\r\n detail.clr(handler);\r\n });\r\n handler[dynamicPropertyDetail] = null;\r\n }\r\n // The handler may have self removed as part of another handler so re-check\r\n if (handler.fn) {\r\n try {\r\n _useHandler(handler, handler.fn);\r\n }\r\n catch (e) {\r\n // Don't let a single failing watcher cause other watches to fail\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n }\r\n });\r\n // During notification we may have had additional updates -- so notify those updates as well\r\n if (_waitingHandlers) {\r\n try {\r\n _notifyWatchers();\r\n }\r\n catch (e) {\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n if (watcherFailures_1[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n throwAggregationError(\"Watcher error(s): \", watcherFailures_1);\r\n }\r\n }\r\n }\r\n function _addWatcher(detail) {\r\n if (detail && detail.h[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n if (!_waitingHandlers) {\r\n _waitingHandlers = [];\r\n }\r\n if (!_watcherTimer) {\r\n _watcherTimer = scheduleTimeout(function () {\r\n _watcherTimer = null;\r\n _notifyWatchers();\r\n }, 0);\r\n }\r\n // Add all of the handlers for this detail (if not already present) - using normal for-loop for performance\r\n for (var idx = 0; idx < detail.h[_DYN_LENGTH /* @min:%2elength */]; idx++) {\r\n var handler = detail.h[idx];\r\n // Add this handler to the collection of handlers to re-execute\r\n if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {\r\n _waitingHandlers[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n }\r\n }\r\n }\r\n function _trackHandler(handler, detail) {\r\n if (handler) {\r\n var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];\r\n if (arrIndexOf(details, detail) === -1) {\r\n // If this detail is not already listed as tracked then add it so that we re-evaluate it's usage\r\n details[_DYN_PUSH /* @min:%2epush */](detail);\r\n }\r\n }\r\n }\r\n theState = (_a = {\r\n prop: dynamicPropertySymbol,\r\n ro: dynamicPropertyReadOnly,\r\n rf: dynamicPropertyReferenced\r\n },\r\n _a[_DYN_BLK_VAL /* @min:blkVal */] = dynamicPropertyBlockValue,\r\n _a[_DYN_HDLR /* @min:hdlr */] = cfgHandler,\r\n _a.add = _addWatcher,\r\n _a[_DYN_NOTIFY /* @min:notify */] = _notifyWatchers,\r\n _a.use = _useHandler,\r\n _a.trk = _trackHandler,\r\n _a);\r\n return theState;\r\n}\r\n//# sourceMappingURL=DynamicState.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { arrSlice } from \"../array/slice\";\r\nimport { fnApply } from \"../funcs/fnApply\";\r\nimport { isArray } from \"../helpers/base\";\r\nimport { UNDEF_VALUE } from \"../internal/constants\";\r\nimport { _createTimerHandler } from \"./handler\";\r\nfunction _createTimeoutWith(self, startTimer, overrideFn, theArgs) {\r\n var isArr = isArray(overrideFn);\r\n var len = isArr ? overrideFn.length : 0;\r\n var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;\r\n var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;\r\n var timerFn = theArgs[0];\r\n theArgs[0] = function () {\r\n handler.dn();\r\n fnApply(timerFn, self, arrSlice(arguments));\r\n };\r\n var handler = _createTimerHandler(startTimer, function (timerId) {\r\n if (timerId) {\r\n if (timerId.refresh) {\r\n timerId.refresh();\r\n return timerId;\r\n }\r\n fnApply(clearFn, self, [timerId]);\r\n }\r\n return fnApply(setFn, self, theArgs);\r\n }, function (timerId) {\r\n fnApply(clearFn, self, [timerId]);\r\n });\r\n return handler.h;\r\n}\r\nexport function scheduleTimeout(callback, timeout) {\r\n return _createTimeoutWith(this, true, UNDEF_VALUE, arrSlice(arguments));\r\n}\r\nexport function scheduleTimeoutWith(overrideFn, callback, timeout) {\r\n return _createTimeoutWith(this, true, overrideFn, arrSlice(arguments, 1));\r\n}\r\nexport function createTimeout(callback, timeout) {\r\n return _createTimeoutWith(this, false, UNDEF_VALUE, arrSlice(arguments));\r\n}\r\nexport function createTimeoutWith(overrideFn, callback, timeout) {\r\n return _createTimeoutWith(this, false, overrideFn, arrSlice(arguments, 1));\r\n}\r\n//# sourceMappingURL=timeout.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { dumpObj, isUndefined, objDefine, objForEachKey } from \"@nevware21/ts-utils\";\r\nimport { createUniqueNamespace } from \"../JavaScriptSDK/DataCacheHelper\";\r\nimport { STR_NOT_DYNAMIC_ERROR } from \"../JavaScriptSDK/InternalConstants\";\r\nimport { _DYN_BLK_VAL, _DYN_LOGGER, _DYN_NOTIFY, _DYN_RD_ONLY, _DYN_SET_DF, _DYN_THROW_INTERNAL, _DYN_WARN_TO_CONSOLE, _DYN_WATCH } from \"../__DynamicConstants\";\r\nimport { _applyDefaultValue } from \"./ConfigDefaults\";\r\nimport { _makeDynamicObject, _setDynamicProperty, _setDynamicPropertyState, _throwDynamicError } from \"./DynamicProperty\";\r\nimport { _createState } from \"./DynamicState\";\r\nimport { CFG_HANDLER_LINK, _cfgDeepCopy, getDynamicConfigHandler, throwInvalidAccess } from \"./DynamicSupport\";\r\n/**\r\n * Identifies a function which will be re-called whenever any of it's accessed configuration values\r\n * change.\r\n * @param configHandler - The callback that will be called for the initial request and then whenever any\r\n * accessed configuration changes are identified.\r\n */\r\nfunction _createAndUseHandler(state, configHandler) {\r\n var handler = {\r\n fn: configHandler,\r\n rm: function () {\r\n // Clear all references to the handler so it can be garbage collected\r\n // This will also cause this handler to never get called and eventually removed\r\n handler.fn = null;\r\n state = null;\r\n configHandler = null;\r\n }\r\n };\r\n state.use(handler, configHandler);\r\n return handler;\r\n}\r\n/**\r\n * Creates the dynamic config handler and associates with the target config as the root object\r\n * @param target - The config that you want to be root of the dynamic config\r\n * @param inPlace - Should the passed config be converted in-place or a new proxy returned\r\n * @returns The existing dynamic handler or a new instance with the provided config values\r\n */\r\nfunction _createDynamicHandler(logger, target, inPlace) {\r\n var _a;\r\n var dynamicHandler = getDynamicConfigHandler(target);\r\n if (dynamicHandler) {\r\n // The passed config is already dynamic so return it's tracker\r\n return dynamicHandler;\r\n }\r\n var uid = createUniqueNamespace(\"dyncfg\", true);\r\n var newTarget = (target && inPlace !== false) ? target : _cfgDeepCopy(target);\r\n var theState;\r\n function _notifyWatchers() {\r\n theState[_DYN_NOTIFY /* @min:%2enotify */]();\r\n }\r\n function _setValue(target, name, value) {\r\n try {\r\n target = _setDynamicProperty(theState, target, name, value);\r\n }\r\n catch (e) {\r\n // Unable to convert to dynamic property so just leave as non-dynamic\r\n _throwDynamicError(logger, name, \"Setting value\", e);\r\n }\r\n return target[name];\r\n }\r\n function _watch(configHandler) {\r\n return _createAndUseHandler(theState, configHandler);\r\n }\r\n function _block(configHandler, allowUpdate) {\r\n theState.use(null, function (details) {\r\n var prevUpd = theState.upd;\r\n try {\r\n if (!isUndefined(allowUpdate)) {\r\n theState.upd = allowUpdate;\r\n }\r\n configHandler(details);\r\n }\r\n finally {\r\n theState.upd = prevUpd;\r\n }\r\n });\r\n }\r\n function _ref(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as referenced with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[0 /* _eSetDynamicPropertyFlags.inPlace */] = true, _a))[name];\r\n }\r\n function _rdOnly(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as readonly with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[1 /* _eSetDynamicPropertyFlags.readOnly */] = true, _a))[name];\r\n }\r\n function _blkPropValue(target, name) {\r\n var _a;\r\n // Make sure it's dynamic and mark as readonly with it's current value\r\n return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[2 /* _eSetDynamicPropertyFlags.blockDynamicProperty */] = true, _a))[name];\r\n }\r\n function _applyDefaults(theConfig, defaultValues) {\r\n if (defaultValues) {\r\n // Resolve/apply the defaults\r\n objForEachKey(defaultValues, function (name, value) {\r\n // Sets the value and makes it dynamic (if it doesn't already exist)\r\n _applyDefaultValue(cfgHandler, theConfig, name, value);\r\n });\r\n }\r\n return theConfig;\r\n }\r\n var cfgHandler = (_a = {\r\n uid: null,\r\n cfg: newTarget\r\n },\r\n _a[_DYN_LOGGER /* @min:logger */] = logger,\r\n _a[_DYN_NOTIFY /* @min:notify */] = _notifyWatchers,\r\n _a.set = _setValue,\r\n _a[_DYN_SET_DF /* @min:setDf */] = _applyDefaults,\r\n _a[_DYN_WATCH /* @min:watch */] = _watch,\r\n _a.ref = _ref,\r\n _a[_DYN_RD_ONLY /* @min:rdOnly */] = _rdOnly,\r\n _a[_DYN_BLK_VAL /* @min:blkVal */] = _blkPropValue,\r\n _a._block = _block,\r\n _a);\r\n objDefine(cfgHandler, \"uid\", {\r\n c: false,\r\n e: false,\r\n w: false,\r\n v: uid\r\n });\r\n theState = _createState(cfgHandler);\r\n // Setup tracking for all defined default keys\r\n _makeDynamicObject(theState, newTarget, \"config\", \"Creating\");\r\n return cfgHandler;\r\n}\r\n/**\r\n * Log an invalid access message to the console\r\n * @param message\r\n */\r\nfunction _logInvalidAccess(logger, message) {\r\n if (logger) {\r\n logger[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](message);\r\n logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](2 /* eLoggingSeverity.WARNING */, 108 /* _eInternalMessageId.DynamicConfigException */, message);\r\n }\r\n else {\r\n // We don't have a logger so just throw an exception\r\n throwInvalidAccess(message);\r\n }\r\n}\r\n/**\r\n * Create or return a dynamic version of the passed config, if it is not already dynamic\r\n * @param config - The config to be converted into a dynamic config\r\n * @param defaultConfig - The default values to apply on the config if the properties don't already exist\r\n * @param inPlace - Should the config be converted in-place into a dynamic config or a new instance returned, defaults to true\r\n * @returns The dynamic config handler for the config (whether new or existing)\r\n */\r\nexport function createDynamicConfig(config, defaultConfig, logger, inPlace) {\r\n var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace);\r\n if (defaultConfig) {\r\n dynamicHandler[_DYN_SET_DF /* @min:%2esetDf */](dynamicHandler.cfg, defaultConfig);\r\n }\r\n return dynamicHandler;\r\n}\r\n/**\r\n * Watch and track changes for accesses to the current config, the provided config MUST already be\r\n * a dynamic config or a child accessed via the dynamic config\r\n * @param config\r\n * @param configHandler\r\n * @param logger - The logger instance to use if there is no existing handler\r\n * @returns A watcher handler instance that can be used to remove itself when being unloaded\r\n * @throws TypeError if the provided config is not a dynamic config instance\r\n */\r\nexport function onConfigChange(config, configHandler, logger) {\r\n var handler = config[CFG_HANDLER_LINK] || config;\r\n if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) {\r\n return handler[_DYN_WATCH /* @min:%2ewatch */](configHandler);\r\n }\r\n _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));\r\n return createDynamicConfig(config, null, logger)[_DYN_WATCH /* @min:%2ewatch */](configHandler);\r\n}\r\n//# sourceMappingURL=DynamicConfig.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { getInst } from \"@nevware21/ts-utils\";\r\nimport { _DYN_APPLY, _DYN_LENGTH } from \"../__DynamicConstants\";\r\nimport { STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_EVENTS_SENT, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];\r\nvar _aiNamespace = null;\r\nvar _debugListener;\r\nfunction _listenerProxyFunc(name, config) {\r\n return function () {\r\n var args = arguments;\r\n var dbgExt = getDebugExt(config);\r\n if (dbgExt) {\r\n var listener = dbgExt.listener;\r\n if (listener && listener[name]) {\r\n listener[name][_DYN_APPLY /* @min:%2eapply */](listener, args);\r\n }\r\n }\r\n };\r\n}\r\nfunction _getExtensionNamespace() {\r\n // Cache the lookup of the global namespace object\r\n var target = getInst(\"Microsoft\");\r\n if (target) {\r\n _aiNamespace = target[\"ApplicationInsights\"];\r\n }\r\n return _aiNamespace;\r\n}\r\nexport function getDebugExt(config) {\r\n var ns = _aiNamespace;\r\n if (!ns && config.disableDbgExt !== true) {\r\n ns = _aiNamespace || _getExtensionNamespace();\r\n }\r\n return ns ? ns[\"ChromeDbgExt\"] : null;\r\n}\r\nexport function getDebugListener(config) {\r\n if (!_debugListener) {\r\n _debugListener = {};\r\n for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);\r\n }\r\n }\r\n return _debugListener;\r\n}\r\n//# sourceMappingURL=DbgExtensionUtils.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nvar _a;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dumpObj, isFunction, isUndefined } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig, onConfigChange } from \"../Config/DynamicConfig\";\r\nimport { _DYN_DIAG_LOG, _DYN_LOGGER, _DYN_LOGGING_LEVEL_CONSOL4, _DYN_LOG_INTERNAL_MESSAGE, _DYN_MESSAGE, _DYN_MESSAGE_ID, _DYN_PUSH, _DYN_REPLACE, _DYN_THROW_INTERNAL, _DYN_UNLOAD, _DYN_WARN_TO_CONSOLE } from \"../__DynamicConstants\";\r\nimport { getDebugExt } from \"./DbgExtensionUtils\";\r\nimport { getConsole, getJSON, hasJSON } from \"./EnvUtils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nvar STR_WARN_TO_CONSOLE = \"warnToConsole\";\r\n/**\r\n * For user non actionable traces use AI Internal prefix.\r\n */\r\nvar AiNonUserActionablePrefix = \"AI (Internal): \";\r\n/**\r\n * Prefix of the traces in portal.\r\n */\r\nvar AiUserActionablePrefix = \"AI: \";\r\n/**\r\n * Session storage key for the prefix for the key indicating message type already logged\r\n */\r\nvar AIInternalMessagePrefix = \"AITR_\";\r\nvar defaultValues = {\r\n loggingLevelConsole: 0,\r\n loggingLevelTelemetry: 1,\r\n maxMessageLimit: 25,\r\n enableDebug: false\r\n};\r\nvar _logFuncs = (_a = {},\r\n _a[0 /* eLoggingSeverity.DISABLED */] = null,\r\n _a[1 /* eLoggingSeverity.CRITICAL */] = \"errorToConsole\",\r\n _a[2 /* eLoggingSeverity.WARNING */] = STR_WARN_TO_CONSOLE,\r\n _a[3 /* eLoggingSeverity.DEBUG */] = \"debugToConsole\",\r\n _a);\r\nfunction _sanitizeDiagnosticText(text) {\r\n if (text) {\r\n return \"\\\"\" + text[_DYN_REPLACE /* @min:%2ereplace */](/\\\"/g, STR_EMPTY) + \"\\\"\";\r\n }\r\n return STR_EMPTY;\r\n}\r\nfunction _logToConsole(func, message) {\r\n var theConsole = getConsole();\r\n if (!!theConsole) {\r\n var logFunc = \"log\";\r\n if (theConsole[func]) {\r\n logFunc = func;\r\n }\r\n if (isFunction(theConsole[logFunc])) {\r\n theConsole[logFunc](message);\r\n }\r\n }\r\n}\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var _self = this;\r\n _self[_DYN_MESSAGE_ID /* @min:%2emessageId */] = msgId;\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] =\r\n (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = STR_EMPTY;\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _sanitizeDiagnosticText(msg) : STR_EMPTY) +\r\n (properties ? \" props:\" + _sanitizeDiagnosticText(strProps) : STR_EMPTY);\r\n _self[_DYN_MESSAGE /* @min:%2emessage */] += diagnosticText;\r\n }\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nexport function safeGetLogger(core, config) {\r\n return (core || {})[_DYN_LOGGER /* @min:%2elogger */] || new DiagnosticLogger(config);\r\n}\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n this.identifier = \"DiagnosticLogger\";\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Count of internal messages sent\r\n */\r\n var _messageCount = 0;\r\n /**\r\n * Holds information about what message types were already logged to console or sent to server.\r\n */\r\n var _messageLogged = {};\r\n var _loggingLevelConsole;\r\n var _loggingLevelTelemetry;\r\n var _maxInternalMessageLimit;\r\n var _enableDebug;\r\n var _unloadHandler;\r\n dynamicProto(DiagnosticLogger, this, function (_self) {\r\n _unloadHandler = _setDefaultsFromConfig(config || {});\r\n _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity - {LoggingSeverity} - The severity of the log message\r\n * @param message - {_InternalLogMessage} - The log message.\r\n */\r\n _self[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */] = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);\r\n if (_enableDebug) {\r\n throw dumpObj(message);\r\n }\r\n else {\r\n // Get the logging function and fallback to warnToConsole of for some reason errorToConsole doesn't exist\r\n var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;\r\n if (!isUndefined(message[_DYN_MESSAGE /* @min:%2emessage */])) {\r\n if (isUserAct) {\r\n // check if this message type was already logged to console for this page view and if so, don't log it again\r\n var messageKey = +message[_DYN_MESSAGE_ID /* @min:%2emessageId */];\r\n if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {\r\n _self[logFunc](message[_DYN_MESSAGE /* @min:%2emessage */]);\r\n _messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // Only log traces if the console Logging Level is >= the throwInternal severity level\r\n if (_loggingLevelConsole >= severity) {\r\n _self[logFunc](message[_DYN_MESSAGE /* @min:%2emessage */]);\r\n }\r\n }\r\n _logInternalMessage(severity, message);\r\n }\r\n else {\r\n _debugExtMsg(\"throw\" + (severity === 1 /* eLoggingSeverity.CRITICAL */ ? \"Critical\" : \"Warning\"), message);\r\n }\r\n }\r\n };\r\n _self.debugToConsole = function (message) {\r\n _logToConsole(\"debug\", message);\r\n _debugExtMsg(\"warning\", message);\r\n };\r\n _self[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */] = function (message) {\r\n _logToConsole(\"warn\", message);\r\n _debugExtMsg(\"warning\", message);\r\n };\r\n _self.errorToConsole = function (message) {\r\n _logToConsole(\"error\", message);\r\n _debugExtMsg(\"error\", message);\r\n };\r\n _self.resetInternalMessageCount = function () {\r\n _messageCount = 0;\r\n _messageLogged = {};\r\n };\r\n _self[_DYN_LOG_INTERNAL_MESSAGE /* @min:%2elogInternalMessage */] = _logInternalMessage;\r\n _self[_DYN_UNLOAD /* @min:%2eunload */] = function (isAsync) {\r\n _unloadHandler && _unloadHandler.rm();\r\n _unloadHandler = null;\r\n };\r\n function _logInternalMessage(severity, message) {\r\n if (_areInternalMessagesThrottled()) {\r\n return;\r\n }\r\n // check if this message type was already logged for this session and if so, don't log it again\r\n var logMessage = true;\r\n var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID /* @min:%2emessageId */];\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _loggingLevelTelemetry) {\r\n _self.queue[_DYN_PUSH /* @min:%2epush */](message);\r\n _messageCount++;\r\n _debugExtMsg((severity === 1 /* eLoggingSeverity.CRITICAL */ ? \"error\" : \"warn\"), message);\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_messageCount === _maxInternalMessageLimit) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(23 /* _eInternalMessageId.MessageLimitPerPVExceeded */, throttleLimitMessage, false);\r\n _self.queue[_DYN_PUSH /* @min:%2epush */](throttleMessage);\r\n if (severity === 1 /* eLoggingSeverity.CRITICAL */) {\r\n _self.errorToConsole(throttleLimitMessage);\r\n }\r\n else {\r\n _self[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](throttleLimitMessage);\r\n }\r\n }\r\n }\r\n }\r\n function _setDefaultsFromConfig(config) {\r\n // make sure the config is dynamic\r\n return onConfigChange(createDynamicConfig(config, defaultValues, _self).cfg, function (details) {\r\n var config = details.cfg;\r\n _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 /* @min:%2eloggingLevelConsole */];\r\n _loggingLevelTelemetry = config.loggingLevelTelemetry;\r\n _maxInternalMessageLimit = config.maxMessageLimit;\r\n _enableDebug = config.enableDebug;\r\n });\r\n }\r\n function _areInternalMessagesThrottled() {\r\n return _messageCount >= _maxInternalMessageLimit;\r\n }\r\n function _debugExtMsg(name, data) {\r\n var dbgExt = getDebugExt(config || {});\r\n if (dbgExt && dbgExt[_DYN_DIAG_LOG /* @min:%2ediagLog */]) {\r\n dbgExt[_DYN_DIAG_LOG /* @min:%2ediagLog */](name, data);\r\n }\r\n }\r\n });\r\n }\r\n// Removed Stub for DiagnosticLogger.prototype.consoleLoggingLevel.\r\n// Removed Stub for DiagnosticLogger.prototype.throwInternal.\r\n// Removed Stub for DiagnosticLogger.prototype.debugToConsole.\r\n// Removed Stub for DiagnosticLogger.prototype.warnToConsole.\r\n// Removed Stub for DiagnosticLogger.prototype.errorToConsole.\r\n// Removed Stub for DiagnosticLogger.prototype.resetInternalMessageCount.\r\n// Removed Stub for DiagnosticLogger.prototype.logInternalMessage.\r\n// Removed Stub for DiagnosticLogger.prototype.unload.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n DiagnosticLogger.__ieDyn=1;\n\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\nfunction _getLogger(logger) {\r\n return (logger || new DiagnosticLogger());\r\n}\r\n/**\r\n * This is a helper method which will call throwInternal on the passed logger, will throw exceptions in\r\n * debug mode or attempt to log the error as a console warning. This helper is provided mostly to better\r\n * support minification as logger.throwInternal() will not compress the publish \"throwInternal\" used throughout\r\n * the code.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param severity - {LoggingSeverity} - The severity of the log message\r\n * @param message - {_InternalLogMessage} - The log message.\r\n */\r\nexport function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n _getLogger(logger)[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](severity, msgId, msg, properties, isUserAct);\r\n}\r\n/**\r\n * This is a helper method which will call warnToConsole on the passed logger with the provided message.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param message - {_InternalLogMessage} - The log message.\r\n */\r\nexport function _warnToConsole(logger, message) {\r\n _getLogger(logger)[_DYN_WARN_TO_CONSOLE /* @min:%2ewarnToConsole */](message);\r\n}\r\n/**\r\n * Logs a message to the internal queue.\r\n * @param logger - The Diagnostic Logger instance to use.\r\n * @param severity - {LoggingSeverity} - The severity of the log message\r\n * @param message - {_InternalLogMessage} - The message to log.\r\n */\r\nexport function _logInternalMessage(logger, severity, message) {\r\n _getLogger(logger)[_DYN_LOG_INTERNAL_MESSAGE /* @min:%2elogInternalMessage */](severity, message);\r\n}\r\n//# sourceMappingURL=DiagnosticLogger.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isArray, isFunction, objDefine, utcNow } from \"@nevware21/ts-utils\";\r\nimport { _DYN_COMPLETE, _DYN_GET_CTX, _DYN_IS_ASYNC, _DYN_IS_CHILD_EVT, _DYN_LENGTH, _DYN_NAME, _DYN_PUSH, _DYN_SET_CTX, _DYN_TIME } from \"../__DynamicConstants\";\r\nimport { STR_GET_PERF_MGR, STR_PERF_EVENT } from \"./InternalConstants\";\r\nvar strExecutionContextKey = \"ctx\";\r\nvar strParentContextKey = \"ParentContextKey\";\r\nvar strChildrenContextKey = \"ChildrenContextKey\";\r\nvar _defaultPerfManager = null;\r\nvar PerfEvent = /** @class */ (function () {\r\n function PerfEvent(name, payloadDetails, isAsync) {\r\n var _self = this;\r\n _self.start = utcNow();\r\n _self[_DYN_NAME /* @min:%2ename */] = name;\r\n _self[_DYN_IS_ASYNC /* @min:%2eisAsync */] = isAsync;\r\n _self[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */] = function () { return false; };\r\n if (isFunction(payloadDetails)) {\r\n // Create an accessor to minimize the potential performance impact of executing the payloadDetails callback\r\n var theDetails_1;\r\n objDefine(_self, \"payload\", {\r\n g: function () {\r\n // Delay the execution of the payloadDetails until needed\r\n if (!theDetails_1 && isFunction(payloadDetails)) {\r\n theDetails_1 = payloadDetails();\r\n // clear it out now so the referenced objects can be garbage collected\r\n payloadDetails = null;\r\n }\r\n return theDetails_1;\r\n }\r\n });\r\n }\r\n _self[_DYN_GET_CTX /* @min:%2egetCtx */] = function (key) {\r\n if (key) {\r\n // The parent and child links are located directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) {\r\n return _self[key];\r\n }\r\n return (_self[strExecutionContextKey] || {})[key];\r\n }\r\n return null;\r\n };\r\n _self[_DYN_SET_CTX /* @min:%2esetCtx */] = function (key, value) {\r\n if (key) {\r\n // Put the parent and child links directly on the object (for better viewing in the DebugPlugin)\r\n if (key === PerfEvent[strParentContextKey]) {\r\n // Simple assumption, if we are setting a parent then we must be a child\r\n if (!_self[key]) {\r\n _self[_DYN_IS_CHILD_EVT /* @min:%2eisChildEvt */] = function () { return true; };\r\n }\r\n _self[key] = value;\r\n }\r\n else if (key === PerfEvent[strChildrenContextKey]) {\r\n _self[key] = value;\r\n }\r\n else {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n }\r\n };\r\n _self[_DYN_COMPLETE /* @min:%2ecomplete */] = function () {\r\n var childTime = 0;\r\n var childEvts = _self[_DYN_GET_CTX /* @min:%2egetCtx */](PerfEvent[strChildrenContextKey]);\r\n if (isArray(childEvts)) {\r\n for (var lp = 0; lp < childEvts[_DYN_LENGTH /* @min:%2elength */]; lp++) {\r\n var childEvt = childEvts[lp];\r\n if (childEvt) {\r\n childTime += childEvt[_DYN_TIME /* @min:%2etime */];\r\n }\r\n }\r\n }\r\n _self[_DYN_TIME /* @min:%2etime */] = utcNow() - _self.start;\r\n _self.exTime = _self[_DYN_TIME /* @min:%2etime */] - childTime;\r\n _self[_DYN_COMPLETE /* @min:%2ecomplete */] = function () { };\r\n };\r\n }\r\n PerfEvent.ParentContextKey = \"parent\";\r\n PerfEvent.ChildrenContextKey = \"childEvts\";\r\n return PerfEvent;\r\n}());\r\nexport { PerfEvent };\r\nvar PerfManager = /** @class */ (function () {\r\n function PerfManager(manager) {\r\n /**\r\n * General bucket used for execution context set and retrieved via setCtx() and getCtx.\r\n * Defined as private so it can be visualized via the DebugPlugin\r\n */\r\n this.ctx = {};\r\n dynamicProto(PerfManager, this, function (_self) {\r\n _self.create = function (src, payloadDetails, isAsync) {\r\n // TODO (@MSNev): at some point we will want to add additional configuration to \"select\" which events to instrument\r\n // for now this is just a simple do everything.\r\n return new PerfEvent(src, payloadDetails, isAsync);\r\n };\r\n _self.fire = function (perfEvent) {\r\n if (perfEvent) {\r\n perfEvent[_DYN_COMPLETE /* @min:%2ecomplete */]();\r\n if (manager && isFunction(manager[STR_PERF_EVENT /* @min:%2eperfEvent */])) {\r\n manager[STR_PERF_EVENT /* @min:%2eperfEvent */](perfEvent);\r\n }\r\n }\r\n };\r\n _self[_DYN_SET_CTX /* @min:%2esetCtx */] = function (key, value) {\r\n if (key) {\r\n var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};\r\n ctx[key] = value;\r\n }\r\n };\r\n _self[_DYN_GET_CTX /* @min:%2egetCtx */] = function (key) {\r\n return (_self[strExecutionContextKey] || {})[key];\r\n };\r\n });\r\n }\r\n// Removed Stub for PerfManager.prototype.create.\r\n// Removed Stub for PerfManager.prototype.fire.\r\n// Removed Stub for PerfManager.prototype.setCtx.\r\n// Removed Stub for PerfManager.prototype.getCtx.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n PerfManager.__ieDyn=1;\n\n return PerfManager;\r\n}());\r\nexport { PerfManager };\r\nvar doPerfActiveKey = \"CoreUtils.doPerf\";\r\n/**\r\n * Helper function to wrap a function with a perf event\r\n * @param mgrSource - The Performance Manager or a Performance provider source (may be null)\r\n * @param getSource - The callback to create the source name for the event (if perf monitoring is enabled)\r\n * @param func - The function to call and measure\r\n * @param details - A function to return the payload details\r\n * @param isAsync - Is the event / function being call asynchronously or synchronously\r\n */\r\nexport function doPerf(mgrSource, getSource, func, details, isAsync) {\r\n if (mgrSource) {\r\n var perfMgr = mgrSource;\r\n if (perfMgr[STR_GET_PERF_MGR]) {\r\n // Looks like a perf manager provider object\r\n perfMgr = perfMgr[STR_GET_PERF_MGR]();\r\n }\r\n if (perfMgr) {\r\n var perfEvt = void 0;\r\n var currentActive = perfMgr[_DYN_GET_CTX /* @min:%2egetCtx */](doPerfActiveKey);\r\n try {\r\n perfEvt = perfMgr.create(getSource(), details, isAsync);\r\n if (perfEvt) {\r\n if (currentActive && perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */](PerfEvent[strParentContextKey], currentActive);\r\n if (currentActive[_DYN_GET_CTX /* @min:%2egetCtx */] && currentActive[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n var children = currentActive[_DYN_GET_CTX /* @min:%2egetCtx */](PerfEvent[strChildrenContextKey]);\r\n if (!children) {\r\n children = [];\r\n currentActive[_DYN_SET_CTX /* @min:%2esetCtx */](PerfEvent[strChildrenContextKey], children);\r\n }\r\n children[_DYN_PUSH /* @min:%2epush */](perfEvt);\r\n }\r\n }\r\n // Set this event as the active event now\r\n perfMgr[_DYN_SET_CTX /* @min:%2esetCtx */](doPerfActiveKey, perfEvt);\r\n return func(perfEvt);\r\n }\r\n }\r\n catch (ex) {\r\n if (perfEvt && perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */]) {\r\n perfEvt[_DYN_SET_CTX /* @min:%2esetCtx */](\"exception\", ex);\r\n }\r\n }\r\n finally {\r\n // fire the perf event\r\n if (perfEvt) {\r\n perfMgr.fire(perfEvt);\r\n }\r\n // Reset the active event to the previous value\r\n perfMgr[_DYN_SET_CTX /* @min:%2esetCtx */](doPerfActiveKey, currentActive);\r\n }\r\n }\r\n }\r\n return func();\r\n}\r\n/**\r\n * Set the global performance manager to use when there is no core instance or it has not been initialized yet.\r\n * @param perfManager - The IPerfManager instance to use when no performance manager is supplied.\r\n */\r\nexport function setGblPerfMgr(perfManager) {\r\n _defaultPerfManager = perfManager;\r\n}\r\n/**\r\n * Get the current global performance manager that will be used with no performance manager is supplied.\r\n * @returns - The current default manager\r\n */\r\nexport function getGblPerfMgr() {\r\n return _defaultPerfManager;\r\n}\r\n//# sourceMappingURL=PerfManager.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { arrForEach, isFunction } from \"@nevware21/ts-utils\";\r\nimport { _DYN_GET_NEXT, _DYN_GET_PLUGIN, _DYN_INITIALIZE, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_NAME, _DYN_PUSH, _DYN_SET_NEXT_PLUGIN, _DYN_SPAN_ID, _DYN_TEARDOWN, _DYN_TRACE_FLAGS, _DYN_TRACE_ID, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { createElmNodeData } from \"./DataCacheHelper\";\r\nimport { STR_CORE, STR_PRIORITY, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { isValidSpanId, isValidTraceId } from \"./W3cTraceParent\";\r\nvar pluginStateData = createElmNodeData(\"plugin\");\r\nexport function _getPluginState(plugin) {\r\n return pluginStateData.get(plugin, \"state\", {}, true);\r\n}\r\n/**\r\n * Initialize the queue of plugins\r\n * @param plugins - The array of plugins to initialize and setting of the next plugin\r\n * @param config - The current config for the instance\r\n * @param core - THe current core instance\r\n * @param extensions - The extensions\r\n */\r\nexport function initializePlugins(processContext, extensions) {\r\n // Set the next plugin and identified the uninitialized plugins\r\n var initPlugins = [];\r\n var lastPlugin = null;\r\n var proxy = processContext[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n var pluginState;\r\n while (proxy) {\r\n var thePlugin = proxy[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]();\r\n if (thePlugin) {\r\n if (lastPlugin && lastPlugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */] && thePlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */]) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */](thePlugin);\r\n }\r\n pluginState = _getPluginState(thePlugin);\r\n var isInitialized = !!pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */];\r\n if (thePlugin[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]) {\r\n isInitialized = thePlugin[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]();\r\n }\r\n if (!isInitialized) {\r\n initPlugins[_DYN_PUSH /* @min:%2epush */](thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n }\r\n // Now initialize the plugins\r\n arrForEach(initPlugins, function (thePlugin) {\r\n var core = processContext[STR_CORE /* @min:%2ecore */]();\r\n thePlugin[_DYN_INITIALIZE /* @min:%2einitialize */](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT /* @min:%2egetNext */]());\r\n pluginState = _getPluginState(thePlugin);\r\n // Only add the core to the state if the plugin didn't set it (doesn't extend from BaseTelemetryPlugin)\r\n if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) {\r\n pluginState[STR_CORE] = core;\r\n }\r\n pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = true;\r\n delete pluginState[_DYN_TEARDOWN /* @min:%2eteardown */];\r\n });\r\n}\r\nexport function sortPlugins(plugins) {\r\n // Sort by priority\r\n return plugins.sort(function (extA, extB) {\r\n var result = 0;\r\n if (extB) {\r\n var bHasProcess = extB[STR_PROCESS_TELEMETRY];\r\n if (extA[STR_PROCESS_TELEMETRY]) {\r\n result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n }\r\n else {\r\n result = extA ? 1 : -1;\r\n }\r\n return result;\r\n });\r\n // sort complete\r\n}\r\n/**\r\n * Teardown / Unload helper to perform teardown/unloading operations for the provided components synchronously or asynchronously, this will call any\r\n * _doTeardown() or _doUnload() functions on the provided components to allow them to finish removal.\r\n * @param components - The components you want to unload\r\n * @param unloadCtx - This is the context that should be used during unloading.\r\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\r\n * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.\r\n * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.\r\n */\r\nexport function unloadComponents(components, unloadCtx, unloadState, asyncCallback) {\r\n var idx = 0;\r\n function _doUnload() {\r\n while (idx < components[_DYN_LENGTH /* @min:%2elength */]) {\r\n var component = components[idx++];\r\n if (component) {\r\n var func = component._doUnload || component[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */];\r\n if (isFunction(func)) {\r\n if (func.call(component, unloadCtx, unloadState, _doUnload) === true) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return _doUnload();\r\n}\r\n/**\r\n * Creates a IDistributedTraceContext which optionally also \"sets\" the value on a parent\r\n * @param parentCtx - An optional parent distributed trace instance\r\n * @returns A new IDistributedTraceContext instance that uses an internal temporary object\r\n */\r\nexport function createDistributedTraceContext(parentCtx) {\r\n var trace = {};\r\n return {\r\n getName: function () {\r\n return trace[_DYN_NAME /* @min:%2ename */];\r\n },\r\n setName: function (newValue) {\r\n parentCtx && parentCtx.setName(newValue);\r\n trace[_DYN_NAME /* @min:%2ename */] = newValue;\r\n },\r\n getTraceId: function () {\r\n return trace[_DYN_TRACE_ID /* @min:%2etraceId */];\r\n },\r\n setTraceId: function (newValue) {\r\n parentCtx && parentCtx.setTraceId(newValue);\r\n if (isValidTraceId(newValue)) {\r\n trace[_DYN_TRACE_ID /* @min:%2etraceId */] = newValue;\r\n }\r\n },\r\n getSpanId: function () {\r\n return trace[_DYN_SPAN_ID /* @min:%2espanId */];\r\n },\r\n setSpanId: function (newValue) {\r\n parentCtx && parentCtx.setSpanId(newValue);\r\n if (isValidSpanId(newValue)) {\r\n trace[_DYN_SPAN_ID /* @min:%2espanId */] = newValue;\r\n }\r\n },\r\n getTraceFlags: function () {\r\n return trace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];\r\n },\r\n setTraceFlags: function (newTraceFlags) {\r\n parentCtx && parentCtx.setTraceFlags(newTraceFlags);\r\n trace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = newTraceFlags;\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nimport { arrForEach, dumpObj, isArray, isFunction, isNullOrUndefined, isUndefined, objForEachKey, objFreeze, objKeys } from \"@nevware21/ts-utils\";\r\nimport { _applyDefaultValue } from \"../Config/ConfigDefaults\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_CREATE_NEW, _DYN_DIAG_LOG, _DYN_GET_NEXT, _DYN_GET_PLUGIN, _DYN_IDENTIFIER, _DYN_IS_ASYNC, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_LOGGER, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_SET_DF, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_UNLOAD, _DYN_UPDATE } from \"../__DynamicConstants\";\r\nimport { _throwInternal, safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { proxyFunctions } from \"./HelperFuncs\";\r\nimport { STR_CORE, STR_DISABLED, STR_EMPTY, STR_EXTENSION_CONFIG, STR_PRIORITY, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { doPerf } from \"./PerfManager\";\r\nimport { _getPluginState } from \"./TelemetryHelpers\";\r\nvar strTelemetryPluginChain = \"TelemetryPluginChain\";\r\nvar strHasRunFlags = \"_hasRun\";\r\nvar strGetTelCtx = \"_getTelCtx\";\r\nvar _chainId = 0;\r\nfunction _getNextProxyStart(proxy, core, startAt) {\r\n while (proxy) {\r\n if (proxy[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]() === startAt) {\r\n return proxy;\r\n }\r\n proxy = proxy[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n // This wasn't found in the existing chain so create an isolated one with just this plugin\r\n return createTelemetryProxyChain([startAt], core.config || {}, core);\r\n}\r\n/**\r\n * @ignore\r\n * @param telemetryChain\r\n * @param dynamicHandler\r\n * @param core\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n * @returns\r\n */\r\nfunction _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {\r\n // We have a special case where we want to start execution from this specific plugin\r\n // or we simply reuse the existing telemetry plugin chain (normal execution case)\r\n var _nextProxy = null; // By Default set as no next plugin\r\n var _onComplete = [];\r\n if (!dynamicHandler) {\r\n dynamicHandler = createDynamicConfig({}, null, core[_DYN_LOGGER /* @min:%2elogger */]);\r\n }\r\n if (startAt !== null) {\r\n // There is no next element (null) vs not defined (undefined) so use the full chain\r\n _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain;\r\n }\r\n var context = {\r\n _next: _moveNext,\r\n ctx: {\r\n core: function () {\r\n return core;\r\n },\r\n diagLog: function () {\r\n return safeGetLogger(core, dynamicHandler.cfg);\r\n },\r\n getCfg: function () {\r\n return dynamicHandler.cfg;\r\n },\r\n getExtCfg: _resolveExtCfg,\r\n getConfig: _getConfig,\r\n hasNext: function () {\r\n return !!_nextProxy;\r\n },\r\n getNext: function () {\r\n return _nextProxy;\r\n },\r\n setNext: function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n },\r\n iterate: _iterateChain,\r\n onComplete: _addOnComplete\r\n }\r\n };\r\n function _addOnComplete(onComplete, that) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n if (onComplete) {\r\n _onComplete[_DYN_PUSH /* @min:%2epush */]({\r\n func: onComplete,\r\n self: !isUndefined(that) ? that : context.ctx,\r\n args: args\r\n });\r\n }\r\n }\r\n function _moveNext() {\r\n var nextProxy = _nextProxy;\r\n // Automatically move to the next plugin\r\n _nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT /* @min:%2egetNext */]() : null;\r\n if (!nextProxy) {\r\n var onComplete = _onComplete;\r\n if (onComplete && onComplete[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(onComplete, function (completeDetails) {\r\n try {\r\n completeDetails.func.call(completeDetails.self, completeDetails.args);\r\n }\r\n catch (e) {\r\n _throwInternal(core[_DYN_LOGGER /* @min:%2elogger */], 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unexpected Exception during onComplete - \" + dumpObj(e));\r\n }\r\n });\r\n _onComplete = [];\r\n }\r\n }\r\n return nextProxy;\r\n }\r\n function _getExtCfg(identifier, createIfMissing) {\r\n var idCfg = null;\r\n var cfg = dynamicHandler.cfg;\r\n if (cfg && identifier) {\r\n var extCfg = cfg[STR_EXTENSION_CONFIG /* @min:%2eextensionConfig */];\r\n if (!extCfg && createIfMissing) {\r\n extCfg = {};\r\n }\r\n // Always set the value so that the property always exists\r\n cfg[STR_EXTENSION_CONFIG] = extCfg; // Note: it is valid for the \"value\" to be undefined\r\n // Calling `ref()` has a side effect of causing the referenced property to become dynamic (if not already)\r\n extCfg = dynamicHandler.ref(cfg, STR_EXTENSION_CONFIG);\r\n if (extCfg) {\r\n idCfg = extCfg[identifier];\r\n if (!idCfg && createIfMissing) {\r\n idCfg = {};\r\n }\r\n // Always set the value so that the property always exists\r\n extCfg[identifier] = idCfg; // Note: it is valid for the \"value\" to be undefined\r\n // Calling `ref()` has a side effect of causing the referenced property to become dynamic (if not already)\r\n idCfg = dynamicHandler.ref(extCfg, identifier);\r\n }\r\n }\r\n return idCfg;\r\n }\r\n function _resolveExtCfg(identifier, defaultValues) {\r\n var newConfig = _getExtCfg(identifier, true);\r\n if (defaultValues) {\r\n // Enumerate over the defaultValues and if not already populated attempt to\r\n // find a value from the root config or use the default value\r\n objForEachKey(defaultValues, function (field, defaultValue) {\r\n // for each unspecified field, set the default value\r\n if (isNullOrUndefined(newConfig[field])) {\r\n var cfgValue = dynamicHandler.cfg[field];\r\n if (cfgValue || !isNullOrUndefined(cfgValue)) {\r\n newConfig[field] = cfgValue;\r\n }\r\n }\r\n _applyDefaultValue(dynamicHandler, newConfig, field, defaultValue);\r\n });\r\n }\r\n return dynamicHandler[_DYN_SET_DF /* @min:%2esetDf */](newConfig, defaultValues);\r\n }\r\n function _getConfig(identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _getExtCfg(identifier, false);\r\n var rootConfig = dynamicHandler.cfg;\r\n if (extConfig && (extConfig[field] || !isNullOrUndefined(extConfig[field]))) {\r\n theValue = extConfig[field];\r\n }\r\n else if (rootConfig[field] || !isNullOrUndefined(rootConfig[field])) {\r\n theValue = rootConfig[field];\r\n }\r\n return (theValue || !isNullOrUndefined(theValue)) ? theValue : defaultValue;\r\n }\r\n function _iterateChain(cb) {\r\n // Keep processing until we reach the end of the chain\r\n var nextPlugin;\r\n while (!!(nextPlugin = context._next())) {\r\n var plugin = nextPlugin[_DYN_GET_PLUGIN /* @min:%2egetPlugin */]();\r\n if (plugin) {\r\n // callback with the current on\r\n cb(plugin);\r\n }\r\n }\r\n }\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) {\r\n var config = createDynamicConfig(cfg);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(env) {\r\n var nextPlugin = internalContext._next();\r\n if (nextPlugin) {\r\n // Run the next plugin which will call \"processNext()\"\r\n nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, context);\r\n }\r\n return !nextPlugin;\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), config.cfg, core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain for handling the unloading of the chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {\r\n var config = createDynamicConfig(core.config);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(unloadState) {\r\n var nextPlugin = internalContext._next();\r\n nextPlugin && nextPlugin[_DYN_UNLOAD /* @min:%2eunload */](context, unloadState);\r\n return !nextPlugin;\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain for updating the configuration\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\r\n */\r\nexport function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {\r\n var config = createDynamicConfig(core.config);\r\n var internalContext = _createInternalContext(telemetryChain, config, core, startAt);\r\n var context = internalContext.ctx;\r\n function _processNext(updateState) {\r\n return context.iterate(function (plugin) {\r\n if (isFunction(plugin[_DYN_UPDATE /* @min:%2eupdate */])) {\r\n plugin[_DYN_UPDATE /* @min:%2eupdate */](context, updateState);\r\n }\r\n });\r\n }\r\n function _createNew(plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n if (isArray(plugins)) {\r\n plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);\r\n }\r\n return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT /* @min:%2egetNext */](), core, startAt);\r\n }\r\n context[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = _processNext;\r\n context[_DYN_CREATE_NEW /* @min:%2ecreateNew */] = _createNew;\r\n return context;\r\n}\r\n/**\r\n * Creates an execution chain from the array of plugins\r\n * @param plugins - The array of plugins that will be executed in this order\r\n * @param defItemCtx - The default execution context to use when no telemetry context is passed to processTelemetry(), this\r\n * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error\r\n * reporting (hasRun) when errors occur.\r\n */\r\nexport function createTelemetryProxyChain(plugins, config, core, startAt) {\r\n var firstProxy = null;\r\n var add = startAt ? false : true;\r\n if (isArray(plugins) && plugins[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy_1 = null;\r\n arrForEach(plugins, function (thePlugin) {\r\n if (!add && startAt === thePlugin) {\r\n add = true;\r\n }\r\n if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */])) {\r\n // Only add plugins that are processors\r\n var newProxy = createTelemetryPluginProxy(thePlugin, config, core);\r\n if (!firstProxy) {\r\n firstProxy = newProxy;\r\n }\r\n if (lastProxy_1) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy_1._setNext(newProxy);\r\n }\r\n lastProxy_1 = newProxy;\r\n }\r\n });\r\n }\r\n if (startAt && !firstProxy) {\r\n // Special case where the \"startAt\" was not in the original list of plugins\r\n return createTelemetryProxyChain([startAt], config, core);\r\n }\r\n return firstProxy;\r\n}\r\n/**\r\n * Create the processing telemetry proxy instance, the proxy is used to abstract the current plugin to allow monitoring and\r\n * execution plugins while passing around the dynamic execution state (IProcessTelemetryContext), the proxy instance no longer\r\n * contains any execution state and can be reused between requests (this was not the case for 2.7.2 and earlier with the\r\n * TelemetryPluginChain class).\r\n * @param plugin - The plugin instance to proxy\r\n * @param config - The default execution context to use when no telemetry context is passed to processTelemetry(), this\r\n * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error\r\n * reporting (hasRun) when errors occur.\r\n * @returns\r\n */\r\nexport function createTelemetryPluginProxy(plugin, config, core) {\r\n var nextProxy = null;\r\n var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */]);\r\n var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */]);\r\n var chainId;\r\n if (plugin) {\r\n chainId = plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + \"-\" + plugin[STR_PRIORITY /* @min:%2epriority */] + \"-\" + _chainId++;\r\n }\r\n else {\r\n chainId = \"Unknown-0-\" + _chainId++;\r\n }\r\n var proxyChain = {\r\n getPlugin: function () {\r\n return plugin;\r\n },\r\n getNext: function () {\r\n return nextProxy;\r\n },\r\n processTelemetry: _processTelemetry,\r\n unload: _unloadPlugin,\r\n update: _updatePlugin,\r\n _id: chainId,\r\n _setNext: function (nextPlugin) {\r\n nextProxy = nextPlugin;\r\n }\r\n };\r\n function _getTelCtx() {\r\n var itemCtx;\r\n // Looks like a plugin didn't pass the (optional) context, so create a new one\r\n if (plugin && isFunction(plugin[strGetTelCtx])) {\r\n // This plugin extends from the BaseTelemetryPlugin so lets use it\r\n itemCtx = plugin[strGetTelCtx]();\r\n }\r\n if (!itemCtx) {\r\n // Create a temporary one\r\n itemCtx = createProcessTelemetryContext(proxyChain, config, core);\r\n }\r\n return itemCtx;\r\n }\r\n function _processChain(itemCtx, processPluginFn, name, details, isAsync) {\r\n var hasRun = false;\r\n var identifier = plugin ? plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] : strTelemetryPluginChain;\r\n var hasRunContext = itemCtx[strHasRunFlags];\r\n if (!hasRunContext) {\r\n // Assign and populate\r\n hasRunContext = itemCtx[strHasRunFlags] = {};\r\n }\r\n // Ensure that we keep the context in sync\r\n itemCtx.setNext(nextProxy);\r\n if (plugin) {\r\n doPerf(itemCtx[STR_CORE /* @min:%2ecore */](), function () { return identifier + \":\" + name; }, function () {\r\n // Mark this component as having run\r\n hasRunContext[chainId] = true;\r\n try {\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n var nextId = nextProxy ? nextProxy._id : STR_EMPTY;\r\n if (nextId) {\r\n hasRunContext[nextId] = false;\r\n }\r\n hasRun = processPluginFn(itemCtx);\r\n }\r\n catch (error) {\r\n var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true;\r\n if (hasNextRun) {\r\n // The next plugin after us has already run so set this one as complete\r\n hasRun = true;\r\n }\r\n if (!nextProxy || !hasNextRun) {\r\n // Either we have no next plugin or the current one did not attempt to call the next plugin\r\n // Which means the current one is the root of the failure so log/report this failure\r\n _throwInternal(itemCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 1 /* eLoggingSeverity.CRITICAL */, 73 /* _eInternalMessageId.PluginException */, \"Plugin [\" + identifier + \"] failed during \" + name + \" - \" + dumpObj(error) + \", run flags: \" + dumpObj(hasRunContext));\r\n }\r\n }\r\n }, details, isAsync);\r\n }\r\n return hasRun;\r\n }\r\n function _processTelemetry(env, itemCtx) {\r\n itemCtx = itemCtx || _getTelCtx();\r\n function _callProcessTelemetry(itemCtx) {\r\n if (!plugin || !hasProcessTelemetry) {\r\n return false;\r\n }\r\n var pluginState = _getPluginState(plugin);\r\n if (pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] || pluginState[STR_DISABLED]) {\r\n return false;\r\n }\r\n // Ensure that we keep the context in sync (for processNext()), just in case a plugin\r\n // doesn't calls processTelemetry() instead of itemContext.processNext() or some\r\n // other form of error occurred\r\n if (hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */](nextProxy);\r\n }\r\n plugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, itemCtx);\r\n // Process Telemetry is expected to call itemCtx.processNext() or nextPlugin.processTelemetry()\r\n return true;\r\n }\r\n if (!_processChain(itemCtx, _callProcessTelemetry, \"processTelemetry\", function () { return ({ item: env }); }, !(env.sync))) {\r\n // The underlying plugin is either not defined, not enabled or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](env);\r\n }\r\n }\r\n function _unloadPlugin(unloadCtx, unloadState) {\r\n function _callTeardown() {\r\n // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext().\r\n var hasRun = false;\r\n if (plugin) {\r\n var pluginState = _getPluginState(plugin);\r\n var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE /* @min:%2ecore */];\r\n // Only teardown the plugin if it was initialized by the current core (i.e. It's not a shared plugin)\r\n if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */]) {\r\n // Handle plugins that don't extend from the BaseTelemetryPlugin\r\n pluginState[STR_CORE /* @min:%2ecore */] = null;\r\n pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] = true;\r\n pluginState[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = false;\r\n if (plugin[_DYN_TEARDOWN /* @min:%2eteardown */] && plugin[_DYN_TEARDOWN /* @min:%2eteardown */](unloadCtx, unloadState) === true) {\r\n // plugin told us that it was going to (or has) call unloadCtx.processNext()\r\n hasRun = true;\r\n }\r\n }\r\n }\r\n return hasRun;\r\n }\r\n if (!_processChain(unloadCtx, _callTeardown, \"unload\", function () { }, unloadState[_DYN_IS_ASYNC /* @min:%2eisAsync */])) {\r\n // Only called if we hasRun was not true\r\n unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);\r\n }\r\n }\r\n function _updatePlugin(updateCtx, updateState) {\r\n function _callUpdate() {\r\n // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext().\r\n var hasRun = false;\r\n if (plugin) {\r\n var pluginState = _getPluginState(plugin);\r\n var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE /* @min:%2ecore */];\r\n // Only update the plugin if it was initialized by the current core (i.e. It's not a shared plugin)\r\n if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */]) {\r\n if (plugin[_DYN_UPDATE /* @min:%2eupdate */] && plugin[_DYN_UPDATE /* @min:%2eupdate */](updateCtx, updateState) === true) {\r\n // plugin told us that it was going to (or has) call unloadCtx.processNext()\r\n hasRun = true;\r\n }\r\n }\r\n }\r\n return hasRun;\r\n }\r\n if (!_processChain(updateCtx, _callUpdate, \"update\", function () { }, false)) {\r\n // Only called if we hasRun was not true\r\n updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](updateState);\r\n }\r\n }\r\n return objFreeze(proxyChain);\r\n}\r\n/**\r\n * This class will be removed!\r\n * @deprecated use createProcessTelemetryContext() instead\r\n */\r\nvar ProcessTelemetryContext = /** @class */ (function () {\r\n /**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n */\r\n function ProcessTelemetryContext(pluginChain, config, core, startAt) {\r\n var _self = this;\r\n var context = createProcessTelemetryContext(pluginChain, config, core, startAt);\r\n // Proxy all functions of the context to this object\r\n proxyFunctions(_self, context, objKeys(context));\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_DIAG_LOG, _DYN_PUSH } from \"../__DynamicConstants\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\nexport function createUnloadHandlerContainer() {\r\n var handlers = [];\r\n function _addHandler(handler) {\r\n if (handler) {\r\n handlers[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n }\r\n function _runHandlers(unloadCtx, unloadState) {\r\n arrForEach(handlers, function (handler) {\r\n try {\r\n handler(unloadCtx, unloadState);\r\n }\r\n catch (e) {\r\n _throwInternal(unloadCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */](), 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unexpected error calling unload handler - \" + dumpObj(e));\r\n }\r\n });\r\n handlers = [];\r\n }\r\n return {\r\n add: _addHandler,\r\n run: _runHandlers\r\n };\r\n}\r\n//# sourceMappingURL=UnloadHandlerContainer.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { arrAppend, arrForEach, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _throwInternal } from \"./DiagnosticLogger\";\r\n/**\r\n * Create a IUnloadHookContainer which can be used to remember unload hook functions to be executed during the component unloading\r\n * process.\r\n * @returns A new IUnloadHookContainer instance\r\n */\r\nexport function createUnloadHookContainer() {\r\n var _hooks = [];\r\n function _doUnload(logger) {\r\n var oldHooks = _hooks;\r\n _hooks = [];\r\n // Remove all registered unload hooks\r\n arrForEach(oldHooks, function (fn) {\r\n // allow either rm or remove callback function\r\n try {\r\n (fn.rm || fn.remove).call(fn);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, \"Unloading:\" + dumpObj(e));\r\n }\r\n });\r\n }\r\n function _addHook(hooks) {\r\n if (hooks) {\r\n arrAppend(_hooks, hooks);\r\n }\r\n }\r\n return {\r\n run: _doUnload,\r\n add: _addHook\r\n };\r\n}\r\n//# sourceMappingURL=UnloadHookContainer.js.map","/*\r\n * @nevware21/ts-utils\r\n * https://github.com/nevware21/ts-utils\r\n *\r\n * Copyright (c) 2022 Nevware21\r\n * Licensed under the MIT license.\r\n */\r\nimport { isArray, isUndefined } from \"../helpers/base\";\r\nimport { isIterable, isIterator } from \"../iterator/iterator\";\r\nimport { iterForOf } from \"../iterator/forOf\";\r\nimport { fnApply } from \"../funcs/fnApply\";\r\n/**\r\n * Appends the `elms` to the `target` where the elms may be an array, a single object\r\n * or an iterator object\r\n * @group Array\r\n * @group Iterator\r\n * @example\r\n * ```ts\r\n * let theArray = arrAppend([], 1);\r\n * arrAppend(theArray, [ 2, 3, 4 ]);\r\n * arrAppend(theArray, [ \"a\", \"b\", \"c\" ]);\r\n * // theArray is now [ 1, 2, 3, 4, \"a\", \"b\", \"c\" ]\r\n * ```\r\n * @param target - The target array\r\n * @param elms - The item, array of items an iterable or iterator object of items to add to the target\r\n * @returns The passed in target array\r\n * @example\r\n * ```ts\r\n * // Adding a single value\r\n * arrAppend([], undefined); // []\r\n * arrAppend([], 0); // [ 0 ]\r\n * arrAppend([1], undefined); // [ 1 ]\r\n * arrAppend([1], 2); // [ 1, 2 ]\r\n *\r\n * // Adding an array\r\n * arrAppend([], [] as number[]); // []\r\n * arrAppend([], [0]); // [ 0 ]\r\n * arrAppend([1], []); // [ 1 ]\r\n * arrAppend([1], [2]); // [ 1, 2 ]\r\n *\r\n * // Adding with an iterator\r\n * arrAppend([], ([] as number[]).values()); // []\r\n * arrAppend([], [0].values()); // [ 0 ]\r\n * arrAppend([1], [].keys()); // [ 1 ]\r\n * arrAppend([1], [2].values()); // [ 1, 2 ]\r\n * arrAppend([1], [2].keys()); // [ 1, 0 ] - 0 is from the index from the first element\r\n * ```\r\n */\r\nexport function arrAppend(target, elms) {\r\n if (!isUndefined(elms) && target) {\r\n if (isArray(elms)) {\r\n // This is not just \"target.push(elms)\" but becomes effectively \"target.push(elms[0], elms[1], ...)\"\r\n fnApply(target.push, target, elms);\r\n }\r\n else if (isIterator(elms) || isIterable(elms)) {\r\n iterForOf(elms, function (elm) {\r\n target.push(elm);\r\n });\r\n }\r\n else {\r\n target.push(elms);\r\n }\r\n }\r\n return target;\r\n}\r\n//# sourceMappingURL=append.js.map","/*\n * Application Insights JavaScript SDK - Core, 3.0.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\n\"use strict\";\r\nvar _a;\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isFunction, objDefine } from \"@nevware21/ts-utils\";\r\nimport { createDynamicConfig } from \"../Config/DynamicConfig\";\r\nimport { _DYN_CREATE_NEW, _DYN_DIAG_LOG, _DYN_GET_NEXT, _DYN_GET_PROCESS_TEL_CONT0, _DYN_INITIALIZE, _DYN_IS_ASYNC, _DYN_IS_INITIALIZED, _DYN_PROCESS_NEXT, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_UPDATE, _DYN__DO_TEARDOWN } from \"../__DynamicConstants\";\r\nimport { safeGetLogger } from \"./DiagnosticLogger\";\r\nimport { isNotNullOrUndefined, proxyFunctionAs } from \"./HelperFuncs\";\r\nimport { STR_CORE, STR_EXTENSION_CONFIG, STR_PROCESS_TELEMETRY } from \"./InternalConstants\";\r\nimport { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext } from \"./ProcessTelemetryContext\";\r\nimport { createUnloadHandlerContainer } from \"./UnloadHandlerContainer\";\r\nimport { createUnloadHookContainer } from \"./UnloadHookContainer\";\r\nvar strGetPlugin = \"getPlugin\";\r\nvar defaultValues = (_a = {},\r\n _a[STR_EXTENSION_CONFIG] = { isVal: isNotNullOrUndefined, v: {} },\r\n _a);\r\n/**\r\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins\r\n * can avoid implementation the same set of boiler plate code as well as provide a base\r\n * implementation so that new default implementations can be added without breaking all plugins.\r\n */\r\nvar BaseTelemetryPlugin = /** @class */ (function () {\r\n function BaseTelemetryPlugin() {\r\n var _self = this; // Setting _self here as it's used outside of the dynamicProto as well\r\n // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()\r\n var _isinitialized;\r\n var _rootCtx; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin; // Used for backward compatibility where plugins don't call the main pipeline\r\n var _unloadHandlerContainer;\r\n var _hookContainer;\r\n _initDefaults();\r\n dynamicProto(BaseTelemetryPlugin, _self, function (_self) {\r\n _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, core, extensions, pluginChain) {\r\n _setDefaults(config, core, pluginChain);\r\n _isinitialized = true;\r\n };\r\n _self[_DYN_TEARDOWN /* @min:%2eteardown */] = function (unloadCtx, unloadState) {\r\n var _a;\r\n // If this plugin has already been torn down (not operational) or is not initialized (core is not set)\r\n // or the core being used for unload was not the same core used for initialization.\r\n var core = _self[STR_CORE /* @min:%2ecore */];\r\n if (!core || (unloadCtx && core !== unloadCtx[STR_CORE /* @min:%2ecore */]())) {\r\n // Do Nothing as either the plugin is not initialized or was not initialized by the current core\r\n return;\r\n }\r\n var result;\r\n var unloadDone = false;\r\n var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);\r\n var theUnloadState = unloadState || (_a = {\r\n reason: 0 /* TelemetryUnloadReason.ManualTeardown */\r\n },\r\n _a[_DYN_IS_ASYNC /* @min:isAsync */] = false,\r\n _a);\r\n function _unloadCallback() {\r\n if (!unloadDone) {\r\n unloadDone = true;\r\n _unloadHandlerContainer.run(theUnloadCtx, unloadState);\r\n _hookContainer.run(theUnloadCtx[_DYN_DIAG_LOG /* @min:%2ediagLog */]());\r\n if (result === true) {\r\n theUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);\r\n }\r\n _initDefaults();\r\n }\r\n }\r\n if (!_self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] || _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {\r\n _unloadCallback();\r\n }\r\n else {\r\n // Tell the caller that we will be calling processNext()\r\n result = true;\r\n }\r\n return result;\r\n };\r\n _self[_DYN_UPDATE /* @min:%2eupdate */] = function (updateCtx, updateState) {\r\n // If this plugin has already been torn down (not operational) or is not initialized (core is not set)\r\n // or the core being used for unload was not the same core used for initialization.\r\n var core = _self[STR_CORE /* @min:%2ecore */];\r\n if (!core || (updateCtx && core !== updateCtx[STR_CORE /* @min:%2ecore */]())) {\r\n // Do Nothing\r\n return;\r\n }\r\n var result;\r\n var updateDone = false;\r\n var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);\r\n var theUpdateState = updateState || {\r\n reason: 0 /* TelemetryUpdateReason.Unknown */\r\n };\r\n function _updateCallback() {\r\n if (!updateDone) {\r\n updateDone = true;\r\n _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT /* @min:%2egetNext */]());\r\n }\r\n }\r\n if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {\r\n _updateCallback();\r\n }\r\n else {\r\n result = true;\r\n }\r\n return result;\r\n };\r\n proxyFunctionAs(_self, \"_addUnloadCb\", function () { return _unloadHandlerContainer; }, \"add\");\r\n proxyFunctionAs(_self, \"_addHook\", function () { return _hookContainer; }, \"add\");\r\n objDefine(_self, \"_unloadHooks\", { g: function () { return _hookContainer; } });\r\n });\r\n // These are added after the dynamicProto so that are not moved to the prototype\r\n _self[_DYN_DIAG_LOG /* @min:%2ediagLog */] = function (itemCtx) {\r\n return _getTelCtx(itemCtx)[_DYN_DIAG_LOG /* @min:%2ediagLog */]();\r\n };\r\n _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = function () {\r\n return _isinitialized;\r\n };\r\n _self.setInitialized = function (isInitialized) {\r\n _isinitialized = isInitialized;\r\n };\r\n // _self.getNextPlugin = () => DO NOT IMPLEMENT\r\n // Sub-classes of this base class *should* not be relying on this value and instead\r\n // should use processNext() function. If you require access to the plugin use the\r\n // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.\r\n _self[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */] = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](env);\r\n }\r\n else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */])) {\r\n // Looks like backward compatibility or out of band processing. And as it looks\r\n // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry\r\n _nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, null);\r\n }\r\n };\r\n _self._getTelCtx = _getTelCtx;\r\n function _getTelCtx(currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE /* @min:%2ecore */]);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin[strGetPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n }\r\n function _setDefaults(config, core, pluginChain) {\r\n // Make sure the extensionConfig exists and the config is dynamic\r\n createDynamicConfig(config, defaultValues, safeGetLogger(core));\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 /* @min:%2egetProcessTelContext */]()[_DYN_GET_NEXT /* @min:%2egetNext */]();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[strGetPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[strGetPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self[STR_CORE /* @min:%2ecore */] = core;\r\n _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n }\r\n function _initDefaults() {\r\n _isinitialized = false;\r\n _self[STR_CORE /* @min:%2ecore */] = null;\r\n _rootCtx = null;\r\n _nextPlugin = null;\r\n _hookContainer = createUnloadHookContainer();\r\n _unloadHandlerContainer = createUnloadHandlerContainer();\r\n }\r\n }\r\n// Removed Stub for BaseTelemetryPlugin.prototype.initialize.\r\n// Removed Stub for BaseTelemetryPlugin.prototype.teardown.\r\n// Removed Stub for BaseTelemetryPlugin.prototype.update.\r\n// Removed Stub for BaseTelemetryPlugin.prototype._addUnloadCb.\r\n// Removed Stub for BaseTelemetryPlugin.prototype._addHook.\r\n // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any\n // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.\n BaseTelemetryPlugin.__ieDyn=1;\n\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","/*\n * 1DS JS SDK Core, 4.0.2\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_INITIALIZE = \"initialize\"; // Count: 4\r\nexport var _DYN_LOGGER = \"logger\"; // Count: 4\r\nexport var _DYN_INDEX_OF = \"indexOf\"; // Count: 4\r\nexport var _DYN_TIMINGS = \"timings\"; // Count: 4\r\nexport var _DYN_POLL_INTERNAL_LOGS = \"pollInternalLogs\"; // Count: 4\r\nexport var _DYN_VALUE = \"value\"; // Count: 20\r\nexport var _DYN_KIND = \"kind\"; // Count: 5\r\nexport var _DYN_LENGTH = \"length\"; // Count: 7\r\nexport var _DYN_PROCESS_TELEMETRY_ST0 = \"processTelemetryStart\"; // Count: 3\r\nexport var _DYN_HANDLE_FIELD = \"handleField\"; // Count: 3\r\nexport var _DYN_RM_SANITIZER = \"rmSanitizer\"; // Count: 3\r\nexport var _DYN_RM_FIELD_SANITIZER = \"rmFieldSanitizer\"; // Count: 3\r\nexport var _DYN_CAN_HANDLE = \"canHandle\"; // Count: 7\r\n//# sourceMappingURL=__DynamicConstants.js.map","/*\n * 1DS JS SDK cV plugin, 4.0.2\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n* CorrelationVectorPlugin.ts\r\n* @author Ram Thiru (ramthi) and Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2018\r\n*/\r\nimport { __extendsFn as __extends } from \"@microsoft/applicationinsights-shims\";\r\nimport { BaseTelemetryPlugin, _throwInternal, setProcessTelemetryTimings } from \"@microsoft/1ds-core-js\";\r\nimport { Cv } from \"./Cv\";\r\nvar CorrelationVectorPlugin = /** @class */ (function (_super) {\r\n __extends(CorrelationVectorPlugin, _super);\r\n function CorrelationVectorPlugin(cvInitialValue) {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"CorrelationVectorPlugin\";\r\n _this.priority = 159;\r\n _this.version = '4.0.2';\r\n _this._cvInitialValue = cvInitialValue;\r\n // Default cV, could be used before initialization of the SDK\r\n _this._cv = _this._cvInitialValue ? new Cv(_this._cvInitialValue) : new Cv();\r\n return _this;\r\n }\r\n /**\r\n * Initialize the Correlation Vector plugin\r\n * @param config - The plugin configuration.\r\n * @param core - Core reference.\r\n * @param extensions - All other extensions\r\n */\r\n CorrelationVectorPlugin.prototype.initialize = function (coreConfig, core, extensions) {\r\n _super.prototype.initialize.call(this, coreConfig, core, extensions);\r\n };\r\n /**\r\n * Process a given event.\r\n * @param event - The event to be hydrated with CV.\r\n * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\r\n * can optionally use this to access the current core instance or define / pass additional information\r\n * to later plugins (vs appending items to the telemetry item)\r\n */\r\n CorrelationVectorPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n setProcessTelemetryTimings(event, this.identifier);\r\n event.ext = event.ext || {};\r\n event.ext[\"mscv\"] = event.ext[\"mscv\"] || {};\r\n // If cV is present do not override\r\n if (!event.ext[\"mscv\"][\"cV\"]) {\r\n if (this._cv && this._cv.isInit()) {\r\n event.ext[\"mscv\"][\"cV\"] = this._cv.getValue();\r\n }\r\n }\r\n this.processNext(event, itemCtx);\r\n };\r\n /**\r\n * Get cV instance\r\n */\r\n CorrelationVectorPlugin.prototype.getCv = function () {\r\n if (!this._cv) {\r\n _throwInternal(this.diagLog(), 2 /* eLoggingSeverity.WARNING */, 513 /* _eExtendedInternalMessageId.FailedToInitializeCorrelationVector */, \"Correlation Vector has not been initialized.\");\r\n }\r\n return this._cv;\r\n };\r\n return CorrelationVectorPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { CorrelationVectorPlugin };\r\n//# sourceMappingURL=CorrelationVectorPlugin.js.map","/*\n * 1DS JS SDK cV plugin, 4.0.2\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\n/**\r\n* Cv.ts\r\n* @author Ram Thiru (ramthi) and Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2018\r\n*/\r\nimport { _throwInternal, safeGetLogger } from \"@microsoft/1ds-core-js\";\r\nimport { strSubstr } from \"@nevware21/ts-utils\";\r\nvar CvConstant = /** @class */ (function () {\r\n function CvConstant() {\r\n }\r\n return CvConstant;\r\n}());\r\nvar Cv = /** @class */ (function () {\r\n function Cv(initValue, core) {\r\n this._base = \"\";\r\n this._currentElement = 0;\r\n this._base64CharSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n // cv version-dependent constants\r\n this._cv1Constants = new CvConstant();\r\n this._cv2Constants = new CvConstant();\r\n this._cvVersionAtLatestValidityCheck = 2;\r\n this._traceLogger = safeGetLogger(core);\r\n this._cv1Constants.maxCorrelationVectorLength = 63;\r\n this._cv1Constants.baseLength = 16;\r\n this._cv1Constants.validationPattern = new RegExp(\"^[\" + this._base64CharSet + \"]{\" + this._cv1Constants.baseLength.toString() + \"}(\\.[0-9]+)*$\");\r\n this._cv2Constants.maxCorrelationVectorLength = 127;\r\n this._cv2Constants.baseLength = 22;\r\n this._cv2Constants.validationPattern = new RegExp(\"^[\" + this._base64CharSet + \"]{\" + this._cv2Constants.baseLength.toString() + \"}(\\.[0-9]+)*$\");\r\n this._currentCvConstants = this._cv2Constants;\r\n this.init(initValue);\r\n }\r\n Cv.prototype.isInit = function () {\r\n return this.isValid(this.storedCv());\r\n };\r\n Cv.prototype.storedCv = function () {\r\n /// creates the cv element from stored variables \r\n /// cV element in string format \r\n return this._base.concat(\".\", this._currentElement.toString());\r\n };\r\n Cv.prototype.getValue = function () {\r\n /// \r\n /// Privileged method to serialize the current value of the Correlation Vector.\r\n /// CV should not be read from meta tag, but this is a breaking change.\r\n /// \r\n /// Serialized value of the Correlation Vector\r\n var value = this.storedCv();\r\n if (this.isValid(value)) {\r\n return value;\r\n }\r\n };\r\n Cv.prototype.getRelatedCv = function () {\r\n return this._relatedCv;\r\n };\r\n Cv.prototype.incrementExternal = function (externalCv) {\r\n /// this method verifies and increments external cVs \r\n /// the cv to be incremented \r\n /// the incremented cv if the incrementation was succesful \r\n if (this.isValid(externalCv)) {\r\n // decompose external cV\r\n var externalCvParts = externalCv.split(\".\");\r\n var numberOfCvParts = externalCvParts.length;\r\n // increment last part of cV\r\n externalCvParts[numberOfCvParts - 1] = (parseInt(externalCvParts[numberOfCvParts - 1], 10) + 1).toString();\r\n // recombine cV\r\n var incrementedCv = \"\";\r\n for (var i = 0; i < numberOfCvParts; i++) {\r\n incrementedCv += (externalCvParts[i]);\r\n if (i < (numberOfCvParts - 1)) {\r\n incrementedCv += \".\";\r\n }\r\n }\r\n // to support cv 1 & 2\r\n var maxLength = (externalCvParts[0].length === this._cv2Constants.baseLength) ?\r\n this._cv2Constants.maxCorrelationVectorLength : this._cv1Constants.maxCorrelationVectorLength;\r\n if (incrementedCv.length <= maxLength) {\r\n return incrementedCv;\r\n }\r\n }\r\n };\r\n Cv.prototype.canExtend = function () {\r\n /// \r\n /// Private method to check if the Correlation Vector can be extended\r\n /// \r\n /// Object reference to the Correlation Vector\r\n /// True if the Correlation Vector can be extended, false otherwise.\r\n var currentCv = this.storedCv();\r\n if (this.isValid(currentCv)) {\r\n return this._isLeqThanMaxCorrelationVectorLength(currentCv.length + 2);\r\n }\r\n return false;\r\n };\r\n Cv.prototype.canIncrement = function () {\r\n /// \r\n /// Private method to check if the Correlation Vector can be incremented\r\n /// \r\n /// True if the Correlation Vector can be incremented, false otherwise.\r\n if (this.isValid(this.storedCv())) {\r\n return this._isLeqThanMaxCorrelationVectorLength(this._base.length + 1 + ((this._currentElement + 1) + \"\").length);\r\n }\r\n return false;\r\n };\r\n /**\r\n * @ Sets the base for the cv object\r\n * @ If the passed in value is a cv itself Base and digits\r\n * @param _base - The base value of the cv.\r\n */\r\n Cv.prototype.setValue = function (_base) {\r\n if (this.isValid(_base)) {\r\n var lastIndex = _base.lastIndexOf(\".\");\r\n if (lastIndex > 1) {\r\n this._base = strSubstr(_base, 0, lastIndex);\r\n this._currentElement = parseInt(strSubstr(_base, lastIndex + 1), 10);\r\n }\r\n else {\r\n this._base = _base;\r\n this._currentElement = 0;\r\n }\r\n return true;\r\n }\r\n else {\r\n _throwInternal(this._traceLogger, 2 /* eLoggingSeverity.WARNING */, 516 /* _eExtendedInternalMessageId.InvalidCorrelationValue */, \"Cannot set invalid correlation vector value\");\r\n return false;\r\n }\r\n };\r\n /**\r\n * Legacy method to support backward compatibility with JSLL shim do not use outside of shim\r\n * This method accepts cV that are already seeded and do not implement related cV logic\r\n */\r\n Cv.prototype.setValueLegacy = function (cv) {\r\n // Related cV functionality was removed from the SDK so legacy and regular would be the same\r\n this.setValue(cv);\r\n return this.getValue();\r\n };\r\n Cv.prototype.seed = function () {\r\n var result = \"\";\r\n for (var i = 0; i < this._currentCvConstants.baseLength; i++) {\r\n result += this._base64CharSet.charAt(Math.floor(Math.random() * this._base64CharSet.length));\r\n }\r\n return result;\r\n };\r\n Cv.prototype.extend = function () {\r\n if (this.canExtend()) {\r\n this._base = this._base.concat(\".\", this._currentElement.toString());\r\n this._currentElement = 0;\r\n return this.storedCv();\r\n }\r\n };\r\n Cv.prototype.increment = function () {\r\n if (this.canIncrement()) {\r\n this._currentElement = this._currentElement + 1;\r\n return this.storedCv();\r\n }\r\n };\r\n Cv.prototype.validateWithCv1 = function (_cv) {\r\n if (this._cv1Constants.validationPattern.test(_cv) && _cv.length <= this._cv1Constants.maxCorrelationVectorLength) {\r\n return true;\r\n }\r\n };\r\n Cv.prototype.validateWithCv2 = function (_cv) {\r\n if (this._cv2Constants.validationPattern.test(_cv) && _cv.length <= this._cv2Constants.maxCorrelationVectorLength) {\r\n return true;\r\n }\r\n };\r\n Cv.prototype.useCv1 = function () {\r\n this._currentCvConstants = this._cv1Constants;\r\n };\r\n Cv.prototype.useCv2 = function () {\r\n this._currentCvConstants = this._cv2Constants;\r\n };\r\n Cv.prototype.isValid = function (_cv) {\r\n if (_cv) {\r\n var baseValue = _cv.split(\".\")[0];\r\n if (baseValue) {\r\n if (baseValue.length === 16) {\r\n this._cvVersionAtLatestValidityCheck = 1;\r\n return this.validateWithCv1(_cv);\r\n }\r\n else if (baseValue.length === 22) {\r\n this._cvVersionAtLatestValidityCheck = 2;\r\n return this.validateWithCv2(_cv);\r\n }\r\n }\r\n }\r\n };\r\n Cv.prototype.init = function (cvInitValue) {\r\n if (cvInitValue) {\r\n this.setValue(cvInitValue);\r\n }\r\n else {\r\n this._base = this.seed();\r\n this._currentElement = 0;\r\n }\r\n return this.getValue();\r\n };\r\n /**\r\n * Legacy method to support backward compatibility with JSLL shim do not use outside of shim\r\n * This method accepts cV that are already seeded and do not implement related cV logic\r\n */\r\n Cv.prototype.initLegacy = function (cvInitValue) {\r\n // Related cV functionality was removed from the SDK so legacy and regular would be the same\r\n return this.init(cvInitValue);\r\n };\r\n Cv.prototype._isLeqThanMaxCorrelationVectorLength = function (length) {\r\n if (this._cvVersionAtLatestValidityCheck === 1) {\r\n return length <= this._cv1Constants.maxCorrelationVectorLength;\r\n }\r\n else {\r\n return length <= this._cv2Constants.maxCorrelationVectorLength;\r\n }\r\n };\r\n return Cv;\r\n}());\r\nexport { Cv };\r\n//# sourceMappingURL=Cv.js.map","/*\n * 1DS JS SDK Core, 4.0.2\n * Copyright (c) Microsoft and contributors. All rights reserved.\n * (Microsoft Internal Only)\n */\nvar _a;\r\n/**\r\n* Utils.ts\r\n* @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2018\r\n* File containing utility functions.\r\n*/\r\nimport { arrForEach, getGlobalInst, getNavigator, hasDocument, hasWindow, isArray, isBoolean, isNullOrUndefined, isNumber, isObject, isReactNative, isString, isUndefined, newGuid, objForEachKey, perfNow } from \"@microsoft/applicationinsights-core-js\";\r\nimport { ObjProto, strShimObject } from \"@microsoft/applicationinsights-shims\";\r\nimport { strIndexOf, strLeft } from \"@nevware21/ts-utils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nimport { _DYN_INDEX_OF, _DYN_KIND, _DYN_LENGTH, _DYN_PROCESS_TELEMETRY_ST0, _DYN_TIMINGS, _DYN_VALUE } from \"./__DynamicConstants\";\r\nexport var Version = '4.0.2';\r\nexport var FullVersionString = \"1DS-Web-JS-\" + Version;\r\nvar ObjHasOwnProperty = ObjProto.hasOwnProperty;\r\n// Defining here so we don't need to take (import) the ApplicationInsights Common module\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\nvar strTimeout = \"timeout\";\r\n// If value is array just get the type for the first element\r\nvar _fieldTypeEventPropMap = (_a = {},\r\n _a[0 /* FieldValueSanitizerType.NotSet */] = 0 /* eEventPropertyType.Unspecified */,\r\n _a[2 /* FieldValueSanitizerType.Number */] = 6 /* eEventPropertyType.Double */,\r\n _a[1 /* FieldValueSanitizerType.String */] = 1 /* eEventPropertyType.String */,\r\n _a[3 /* FieldValueSanitizerType.Boolean */] = 7 /* eEventPropertyType.Bool */,\r\n _a[4096 /* FieldValueSanitizerType.Array */ | 2 /* FieldValueSanitizerType.Number */] = 6 /* eEventPropertyType.Double */,\r\n _a[4096 /* FieldValueSanitizerType.Array */ | 1 /* FieldValueSanitizerType.String */] = 1 /* eEventPropertyType.String */,\r\n _a[4096 /* FieldValueSanitizerType.Array */ | 3 /* FieldValueSanitizerType.Boolean */] = 7 /* eEventPropertyType.Bool */,\r\n _a);\r\n/**\r\n * @ignore\r\n */\r\n// let _uaDisallowsSameSiteNone = null;\r\nvar uInt8ArraySupported = null;\r\n// var _areCookiesAvailable: boolean | undefined;\r\n/**\r\n * Checks if document object is available\r\n */\r\nexport var isDocumentObjectAvailable = hasDocument();\r\n/**\r\n * Checks if window object is available\r\n */\r\nexport var isWindowObjectAvailable = hasWindow();\r\n/**\r\n * Checks if value is assigned to the given param.\r\n * @param value - The token from which the tenant id is to be extracted.\r\n * @returns True/false denoting if value is assigned to the param.\r\n */\r\nexport function isValueAssigned(value) {\r\n /// takes a value and checks for undefined, null and empty string \r\n /// value to be tested \r\n /// true if value is null undefined or emptyString \r\n return !(value === STR_EMPTY || isNullOrUndefined(value));\r\n}\r\n/**\r\n * Gets the tenant id from the tenant token.\r\n * @param apiKey - The token from which the tenant id is to be extracted.\r\n * @returns The tenant id.\r\n */\r\nexport function getTenantId(apiKey) {\r\n if (apiKey) {\r\n var indexTenantId = strIndexOf(apiKey, \"-\");\r\n if (indexTenantId > -1) {\r\n return strLeft(apiKey, indexTenantId);\r\n }\r\n }\r\n return STR_EMPTY;\r\n}\r\n/**\r\n * Checks if Uint8Array are available in the current environment. Safari and Firefox along with\r\n * ReactNative are known to not support Uint8Array properly.\r\n * @returns True if available, false otherwise.\r\n */\r\nexport function isUint8ArrayAvailable() {\r\n if (uInt8ArraySupported === null) {\r\n uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();\r\n }\r\n return uInt8ArraySupported;\r\n}\r\n/**\r\n * Checks if the value is a valid EventLatency.\r\n * @param value - The value that needs to be checked.\r\n * @returns True if the value is in AWTEventLatency, false otherwise.\r\n */\r\nexport function isLatency(value) {\r\n if (value && isNumber(value) && value >= 1 /* EventLatencyValue.Normal */ && value <= 4 /* EventLatencyValue.Immediate */) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Sanitizes the Property. It checks the that the property name and value are valid. It also\r\n * checks/populates the correct type and pii of the property value.\r\n * @param name - property name - The property name.\r\n * @param property - The property value or an IEventProperty containing value,\r\n * type ,pii and customer content.\r\n * @returns IEventProperty containing valid name, value, pii and type or null if invalid.\r\n */\r\nexport function sanitizeProperty(name, property, stringifyObjects) {\r\n // Check that property is valid\r\n if ((!property && !isValueAssigned(property)) || typeof name !== \"string\") {\r\n return null;\r\n }\r\n // Perf optimization -- only need to get the type once not multiple times\r\n var propType = typeof property;\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n if (propType === \"string\" || propType === \"number\" || propType === \"boolean\" || isArray(property)) {\r\n property = { value: property };\r\n }\r\n else if (propType === \"object\" && !ObjHasOwnProperty.call(property, \"value\")) {\r\n property = { value: stringifyObjects ? JSON.stringify(property) : property };\r\n }\r\n else if (isNullOrUndefined(property[_DYN_VALUE /* @min:%2evalue */])\r\n || property[_DYN_VALUE /* @min:%2evalue */] === STR_EMPTY || (!isString(property[_DYN_VALUE /* @min:%2evalue */])\r\n && !isNumber(property[_DYN_VALUE /* @min:%2evalue */]) && !isBoolean(property[_DYN_VALUE /* @min:%2evalue */])\r\n && !isArray(property[_DYN_VALUE /* @min:%2evalue */]))) {\r\n // Since property is IEventProperty, we need to validate its value\r\n return null;\r\n }\r\n // We need to check that if the property value is an array, it is valid\r\n if (isArray(property[_DYN_VALUE /* @min:%2evalue */]) &&\r\n !isArrayValid(property[_DYN_VALUE /* @min:%2evalue */])) {\r\n return null;\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property[_DYN_KIND /* @min:%2ekind */])) {\r\n if (isArray(property[_DYN_VALUE /* @min:%2evalue */]) || !isValueKind(property[_DYN_KIND /* @min:%2ekind */])) {\r\n return null;\r\n }\r\n property[_DYN_VALUE /* @min:%2evalue */] = property[_DYN_VALUE /* @min:%2evalue */].toString();\r\n }\r\n return property;\r\n}\r\nexport function getCommonSchemaMetaData(value, kind, type) {\r\n var encodedTypeValue = -1;\r\n if (!isUndefined(value)) {\r\n if (kind > 0) {\r\n if (kind === 32) {\r\n // encode customer content. Value can only be string. bit 13-16 are for cc\r\n encodedTypeValue = (1 << 13);\r\n }\r\n else if (kind <= 13) {\r\n // encode PII. Value can only be string. bits 5-12 are for Pii\r\n encodedTypeValue = (kind << 5);\r\n }\r\n }\r\n // isDataType checks that the \"type\" is a number so we don't need to check for undefined\r\n if (isDataType(type)) {\r\n // Data Type is provided and valid, so use that\r\n if (encodedTypeValue === -1) {\r\n // Don't return -1\r\n encodedTypeValue = 0;\r\n }\r\n encodedTypeValue |= type;\r\n }\r\n else {\r\n var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;\r\n if (encodedTypeValue !== -1 && propType !== -1) {\r\n // pii exists so we must return correct type\r\n encodedTypeValue |= propType;\r\n }\r\n else if (propType === 6 /* eEventPropertyType.Double */) {\r\n encodedTypeValue = propType;\r\n }\r\n }\r\n }\r\n return encodedTypeValue;\r\n}\r\n/**\r\n * Helper to get and decode the cookie value using decodeURIComponent, this is for historical\r\n * backward compatibility where the document.cookie value was decoded before parsing.\r\n * @param cookieMgr - The cookie manager to use\r\n * @param name - The name of the cookie to get\r\n * @param decode - A flag to indicate whether the cookie value should be decoded\r\n * @returns The decoded cookie value (if available) otherwise an empty string.\r\n */\r\nexport function getCookieValue(cookieMgr, name, decode) {\r\n if (decode === void 0) { decode = true; }\r\n var cookieValue;\r\n if (cookieMgr) {\r\n cookieValue = cookieMgr.get(name);\r\n if (decode && cookieValue && decodeURIComponent) {\r\n cookieValue = decodeURIComponent(cookieValue);\r\n }\r\n }\r\n return cookieValue || STR_EMPTY;\r\n}\r\n/**\r\n * Create a new guid.\r\n * @param style - The style of guid to generated, defaults to Digits\r\n * Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000\r\n * Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000}\r\n * Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000)\r\n * Numeric - 32 digits: 00000000000000000000000000000000\r\n * @returns The formatted guid.\r\n */\r\nexport function createGuid(style) {\r\n if (style === void 0) { style = \"D\" /* GuidStyle.Digits */; }\r\n var theGuid = newGuid();\r\n if (style === \"B\" /* GuidStyle.Braces */) {\r\n theGuid = \"{\" + theGuid + \"}\";\r\n }\r\n else if (style === \"P\" /* GuidStyle.Parentheses */) {\r\n theGuid = \"(\" + theGuid + \")\";\r\n }\r\n else if (style === \"N\" /* GuidStyle.Numeric */) {\r\n theGuid = theGuid.replace(/-/g, STR_EMPTY);\r\n }\r\n return theGuid;\r\n}\r\n/**\r\n * Pass in the objects to merge as arguments.\r\n * @param obj1 - object to merge. Set this argument to 'true' for a deep extend.\r\n * @param obj2 - object to merge.\r\n * @param obj3 - object to merge.\r\n * @param obj4 - object to merge.\r\n * @param obj5 - object to merge.\r\n * @returns The extended object.\r\n */\r\nexport function extend(obj, obj2, obj3, obj4, obj5) {\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n var length = arguments[_DYN_LENGTH /* @min:%2elength */];\r\n var theArgs = arguments;\r\n // Check if a deep merge\r\n if (isBoolean(theArgs[0])) {\r\n deep = theArgs[0];\r\n i++;\r\n }\r\n // Loop through each object and conduct a merge\r\n for (; i < length; i++) {\r\n var obj = theArgs[i];\r\n objForEachKey(obj, function (prop, value) {\r\n // If deep merge and property is an object, merge properties\r\n if (deep && value && isObject(value)) {\r\n if (isArray(value)) {\r\n extended[prop] = extended[prop] || [];\r\n arrForEach(value, function (arrayValue, arrayIndex) {\r\n if (arrayValue && isObject(arrayValue)) {\r\n extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);\r\n }\r\n else {\r\n extended[prop][arrayIndex] = arrayValue;\r\n }\r\n });\r\n }\r\n else {\r\n extended[prop] = extend(true, extended[prop], value);\r\n }\r\n }\r\n else {\r\n extended[prop] = value;\r\n }\r\n });\r\n }\r\n return extended;\r\n}\r\nexport var getTime = perfNow;\r\nexport function isValueKind(value) {\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value === 0 /* eValueKind.NotSet */ || ((value > 0 /* eValueKind.NotSet */ && value <= 13 /* eValueKind.Pii_IPV4AddressLegacy */) || value === 32 /* eValueKind.CustomerContent_GenericContent */)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isDataType(value) {\r\n // Remark: 0 returns false, but it doesn't affect encoding anyways\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value >= 0 && value <= 9) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSafariOrFirefox() {\r\n var nav = getNavigator();\r\n // If non-browser navigator will be undefined\r\n if (!isUndefined(nav) && nav.userAgent) {\r\n var ua = nav.userAgent.toLowerCase();\r\n if ((ua[_DYN_INDEX_OF /* @min:%2eindexOf */](\"safari\") >= 0 || ua[_DYN_INDEX_OF /* @min:%2eindexOf */](\"firefox\") >= 0) && ua[_DYN_INDEX_OF /* @min:%2eindexOf */](\"chrome\") < 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function isArrayValid(value) {\r\n return value[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n}\r\nexport function setProcessTelemetryTimings(event, identifier) {\r\n var evt = event;\r\n evt[_DYN_TIMINGS /* @min:%2etimings */] = evt[_DYN_TIMINGS /* @min:%2etimings */] || {};\r\n evt[_DYN_TIMINGS /* @min:%2etimings */][_DYN_PROCESS_TELEMETRY_ST0 /* @min:%2eprocessTelemetryStart */] = evt[_DYN_TIMINGS /* @min:%2etimings */][_DYN_PROCESS_TELEMETRY_ST0 /* @min:%2eprocessTelemetryStart */] || {};\r\n evt[_DYN_TIMINGS /* @min:%2etimings */][_DYN_PROCESS_TELEMETRY_ST0 /* @min:%2eprocessTelemetryStart */][identifier] = getTime();\r\n}\r\n/**\r\n * Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value\r\n * @param value The value to determine the type\r\n */\r\nexport function getFieldValueType(value) {\r\n var theType = 0 /* FieldValueSanitizerType.NotSet */;\r\n if (value !== null && value !== undefined) {\r\n var objType = typeof value;\r\n if (objType === \"string\") {\r\n theType = 1 /* FieldValueSanitizerType.String */;\r\n }\r\n else if (objType === \"number\") {\r\n theType = 2 /* FieldValueSanitizerType.Number */;\r\n }\r\n else if (objType === \"boolean\") {\r\n theType = 3 /* FieldValueSanitizerType.Boolean */;\r\n }\r\n else if (objType === strShimObject) {\r\n theType = 4 /* FieldValueSanitizerType.Object */;\r\n if (isArray(value)) {\r\n theType = 4096 /* FieldValueSanitizerType.Array */;\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n // Empty arrays are not supported and are considered to be the same as null\r\n theType |= getFieldValueType(value[0]);\r\n }\r\n }\r\n else if (ObjHasOwnProperty.call(value, \"value\")) {\r\n // Looks like an IEventProperty\r\n theType = 8192 /* FieldValueSanitizerType.EventProperty */ | getFieldValueType(value[_DYN_VALUE /* @min:%2evalue */]);\r\n }\r\n }\r\n }\r\n return theType;\r\n}\r\n/**\r\n * Helper to identify whether we are running in a chromium based browser environment\r\n */\r\nexport function isChromium() {\r\n return !!getGlobalInst(\"chrome\");\r\n}\r\n/**\r\n * Create and open an XMLHttpRequest object\r\n * @param method - The request method\r\n * @param urlString - The url\r\n * @param withCredentials - Option flag indicating that credentials should be sent\r\n * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)\r\n * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)\r\n * @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) {\r\n if (disabled === void 0) { disabled = false; }\r\n if (isSync === void 0) { isSync = false; }\r\n function _wrapSetXhrProp(xhr, prop, value) {\r\n try {\r\n xhr[prop] = value;\r\n }\r\n catch (e) {\r\n // - Wrapping as depending on the environment setting the property may fail (non-terminally)\r\n }\r\n }\r\n var xhr = new XMLHttpRequest();\r\n if (disabled) {\r\n // Tag the instance so it's not tracked (trackDependency)\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);\r\n }\r\n if (withCredentials) {\r\n // Some libraries require that the withCredentials flag is set \"before\" open and\r\n // - Wrapping as IE 10 has started throwing when setting before open\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n xhr.open(method, urlString, !isSync);\r\n if (withCredentials) {\r\n // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)\r\n // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n // Only set the timeout for asynchronous requests as\r\n // \"Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception.\"\"\r\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout\r\n if (!isSync && timeout) {\r\n _wrapSetXhrProp(xhr, strTimeout, timeout);\r\n }\r\n return xhr;\r\n}\r\n/**\r\n * Check to see if the value is > 0\r\n * @param value - The value to check\r\n * @returns true if > 0 otherwise false\r\n */\r\nexport function isGreaterThanZero(value) {\r\n return value > 0;\r\n}\r\n//# sourceMappingURL=Utils.js.map"],"names":["strShimObject","strShimUndefined","strShimPrototype","ObjClass","Object","UNDEF_VALUE","undefined","NULL_VALUE","EMPTY","FUNCTION","OBJECT","PROTOTYPE","__PROTO__","UNDEFINED","CONSTRUCTOR","SYMBOL","POLYFILL_TAG","INDEX_OF","LENGTH","DONE","VALUE","NAME","SLICE","ObjProto","StrCls","String","StrProto","MathCls","Math","ArrCls","Array","ArrProto","_createIs","theType","value","objToString","toString","call","isUndefined","isNullOrUndefined","isDefined","arg","isString","isFunction","isObject","isArray","isNumber","isError","objGetOwnPropertyDescriptor","getOwnPropertyDescriptor","objHasOwnProperty","obj","prop","hasOwnProperty","objHasOwn","objForEachKey","theObject","callbackfn","thisArg","throwTypeError","message","TypeError","_objFreeze","objFreeze","objGetPrototypeOf","theMap","asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables","key","_globalCfg","_wellKnownSymbolMap","asString","GLOBAL_CONFIG_KEY","_getGlobalValue","result","globalThis","self","window","global","_getGlobalConfig","gbl","dumpObj","object","format","propertyValueDump","stack","name","JSON","stringify","e","funcName","polyFunc","clsFn","_polySymbols","_arrSlice","_throwMissingFunction","_unwrapInstFunction","apply","arguments","_unwrapFunction","clsProto","theFunc","mathMax","max","strSlice","strSubstr","start","length","theArgs","_wellKnownSymbolCache","polyNewSymbol","description","theSymbol","_globalLazyTestHooks","propMap","c","v","w","g","s","objDefineProp","objDefine","target","propDesc","l","get","desc","set","newValue","_fetchLazyTestHooks","getLazy","cb","lazyValue","b","lzy","configurable","safeGetLazy","defValue","safeGet","_cachedGlobal","_cachedWindow","_cachedDocument","_cachedNavigator","_symbol","_symbolFor","_symbolKeyFor","_iterSymbol","WINDOW","lazySafeGetInst","getInst","getGlobal","useCached","getWindow","_getSymbolValue","getSymbol","resetCache","getKnownSymbol","noPoly","knownName","newSymbol","symbolFor","gblCfg","gblSym","k","newSymbol_1","regId_1","registry","keys","isIterator","next","iterForOf","iter","err","iterResult","count","failed","throw","return","fnApply","arrForEach","theArray","len","idx","_isProtoArray","arrIndexOf","arrSlice","fnCall","objCreate","type","tempFunc","objSetPrototypeOf","proto","d","__proto__","_fnToString","_objCtrFnString","_gblWindow","_perf","_safeSetName","baseClass","_safeDefineName","utcNow","Date","now","getTime","isPlainObject","Function","ex","strIndexOf","UNREF","ENABLED","extendStaticsFn","p","Constructor","Prototype","strFunction","DynInstFuncTable","DynProxyTag","DynClassName","DynInstChkTag","DynAllowInstChkTag","DynProtoDefaultOptions","UnknownValue","str__Proto","DynProtoBaseProto","DynProtoGlobalSettings","DynProtoCurrent","strUseBaseInst","strSetInstFuncs","Obj","_objGetPrototypeOf","_objGetOwnProps","_gbl","_gblInst","o","_a","n","_isObjectOrArrayPrototype","_isObjectArrayOrFunctionPrototype","_getObjProto","curProto","newProto","_forEachProp","func","props","name_1","push","lp","_isDynamicCandidate","skipOwn","_throwTypeError","_hasVisited","values","_getObjName","unknownValue","dynamicProto","theClass","delegateFunc","options","thisTarget","instFuncs","baseInstFuncs","instFuncs_1","classProto","className","visited","thisProto","_checkPrototype","perfOptions","useBaseInst","setInstanceFunc","_instFuncProxy","funcHost","instFuncTable","baseFuncs","baseProto","_getBaseFuncs","dynProtoProxy","protoFunc","currentDynProtoProxy","instFunc","canAddInst","objProto","_getInstFunc","this","aggregationErrorType","_DYN_BLK_VAL","_DYN_LENGTH","_DYN_RD_ONLY","_DYN_NOTIFY","_DYN_WARN_TO_CONSOLE","_DYN_THROW_INTERNAL","_DYN_SET_DF","_DYN_WATCH","_DYN_LOGGER","_DYN_APPLY","_DYN_PUSH","_DYN_SPLICE","_DYN_HDLR","_DYN_IDENTIFIER","_DYN_IS_INITIALIZED","_DYN_GET_PLUGIN","_DYN_TIME","_DYN_PROCESS_NEXT","_DYN_CREATE_NEW","_DYN_TEARDOWN","_DYN_MESSAGE_ID","_DYN_MESSAGE","_DYN_IS_ASYNC","_DYN_DIAG_LOG","_DYN__DO_TEARDOWN","_DYN_UPDATE","_DYN_GET_NEXT","_DYN_SET_NEXT_PLUGIN","_DYN_USER_AGENT","_DYN_NODE_TYPE","_DYN_REPLACE","_DYN_IS_CHILD_EVT","_DYN_GET_CTX","_DYN_SET_CTX","_DYN_COMPLETE","UNDEFINED_VALUE","STR_EMPTY","STR_CORE","STR_DISABLED","STR_EXTENSION_CONFIG","STR_PROCESS_TELEMETRY","STR_PRIORITY","STR_GET_PERF_MGR","rCamelCase","rNormalizeInvalid","rLeadingNumeric","normalizeJsName","_all","letter","toUpperCase","strContains","proxyFunctionAs","source","overwriteTarget","srcFunc","src","originalArguments","strConsole","strJSON","_isTrident","_navUserAgentCheck","hasJSON","UInt32Mask","MaxUInt32","SEED1","SEED2","_mwcSeeded","_mwcW","_mwcZ","random32","signed","seedValue","getRandomValues","Uint32Array","nav","userAgent","random","floor","instanceName","maxLength","number","chars","base64chars","newId","_dataUid","_canAcceptData","createUniqueNamespace","includeVersion","_isConfigDefaults","isVal","fb","_getDefault","dynamicHandler","theConfig","cfgDefaults","isDefaultValid","dfVal","fallbacks","fallback","fbValue","cfg","_applyDefaultValue","defaultValue","isValid","setFn","mergeDf","reference","readOnly","theValue","blkDynamicValue","mrg","ref","usingDefault","cfgValue","_resolveDefaultValue","newValue_1","dfName","dfValue","CFG_HANDLER_LINK","BLOCK_DYNAMIC","FORCE_DYNAMIC","_canMakeDynamic","getFunc","state","blkVal","throwInvalidAccess","arrayMethodsToPatch","_throwDynamicError","logger","concat","_getOwnPropGetter","_createDynamicProperty","detail","h","trk","handler","fn","clr","checkDynamic","isObjectOrArray","_getProperty","_makeDynamicObject","activeHandler","act","chng","add","ro","upd","newIsObjectOrArray","isReferenced","rf","_setDynamicProperty","hdlr","getter","valueState","_setDynamicPropertyState","flags","isDynamic","inPlace","rdOnly","blkProp","blockDynamicConversion","method","orgMethod","args","_i","symPrefix","symPostfix","_createState","cfgHandler","theState","dynamicPropertySymbol","uid","dynamicPropertyReadOnly","dynamicPropertyReferenced","dynamicPropertyBlockValue","dynamicPropertyDetail","_waitingHandlers","_watcherTimer","_useHandler","callback","prevWatcher","bind","setDf","_notifyWatchers","theMessage","notifyHandlers","watcherFailures_1","sourceErrors","constructCb","errors","orgName","theBaseClass","Error","captureFn","captureStackTrace","_this","orgProto","_self","__","srcError","constructor","createCustomError","overrideFn","isArr","setTimeout","clearFn","clearTimeout","timerFn","dn","cancelFn","timerId","refreshFn","refresh","cancel","_cancel","_refresh","_unref","theTimerHandler","hasRef","scheduleTimeout","use","details","_createDynamicHandler","getDynamicConfigHandler","newTarget","_cfgDeepCopy","target_1","defaultValues","configHandler","rm","_block","allowUpdate","prevUpd","createDynamicConfig","config","defaultConfig","_aiNamespace","STR_WARN_TO_CONSOLE","loggingLevelConsole","loggingLevelTelemetry","maxMessageLimit","enableDebug","_logFuncs","_sanitizeDiagnosticText","text","_logToConsole","logFunc","theConsole","console","_InternalLogMessage","dataType","msgId","msg","isUserAct","properties","strProps","diagnosticText","safeGetLogger","core","DiagnosticLogger","__ieDyn","identifier","queue","_loggingLevelConsole","_loggingLevelTelemetry","_maxInternalMessageLimit","_enableDebug","_unloadHandler","_messageCount","_messageLogged","_logInternalMessage","severity","throttleLimitMessage","throttleMessage","logMessage","messageKey","_debugExtMsg","errorToConsole","data","ns","dbgExt","disableDbgExt","consoleLoggingLevel","debugToConsole","resetInternalMessageCount","isAsync","_throwInternal","strParentContextKey","strChildrenContextKey","PerfEvent","ParentContextKey","ChildrenContextKey","payloadDetails","theDetails_1","childTime","childEvts","childEvt","exTime","doPerfActiveKey","doPerf","mgrSource","getSource","perfMgr","children","perfEvt","currentActive","create","fire","pluginStateData","id","accept","addDefault","theCache","_getCache","kill","_getPluginState","plugin","strTelemetryPluginChain","strHasRunFlags","strGetTelCtx","_chainId","_createInternalContext","telemetryChain","startAt","_nextProxy","_onComplete","context","proxy","createTelemetryProxyChain","_getNextProxyStart","_next","onComplete","nextProxy","completeDetails","ctx","diagLog","getCfg","getExtCfg","newConfig","_getExtCfg","field","getConfig","extConfig","rootConfig","hasNext","getNext","setNext","nextPlugin","iterate","that","createIfMissing","extCfg","idCfg","createProcessTelemetryContext","internalContext","env","plugins","lastProxy_1","firstProxy","thePlugin","newProxy","createTelemetryPluginProxy","_setNext","hasProcessTelemetry","hasSetNext","chainId","proxyChain","getPlugin","processTelemetry","itemCtx","_processChain","pluginState","item","unload","unloadCtx","unloadState","pluginCore","hasRun","update","updateCtx","updateState","_id","processPluginFn","hasRunContext","nextId","error","hasNextRun","createUnloadHandlerContainer","handlers","run","createUnloadHookContainer","_hooks","oldHooks","remove","hooks","elms","elm","strGetPlugin","BaseTelemetryPlugin","_isinitialized","_rootCtx","_nextPlugin","_unloadHandlerContainer","_hookContainer","_getTelCtx","currentCtx","rootCtx","_setDefaults","pluginChain","_initDefaults","extensions","unloadDone","theUnloadCtx","theUnloadState","createProcessTelemetryUnloadContext","reason","_unloadCallback","updateDone","theUpdateCtx","createProcessTelemetryUpdateContext","_doUpdate","_updateCallback","setInitialized","isInitialized","_super","_DYN_TIMINGS","_DYN_PROCESS_TELEMETRY_ST0","CvConstant","Cv","prototype","isInit","storedCv","_base","_currentElement","getValue","getRelatedCv","_relatedCv","incrementExternal","externalCv","externalCvParts","numberOfCvParts","incrementedCv","parseInt","i","_cv2Constants","baseLength","_cv1Constants","maxCorrelationVectorLength","canExtend","currentCv","_isLeqThanMaxCorrelationVectorLength","canIncrement","setValue","lastIndex","lastIndexOf","_traceLogger","setValueLegacy","cv","seed","_currentCvConstants","_base64CharSet","extend","increment","validateWithCv1","_cv","validationPattern","test","validateWithCv2","useCv1","useCv2","baseValue","_cvVersionAtLatestValidityCheck","init","cvInitValue","initLegacy","initValue","RegExp","CorrelationVectorPlugin","cvInitialValue","priority","version","_cvInitialValue","initialize","coreConfig","event","evt","perf","ext","processNext","getCv"],"mappings":";;;;;0jBAEO,IACIA,EAAgB,SAChBC,EAAmB,YACnBC,EAAmB,YAEnBC,EAAWC,OCEXC,EAAcC,UACdC,EAAa,KACbC,EAAQ,GAERC,EAAW,WAEXC,EAAS,SACTC,EAAY,YACZC,EAAY,YAEZC,EAAY,YACZC,EAAc,cACdC,EAAS,SACTC,EAAe,YACfC,EAAW,UAEXC,EAAS,SACTC,EAAO,OACPC,EAAQ,QACRC,EAAO,OACPC,EAAQ,QAIRnB,EAAWC,OAIXmB,GAAWpB,EAASQ,GAIpBa,EAASC,OAITC,GAAWF,EAAOb,GAIlBgB,GAAUC,KAIVC,EAASC,MAITC,GAAWF,EAAOlB,GCvCtB,SAASqB,GAAUC,GACtB,OAAO,SAAUC,GACb,cAAcA,IAAUD,GAwCzB,SAASE,GAAYD,GACxB,OAAOX,GAASa,SAASC,KAAKH,GA6D3B,SAASI,EAAYJ,GACxB,cAAcA,IAAUrB,GAAaqB,IAAUrB,EAmD5C,SAAS0B,EAAkBL,GAC9B,OAAOA,IAAU3B,GAAc+B,EAAYJ,GAsDxC,SAASM,GAAUC,GACtB,QAASA,GAAOA,IAAQpC,EA2HrB,IAAIqC,GAAWV,GD/UF,UCsWTW,EAAaX,GAAUvB,GAS3B,SAASmC,GAASV,GACrB,OAAKA,IAASK,EAAkBL,KAGvBA,UAAgB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