@microsoft/applicationinsights-common 3.0.6 → 3.0.7-nightly3.2312-05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/es5/applicationinsights-common.cjs.js +358 -14
- package/browser/es5/applicationinsights-common.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-common.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.js +360 -16
- package/browser/es5/applicationinsights-common.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.integrity.json +25 -25
- package/browser/es5/applicationinsights-common.js +360 -16
- package/browser/es5/applicationinsights-common.js.map +1 -1
- package/browser/es5/applicationinsights-common.min.js +2 -2
- package/browser/es5/applicationinsights-common.min.js.map +1 -1
- package/dist/es5/applicationinsights-common.js +358 -14
- package/dist/es5/applicationinsights-common.js.map +1 -1
- package/dist/es5/applicationinsights-common.min.js +2 -2
- package/dist/es5/applicationinsights-common.min.js.map +1 -1
- package/dist-es5/ConnectionStringParser.js +1 -1
- package/dist-es5/Constants.js +1 -1
- package/dist-es5/DomHelperFuncs.js +1 -1
- package/dist-es5/Enums.js +1 -1
- package/dist-es5/HelperFuncs.js +1 -1
- package/dist-es5/Interfaces/ConnectionString.js +1 -1
- package/dist-es5/Interfaces/Context/IApplication.js +1 -1
- package/dist-es5/Interfaces/Context/IDevice.js +1 -1
- package/dist-es5/Interfaces/Context/IInternal.js +1 -1
- package/dist-es5/Interfaces/Context/ILocation.js +1 -1
- package/dist-es5/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-es5/Interfaces/Context/ISample.js +1 -1
- package/dist-es5/Interfaces/Context/ISession.js +1 -1
- package/dist-es5/Interfaces/Context/ISessionManager.js +1 -1
- package/dist-es5/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-es5/Interfaces/Context/IUser.js +1 -1
- package/dist-es5/Interfaces/Context/IWeb.js +1 -1
- package/dist-es5/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-es5/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-es5/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-es5/Interfaces/Contracts/IBase.js +1 -1
- package/dist-es5/Interfaces/Contracts/IData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-es5/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-es5/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-es5/Interfaces/IAppInsights.js +1 -1
- package/dist-es5/Interfaces/IConfig.js +1 -1
- package/dist-es5/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-es5/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-es5/Interfaces/IEventTelemetry.js +1 -1
- package/dist-es5/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-es5/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPartC.js +1 -1
- package/dist-es5/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-es5/Interfaces/IRequestContext.js +1 -1
- package/dist-es5/Interfaces/IStorageBuffer.js +1 -1
- package/dist-es5/Interfaces/ITelemetryContext.js +1 -1
- package/dist-es5/Interfaces/IThrottleMgr.js +1 -1
- package/dist-es5/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-es5/Interfaces/PartAExtensions.js +1 -1
- package/dist-es5/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-es5/Offline.js +138 -0
- package/dist-es5/Offline.js.map +1 -0
- package/dist-es5/RequestResponseHeaders.js +1 -1
- package/dist-es5/StorageHelperFuncs.js +3 -3
- package/dist-es5/StorageHelperFuncs.js.map +1 -1
- package/dist-es5/Telemetry/Common/Data.js +1 -1
- package/dist-es5/Telemetry/Common/DataPoint.js +1 -1
- package/dist-es5/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-es5/Telemetry/Common/Envelope.js +1 -1
- package/dist-es5/Telemetry/Event.js +1 -1
- package/dist-es5/Telemetry/Exception.js +4 -4
- package/dist-es5/Telemetry/Exception.js.map +1 -1
- package/dist-es5/Telemetry/Metric.js +1 -1
- package/dist-es5/Telemetry/PageView.js +1 -1
- package/dist-es5/Telemetry/PageViewPerformance.js +1 -1
- package/dist-es5/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-es5/Telemetry/Trace.js +1 -1
- package/dist-es5/TelemetryItemCreator.js +1 -1
- package/dist-es5/ThrottleMgr.js +3 -3
- package/dist-es5/ThrottleMgr.js.map +1 -1
- package/dist-es5/UrlHelperFuncs.js +1 -1
- package/dist-es5/Util.js +1 -1
- package/dist-es5/__DynamicConstants.js +2 -1
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-common.js +2 -1
- package/dist-es5/applicationinsights-common.js.map +1 -1
- package/package.json +66 -63
- package/types/applicationinsights-common.d.ts +47 -1
- package/types/applicationinsights-common.namespaced.d.ts +47 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.0.
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.0.7-nightly3.2312-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
6
6
|
var undef = "undefined";
|
|
7
|
-
var nsKey, key, nm, theExports = {}, modName = "
|
|
8
|
-
var mods={}, modDetail=mods[modName]={}, ver="3.0.
|
|
7
|
+
var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_common_3_0_7_nightly3_2312_05", msMod="__ms$mod__";
|
|
8
|
+
var mods={}, modDetail=mods[modName]={}, ver="3.0.7-nightly3.2312-05";
|
|
9
9
|
var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
|
|
10
10
|
// Versioned namespace "Microsoft.ApplicationInsights3"
|
|
11
11
|
var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
|
|
@@ -707,7 +707,7 @@ var _DYN_SET_DF = "setDf";
|
|
|
707
707
|
var _DYN_WATCH = "watch";
|
|
708
708
|
var _DYN_LOGGER = "logger";
|
|
709
709
|
var _DYN_APPLY = "apply";
|
|
710
|
-
var _DYN_PUSH = "push";
|
|
710
|
+
var _DYN_PUSH$1 = "push";
|
|
711
711
|
var _DYN_SPLICE = "splice";
|
|
712
712
|
var _DYN_HDLR = "hdlr";
|
|
713
713
|
var _DYN_CANCEL = "cancel";
|
|
@@ -720,8 +720,11 @@ var _DYN_MESSAGE$1 = "message";
|
|
|
720
720
|
var _DYN_DIAG_LOG = "diagLog";
|
|
721
721
|
var _DYN_USER_AGENT = "userAgent";
|
|
722
722
|
var _DYN_SPLIT$1 = "split";
|
|
723
|
+
var _DYN_NODE_TYPE = "nodeType";
|
|
723
724
|
var _DYN_REPLACE = "replace";
|
|
724
725
|
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
726
|
+
var _DYN_TYPE = "type";
|
|
727
|
+
var _DYN_HANDLER = "handler";
|
|
725
728
|
var _DYN_TRACE_ID = "traceId";
|
|
726
729
|
var _DYN_SPAN_ID = "spanId";
|
|
727
730
|
var _DYN_TRACE_FLAGS = "traceFlags";
|
|
@@ -1238,13 +1241,62 @@ function newId(maxLength) {
|
|
|
1238
1241
|
return result;
|
|
1239
1242
|
}
|
|
1240
1243
|
|
|
1241
|
-
var version = '3.0.
|
|
1244
|
+
var version = '3.0.7-nightly3.2312-05';
|
|
1242
1245
|
var instanceName = "." + newId(6);
|
|
1243
1246
|
var _dataUid = 0;
|
|
1247
|
+
function _canAcceptData(target) {
|
|
1248
|
+
return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]);
|
|
1249
|
+
}
|
|
1250
|
+
function _getCache(data, target) {
|
|
1251
|
+
var theCache = target[data.id];
|
|
1252
|
+
if (!theCache) {
|
|
1253
|
+
theCache = {};
|
|
1254
|
+
try {
|
|
1255
|
+
if (_canAcceptData(target)) {
|
|
1256
|
+
objDefine(target, data.id, {
|
|
1257
|
+
e: false,
|
|
1258
|
+
v: theCache
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
catch (e) {
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
return theCache;
|
|
1266
|
+
}
|
|
1244
1267
|
function createUniqueNamespace(name, includeVersion) {
|
|
1245
1268
|
if (includeVersion === void 0) { includeVersion = false; }
|
|
1246
1269
|
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName);
|
|
1247
1270
|
}
|
|
1271
|
+
function createElmNodeData(name) {
|
|
1272
|
+
var data = {
|
|
1273
|
+
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version),
|
|
1274
|
+
accept: function (target) {
|
|
1275
|
+
return _canAcceptData(target);
|
|
1276
|
+
},
|
|
1277
|
+
get: function (target, name, defValue, addDefault) {
|
|
1278
|
+
var theCache = target[data.id];
|
|
1279
|
+
if (!theCache) {
|
|
1280
|
+
if (addDefault) {
|
|
1281
|
+
theCache = _getCache(data, target);
|
|
1282
|
+
theCache[normalizeJsName(name)] = defValue;
|
|
1283
|
+
}
|
|
1284
|
+
return defValue;
|
|
1285
|
+
}
|
|
1286
|
+
return theCache[normalizeJsName(name)];
|
|
1287
|
+
},
|
|
1288
|
+
kill: function (target, name) {
|
|
1289
|
+
if (target && target[name]) {
|
|
1290
|
+
try {
|
|
1291
|
+
delete target[name];
|
|
1292
|
+
}
|
|
1293
|
+
catch (e) {
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
return data;
|
|
1299
|
+
}
|
|
1248
1300
|
|
|
1249
1301
|
function _isConfigDefaults(value) {
|
|
1250
1302
|
return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, "v") || objHasOwn(value, "mrg") || objHasOwn(value, "ref") || value.set));
|
|
@@ -1467,7 +1519,7 @@ function _createDynamicProperty(state, theConfig, name, value) {
|
|
|
1467
1519
|
trk: function (handler) {
|
|
1468
1520
|
if (handler && handler.fn) {
|
|
1469
1521
|
if (arrIndexOf(detail.h, handler) === -1) {
|
|
1470
|
-
detail.h[_DYN_PUSH ](handler);
|
|
1522
|
+
detail.h[_DYN_PUSH$1 ](handler);
|
|
1471
1523
|
}
|
|
1472
1524
|
state.trk(handler, detail);
|
|
1473
1525
|
}
|
|
@@ -1679,7 +1731,7 @@ function _createState(cfgHandler) {
|
|
|
1679
1731
|
_useHandler(handler, handler.fn);
|
|
1680
1732
|
}
|
|
1681
1733
|
catch (e) {
|
|
1682
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
1734
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
1683
1735
|
}
|
|
1684
1736
|
}
|
|
1685
1737
|
}
|
|
@@ -1689,7 +1741,7 @@ function _createState(cfgHandler) {
|
|
|
1689
1741
|
_notifyWatchers();
|
|
1690
1742
|
}
|
|
1691
1743
|
catch (e) {
|
|
1692
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
1744
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
1693
1745
|
}
|
|
1694
1746
|
}
|
|
1695
1747
|
if (watcherFailures_1[_DYN_LENGTH$1 ] > 0) {
|
|
@@ -1711,7 +1763,7 @@ function _createState(cfgHandler) {
|
|
|
1711
1763
|
for (var idx = 0; idx < detail.h[_DYN_LENGTH$1 ]; idx++) {
|
|
1712
1764
|
var handler = detail.h[idx];
|
|
1713
1765
|
if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
|
|
1714
|
-
_waitingHandlers[_DYN_PUSH ](handler);
|
|
1766
|
+
_waitingHandlers[_DYN_PUSH$1 ](handler);
|
|
1715
1767
|
}
|
|
1716
1768
|
}
|
|
1717
1769
|
}
|
|
@@ -1720,7 +1772,7 @@ function _createState(cfgHandler) {
|
|
|
1720
1772
|
if (handler) {
|
|
1721
1773
|
var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
|
|
1722
1774
|
if (arrIndexOf(details, detail) === -1) {
|
|
1723
|
-
details[_DYN_PUSH ](detail);
|
|
1775
|
+
details[_DYN_PUSH$1 ](detail);
|
|
1724
1776
|
}
|
|
1725
1777
|
}
|
|
1726
1778
|
}
|
|
@@ -2008,14 +2060,14 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
2008
2060
|
}
|
|
2009
2061
|
if (logMessage) {
|
|
2010
2062
|
if (severity <= _loggingLevelTelemetry) {
|
|
2011
|
-
_self.queue[_DYN_PUSH ](message);
|
|
2063
|
+
_self.queue[_DYN_PUSH$1 ](message);
|
|
2012
2064
|
_messageCount++;
|
|
2013
2065
|
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
2014
2066
|
}
|
|
2015
2067
|
if (_messageCount === _maxInternalMessageLimit) {
|
|
2016
2068
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
2017
2069
|
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
2018
|
-
_self.queue[_DYN_PUSH ](throttleMessage);
|
|
2070
|
+
_self.queue[_DYN_PUSH$1 ](throttleMessage);
|
|
2019
2071
|
if (severity === 1 ) {
|
|
2020
2072
|
_self.errorToConsole(throttleLimitMessage);
|
|
2021
2073
|
}
|
|
@@ -2187,6 +2239,180 @@ function findW3cTraceParent(selectIdx) {
|
|
|
2187
2239
|
return traceParent;
|
|
2188
2240
|
}
|
|
2189
2241
|
|
|
2242
|
+
var strOnPrefix = "on";
|
|
2243
|
+
var strAttachEvent = "attachEvent";
|
|
2244
|
+
var strAddEventHelper = "addEventListener";
|
|
2245
|
+
var strDetachEvent = "detachEvent";
|
|
2246
|
+
var strRemoveEventListener = "removeEventListener";
|
|
2247
|
+
var strEvents = "events";
|
|
2248
|
+
createUniqueNamespace("aiEvtPageHide");
|
|
2249
|
+
createUniqueNamespace("aiEvtPageShow");
|
|
2250
|
+
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
2251
|
+
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
2252
|
+
var _guid = 1;
|
|
2253
|
+
var elmNodeData = createElmNodeData("events");
|
|
2254
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
2255
|
+
function _normalizeNamespace(name) {
|
|
2256
|
+
if (name && name[_DYN_REPLACE ]) {
|
|
2257
|
+
return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY);
|
|
2258
|
+
}
|
|
2259
|
+
return name;
|
|
2260
|
+
}
|
|
2261
|
+
function _getEvtNamespace(eventName, evtNamespace) {
|
|
2262
|
+
var _a;
|
|
2263
|
+
if (evtNamespace) {
|
|
2264
|
+
var theNamespace_1 = STR_EMPTY;
|
|
2265
|
+
if (isArray(evtNamespace)) {
|
|
2266
|
+
theNamespace_1 = STR_EMPTY;
|
|
2267
|
+
arrForEach(evtNamespace, function (name) {
|
|
2268
|
+
name = _normalizeNamespace(name);
|
|
2269
|
+
if (name) {
|
|
2270
|
+
if (name[0] !== ".") {
|
|
2271
|
+
name = "." + name;
|
|
2272
|
+
}
|
|
2273
|
+
theNamespace_1 += name;
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
}
|
|
2277
|
+
else {
|
|
2278
|
+
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
2279
|
+
}
|
|
2280
|
+
if (theNamespace_1) {
|
|
2281
|
+
if (theNamespace_1[0] !== ".") {
|
|
2282
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
2283
|
+
}
|
|
2284
|
+
eventName = (eventName || STR_EMPTY) + theNamespace_1;
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []);
|
|
2288
|
+
return _a = {},
|
|
2289
|
+
_a[_DYN_TYPE ] = parsedEvent[1],
|
|
2290
|
+
_a.ns = ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT$1 ](".").sort()).join("."),
|
|
2291
|
+
_a;
|
|
2292
|
+
}
|
|
2293
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
2294
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
2295
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
2296
|
+
var registeredEvents = aiEvts[evtName];
|
|
2297
|
+
if (!registeredEvents) {
|
|
2298
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
2299
|
+
}
|
|
2300
|
+
return registeredEvents;
|
|
2301
|
+
}
|
|
2302
|
+
function _doDetach(obj, evtName, handlerRef, useCapture) {
|
|
2303
|
+
if (obj && evtName && evtName[_DYN_TYPE ]) {
|
|
2304
|
+
if (obj[strRemoveEventListener]) {
|
|
2305
|
+
obj[strRemoveEventListener](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2306
|
+
}
|
|
2307
|
+
else if (obj[strDetachEvent]) {
|
|
2308
|
+
obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
2313
|
+
var result = false;
|
|
2314
|
+
if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) {
|
|
2315
|
+
if (obj[strAddEventHelper]) {
|
|
2316
|
+
obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2317
|
+
result = true;
|
|
2318
|
+
}
|
|
2319
|
+
else if (obj[strAttachEvent]) {
|
|
2320
|
+
obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2321
|
+
result = true;
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
return result;
|
|
2325
|
+
}
|
|
2326
|
+
function _doUnregister(target, events, evtName, unRegFn) {
|
|
2327
|
+
var idx = events[_DYN_LENGTH$1 ];
|
|
2328
|
+
while (idx--) {
|
|
2329
|
+
var theEvent = events[idx];
|
|
2330
|
+
if (theEvent) {
|
|
2331
|
+
if (!evtName.ns || evtName.ns === theEvent.evtName.ns) {
|
|
2332
|
+
if (!unRegFn || unRegFn(theEvent)) {
|
|
2333
|
+
_doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture);
|
|
2334
|
+
events[_DYN_SPLICE ](idx, 1);
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
function _unregisterEvents(target, evtName, unRegFn) {
|
|
2341
|
+
if (evtName[_DYN_TYPE ]) {
|
|
2342
|
+
_doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn);
|
|
2343
|
+
}
|
|
2344
|
+
else {
|
|
2345
|
+
var eventCache = elmNodeData.get(target, strEvents, {});
|
|
2346
|
+
objForEachKey(eventCache, function (evtType, events) {
|
|
2347
|
+
_doUnregister(target, events, evtName, unRegFn);
|
|
2348
|
+
});
|
|
2349
|
+
if (objKeys(eventCache)[_DYN_LENGTH$1 ] === 0) {
|
|
2350
|
+
elmNodeData.kill(target, strEvents);
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
function mergeEvtNamespace(theNamespace, namespaces) {
|
|
2355
|
+
var newNamespaces;
|
|
2356
|
+
if (namespaces) {
|
|
2357
|
+
if (isArray(namespaces)) {
|
|
2358
|
+
newNamespaces = [theNamespace].concat(namespaces);
|
|
2359
|
+
}
|
|
2360
|
+
else {
|
|
2361
|
+
newNamespaces = [theNamespace, namespaces];
|
|
2362
|
+
}
|
|
2363
|
+
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ](".");
|
|
2364
|
+
}
|
|
2365
|
+
else {
|
|
2366
|
+
newNamespaces = theNamespace;
|
|
2367
|
+
}
|
|
2368
|
+
return newNamespaces;
|
|
2369
|
+
}
|
|
2370
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2371
|
+
var _a;
|
|
2372
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2373
|
+
var result = false;
|
|
2374
|
+
if (target) {
|
|
2375
|
+
try {
|
|
2376
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
2377
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
2378
|
+
if (result && elmNodeData.accept(target)) {
|
|
2379
|
+
var registeredEvent = (_a = {
|
|
2380
|
+
guid: _guid++,
|
|
2381
|
+
evtName: evtName
|
|
2382
|
+
},
|
|
2383
|
+
_a[_DYN_HANDLER ] = handlerRef,
|
|
2384
|
+
_a.capture = useCapture,
|
|
2385
|
+
_a);
|
|
2386
|
+
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH$1 ](registeredEvent);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
catch (e) {
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
return result;
|
|
2393
|
+
}
|
|
2394
|
+
function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2395
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2396
|
+
if (target) {
|
|
2397
|
+
try {
|
|
2398
|
+
var evtName_1 = _getEvtNamespace(eventName, evtNamespace);
|
|
2399
|
+
var found_1 = false;
|
|
2400
|
+
_unregisterEvents(target, evtName_1, function (regEvent) {
|
|
2401
|
+
if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) {
|
|
2402
|
+
found_1 = true;
|
|
2403
|
+
return true;
|
|
2404
|
+
}
|
|
2405
|
+
return false;
|
|
2406
|
+
});
|
|
2407
|
+
if (!found_1) {
|
|
2408
|
+
_doDetach(target, evtName_1, handlerRef, useCapture);
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
catch (e) {
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2190
2416
|
var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
2191
2417
|
var SampleRate = "sampleRate";
|
|
2192
2418
|
var ProcessLegacy = "ProcessLegacy";
|
|
@@ -2213,6 +2439,7 @@ var _DYN_LENGTH = "length";
|
|
|
2213
2439
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
2214
2440
|
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
2215
2441
|
var _DYN_TO_STRING = "toString";
|
|
2442
|
+
var _DYN_PUSH = "push";
|
|
2216
2443
|
var _DYN_REMOVE_ITEM = "removeItem";
|
|
2217
2444
|
var _DYN_NAME = "name";
|
|
2218
2445
|
var _DYN_MESSAGE = "message";
|
|
@@ -2704,7 +2931,7 @@ function utlGetSessionStorageKeys() {
|
|
|
2704
2931
|
var keys = [];
|
|
2705
2932
|
if (utlCanUseSessionStorage()) {
|
|
2706
2933
|
objForEachKey(getInst("sessionStorage"), function (key) {
|
|
2707
|
-
keys
|
|
2934
|
+
keys[_DYN_PUSH ](key);
|
|
2708
2935
|
});
|
|
2709
2936
|
}
|
|
2710
2937
|
return keys;
|
|
@@ -2864,7 +3091,7 @@ var ThrottleMgr = /** @class */ (function () {
|
|
|
2864
3091
|
else {
|
|
2865
3092
|
if (!!saveUnsentMsg) {
|
|
2866
3093
|
var queue = _getQueueByKey(msgID);
|
|
2867
|
-
queue
|
|
3094
|
+
queue[_DYN_PUSH ]({
|
|
2868
3095
|
msgID: msgID,
|
|
2869
3096
|
message: message,
|
|
2870
3097
|
severity: severity
|
|
@@ -3243,7 +3470,7 @@ function _getOperaStack(errorMessage) {
|
|
|
3243
3470
|
entry += "@" + lines[lp + 1];
|
|
3244
3471
|
lp++;
|
|
3245
3472
|
}
|
|
3246
|
-
stack
|
|
3473
|
+
stack[_DYN_PUSH ](entry);
|
|
3247
3474
|
}
|
|
3248
3475
|
return {
|
|
3249
3476
|
src: errorMessage,
|
|
@@ -3326,7 +3553,7 @@ function _parseStack(stack) {
|
|
|
3326
3553
|
if (_StackFrame.regex.test(theFrame)) {
|
|
3327
3554
|
var parsedFrame = new _StackFrame(theFrame, level_1++);
|
|
3328
3555
|
totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES ];
|
|
3329
|
-
parsedStack
|
|
3556
|
+
parsedStack[_DYN_PUSH ](parsedFrame);
|
|
3330
3557
|
}
|
|
3331
3558
|
});
|
|
3332
3559
|
var exceptionParsedStackThreshold = 32 * 1024;
|
|
@@ -4014,6 +4241,122 @@ function createDomEvent(eventName) {
|
|
|
4014
4241
|
return event;
|
|
4015
4242
|
}
|
|
4016
4243
|
|
|
4244
|
+
function _disableEvents(target, evtNamespace) {
|
|
4245
|
+
eventOff(target, null, null, evtNamespace);
|
|
4246
|
+
}
|
|
4247
|
+
function createOfflineListener(parentEvtNamespace) {
|
|
4248
|
+
var _document = getDocument();
|
|
4249
|
+
var _navigator = getNavigator();
|
|
4250
|
+
var _isListening = false;
|
|
4251
|
+
var listenerList = [];
|
|
4252
|
+
var rState = 1 ;
|
|
4253
|
+
if (_navigator && !isNullOrUndefined(_navigator.onLine) && !_navigator.onLine) {
|
|
4254
|
+
rState = 2 ;
|
|
4255
|
+
}
|
|
4256
|
+
var uState = 0 ;
|
|
4257
|
+
var _currentState = calCurrentState();
|
|
4258
|
+
var _evtNamespace = mergeEvtNamespace(createUniqueNamespace("OfflineListener"), parentEvtNamespace);
|
|
4259
|
+
try {
|
|
4260
|
+
if (_enableEvents(getWindow())) {
|
|
4261
|
+
_isListening = true;
|
|
4262
|
+
}
|
|
4263
|
+
if (_document) {
|
|
4264
|
+
var target = _document.body || _document;
|
|
4265
|
+
if (target.ononline) {
|
|
4266
|
+
if (_enableEvents(target)) {
|
|
4267
|
+
_isListening = true;
|
|
4268
|
+
}
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
4271
|
+
}
|
|
4272
|
+
catch (e) {
|
|
4273
|
+
_isListening = false;
|
|
4274
|
+
}
|
|
4275
|
+
function _enableEvents(target) {
|
|
4276
|
+
var enabled = false;
|
|
4277
|
+
if (target) {
|
|
4278
|
+
enabled = eventOn(target, "online", _setOnline, _evtNamespace);
|
|
4279
|
+
if (enabled) {
|
|
4280
|
+
eventOn(target, "offline", _setOffline, _evtNamespace);
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
return enabled;
|
|
4284
|
+
}
|
|
4285
|
+
function _isOnline() {
|
|
4286
|
+
return _currentState;
|
|
4287
|
+
}
|
|
4288
|
+
function calCurrentState() {
|
|
4289
|
+
if (uState === 2 || rState === 2 ) {
|
|
4290
|
+
return false;
|
|
4291
|
+
}
|
|
4292
|
+
return true;
|
|
4293
|
+
}
|
|
4294
|
+
function listnerNoticeCheck() {
|
|
4295
|
+
var newState = calCurrentState();
|
|
4296
|
+
if (_currentState !== newState) {
|
|
4297
|
+
_currentState = newState;
|
|
4298
|
+
arrForEach(listenerList, function (callback) {
|
|
4299
|
+
var offlineState = {
|
|
4300
|
+
isOnline: _currentState,
|
|
4301
|
+
rState: rState,
|
|
4302
|
+
uState: uState
|
|
4303
|
+
};
|
|
4304
|
+
try {
|
|
4305
|
+
callback(offlineState);
|
|
4306
|
+
}
|
|
4307
|
+
catch (e) {
|
|
4308
|
+
}
|
|
4309
|
+
});
|
|
4310
|
+
}
|
|
4311
|
+
}
|
|
4312
|
+
function setOnlineState(newState) {
|
|
4313
|
+
uState = newState;
|
|
4314
|
+
listnerNoticeCheck();
|
|
4315
|
+
}
|
|
4316
|
+
function _setOnline() {
|
|
4317
|
+
rState = 1 ;
|
|
4318
|
+
listnerNoticeCheck();
|
|
4319
|
+
}
|
|
4320
|
+
function _setOffline() {
|
|
4321
|
+
rState = 2 ;
|
|
4322
|
+
listnerNoticeCheck();
|
|
4323
|
+
}
|
|
4324
|
+
function _unload() {
|
|
4325
|
+
var win = getWindow();
|
|
4326
|
+
if (win && _isListening) {
|
|
4327
|
+
_disableEvents(win, _evtNamespace);
|
|
4328
|
+
if (_document) {
|
|
4329
|
+
var target = _document.body || _document;
|
|
4330
|
+
if (!isUndefined(target.ononline)) {
|
|
4331
|
+
_disableEvents(target, _evtNamespace);
|
|
4332
|
+
}
|
|
4333
|
+
}
|
|
4334
|
+
_isListening = false;
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
function addListener(callback) {
|
|
4338
|
+
listenerList[_DYN_PUSH ](callback);
|
|
4339
|
+
return {
|
|
4340
|
+
rm: function () {
|
|
4341
|
+
var index = listenerList.indexOf(callback);
|
|
4342
|
+
if (index > -1) {
|
|
4343
|
+
return listenerList.splice(index, 1);
|
|
4344
|
+
}
|
|
4345
|
+
else {
|
|
4346
|
+
return;
|
|
4347
|
+
}
|
|
4348
|
+
}
|
|
4349
|
+
};
|
|
4350
|
+
}
|
|
4351
|
+
return {
|
|
4352
|
+
isOnline: _isOnline,
|
|
4353
|
+
isListening: function () { return _isListening; },
|
|
4354
|
+
unload: _unload,
|
|
4355
|
+
addListener: addListener,
|
|
4356
|
+
setOnlineState: setOnlineState
|
|
4357
|
+
};
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4017
4360
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
4018
4361
|
var BreezeChannelIdentifier = "AppInsightsChannelPlugin";
|
|
4019
4362
|
var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics";
|
|
@@ -4053,6 +4396,7 @@ exports.correlationIdGetPrefix = correlationIdGetPrefix;
|
|
|
4053
4396
|
exports.correlationIdSetPrefix = correlationIdSetPrefix;
|
|
4054
4397
|
exports.createDistributedTraceContextFromTrace = createDistributedTraceContextFromTrace;
|
|
4055
4398
|
exports.createDomEvent = createDomEvent;
|
|
4399
|
+
exports.createOfflineListener = createOfflineListener;
|
|
4056
4400
|
exports.createTelemetryItem = createTelemetryItem;
|
|
4057
4401
|
exports.createTraceParent = createTraceParent;
|
|
4058
4402
|
exports.dataSanitizeException = dataSanitizeException;
|