{"version":3,"sources":["webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryHelpers.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/NotificationManager.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryPluginChain.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js","webpack:///./node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/InstrumentHooks.js"],"names":["_isFunction","isFunction","getPlugin","BaseTelemetryPlugin","_self","this","_isinitialized","_rootCtx","_nextPlugin","core","diagLog","itemCtx","_getTelCtx","isInitialized","setInitialized","setNextPlugin","next","processNext","env","processTelemetry","currentCtx","rootCtx","createNew","_baseTelInit","config","extensions","pluginChain","extensionConfig","getProcessTelContext","getNext","nextPlugin","prototype","initialize","_InternalLogMessage","msgId","msg","isUserAct","properties","messageId","message","AiUserActionablePrefix","AiNonUserActionablePrefix","strProps","stringify","diagnosticText","sanitizeDiagnosticText","text","replace","dataType","DiagnosticLogger","queue","AIInternalMessagePrefix","_messageCount","_messageLogged","enableDebugExceptions","consoleLoggingLevel","telemetryLoggingLevel","maxInternalMessageLimit","isNullOrUndefined","loggingLevelConsole","loggingLevelTelemetry","maxMessageLimit","throwInternal","severity","_this","isUndefined","messageKey","WARNING","warnToConsole","logInternalMessage","console","warn","log","resetInternalMessageCount","_areInternalMessagesThrottled","logMessage","push","throttleLimitMessage","throttleMessage","MessageLimitPerPVExceeded","LoggingSeverity","_InternalMessageId","BrowserDoesNotSupportLocalStorage","BrowserCannotReadLocalStorage","BrowserCannotReadSessionStorage","BrowserCannotWriteLocalStorage","BrowserCannotWriteSessionStorage","BrowserFailedRemovalFromLocalStorage","BrowserFailedRemovalFromSessionStorage","CannotSendEmptyTelemetry","ClientPerformanceMathError","ErrorParsingAISessionCookie","ErrorPVCalc","ExceptionWhileLoggingError","FailedAddingTelemetryToBuffer","FailedMonitorAjaxAbort","FailedMonitorAjaxDur","FailedMonitorAjaxOpen","FailedMonitorAjaxRSC","FailedMonitorAjaxSend","FailedMonitorAjaxGetCorrelationHeader","FailedToAddHandlerForOnBeforeUnload","FailedToSendQueuedTelemetry","FailedToReportDataLoss","FlushFailed","MissingRequiredFieldSpecification","NavigationTimingNotSupported","OnError","SessionRenewalDateIsZero","SenderNotInitialized","StartTrackEventFailed","StopTrackEventFailed","StartTrackFailed","StopTrackFailed","TelemetrySampledAndNotSent","TrackEventFailed","TrackExceptionFailed","TrackMetricFailed","TrackPVFailed","TrackPVFailedCalc","TrackTraceFailed","TransmissionFailed","FailedToSetStorageBuffer","FailedToRestoreStorageBuffer","InvalidBackendResponse","FailedToFixDepricatedValues","InvalidDurationValue","TelemetryEnvelopeInvalid","CreateEnvelopeError","CannotSerializeObject","CannotSerializeObjectNonSerializable","CircularReferenceDetected","ClearAuthContextFailed","ExceptionTruncated","IllegalCharsInName","ItemNotInArray","MaxAjaxPerPVExceeded","MessageTruncated","NameTooLong","SampleRateOutOfRange","SetAuthContextFailed","SetAuthContextFailedAccountName","StringValueTooLong","StartCalledMoreThanOnce","StopCalledWithoutStart","TelemetryInitializerFailed","TrackArgumentsNotSpecified","UrlTooLong","SessionStorageBufferFull","CannotAccessCookie","IdTooLong","InvalidEvent","FailedMonitorAjaxSetRequestHeader","SendBrowserInfoOnUserInit","PluginException","strUndefined","strObject","strPrototype","strFunction","strWindow","strDocument","strNavigator","strHistory","strLocation","strPerformance","strJSON","getGlobal","globalThis","self","window","global","getGlobalInst","name","gbl","hasWindow","Boolean","getWindow","hasDocument","document","getDocument","hasNavigator","navigator","getNavigator","hasHistory","history","getHistory","getLocation","location","getPerformance","hasJSON","JSON","getJSON","strOnPrefix","strAttachEvent","strAddEventHelper","strDetachEvent","strRemoveEventListener","_isTypeof","value","theType","_isUndefined","undefined","_isNullOrUndefined","_hasOwnProperty","obj","prop","Object","hasOwnProperty","call","_isObject","_attachEvent","eventNameWithoutOn","handlerRef","useCapture","result","e","_detachEvent","normalizeJsName","match","test","CoreUtils","isDate","toString","isString","isNumber","isBoolean","disableCookies","_canUseCookies","newGuid","GuidRegex","c","r","Math","random","v","toISOString","date","pad","num","String","length","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","toFixed","slice","arrForEach","arr","callbackfn","thisArg","len","idx","arrIndexOf","searchElement","fromIndex","from","lp","max","abs","arrMap","results","Array","arrReduce","initialValue","arguments","objCreate","TypeError","tmpFunc","objKeys","hasDontEnumBug","propertyIsEnumerable","dontEnums","dontEnumsLength","objDefineAccessors","target","getProp","setProp","defineProp","descriptor","enumerable","configurable","get","set","addEventHandler","eventName","callback","w","doc","EventHelper","Attach","isTypeof","isObject","AttachEvent","Detach","DetachEvent","priority","initializePlugins","processContext","initPlugins","lastPlugin","proxy","thePlugin","getCfg","sortPlugins","plugins","sort","extA","extB","bHasProcess","ChannelControllerPriority","ChannelValidationMessage","_arrForEach","_objDefineAccessors","_checkQueuePriority","queueItem","Error","identifier","_addChannelQueue","channelQueues","a","b","_createChannelQueues","channels","extensionQueue_1","plugin","_super","ChannelController","apply","item","_channelQueue","queues","chainCtx","getChannelControls","isCookieUseDisabled","channelQueue","ProcessTelemetryContext","_staticInit","validationError","BaseCore","_isInitialized","_extensions","_channelController","_setInit","_eventQueue","logger","notificationManager","instrumentationKey","channelController","addNotificationListener","listener","removeNotificationListener","eventsSent","events","eventsDiscarded","reason","_notificationManager","extConfig","NotificationManager","allExtensions","concat","coreExtensions","channelExtensions","extPriorities","ext","extPriority","getTransmissionControls","track","telemetryItem","iKey","time","Date","ver","event","thePlugins","EventsDiscardedReason","Unknown","NonRetryableStatus","SizeLimitExceeded","KillSwitch","QueueFull","listeners","index","splice","_loop_1","i","this_1","setTimeout","_loop_2","this_2","AppInsightsCore","_notifyInvalidEvent","_validateTelemetryItem","pollInternalLogs","interval","diagnosticLogInterval","setInterval","baseType","baseData","TelemetryPluginChain","defItemCtx","_nextProxy","_hasProcessTelemetry","_hasSetNext","_hasRun","setNext","error","hasRun","CRITICAL","_createProxyChain","proxies","lastProxy","newProxy","_copyProxyChain","startAt","add","_copyPluginChain","srcPlugins","getExtCfg","defaultValue","theConfig","getConfig","field","theValue","hasNext","aiInstrumentHooks","cbNames","_arrLoop","fn","_doCallbacks","hooks","callDetails","cbArgs","hookCtx","type","hook","cbks","cb","ctx","inst","err","orgEx","hookErrorCb","_createFunctionHook","aiHook","funcThis","orgArgs","h","funcArgs","n","_replaceArg","_createArgs","theArgs","arg","theFunc","f","rslt","_getOwner","checkPrototype","owner","InstrumentProto","funcName","callbacks","InstrumentFunc","aiHook_1","newFunc","theHook","id","rm"],"mappings":"0HAAA,8DAKIA,EAAc,OAAUC,WACxBC,EAAY,YAMZC,EAAqC,WACrC,SAASA,IACL,IAAIC,EAAQC,KACRC,GAAiB,EACjBC,EAAW,KACXC,EAAc,KAClBJ,EAAMK,KAAO,KACbL,EAAMM,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EAASR,IAAMA,EACfX,EAAaC,EAAOkB,EAAUhB,EAAQC,EAAS,GAEzCO,EAIV,OADAX,EAAaC,EAAOkB,EAAUhB,EAAQC,EAAS,GACxCe,EAASQ,MAIxB,SAASC,EAAUtL,EAAQ1G,EAAMiS,GAC7B,IAAIC,EAAQ,KASZ,OARIxL,IACI,OAAUvE,eAAeuE,EAAQ1G,GACjCkS,EAAQxL,EAEHuL,IACLC,EAAQF,EAAUtL,EAAO,QAAe1G,GAAM,KAG/CkS,EAQJ,SAASC,EAAgBzL,EAAQ0L,EAAUC,GAC9C,OAAI3L,EACO4L,EAAe5L,EAAO,QAAe0L,EAAUC,GAAW,GAE9D,KAqBJ,SAASC,EAAe5L,EAAQ0L,EAAUC,EAAWJ,GAExD,QADuB,IAAnBA,IAA6BA,GAAiB,GAC9CvL,GAAU0L,GAAYC,EAAW,CACjC,IAAIH,EAAQF,EAAUtL,EAAQ0L,EAAUH,GACpC9B,EAAK+B,EAAME,GACf,UAAWjC,IAAO,OAAa,CAC3B,IAAIoC,EAAWpC,EAAGH,GAClB,IAAKuC,EAAU,CAEXA,EAAW,CACP/E,EAAG,EACHgE,EAAGY,EACHN,EAAG3B,EACHmB,EAAG,IAGP,IAAIkB,EAAUtB,EAAoBqB,GAClCC,EAAQxC,GAAqBuC,EAC7BL,EAAME,GAAYI,EAEtB,IAAIC,EAAU,CAEVC,GAAIH,EAAS/E,EACbmD,KAAM0B,EACNM,GAAI,WAGA,IAAID,EAAKjd,KAAKid,GACdxC,EAASqC,EAASjB,GAAG,SAAUZ,EAAMvL,GACjC,GAAIuL,EAAKgC,KAAOA,EAEZ,OADAH,EAASjB,EAAEhE,OAAOnI,EAAK,GAChB,OAQvB,OAFAoN,EAAS/E,IACT+E,EAASjB,EAAEtX,KAAKyY,GACTA,GAGf,OAAO","file":"js/chunk-vendors~0eba4586.a9044f02.js","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar getPlugin = \"getPlugin\";\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;\r\n var _isinitialized = false;\r\n var _rootCtx = null; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin = null; // Used for backward compatibility where plugins don't call the main pipeline\r\n _self.core = null;\r\n _self.diagLog = function (itemCtx) {\r\n return _self._getTelCtx(itemCtx).diagLog();\r\n };\r\n _self.isInitialized = 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.setNextPlugin = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self.processNext = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx.processNext(env);\r\n }\r\n else if (_nextPlugin && _isFunction(_nextPlugin.processTelemetry)) {\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.processTelemetry(env, null);\r\n }\r\n };\r\n _self._getTelCtx = function (currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx.createNew(null, _nextPlugin[getPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx.createNew(null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n };\r\n _self._baseTelInit = function (config, core, extensions, pluginChain) {\r\n if (config) {\r\n // Make sure the extensionConfig exists\r\n config.extensionConfig = config.extensionConfig || [];\r\n }\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core.getProcessTelContext().getNext();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[getPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self.core = core;\r\n _rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n _isinitialized = true;\r\n };\r\n }\r\n BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n this._baseTelInit(config, core, extensions, pluginChain);\r\n };\r\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { hasJSON, getJSON } from \"./EnvUtils\";\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n this.messageId = msgId;\r\n this.message =\r\n (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = \"\";\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _InternalLogMessage.sanitizeDiagnosticText(msg) : \"\") +\r\n (properties ? \" props:\" + _InternalLogMessage.sanitizeDiagnosticText(strProps) : \"\");\r\n this.message += diagnosticText;\r\n }\r\n _InternalLogMessage.sanitizeDiagnosticText = function (text) {\r\n if (text) {\r\n return \"\\\"\" + text.replace(/\\\"/g, \"\") + \"\\\"\";\r\n }\r\n return \"\";\r\n };\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n /**\r\n * For user non actionable traces use AI Internal prefix.\r\n */\r\n _InternalLogMessage.AiNonUserActionablePrefix = \"AI (Internal): \";\r\n /**\r\n * Prefix of the traces in portal.\r\n */\r\n _InternalLogMessage.AiUserActionablePrefix = \"AI: \";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Session storage key for the prefix for the key indicating message type already logged\r\n */\r\n this.AIInternalMessagePrefix = \"AITR_\";\r\n /**\r\n * Count of internal messages sent\r\n */\r\n this._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 this._messageLogged = {};\r\n /**\r\n * When this is true the SDK will throw exceptions to aid in debugging.\r\n */\r\n this.enableDebugExceptions = function () { return false; };\r\n /**\r\n * 0: OFF (default)\r\n * 1: CRITICAL\r\n * 2: >= WARNING\r\n */\r\n this.consoleLoggingLevel = function () { return 0; };\r\n /**\r\n * 0: OFF\r\n * 1: CRITICAL (default)\r\n * 2: >= WARNING\r\n */\r\n this.telemetryLoggingLevel = function () { return 1; };\r\n /**\r\n * The maximum number of internal messages allowed to be sent per page view\r\n */\r\n this.maxInternalMessageLimit = function () { return 25; };\r\n if (CoreUtils.isNullOrUndefined(config)) {\r\n // TODO: Use default config\r\n // config = AppInsightsCore.defaultConfig;\r\n // For now, use defaults specified in DiagnosticLogger members;\r\n return;\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) {\r\n this.consoleLoggingLevel = function () { return config.loggingLevelConsole; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) {\r\n this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.maxMessageLimit)) {\r\n this.maxInternalMessageLimit = function () { return config.maxMessageLimit; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) {\r\n this.enableDebugExceptions = function () { return config.enableDebugExceptions; };\r\n }\r\n }\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 DiagnosticLogger.prototype.throwInternal = 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 var _this = this;\r\n if (_this.enableDebugExceptions()) {\r\n throw message;\r\n }\r\n else {\r\n if (!CoreUtils.isUndefined(message) && !!message) {\r\n if (!CoreUtils.isUndefined(message.message)) {\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.messageId;\r\n if (!_this._messageLogged[messageKey] && _this.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _this.warnToConsole(message.message);\r\n _this._messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // don't log internal AI traces in the console, unless the verbose logging is enabled\r\n if (_this.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _this.warnToConsole(message.message);\r\n }\r\n }\r\n _this.logInternalMessage(severity, message);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message {string} - The warning message\r\n */\r\n DiagnosticLogger.prototype.warnToConsole = function (message) {\r\n if (!CoreUtils.isUndefined(console) && !!console) {\r\n if (CoreUtils.isFunction(console.warn)) {\r\n console.warn(message);\r\n }\r\n else if (CoreUtils.isFunction(console.log)) {\r\n console.log(message);\r\n }\r\n }\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n DiagnosticLogger.prototype.resetInternalMessageCount = function () {\r\n this._messageCount = 0;\r\n this._messageLogged = {};\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The message to log.\r\n */\r\n DiagnosticLogger.prototype.logInternalMessage = function (severity, message) {\r\n var _this = this;\r\n if (_this._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 = _this.AIInternalMessagePrefix + message.messageId;\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_this._messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _this._messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _this.telemetryLoggingLevel()) {\r\n _this.queue.push(message);\r\n _this._messageCount++;\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_this._messageCount === _this.maxInternalMessageLimit()) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);\r\n _this.queue.push(throttleMessage);\r\n _this.warnToConsole(throttleLimitMessage);\r\n }\r\n }\r\n };\r\n /**\r\n * Indicates whether the internal events are throttled\r\n */\r\n DiagnosticLogger.prototype._areInternalMessagesThrottled = function () {\r\n return this._messageCount >= this.maxInternalMessageLimit();\r\n };\r\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\n//# sourceMappingURL=DiagnosticLogger.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var LoggingSeverity;\r\n(function (LoggingSeverity) {\r\n /**\r\n * Error will be sent as internal telemetry\r\n */\r\n LoggingSeverity[LoggingSeverity[\"CRITICAL\"] = 1] = \"CRITICAL\";\r\n /**\r\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\r\n */\r\n LoggingSeverity[LoggingSeverity[\"WARNING\"] = 2] = \"WARNING\";\r\n})(LoggingSeverity || (LoggingSeverity = {}));\r\n/**\r\n * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered\r\n */\r\nexport var _InternalMessageId = {\r\n // Non user actionable\r\n BrowserDoesNotSupportLocalStorage: 0,\r\n BrowserCannotReadLocalStorage: 1,\r\n BrowserCannotReadSessionStorage: 2,\r\n BrowserCannotWriteLocalStorage: 3,\r\n BrowserCannotWriteSessionStorage: 4,\r\n BrowserFailedRemovalFromLocalStorage: 5,\r\n BrowserFailedRemovalFromSessionStorage: 6,\r\n CannotSendEmptyTelemetry: 7,\r\n ClientPerformanceMathError: 8,\r\n ErrorParsingAISessionCookie: 9,\r\n ErrorPVCalc: 10,\r\n ExceptionWhileLoggingError: 11,\r\n FailedAddingTelemetryToBuffer: 12,\r\n FailedMonitorAjaxAbort: 13,\r\n FailedMonitorAjaxDur: 14,\r\n FailedMonitorAjaxOpen: 15,\r\n FailedMonitorAjaxRSC: 16,\r\n FailedMonitorAjaxSend: 17,\r\n FailedMonitorAjaxGetCorrelationHeader: 18,\r\n FailedToAddHandlerForOnBeforeUnload: 19,\r\n FailedToSendQueuedTelemetry: 20,\r\n FailedToReportDataLoss: 21,\r\n FlushFailed: 22,\r\n MessageLimitPerPVExceeded: 23,\r\n MissingRequiredFieldSpecification: 24,\r\n NavigationTimingNotSupported: 25,\r\n OnError: 26,\r\n SessionRenewalDateIsZero: 27,\r\n SenderNotInitialized: 28,\r\n StartTrackEventFailed: 29,\r\n StopTrackEventFailed: 30,\r\n StartTrackFailed: 31,\r\n StopTrackFailed: 32,\r\n TelemetrySampledAndNotSent: 33,\r\n TrackEventFailed: 34,\r\n TrackExceptionFailed: 35,\r\n TrackMetricFailed: 36,\r\n TrackPVFailed: 37,\r\n TrackPVFailedCalc: 38,\r\n TrackTraceFailed: 39,\r\n TransmissionFailed: 40,\r\n FailedToSetStorageBuffer: 41,\r\n FailedToRestoreStorageBuffer: 42,\r\n InvalidBackendResponse: 43,\r\n FailedToFixDepricatedValues: 44,\r\n InvalidDurationValue: 45,\r\n TelemetryEnvelopeInvalid: 46,\r\n CreateEnvelopeError: 47,\r\n // User actionable\r\n CannotSerializeObject: 48,\r\n CannotSerializeObjectNonSerializable: 49,\r\n CircularReferenceDetected: 50,\r\n ClearAuthContextFailed: 51,\r\n ExceptionTruncated: 52,\r\n IllegalCharsInName: 53,\r\n ItemNotInArray: 54,\r\n MaxAjaxPerPVExceeded: 55,\r\n MessageTruncated: 56,\r\n NameTooLong: 57,\r\n SampleRateOutOfRange: 58,\r\n SetAuthContextFailed: 59,\r\n SetAuthContextFailedAccountName: 60,\r\n StringValueTooLong: 61,\r\n StartCalledMoreThanOnce: 62,\r\n StopCalledWithoutStart: 63,\r\n TelemetryInitializerFailed: 64,\r\n TrackArgumentsNotSpecified: 65,\r\n UrlTooLong: 66,\r\n SessionStorageBufferFull: 67,\r\n CannotAccessCookie: 68,\r\n IdTooLong: 69,\r\n InvalidEvent: 70,\r\n FailedMonitorAjaxSetRequestHeader: 71,\r\n SendBrowserInfoOnUserInit: 72,\r\n PluginException: 73\r\n};\r\n//# sourceMappingURL=LoggingEnums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\n/**\r\n * This file exists to hold environment utilities that are requied to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only 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\nexport var strUndefined = \"undefined\";\r\nexport var strObject = \"object\";\r\nexport var strPrototype = \"prototype\";\r\nexport var strFunction = \"function\";\r\nvar strWindow = \"window\";\r\nvar strDocument = \"document\";\r\nvar strNavigator = \"navigator\";\r\nvar strHistory = \"history\";\r\nvar strLocation = \"location\";\r\nvar strPerformance = \"performance\";\r\nvar strJSON = \"JSON\";\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.\r\n */\r\nexport function getGlobal() {\r\n if (typeof globalThis !== strUndefined && globalThis) {\r\n return globalThis;\r\n }\r\n if (typeof self !== strUndefined && self) {\r\n return self;\r\n }\r\n if (typeof window !== strUndefined && window) {\r\n return window;\r\n }\r\n if (typeof global !== strUndefined && global) {\r\n return global;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @param name The globally named object\r\n */\r\nexport function getGlobalInst(name) {\r\n var gbl = getGlobal();\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 === strWindow && hasWindow()) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return window;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if window 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 window\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: window 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 hasWindow() {\r\n return Boolean(typeof window === strObject && window);\r\n}\r\n/**\r\n * Returns the global window object if it is present otherwise null.\r\n * This helper is used to access the window object without causing an exception\r\n * \"Uncaught ReferenceError: window is not defined\"\r\n */\r\nexport function getWindow() {\r\n if (hasWindow()) {\r\n return window;\r\n }\r\n // Return the global instance or null\r\n return getGlobalInst(strWindow);\r\n}\r\n/**\r\n * Checks if document 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 document\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: document 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 hasDocument() {\r\n return Boolean(typeof document === strObject && document);\r\n}\r\n/**\r\n * Returns the global document object if it is present otherwise null.\r\n * This helper is used to access the document object without causing an exception\r\n * \"Uncaught ReferenceError: document is not defined\"\r\n */\r\nexport function getDocument() {\r\n if (hasDocument()) {\r\n return document;\r\n }\r\n return getGlobalInst(strDocument);\r\n}\r\n/**\r\n * Checks if navigator 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 navigator\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator 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 hasNavigator() {\r\n return Boolean(typeof navigator === strObject && navigator);\r\n}\r\n/**\r\n * Returns the global navigator object if it is present otherwise null.\r\n * This helper is used to access the navigator object without causing an exception\r\n * \"Uncaught ReferenceError: navigator is not defined\"\r\n */\r\nexport function getNavigator() {\r\n if (hasNavigator()) {\r\n return navigator;\r\n }\r\n return getGlobalInst(strNavigator);\r\n}\r\n/**\r\n * Checks if history 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: history 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 hasHistory() {\r\n return Boolean(typeof history === strObject && history);\r\n}\r\n/**\r\n * Returns the global history object if it is present otherwise null.\r\n * This helper is used to access the history object without causing an exception\r\n * \"Uncaught ReferenceError: history is not defined\"\r\n */\r\nexport function getHistory() {\r\n if (hasHistory()) {\r\n return history;\r\n }\r\n return getGlobalInst(strHistory);\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() {\r\n if (typeof location === strObject && location) {\r\n return location;\r\n }\r\n return getGlobalInst(strLocation);\r\n}\r\n/**\r\n * Returns the performance object if it is present otherwise null.\r\n * This helper is used to access the performance object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getPerformance() {\r\n return getGlobalInst(strPerformance);\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 === strObject && JSON) || getGlobalInst(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 || getGlobalInst(strJSON);\r\n }\r\n return null;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { getWindow, getDocument, strUndefined, strObject, strFunction, strPrototype } from './EnvUtils';\r\n// Added to help with minfication\r\nexport var Undefined = strUndefined;\r\nvar strOnPrefix = \"on\";\r\nvar strAttachEvent = \"attachEvent\";\r\nvar strAddEventHelper = \"addEventListener\";\r\nvar strDetachEvent = \"detachEvent\";\r\nvar strRemoveEventListener = \"removeEventListener\";\r\nfunction _isTypeof(value, theType) {\r\n return typeof value === theType;\r\n}\r\n;\r\nfunction _isUndefined(value) {\r\n return _isTypeof(value, strUndefined) || value === undefined;\r\n}\r\n;\r\nfunction _isNullOrUndefined(value) {\r\n return (_isUndefined(value) || value === null);\r\n}\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Object[strPrototype].hasOwnProperty.call(obj, prop);\r\n}\r\n;\r\nfunction _isObject(value) {\r\n return _isTypeof(value, strObject);\r\n}\r\n;\r\nfunction _isFunction(value) {\r\n return _isTypeof(value, strFunction);\r\n}\r\n;\r\n/**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @param useCapture [Optional] Defaults to false\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\nfunction _attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strAddEventHelper])) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (!_isNullOrUndefined(obj[strAttachEvent])) {\r\n // IE before version 9 \r\n obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n result = true;\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object to remove the event from\r\n * @param eventNameWithoutOn {string} - The name of the event\r\n * @param handlerRef {any} - The callback function that needs to be executed for the given event\r\n * @param useCapture [Optional] Defaults to false\r\n */\r\nfunction _detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strRemoveEventListener])) {\r\n obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);\r\n }\r\n else if (!_isNullOrUndefined(obj[strDetachEvent])) {\r\n obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\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 var match = /([^\\w\\d_$])/g;\r\n if (match.test(name)) {\r\n value = name.replace(match, \"_\");\r\n }\r\n return value;\r\n}\r\nvar CoreUtils = /** @class */ (function () {\r\n function CoreUtils() {\r\n }\r\n /**\r\n * Check if an object is of type Date\r\n */\r\n CoreUtils.isDate = function (obj) {\r\n return Object[strPrototype].toString.call(obj) === \"[object Date]\";\r\n };\r\n /**\r\n * Checks if the type of value is a string.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a string, false otherwise.\r\n */\r\n CoreUtils.isString = function (value) {\r\n return _isTypeof(value, \"string\");\r\n };\r\n /**\r\n * Checks if the type of value is a number.\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\n CoreUtils.isNumber = function (value) {\r\n return _isTypeof(value, \"number\");\r\n };\r\n /**\r\n * Checks if the type of value is a boolean.\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\n CoreUtils.isBoolean = function (value) {\r\n return _isTypeof(value, \"boolean\");\r\n };\r\n /**\r\n * Creates a new GUID.\r\n * @return {string} A GUID.\r\n */\r\n CoreUtils.disableCookies = function () {\r\n CoreUtils._canUseCookies = false;\r\n };\r\n CoreUtils.newGuid = function () {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) {\r\n var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n };\r\n /**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\n CoreUtils.toISOString = function (date) {\r\n if (CoreUtils.isDate(date)) {\r\n var pad = function (num) {\r\n var r = String(num);\r\n if (r.length === 1) {\r\n r = \"0\" + r;\r\n }\r\n return r;\r\n };\r\n return date.getUTCFullYear()\r\n + \"-\" + pad(date.getUTCMonth() + 1)\r\n + \"-\" + pad(date.getUTCDate())\r\n + \"T\" + pad(date.getUTCHours())\r\n + \":\" + pad(date.getUTCMinutes())\r\n + \":\" + pad(date.getUTCSeconds())\r\n + \".\" + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)\r\n + \"Z\";\r\n }\r\n };\r\n /**\r\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\r\n * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\n CoreUtils.arrForEach = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n for (var idx = 0; idx < len; ++idx) {\r\n if (idx in arr) {\r\n callbackfn.call(thisArg || arr, arr[idx], idx, arr);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param searchElement The value to locate in the array.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\n CoreUtils.arrIndexOf = function (arr, searchElement, fromIndex) {\r\n var len = arr.length;\r\n var from = fromIndex || 0;\r\n for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {\r\n if (lp in arr && arr[lp] === searchElement) {\r\n return lp;\r\n }\r\n }\r\n return -1;\r\n };\r\n /**\r\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists\r\n * to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page\r\n * checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx\r\n * implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. The map method 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, undefined is used as the this value.\r\n */\r\n CoreUtils.arrMap = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n var _this = thisArg || arr;\r\n var results = new Array(len);\r\n for (var lp = 0; lp < len; lp++) {\r\n if (lp in arr) {\r\n results[lp] = callbackfn.call(_this, arr[lp], arr);\r\n }\r\n }\r\n return results;\r\n };\r\n /**\r\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is\r\n * provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define\r\n * Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency\r\n * this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r\n */\r\n CoreUtils.arrReduce = function (arr, callbackfn, initialValue) {\r\n var len = arr.length;\r\n var lp = 0;\r\n var value;\r\n // Specifically checking the number of passed arguments as the value could be anything\r\n if (arguments.length >= 3) {\r\n value = arguments[2];\r\n }\r\n else {\r\n while (lp < len && !(lp in arr)) {\r\n lp++;\r\n }\r\n value = arr[lp++];\r\n }\r\n while (lp < len) {\r\n if (lp in arr) {\r\n value = callbackfn(value, arr[lp], lp, arr);\r\n }\r\n lp++;\r\n }\r\n return value;\r\n };\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 * @param obj Object to use as a prototype. May be null\r\n */\r\n CoreUtils.objCreate = function (obj) {\r\n if (obj == null) {\r\n return {};\r\n }\r\n if (!_isObject(obj) && !_isFunction(obj)) {\r\n throw new TypeError('Object prototype may only be an Object: ' + obj);\r\n }\r\n function tmpFunc() { }\r\n ;\r\n tmpFunc[strPrototype] = obj;\r\n return new tmpFunc();\r\n };\r\n /**\r\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Object.keys 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.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\r\n */\r\n CoreUtils.objKeys = function (obj) {\r\n var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');\r\n if (!_isFunction(obj) && (!_isObject(obj) || obj === null)) {\r\n throw new TypeError('objKeys called on non-object');\r\n }\r\n var result = [];\r\n for (var prop in obj) {\r\n if (_hasOwnProperty(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n if (hasDontEnumBug) {\r\n var dontEnums = [\r\n 'toString',\r\n 'toLocaleString',\r\n 'valueOf',\r\n 'hasOwnProperty',\r\n 'isPrototypeOf',\r\n 'propertyIsEnumerable',\r\n 'constructor'\r\n ];\r\n var dontEnumsLength = dontEnums.length;\r\n for (var lp = 0; lp < dontEnumsLength; lp++) {\r\n if (_hasOwnProperty(obj, dontEnums[lp])) {\r\n result.push(dontEnums[lp]);\r\n }\r\n }\r\n }\r\n return result;\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 * @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 * @returns True if it was able to create the accessors otherwise false\r\n */\r\n CoreUtils.objDefineAccessors = function (target, prop, getProp, setProp) {\r\n var defineProp = Object[\"defineProperty\"];\r\n if (defineProp) {\r\n try {\r\n var descriptor = {\r\n enumerable: true,\r\n configurable: true\r\n };\r\n if (getProp) {\r\n descriptor.get = getProp;\r\n }\r\n if (setProp) {\r\n descriptor.set = setProp;\r\n }\r\n defineProp(target, prop, descriptor);\r\n return true;\r\n }\r\n catch (e) {\r\n // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw\r\n // We will just ignore this here.\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n CoreUtils.addEventHandler = function (eventName, callback) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = _attachEvent(w, eventName, callback);\r\n result = _attachEvent(w[\"body\"], eventName, callback) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = EventHelper.Attach(doc, eventName, callback) || result;\r\n }\r\n return result;\r\n };\r\n CoreUtils.isTypeof = _isTypeof;\r\n CoreUtils.isUndefined = _isUndefined;\r\n CoreUtils.isNullOrUndefined = _isNullOrUndefined;\r\n CoreUtils.hasOwnProperty = _hasOwnProperty;\r\n /**\r\n * Checks if the passed of value is a function.\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\n CoreUtils.isFunction = _isFunction;\r\n /**\r\n * Checks if the passed of value is a function.\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\n CoreUtils.isObject = _isObject;\r\n return CoreUtils;\r\n}());\r\nexport { CoreUtils };\r\nvar GuidRegex = /[xy]/g;\r\nvar EventHelper = /** @class */ (function () {\r\n function EventHelper() {\r\n }\r\n /**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.Attach = _attachEvent;\r\n /**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @deprecated Use {@link EventHelper#Attach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.AttachEvent = _attachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.Detach = _detachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @deprecated Use {@link EventHelper#Detach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.DetachEvent = _detachEvent;\r\n return EventHelper;\r\n}());\r\nexport { EventHelper };\r\n//# sourceMappingURL=CoreUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar processTelemetry = \"processTelemetry\";\r\nvar priority = \"priority\";\r\nvar setNextPlugin = \"setNextPlugin\";\r\nvar isInitialized = \"isInitialized\";\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.getNext();\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (thePlugin) {\r\n if (lastPlugin &&\r\n _isFunction(lastPlugin[setNextPlugin]) &&\r\n _isFunction(thePlugin[processTelemetry])) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[setNextPlugin](thePlugin);\r\n }\r\n if (!_isFunction(thePlugin[isInitialized]) || !thePlugin[isInitialized]()) {\r\n initPlugins.push(thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n // Now initiatilize the plugins\r\n CoreUtils.arrForEach(initPlugins, function (thePlugin) {\r\n thePlugin.initialize(processContext.getCfg(), processContext.core(), extensions, processContext.getNext());\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 var bHasProcess = _isFunction(extB[processTelemetry]);\r\n if (_isFunction(extA[processTelemetry])) {\r\n result = bHasProcess ? extA[priority] - extB[priority] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n return result;\r\n });\r\n // sort complete \r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport * as tslib_1 from \"tslib\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { BaseTelemetryPlugin } from './BaseTelemetryPlugin';\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nimport { initializePlugins } from './TelemetryHelpers';\r\nvar ChannelControllerPriority = 500;\r\nvar ChannelValidationMessage = \"Channel has invalid priority\";\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _objDefineAccessors = CoreUtils.objDefineAccessors;\r\nfunction _checkQueuePriority(queue) {\r\n _arrForEach(queue, function (queueItem) {\r\n if (queueItem.priority < ChannelControllerPriority) {\r\n throw Error(ChannelValidationMessage + queueItem.identifier);\r\n }\r\n });\r\n}\r\nfunction _addChannelQueue(channelQueues, queue) {\r\n if (queue && queue.length > 0) {\r\n queue = queue.sort(function (a, b) {\r\n return a.priority - b.priority;\r\n });\r\n _checkQueuePriority(queue);\r\n channelQueues.push(queue);\r\n }\r\n}\r\nfunction _createChannelQueues(channels, extensions) {\r\n var channelQueues = [];\r\n if (channels) {\r\n // Add and sort the configuration channel queues\r\n _arrForEach(channels, function (queue) { return _addChannelQueue(channelQueues, queue); });\r\n }\r\n if (extensions) {\r\n // Create a new channel queue for any extensions with a priority > the ChannelControllerPriority\r\n var extensionQueue_1 = [];\r\n _arrForEach(extensions, function (plugin) {\r\n if (plugin.priority > ChannelControllerPriority) {\r\n extensionQueue_1.push(plugin);\r\n }\r\n });\r\n _addChannelQueue(channelQueues, extensionQueue_1);\r\n }\r\n return channelQueues;\r\n}\r\nvar ChannelController = /** @class */ (function (_super) {\r\n tslib_1.__extends(ChannelController, _super);\r\n function ChannelController() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.identifier = \"ChannelControllerPlugin\";\r\n _this.priority = ChannelControllerPriority; // in reserved range 100 to 200\r\n return _this;\r\n }\r\n ChannelController.prototype.processTelemetry = function (item, itemCtx) {\r\n var _this = this;\r\n if (this._channelQueue) {\r\n _arrForEach(this._channelQueue, function (queues) {\r\n // pass on to first item in queue\r\n if (queues.length > 0) {\r\n // Copying the item context as we could have mutiple chains that are executing asynchronously\r\n // and calling _getDefTelCtx as it's possible that the caller doesn't pass any context\r\n var chainCtx = _this._getTelCtx(itemCtx).createNew(queues);\r\n chainCtx.processNext(item);\r\n }\r\n });\r\n }\r\n };\r\n ;\r\n ChannelController.prototype.getChannelControls = function () {\r\n return this._channelQueue;\r\n };\r\n ChannelController.prototype.initialize = function (config, core, extensions) {\r\n var _self = this;\r\n if (_self.isInitialized()) {\r\n // already initialized\r\n return;\r\n }\r\n _super.prototype.initialize.call(this, config, core, extensions);\r\n if (config.isCookieUseDisabled) {\r\n CoreUtils.disableCookies();\r\n }\r\n var channelQueue = _self._channelQueue = _createChannelQueues((config || {}).channels, extensions);\r\n // Initialize the Queues\r\n _arrForEach(channelQueue, function (queue) { return initializePlugins(new ProcessTelemetryContext(queue, config, core), extensions); });\r\n };\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n // tslint:disable-next-line\r\n ChannelController._staticInit = (function () {\r\n // Dynamically create get/set property accessors\r\n _objDefineAccessors(ChannelController.prototype, \"ChannelControls\", ChannelController.prototype.getChannelControls);\r\n _objDefineAccessors(ChannelController.prototype, \"channelQueue\", ChannelController.prototype.getChannelControls);\r\n })();\r\n return ChannelController;\r\n}(BaseTelemetryPlugin));\r\nexport { ChannelController };\r\n//# sourceMappingURL=ChannelController.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { ChannelController } from './ChannelController';\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nimport { initializePlugins, sortPlugins } from './TelemetryHelpers';\r\nvar validationError = \"Extensions must provide callback to initialize\";\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\nvar BaseCore = /** @class */ (function () {\r\n function BaseCore() {\r\n var _isInitialized = false;\r\n var _this = this;\r\n _this._extensions = new Array();\r\n _this._channelController = new ChannelController();\r\n _this.isInitialized = function () { return _isInitialized; };\r\n _this._setInit = function (value) { _isInitialized = value; };\r\n _this._eventQueue = [];\r\n }\r\n BaseCore.prototype.initialize = function (config, extensions, logger, notificationManager) {\r\n var _this = this;\r\n // Make sure core is only initialized once\r\n if (_this.isInitialized()) {\r\n throw Error(\"Core should not be initialized more than once\");\r\n }\r\n if (!config || _isNullOrUndefined(config.instrumentationKey)) {\r\n throw Error(\"Please provide instrumentation key\");\r\n }\r\n _this.config = config;\r\n var channelController = _this._channelController;\r\n if (!notificationManager) {\r\n // Create Dummy notification manager\r\n notificationManager = CoreUtils.objCreate({\r\n addNotificationListener: function (listener) { },\r\n removeNotificationListener: function (listener) { },\r\n eventsSent: function (events) { },\r\n eventsDiscarded: function (events, reason) { }\r\n });\r\n }\r\n _this._notificationManager = notificationManager;\r\n config.extensions = _isNullOrUndefined(config.extensions) ? [] : config.extensions;\r\n // add notification to the extensions in the config so other plugins can access it\r\n var extConfig = config.extensionConfig = _isNullOrUndefined(config.extensionConfig) ? {} : config.extensionConfig;\r\n extConfig.NotificationManager = notificationManager;\r\n if (!logger) {\r\n logger = CoreUtils.objCreate({\r\n throwInternal: function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n },\r\n warnToConsole: function (message) { },\r\n resetInternalMessageCount: function () { }\r\n });\r\n }\r\n _this.logger = logger;\r\n // Concat all available extensions\r\n var allExtensions = [];\r\n allExtensions.push.apply(allExtensions, extensions.concat(config.extensions));\r\n allExtensions = sortPlugins(allExtensions);\r\n var coreExtensions = [];\r\n var channelExtensions = [];\r\n // Check if any two extensions have the same priority, then warn to console\r\n // And extract the local extensions from the \r\n var extPriorities = {};\r\n // Extension validation\r\n _arrForEach(allExtensions, function (ext) {\r\n if (_isNullOrUndefined(ext) || _isNullOrUndefined(ext.initialize)) {\r\n throw Error(validationError);\r\n }\r\n var extPriority = ext.priority;\r\n var identifier = ext.identifier;\r\n if (ext && extPriority) {\r\n if (!_isNullOrUndefined(extPriorities[extPriority])) {\r\n logger.warnToConsole(\"Two extensions have same priority #\" + extPriority + \" - \" + extPriorities[extPriority] + \", \" + identifier);\r\n }\r\n else {\r\n // set a value\r\n extPriorities[extPriority] = identifier;\r\n }\r\n }\r\n // Split extensions to core and channelController\r\n if (!extPriority || extPriority < channelController.priority) {\r\n // Add to core extension that will be managed by BaseCore\r\n coreExtensions.push(ext);\r\n }\r\n else {\r\n // Add all other extensions to be managed by the channel controller\r\n channelExtensions.push(ext);\r\n }\r\n });\r\n // Validation complete\r\n // Add the channelController to the complete extension collection and\r\n // to the end of the core extensions\r\n allExtensions.push(channelController);\r\n coreExtensions.push(channelController);\r\n // Sort the complete set of extensions by priority\r\n allExtensions = sortPlugins(allExtensions);\r\n _this._extensions = allExtensions;\r\n // initialize channel controller first, this will initialize all channel plugins\r\n initializePlugins(new ProcessTelemetryContext([channelController], config, _this), allExtensions);\r\n initializePlugins(new ProcessTelemetryContext(coreExtensions, config, _this), allExtensions);\r\n // Now reset the extensions to just those being managed by Basecore\r\n _this._extensions = coreExtensions;\r\n if (_this.getTransmissionControls().length === 0) {\r\n throw new Error(\"No channels available\");\r\n }\r\n _this._setInit(true);\r\n };\r\n BaseCore.prototype.getTransmissionControls = function () {\r\n return this._channelController.getChannelControls();\r\n };\r\n BaseCore.prototype.track = function (telemetryItem) {\r\n var _this = this;\r\n if (!telemetryItem.iKey) {\r\n // setup default iKey if not passed in\r\n telemetryItem.iKey = _this.config.instrumentationKey;\r\n }\r\n if (!telemetryItem.time) {\r\n // add default timestamp if not passed in\r\n telemetryItem.time = CoreUtils.toISOString(new Date());\r\n }\r\n if (_isNullOrUndefined(telemetryItem.ver)) {\r\n // CommonSchema 4.0\r\n telemetryItem.ver = \"4.0\";\r\n }\r\n if (_this.isInitialized()) {\r\n // Release queue\r\n if (_this._eventQueue.length > 0) {\r\n _arrForEach(_this._eventQueue, function (event) {\r\n _this.getProcessTelContext().processNext(event);\r\n });\r\n _this._eventQueue = [];\r\n }\r\n // Process the telemetry plugin chain\r\n _this.getProcessTelContext().processNext(telemetryItem);\r\n }\r\n else {\r\n // Queue events until all extensions are initialized\r\n _this._eventQueue.push(telemetryItem);\r\n }\r\n };\r\n BaseCore.prototype.getProcessTelContext = function () {\r\n var _this = this;\r\n var extensions = _this._extensions;\r\n var thePlugins = extensions;\r\n // invoke any common telemetry processors before sending through pipeline\r\n if (!extensions || extensions.length === 0) {\r\n // Pass to Channel controller so data is sent to correct channel queues\r\n thePlugins = [_this._channelController];\r\n }\r\n return new ProcessTelemetryContext(thePlugins, _this.config, _this);\r\n };\r\n return BaseCore;\r\n}());\r\nexport { BaseCore };\r\n//# sourceMappingURL=BaseCore.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\r\n */\r\nexport var EventsDiscardedReason = {\r\n /**\r\n * Unknown.\r\n */\r\n Unknown: 0,\r\n /**\r\n * Status set to non-retryable.\r\n */\r\n NonRetryableStatus: 1,\r\n /**\r\n * The event is invalid.\r\n */\r\n InvalidEvent: 2,\r\n /**\r\n * The size of the event is too large.\r\n */\r\n SizeLimitExceeded: 3,\r\n /**\r\n * The server is not accepting events from this instrumentation key.\r\n */\r\n KillSwitch: 4,\r\n /**\r\n * The event queue is full.\r\n */\r\n QueueFull: 5\r\n};\r\n//# sourceMappingURL=EventsDiscardedReason.js.map","import { CoreUtils } from \"./CoreUtils\";\r\n/**\r\n * Class to manage sending notifications to all the listeners.\r\n */\r\nvar NotificationManager = /** @class */ (function () {\r\n function NotificationManager() {\r\n this.listeners = [];\r\n }\r\n /**\r\n * Adds a notification listener.\r\n * @param {INotificationListener} listener - The notification listener to be added.\r\n */\r\n NotificationManager.prototype.addNotificationListener = function (listener) {\r\n this.listeners.push(listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - AWTNotificationListener to remove.\r\n */\r\n NotificationManager.prototype.removeNotificationListener = function (listener) {\r\n var index = CoreUtils.arrIndexOf(this.listeners, listener);\r\n while (index > -1) {\r\n this.listeners.splice(index, 1);\r\n index = CoreUtils.arrIndexOf(this.listeners, listener);\r\n }\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param {ITelemetryItem[]} events - The array of events that have been sent.\r\n */\r\n NotificationManager.prototype.eventsSent = function (events) {\r\n var _this = this;\r\n var _loop_1 = function (i) {\r\n if (this_1.listeners[i].eventsSent) {\r\n setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0);\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0; i < this.listeners.length; ++i) {\r\n _loop_1(i);\r\n }\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK.\r\n * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason\r\n * constant should be used to check the different values.\r\n */\r\n NotificationManager.prototype.eventsDiscarded = function (events, reason) {\r\n var _this = this;\r\n var _loop_2 = function (i) {\r\n if (this_2.listeners[i].eventsDiscarded) {\r\n setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0);\r\n }\r\n };\r\n var this_2 = this;\r\n for (var i = 0; i < this.listeners.length; ++i) {\r\n _loop_2(i);\r\n }\r\n };\r\n return NotificationManager;\r\n}());\r\nexport { NotificationManager };\r\n//# sourceMappingURL=NotificationManager.js.map","import * as tslib_1 from \"tslib\";\r\nimport { BaseCore } from './BaseCore';\r\nimport { EventsDiscardedReason } from \"../JavaScriptSDK.Enums/EventsDiscardedReason\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { _InternalLogMessage, DiagnosticLogger } from \"./DiagnosticLogger\";\r\n\"use strict\";\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n tslib_1.__extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n return _super.call(this) || this;\r\n }\r\n AppInsightsCore.prototype.initialize = function (config, extensions) {\r\n var _self = this;\r\n _self._notificationManager = new NotificationManager();\r\n _self.logger = new DiagnosticLogger(config);\r\n _self.config = config;\r\n _super.prototype.initialize.call(this, config, extensions, _self.logger, _self._notificationManager);\r\n };\r\n AppInsightsCore.prototype.getTransmissionControls = function () {\r\n return _super.prototype.getTransmissionControls.call(this);\r\n };\r\n AppInsightsCore.prototype.track = function (telemetryItem) {\r\n if (telemetryItem === null) {\r\n this._notifyInvalidEvent(telemetryItem);\r\n // throw error\r\n throw Error(\"Invalid telemetry item\");\r\n }\r\n // do basic validation before sending it through the pipeline\r\n this._validateTelemetryItem(telemetryItem);\r\n _super.prototype.track.call(this, telemetryItem);\r\n };\r\n /**\r\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.\r\n * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be\r\n * called.\r\n * @param {INotificationListener} listener - An INotificationListener object.\r\n */\r\n AppInsightsCore.prototype.addNotificationListener = function (listener) {\r\n if (this._notificationManager) {\r\n this._notificationManager.addNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - INotificationListener to remove.\r\n */\r\n AppInsightsCore.prototype.removeNotificationListener = function (listener) {\r\n if (this._notificationManager) {\r\n this._notificationManager.removeNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Periodically check logger.queue for\r\n */\r\n AppInsightsCore.prototype.pollInternalLogs = function (eventName) {\r\n var _this = this;\r\n var interval = this.config.diagnosticLogInterval;\r\n if (!interval || !(interval > 0)) {\r\n interval = 10000;\r\n }\r\n return setInterval(function () {\r\n var _self = _this;\r\n var queue = _self.logger ? _self.logger.queue : [];\r\n CoreUtils.arrForEach(queue, function (logMessage) {\r\n var item = {\r\n name: eventName ? eventName : \"InternalMessageId: \" + logMessage.messageId,\r\n iKey: _self.config.instrumentationKey,\r\n time: CoreUtils.toISOString(new Date()),\r\n baseType: _InternalLogMessage.dataType,\r\n baseData: { message: logMessage.message }\r\n };\r\n _self.track(item);\r\n });\r\n queue.length = 0;\r\n }, interval);\r\n };\r\n AppInsightsCore.prototype._validateTelemetryItem = function (telemetryItem) {\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.name)) {\r\n this._notifyInvalidEvent(telemetryItem);\r\n throw Error(\"telemetry name required\");\r\n }\r\n };\r\n AppInsightsCore.prototype._notifyInvalidEvent = function (telemetryItem) {\r\n if (this._notificationManager) {\r\n this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason.InvalidEvent);\r\n }\r\n };\r\n return AppInsightsCore;\r\n}(BaseCore));\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { LoggingSeverity, _InternalMessageId } from '../JavaScriptSDK.Enums/LoggingEnums';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar TelemetryPluginChain = /** @class */ (function () {\r\n function TelemetryPluginChain(plugin, defItemCtx) {\r\n var _self = this;\r\n var _nextProxy = null;\r\n var _hasProcessTelemetry = _isFunction(plugin.processTelemetry);\r\n var _hasSetNext = _isFunction(plugin.setNextPlugin);\r\n _self._hasRun = false;\r\n _self.getPlugin = function () {\r\n return plugin;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n if (!itemCtx) {\r\n // Looks like a plugin didn't pass the (optional) context, so restore to the default\r\n itemCtx = defItemCtx;\r\n }\r\n if (plugin && _hasProcessTelemetry) {\r\n _self._hasRun = true;\r\n try {\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 itemCtx.setNext(_nextProxy);\r\n if (_hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin.setNextPlugin(_nextProxy);\r\n }\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n _nextProxy && (_nextProxy._hasRun = false);\r\n plugin.processTelemetry(env, itemCtx);\r\n }\r\n catch (error) {\r\n var hasRun = _nextProxy && _nextProxy._hasRun;\r\n if (!_nextProxy || !hasRun) {\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 itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, \"Plugin [\" + plugin.identifier + \"] failed during processTelemetry - \" + error);\r\n }\r\n if (_nextProxy && !hasRun) {\r\n // As part of the failure the current plugin did not attempt to call the next plugin in the cahin\r\n // So rather than leave the pipeline dead in the water we call the next plugin\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }\r\n }\r\n else if (_nextProxy) {\r\n _self._hasRun = true;\r\n // The underlying plugin is either not defined or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n };\r\n }\r\n return TelemetryPluginChain;\r\n}());\r\nexport { TelemetryPluginChain };\r\n//# sourceMappingURL=TelemetryPluginChain.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { DiagnosticLogger } from \"./DiagnosticLogger\";\r\nimport { TelemetryPluginChain } from \"./TelemetryPluginChain\";\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n/**\r\n * Creates the instance execution chain for the plugins\r\n */\r\nfunction _createProxyChain(plugins, itemCtx) {\r\n var proxies = [];\r\n if (plugins && plugins.length > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy = null;\r\n for (var idx = 0; idx < plugins.length; idx++) {\r\n var thePlugin = plugins[idx];\r\n if (thePlugin && CoreUtils.isFunction(thePlugin.processTelemetry)) {\r\n // Only add plugins that are processors\r\n var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);\r\n proxies.push(newProxy);\r\n if (lastProxy) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy.setNext(newProxy);\r\n }\r\n lastProxy = newProxy;\r\n }\r\n }\r\n }\r\n return proxies.length > 0 ? proxies[0] : null;\r\n}\r\nfunction _copyProxyChain(proxy, itemCtx, startAt) {\r\n var plugins = [];\r\n var add = startAt ? false : true;\r\n if (proxy) {\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n if (!add) {\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nfunction _copyPluginChain(srcPlugins, itemCtx, startAt) {\r\n var plugins = srcPlugins;\r\n var add = false;\r\n if (startAt && srcPlugins) {\r\n plugins = [];\r\n CoreUtils.arrForEach(srcPlugins, function (thePlugin) {\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n });\r\n }\r\n if (startAt && !add) {\r\n if (!plugins) {\r\n plugins = [];\r\n }\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\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(plugins, config, core, startAt) {\r\n var _self = this;\r\n var _nextProxy = null; // Null == No next plugin\r\n // There is no next element (null) vs not defined (undefined)\r\n if (startAt !== null) {\r\n if (plugins && CoreUtils.isFunction(plugins.getPlugin)) {\r\n // We have a proxy chain object\r\n _nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());\r\n }\r\n else {\r\n // We just have an array\r\n if (startAt) {\r\n _nextProxy = _copyPluginChain(plugins, _self, startAt);\r\n }\r\n else if (CoreUtils.isUndefined(startAt)) {\r\n // Undefined means copy the existing chain\r\n _nextProxy = _createProxyChain(plugins, _self);\r\n }\r\n }\r\n }\r\n _self.core = function () {\r\n return core;\r\n };\r\n _self.diagLog = function () {\r\n var logger = (core || {}).logger;\r\n if (!logger) {\r\n // Fallback so we always have a logger\r\n logger = new DiagnosticLogger(config || {});\r\n }\r\n return logger;\r\n };\r\n _self.getCfg = function () {\r\n return config;\r\n };\r\n _self.getExtCfg = function (identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = {}; }\r\n var theConfig;\r\n if (config) {\r\n var extConfig = config.extensionConfig;\r\n if (extConfig && identifier) {\r\n theConfig = extConfig[identifier];\r\n }\r\n }\r\n return (theConfig ? theConfig : defaultValue);\r\n };\r\n _self.getConfig = function (identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _self.getExtCfg(identifier, null);\r\n if (extConfig && !_isNullOrUndefined(extConfig[field])) {\r\n theValue = extConfig[field];\r\n }\r\n else if (config && !_isNullOrUndefined(config[field])) {\r\n theValue = config[field];\r\n }\r\n return !_isNullOrUndefined(theValue) ? theValue : defaultValue;\r\n };\r\n _self.hasNext = function () {\r\n return _nextProxy != null;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processNext = function (env) {\r\n var nextPlugin = _nextProxy;\r\n if (nextPlugin) {\r\n // Automatically move to the next plugin\r\n _nextProxy = nextPlugin.getNext();\r\n nextPlugin.processTelemetry(env, _self);\r\n }\r\n };\r\n _self.createNew = function (plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);\r\n };\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strFunction, strPrototype } from \"./EnvUtils\";\r\nimport { CoreUtils } from './CoreUtils';\r\nvar aiInstrumentHooks = \"_aiHooks\";\r\n;\r\nvar cbNames = [\r\n \"req\", \"rsp\", \"hkErr\", \"fnErr\"\r\n];\r\n/** @ignore */\r\nfunction _arrLoop(arr, fn) {\r\n if (arr) {\r\n for (var lp = 0; lp < arr.length; lp++) {\r\n if (fn(arr[lp], lp)) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/** @ignore */\r\nfunction _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) {\r\n if (type >= 0 /* Request */ && type <= 2 /* HookError */) {\r\n _arrLoop(hooks, function (hook, idx) {\r\n var cbks = hook.cbks;\r\n var cb = cbks[cbNames[type]];\r\n if (cb) {\r\n // Set the specific hook context implementation using a lazy creation pattern\r\n callDetails.ctx = function () {\r\n var ctx = hookCtx[idx] = (hookCtx[idx] || {});\r\n return ctx;\r\n };\r\n try {\r\n cb.apply(callDetails.inst, cbArgs);\r\n }\r\n catch (err) {\r\n var orgEx = callDetails.err;\r\n try {\r\n // Report Hook error via the callback\r\n var hookErrorCb = cbks[cbNames[2 /* HookError */]];\r\n if (hookErrorCb) {\r\n callDetails.err = err;\r\n hookErrorCb.apply(callDetails.inst, cbArgs);\r\n }\r\n }\r\n catch (e) {\r\n // Not much we can do here -- swallowing the exception to avoid crashing the hosting app\r\n }\r\n finally {\r\n // restore the original exception (if any)\r\n callDetails.err = orgEx;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/** @ignore */\r\nfunction _createFunctionHook(aiHook) {\r\n // Define a temporary method that queues-up a the real method call\r\n return function () {\r\n var funcThis = this;\r\n // Capture the original arguments passed to the method\r\n var orgArgs = arguments;\r\n var hooks = aiHook.h;\r\n var funcArgs = {\r\n name: aiHook.n,\r\n inst: funcThis,\r\n ctx: null,\r\n set: _replaceArg\r\n };\r\n var hookCtx = [];\r\n var cbArgs = _createArgs([funcArgs], orgArgs);\r\n function _createArgs(target, theArgs) {\r\n _arrLoop(theArgs, function (arg) {\r\n target.push(arg);\r\n });\r\n return target;\r\n }\r\n function _replaceArg(idx, value) {\r\n orgArgs = _createArgs([], orgArgs);\r\n orgArgs[idx] = value;\r\n cbArgs = _createArgs([funcArgs], orgArgs);\r\n }\r\n // Call the pre-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 /* Request */);\r\n // Call the original function was called\r\n var theFunc = aiHook.f;\r\n try {\r\n funcArgs.rslt = theFunc.apply(funcThis, orgArgs);\r\n }\r\n catch (err) {\r\n // Report the request callback\r\n funcArgs.err = err;\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 /* FunctionError */);\r\n // rethrow the original exception so anyone listening for it can catch the exception\r\n throw err;\r\n }\r\n // Call the post-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 /* Response */);\r\n return funcArgs.rslt;\r\n };\r\n}\r\n/** @ignore */\r\nfunction _getOwner(target, name, checkPrototype) {\r\n var owner = null;\r\n if (target) {\r\n if (CoreUtils.hasOwnProperty(target, name)) {\r\n owner = target;\r\n }\r\n else if (checkPrototype) {\r\n owner = _getOwner(target[strPrototype], name, false);\r\n }\r\n }\r\n return owner;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProto(target, funcName, callbacks) {\r\n if (target) {\r\n return InstrumentFunc(target[strPrototype], funcName, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProtos(target, funcNames, callbacks) {\r\n if (target) {\r\n return InstrumentFuncs(target[strPrototype], funcNames, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n */\r\nexport function InstrumentFunc(target, funcName, callbacks, checkPrototype) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n if (target && funcName && callbacks) {\r\n var owner = _getOwner(target, funcName, checkPrototype);\r\n var fn = owner[funcName];\r\n if (typeof fn === strFunction) {\r\n var aiHook_1 = fn[aiInstrumentHooks];\r\n if (!aiHook_1) {\r\n // Only hook the function once\r\n aiHook_1 = {\r\n i: 0,\r\n n: funcName,\r\n f: fn,\r\n h: []\r\n };\r\n // Override (hook) the original function\r\n var newFunc = _createFunctionHook(aiHook_1);\r\n newFunc[aiInstrumentHooks] = aiHook_1; // Tag and store the function hooks\r\n owner[funcName] = newFunc;\r\n }\r\n var theHook = {\r\n // tslint:disable:object-literal-shorthand\r\n id: aiHook_1.i,\r\n cbks: callbacks,\r\n rm: function () {\r\n // DO NOT Use () => { shorthand for the function as the this gets replaced\r\n // with the outer this and not the this for theHook instance.\r\n var id = this.id;\r\n _arrLoop(aiHook_1.h, function (hook, idx) {\r\n if (hook.id === id) {\r\n aiHook_1.h.splice(idx, 1);\r\n return 1;\r\n }\r\n });\r\n }\r\n // tslint:enable:object-literal-shorthand\r\n };\r\n aiHook_1.i++;\r\n aiHook_1.h.push(theHook);\r\n return theHook;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n */\r\nexport function InstrumentFuncs(target, funcNames, callbacks, checkPrototype) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n var hooks = null;\r\n _arrLoop(funcNames, function (funcName) {\r\n var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype);\r\n if (hook) {\r\n if (!hooks) {\r\n hooks = [];\r\n }\r\n hooks.push(hook);\r\n }\r\n });\r\n return hooks;\r\n}\r\n//# sourceMappingURL=InstrumentHooks.js.map"],"sourceRoot":""}