@microsoft/applicationinsights-common 3.0.0-beta.2208-03 → 3.0.0-beta.2208-16
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/README.md +7 -0
- package/browser/applicationinsights-common.integrity.json +9 -9
- package/browser/applicationinsights-common.js +698 -1422
- package/browser/applicationinsights-common.js.map +1 -1
- package/browser/applicationinsights-common.min.js +2 -2
- package/browser/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.api.json +1785 -3953
- package/dist/applicationinsights-common.api.md +13 -137
- package/dist/applicationinsights-common.d.ts +23 -278
- package/dist/applicationinsights-common.js +698 -1422
- package/dist/applicationinsights-common.js.map +1 -1
- package/dist/applicationinsights-common.min.js +2 -2
- package/dist/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.rollup.d.ts +23 -278
- package/dist-esm/ConnectionStringParser.js +1 -1
- package/dist-esm/Constants.js +1 -1
- package/dist-esm/DomHelperFuncs.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/HelperFuncs.js +1 -1
- package/dist-esm/Interfaces/ConnectionString.js +1 -1
- package/dist-esm/Interfaces/Context/IApplication.js +1 -1
- package/dist-esm/Interfaces/Context/IDevice.js +1 -1
- package/dist-esm/Interfaces/Context/IInternal.js +1 -1
- package/dist-esm/Interfaces/Context/ILocation.js +1 -1
- package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-esm/Interfaces/Context/ISample.js +1 -1
- package/dist-esm/Interfaces/Context/ISession.js +1 -1
- package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-esm/Interfaces/Context/IUser.js +1 -1
- package/dist-esm/Interfaces/Context/IWeb.js +1 -1
- package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
- package/dist-esm/Interfaces/Contracts/IData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-esm/Interfaces/IAppInsights.js +1 -1
- package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
- package/dist-esm/Interfaces/IConfig.js +1 -1
- package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
- package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPartC.js +1 -1
- package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-esm/Interfaces/IRequestContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
- package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-esm/Interfaces/PartAExtensions.js +1 -1
- package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-esm/RequestResponseHeaders.js +1 -1
- package/dist-esm/StorageHelperFuncs.js +1 -1
- package/dist-esm/Telemetry/Common/Data.js +1 -1
- package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
- package/dist-esm/Telemetry/Common/DataSanitizer.js +6 -32
- package/dist-esm/Telemetry/Common/DataSanitizer.js.map +1 -1
- package/dist-esm/Telemetry/Common/Envelope.js +1 -1
- package/dist-esm/Telemetry/Event.js +1 -1
- package/dist-esm/Telemetry/Exception.js +1 -1
- package/dist-esm/Telemetry/Metric.js +1 -1
- package/dist-esm/Telemetry/PageView.js +1 -1
- package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
- package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-esm/Telemetry/Trace.js +1 -1
- package/dist-esm/TelemetryItemCreator.js +1 -1
- package/dist-esm/UrlHelperFuncs.js +1 -1
- package/dist-esm/Util.js +79 -133
- package/dist-esm/Util.js.map +1 -1
- package/dist-esm/__DynamicConstants.js +4 -8
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-common.js +3 -3
- package/dist-esm/applicationinsights-common.js.map +1 -1
- package/package.json +5 -4
- package/src/Telemetry/Common/DataSanitizer.ts +5 -95
- package/src/Util.ts +79 -395
- package/src/__DynamicConstants.ts +3 -7
- package/src/applicationinsights-common.ts +3 -4
- package/tsconfig.json +1 -1
- package/types/Telemetry/Common/DataSanitizer.d.ts +0 -50
- package/types/Util.d.ts +19 -212
- package/types/__DynamicConstants.d.ts +0 -4
- package/types/applicationinsights-common.d.ts +2 -2
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.0.0-beta.2208-
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.0.0-beta.2208-16
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -8,6 +8,297 @@
|
|
|
8
8
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {})));
|
|
9
9
|
})(this, (function (exports) { 'use strict';
|
|
10
10
|
|
|
11
|
+
var UNDEF_VALUE = undefined;
|
|
12
|
+
var EMPTY = "";
|
|
13
|
+
var FUNCTION = "function";
|
|
14
|
+
var NUMBER = "number";
|
|
15
|
+
var OBJECT = "object";
|
|
16
|
+
var PROTOTYPE = "prototype";
|
|
17
|
+
var STRING = "string";
|
|
18
|
+
var UNDEFINED = "undefined";
|
|
19
|
+
var HAS_OWN_PROPERTY = "hasOwnProperty";
|
|
20
|
+
var INDEX_OF = "indexOf";
|
|
21
|
+
var LENGTH = "length";
|
|
22
|
+
var ObjClass$1 = Object;
|
|
23
|
+
var ObjProto$1 = ObjClass$1[PROTOTYPE];
|
|
24
|
+
var StrCls = String;
|
|
25
|
+
var StrProto = StrCls[PROTOTYPE];
|
|
26
|
+
var ArrCls = Array;
|
|
27
|
+
|
|
28
|
+
function _safeCheck(cb, defValue) {
|
|
29
|
+
var result = defValue;
|
|
30
|
+
try {
|
|
31
|
+
result = cb();
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _createIs(theType) {
|
|
39
|
+
return function (value) {
|
|
40
|
+
return typeof value === theType;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function _createObjIs(theType) {
|
|
44
|
+
return function (value) {
|
|
45
|
+
return !!(value && objToString(value) === theType);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function objToString(value) {
|
|
49
|
+
return ObjProto$1.toString.call(value);
|
|
50
|
+
}
|
|
51
|
+
function isUndefined(value) {
|
|
52
|
+
return typeof value === UNDEFINED || value === UNDEFINED;
|
|
53
|
+
}
|
|
54
|
+
function isNullOrUndefined(value) {
|
|
55
|
+
return value === null || isUndefined(value);
|
|
56
|
+
}
|
|
57
|
+
function isDefined(arg) {
|
|
58
|
+
return !!arg || arg !== UNDEF_VALUE;
|
|
59
|
+
}
|
|
60
|
+
var isString = _createIs(STRING);
|
|
61
|
+
var isFunction = _createIs(FUNCTION);
|
|
62
|
+
function isObject(value) {
|
|
63
|
+
if (isNullOrUndefined(value)) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return !!value && typeof value === OBJECT;
|
|
67
|
+
}
|
|
68
|
+
var isArray = ArrCls.isArray;
|
|
69
|
+
var isNumber = _createIs(NUMBER);
|
|
70
|
+
var isError = _createObjIs("[object Error]");
|
|
71
|
+
|
|
72
|
+
var DOCUMENT = "document";
|
|
73
|
+
var NAVIGATOR = "navigator";
|
|
74
|
+
var WINDOW = "window";
|
|
75
|
+
var _cachedGlobal$1 = null;
|
|
76
|
+
var _hasWindow = _safeCheck(function () { return isDefined(window); }, false);
|
|
77
|
+
var _hasDocument = _safeCheck(function () { return isDefined(document); }, false);
|
|
78
|
+
var _hasNavigator = _safeCheck(function () { return isDefined(navigator); }, false);
|
|
79
|
+
_safeCheck(function () { return isDefined(history); }, false);
|
|
80
|
+
_safeCheck(function () { return !!(self && self instanceof WorkerGlobalScope); }, false);
|
|
81
|
+
_safeCheck(function () { return !!(process && (process.versions || {}).node); }, false);
|
|
82
|
+
function getGlobal$1(useCached) {
|
|
83
|
+
var result = useCached === false ? null : _cachedGlobal$1;
|
|
84
|
+
if (!result) {
|
|
85
|
+
if (!result && typeof globalThis !== UNDEFINED) {
|
|
86
|
+
result = globalThis;
|
|
87
|
+
}
|
|
88
|
+
if (!result && typeof self !== UNDEFINED) {
|
|
89
|
+
result = self;
|
|
90
|
+
}
|
|
91
|
+
if (!result && typeof window !== UNDEFINED) {
|
|
92
|
+
result = window;
|
|
93
|
+
}
|
|
94
|
+
if (!result && typeof global !== UNDEFINED) {
|
|
95
|
+
result = global;
|
|
96
|
+
}
|
|
97
|
+
_cachedGlobal$1 = result;
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
function getInst(name, useCached) {
|
|
102
|
+
var gbl = getGlobal$1(useCached);
|
|
103
|
+
if (gbl && gbl[name]) {
|
|
104
|
+
return gbl[name];
|
|
105
|
+
}
|
|
106
|
+
if (name === WINDOW && _hasWindow) {
|
|
107
|
+
return window;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
function getDocument() {
|
|
112
|
+
return _hasDocument ? document : getInst(DOCUMENT);
|
|
113
|
+
}
|
|
114
|
+
function hasNavigator() {
|
|
115
|
+
return !!getNavigator();
|
|
116
|
+
}
|
|
117
|
+
function getNavigator() {
|
|
118
|
+
return _hasNavigator ? navigator : getInst(NAVIGATOR);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function objHasOwnProperty(obj, prop) {
|
|
122
|
+
return obj && ObjProto$1[HAS_OWN_PROPERTY].call(obj, prop);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function objForEachKey(theObject, callbackfn, thisArg) {
|
|
126
|
+
if (theObject && isObject(theObject)) {
|
|
127
|
+
for (var prop in theObject) {
|
|
128
|
+
if (objHasOwnProperty(theObject, prop)) {
|
|
129
|
+
if (callbackfn.call(thisArg || theObject, prop, theObject[prop]) === -1) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function arrForEach(arr, callbackfn, thisArg) {
|
|
138
|
+
if (arr) {
|
|
139
|
+
var len = arr[LENGTH];
|
|
140
|
+
for (var idx = 0; idx < len; idx++) {
|
|
141
|
+
if (idx in arr) {
|
|
142
|
+
if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function throwError(message) {
|
|
151
|
+
throw new Error(message);
|
|
152
|
+
}
|
|
153
|
+
function throwTypeError$1(message) {
|
|
154
|
+
throw new TypeError(message);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
var _objFreeze = ObjClass$1["freeze"];
|
|
158
|
+
function _doNothing(value) {
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
function objKeys(value) {
|
|
162
|
+
if (!isObject(value) || value === null) {
|
|
163
|
+
throwTypeError$1("objKeys called on non-object");
|
|
164
|
+
}
|
|
165
|
+
return ObjClass$1.keys(value);
|
|
166
|
+
}
|
|
167
|
+
function objDeepFreeze(value) {
|
|
168
|
+
if (_objFreeze) {
|
|
169
|
+
objForEachKey(value, function (key, value) {
|
|
170
|
+
if (isArray(value) || isObject(value)) {
|
|
171
|
+
_objFreeze(value);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return objFreeze(value);
|
|
176
|
+
}
|
|
177
|
+
var objFreeze = _objFreeze || _doNothing;
|
|
178
|
+
|
|
179
|
+
function createEnum(values) {
|
|
180
|
+
var theEnum = {};
|
|
181
|
+
objForEachKey(values, function (field, value) {
|
|
182
|
+
theEnum[field] = value;
|
|
183
|
+
theEnum[value] = field;
|
|
184
|
+
});
|
|
185
|
+
return objDeepFreeze(theEnum);
|
|
186
|
+
}
|
|
187
|
+
function createSimpleMap(values) {
|
|
188
|
+
var mapClass = {};
|
|
189
|
+
objForEachKey(values, function (field, value) {
|
|
190
|
+
mapClass[field] = value[1];
|
|
191
|
+
mapClass[value[0]] = value[1];
|
|
192
|
+
});
|
|
193
|
+
return objDeepFreeze(mapClass);
|
|
194
|
+
}
|
|
195
|
+
function createTypeMap(values) {
|
|
196
|
+
return createSimpleMap(values);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function dumpObj(object, format) {
|
|
200
|
+
var objectTypeDump = objToString(object);
|
|
201
|
+
var propertyValueDump = "";
|
|
202
|
+
if (objectTypeDump === "[object Error]") {
|
|
203
|
+
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
if (format) {
|
|
207
|
+
if (isNumber(format)) {
|
|
208
|
+
propertyValueDump = JSON.stringify(object, null, format);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
propertyValueDump = JSON.stringify(object, null, format ? 4 : 0);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
propertyValueDump = JSON.stringify(object);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return objectTypeDump + ": " + propertyValueDump;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function _unwrapFunction(funcName) {
|
|
222
|
+
return function (thisArg) {
|
|
223
|
+
var args = [];
|
|
224
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
225
|
+
args[_i - 1] = arguments[_i];
|
|
226
|
+
}
|
|
227
|
+
if ((thisArg || thisArg === EMPTY) && thisArg[funcName]) {
|
|
228
|
+
return thisArg[funcName].apply(thisArg, args);
|
|
229
|
+
}
|
|
230
|
+
throwTypeError$1("'" + funcName + "' not defined for " + dumpObj(thisArg));
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
var arrIndexOf = _unwrapFunction(INDEX_OF);
|
|
235
|
+
|
|
236
|
+
var arrMap = _unwrapFunction("map");
|
|
237
|
+
|
|
238
|
+
var arrReduce = _unwrapFunction("reduce");
|
|
239
|
+
|
|
240
|
+
function objSetPrototypeOf(obj, proto) {
|
|
241
|
+
var fn = ObjClass$1["setPrototypeOf"] ||
|
|
242
|
+
({ __proto__: [] } instanceof Array && function (d, b) {
|
|
243
|
+
d.__proto__ = b;
|
|
244
|
+
}) ||
|
|
245
|
+
function (d, b) {
|
|
246
|
+
objForEachKey(b, function (key, value) {
|
|
247
|
+
d[key] = value;
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
return fn(obj, proto);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function _createCustomError(name, d, b) {
|
|
254
|
+
objSetPrototypeOf(d, b);
|
|
255
|
+
function __() {
|
|
256
|
+
this.constructor = d;
|
|
257
|
+
}
|
|
258
|
+
__[PROTOTYPE] = b[PROTOTYPE];
|
|
259
|
+
__[PROTOTYPE].name = name;
|
|
260
|
+
d[PROTOTYPE] = new __();
|
|
261
|
+
return d;
|
|
262
|
+
}
|
|
263
|
+
function createCustomError(name, constructCb) {
|
|
264
|
+
var baseClass = Error;
|
|
265
|
+
var customError = _createCustomError(name, function () {
|
|
266
|
+
var _this = this;
|
|
267
|
+
_this = baseClass.apply(_this, arguments) || _this;
|
|
268
|
+
constructCb && constructCb(_this, arguments);
|
|
269
|
+
return _this;
|
|
270
|
+
}, baseClass);
|
|
271
|
+
return customError;
|
|
272
|
+
}
|
|
273
|
+
var _unsupportedError;
|
|
274
|
+
function throwUnsupported(message) {
|
|
275
|
+
if (!_unsupportedError) {
|
|
276
|
+
_unsupportedError = createCustomError("UnsupportedError");
|
|
277
|
+
}
|
|
278
|
+
throw new _unsupportedError(message);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
var strIndexOf = _unwrapFunction(INDEX_OF);
|
|
282
|
+
|
|
283
|
+
function _createTrimFn(exp) {
|
|
284
|
+
return function _doTrim(value) {
|
|
285
|
+
if (isNullOrUndefined(value)) {
|
|
286
|
+
throwTypeError$1("strTrim called [" + dumpObj(value) + "]");
|
|
287
|
+
}
|
|
288
|
+
if (value && value.replace) {
|
|
289
|
+
value = value.replace(exp, "");
|
|
290
|
+
}
|
|
291
|
+
return value;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
|
|
295
|
+
|
|
296
|
+
var TRIM = "trim";
|
|
297
|
+
var strTrim = StrProto[TRIM] ? _unwrapFunction(TRIM) : polyStrTrim;
|
|
298
|
+
|
|
299
|
+
var createEnumStyle = createEnum;
|
|
300
|
+
var createValueMap = createTypeMap;
|
|
301
|
+
|
|
11
302
|
var strShimFunction = "function";
|
|
12
303
|
var strShimObject = "object";
|
|
13
304
|
var strShimUndefined = "undefined";
|
|
@@ -17,7 +308,6 @@
|
|
|
17
308
|
var ObjProto = ObjClass[strShimPrototype];
|
|
18
309
|
var ObjAssign = ObjClass["assign"];
|
|
19
310
|
var ObjCreate = ObjClass["create"];
|
|
20
|
-
var ObjDefineProperty = ObjClass["defineProperty"];
|
|
21
311
|
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];
|
|
22
312
|
|
|
23
313
|
var _cachedGlobal = null;
|
|
@@ -98,389 +388,6 @@
|
|
|
98
388
|
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
|
|
99
389
|
}
|
|
100
390
|
|
|
101
|
-
var _DYN_NAME$1 = "name";
|
|
102
|
-
var _DYN_PUSH = "push";
|
|
103
|
-
var _DYN_LENGTH$1 = "length";
|
|
104
|
-
var _DYN_MESSAGE_ID = "messageId";
|
|
105
|
-
var _DYN_MESSAGE$1 = "message";
|
|
106
|
-
var _DYN_DIAG_LOG = "diagLog";
|
|
107
|
-
var _DYN_COOKIE_CFG = "cookieCfg";
|
|
108
|
-
var _DYN_INDEX_OF$1 = "indexOf";
|
|
109
|
-
var _DYN_SUBSTRING$1 = "substring";
|
|
110
|
-
var _DYN_USER_AGENT = "userAgent";
|
|
111
|
-
var _DYN_SPLIT$1 = "split";
|
|
112
|
-
var _DYN_SET_ENABLED = "setEnabled";
|
|
113
|
-
var _DYN_REPLACE = "replace";
|
|
114
|
-
var _DYN_SUBSTR = "substr";
|
|
115
|
-
var _DYN_NODE_TYPE = "nodeType";
|
|
116
|
-
var _DYN_ENABLE_DEBUG_EXCEPTI4 = "enableDebugExceptions";
|
|
117
|
-
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
118
|
-
var _DYN_TO_LOWER_CASE$1 = "toLowerCase";
|
|
119
|
-
var _DYN_CALL = "call";
|
|
120
|
-
var _DYN_TYPE = "type";
|
|
121
|
-
var _DYN_HANDLER = "handler";
|
|
122
|
-
var _DYN_TRACE_ID = "traceId";
|
|
123
|
-
var _DYN_SPAN_ID = "spanId";
|
|
124
|
-
var _DYN_TRACE_FLAGS = "traceFlags";
|
|
125
|
-
var _DYN_VERSION = "version";
|
|
126
|
-
|
|
127
|
-
var STR_EMPTY = "";
|
|
128
|
-
var STR_ERROR_TO_CONSOLE = "errorToConsole";
|
|
129
|
-
var STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
130
|
-
|
|
131
|
-
var strToISOString = "toISOString";
|
|
132
|
-
var cStrEndsWith = "endsWith";
|
|
133
|
-
var strIndexOf = "indexOf";
|
|
134
|
-
var strMap = "map";
|
|
135
|
-
var strReduce = "reduce";
|
|
136
|
-
var cStrTrim = "trim";
|
|
137
|
-
var strToString = "toString";
|
|
138
|
-
var _objDefineProperty$1 = ObjDefineProperty;
|
|
139
|
-
var _objFreeze = ObjClass.freeze;
|
|
140
|
-
var _objKeys = ObjClass.keys;
|
|
141
|
-
var StringProto = String[strShimPrototype];
|
|
142
|
-
var _strTrim = StringProto[cStrTrim];
|
|
143
|
-
var _strEndsWith = StringProto[cStrEndsWith];
|
|
144
|
-
var DateProto = Date[strShimPrototype];
|
|
145
|
-
var _dataToISOString = DateProto[strToISOString];
|
|
146
|
-
var _isArray = Array.isArray;
|
|
147
|
-
var _objToString = ObjProto[strToString];
|
|
148
|
-
var _fnToString = ObjHasOwnProperty[strToString];
|
|
149
|
-
_fnToString[_DYN_CALL ](ObjClass);
|
|
150
|
-
var rCamelCase = /-([a-z])/g;
|
|
151
|
-
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
152
|
-
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
153
|
-
function isTypeof(value, theType) {
|
|
154
|
-
return typeof value === theType;
|
|
155
|
-
}
|
|
156
|
-
function isUndefined(value) {
|
|
157
|
-
return value === undefined || typeof value === strShimUndefined;
|
|
158
|
-
}
|
|
159
|
-
function isNullOrUndefined(value) {
|
|
160
|
-
return (value === null || isUndefined(value));
|
|
161
|
-
}
|
|
162
|
-
function isNotNullOrUndefined(value) {
|
|
163
|
-
return !isNullOrUndefined(value);
|
|
164
|
-
}
|
|
165
|
-
function hasOwnProperty(obj, prop) {
|
|
166
|
-
return !!(obj && ObjHasOwnProperty[_DYN_CALL ](obj, prop));
|
|
167
|
-
}
|
|
168
|
-
function isObject(value) {
|
|
169
|
-
return !!(value && typeof value === strShimObject);
|
|
170
|
-
}
|
|
171
|
-
function isFunction(value) {
|
|
172
|
-
return !!(value && typeof value === strShimFunction);
|
|
173
|
-
}
|
|
174
|
-
function normalizeJsName(name) {
|
|
175
|
-
var value = name;
|
|
176
|
-
if (value && isString(value)) {
|
|
177
|
-
value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
|
|
178
|
-
return letter.toUpperCase();
|
|
179
|
-
});
|
|
180
|
-
value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
|
|
181
|
-
value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
|
|
182
|
-
return "_" + match;
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
return value;
|
|
186
|
-
}
|
|
187
|
-
function objForEachKey(target, callbackfn) {
|
|
188
|
-
if (target) {
|
|
189
|
-
for (var prop in target) {
|
|
190
|
-
if (ObjHasOwnProperty[_DYN_CALL ](target, prop)) {
|
|
191
|
-
callbackfn[_DYN_CALL ](target, prop, target[prop]);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
function strEndsWith(value, search) {
|
|
197
|
-
var result = false;
|
|
198
|
-
if (value && search && !(result = value === search)) {
|
|
199
|
-
result = _strEndsWith ? value[cStrEndsWith](search) : _strEndsWithPoly(value, search);
|
|
200
|
-
}
|
|
201
|
-
return result;
|
|
202
|
-
}
|
|
203
|
-
function _strEndsWithPoly(value, search) {
|
|
204
|
-
var result = false;
|
|
205
|
-
var searchLen = search ? search[_DYN_LENGTH$1 ] : 0;
|
|
206
|
-
var valLen = value ? value[_DYN_LENGTH$1 ] : 0;
|
|
207
|
-
if (searchLen && valLen && valLen >= searchLen && !(result = value === search)) {
|
|
208
|
-
var pos = valLen - 1;
|
|
209
|
-
for (var lp = searchLen - 1; lp >= 0; lp--) {
|
|
210
|
-
if (value[pos] != search[lp]) {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
pos--;
|
|
214
|
-
}
|
|
215
|
-
result = true;
|
|
216
|
-
}
|
|
217
|
-
return result;
|
|
218
|
-
}
|
|
219
|
-
function strContains(value, search) {
|
|
220
|
-
if (value && search) {
|
|
221
|
-
return value[_DYN_INDEX_OF$1 ](search) !== -1;
|
|
222
|
-
}
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
function isDate(obj) {
|
|
226
|
-
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Date]");
|
|
227
|
-
}
|
|
228
|
-
var isArray = _isArray || _isArrayPoly;
|
|
229
|
-
function _isArrayPoly(obj) {
|
|
230
|
-
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Array]");
|
|
231
|
-
}
|
|
232
|
-
function isError(obj) {
|
|
233
|
-
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Error]");
|
|
234
|
-
}
|
|
235
|
-
function isString(value) {
|
|
236
|
-
return typeof value === "string";
|
|
237
|
-
}
|
|
238
|
-
function isNumber(value) {
|
|
239
|
-
return typeof value === "number";
|
|
240
|
-
}
|
|
241
|
-
function isBoolean(value) {
|
|
242
|
-
return typeof value === "boolean";
|
|
243
|
-
}
|
|
244
|
-
function toISOString(date) {
|
|
245
|
-
if (date) {
|
|
246
|
-
return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function _toISOStringPoly(date) {
|
|
250
|
-
if (date && date.getUTCFullYear) {
|
|
251
|
-
var pad = function (num) {
|
|
252
|
-
var r = String(num);
|
|
253
|
-
if (r[_DYN_LENGTH$1 ] === 1) {
|
|
254
|
-
r = "0" + r;
|
|
255
|
-
}
|
|
256
|
-
return r;
|
|
257
|
-
};
|
|
258
|
-
return date.getUTCFullYear()
|
|
259
|
-
+ "-" + pad(date.getUTCMonth() + 1)
|
|
260
|
-
+ "-" + pad(date.getUTCDate())
|
|
261
|
-
+ "T" + pad(date.getUTCHours())
|
|
262
|
-
+ ":" + pad(date.getUTCMinutes())
|
|
263
|
-
+ ":" + pad(date.getUTCSeconds())
|
|
264
|
-
+ "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
|
|
265
|
-
+ "Z";
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
function arrForEach(arr, callbackfn, thisArg) {
|
|
269
|
-
var len = arr[_DYN_LENGTH$1 ];
|
|
270
|
-
try {
|
|
271
|
-
for (var idx = 0; idx < len; idx++) {
|
|
272
|
-
if (idx in arr) {
|
|
273
|
-
if (callbackfn[_DYN_CALL ](thisArg || arr, arr[idx], idx, arr) === -1) {
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
catch (e) {
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
function arrIndexOf(arr, searchElement, fromIndex) {
|
|
283
|
-
if (arr) {
|
|
284
|
-
if (arr[strIndexOf]) {
|
|
285
|
-
return arr[strIndexOf](searchElement, fromIndex);
|
|
286
|
-
}
|
|
287
|
-
var len = arr[_DYN_LENGTH$1 ];
|
|
288
|
-
var from = fromIndex || 0;
|
|
289
|
-
try {
|
|
290
|
-
for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {
|
|
291
|
-
if (lp in arr && arr[lp] === searchElement) {
|
|
292
|
-
return lp;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
catch (e) {
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
return -1;
|
|
300
|
-
}
|
|
301
|
-
function arrMap(arr, callbackfn, thisArg) {
|
|
302
|
-
var results;
|
|
303
|
-
if (arr) {
|
|
304
|
-
if (arr[strMap]) {
|
|
305
|
-
return arr[strMap](callbackfn, thisArg);
|
|
306
|
-
}
|
|
307
|
-
var len = arr[_DYN_LENGTH$1 ];
|
|
308
|
-
var _this = thisArg || arr;
|
|
309
|
-
results = new Array(len);
|
|
310
|
-
try {
|
|
311
|
-
for (var lp = 0; lp < len; lp++) {
|
|
312
|
-
if (lp in arr) {
|
|
313
|
-
results[lp] = callbackfn[_DYN_CALL ](_this, arr[lp], arr);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
catch (e) {
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return results;
|
|
321
|
-
}
|
|
322
|
-
function arrReduce(arr, callbackfn, initialValue) {
|
|
323
|
-
var value;
|
|
324
|
-
if (arr) {
|
|
325
|
-
if (arr[strReduce]) {
|
|
326
|
-
return arr[strReduce](callbackfn, initialValue);
|
|
327
|
-
}
|
|
328
|
-
var len = arr[_DYN_LENGTH$1 ];
|
|
329
|
-
var lp = 0;
|
|
330
|
-
if (arguments[_DYN_LENGTH$1 ] >= 3) {
|
|
331
|
-
value = arguments[2];
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
while (lp < len && !(lp in arr)) {
|
|
335
|
-
lp++;
|
|
336
|
-
}
|
|
337
|
-
value = arr[lp++];
|
|
338
|
-
}
|
|
339
|
-
while (lp < len) {
|
|
340
|
-
if (lp in arr) {
|
|
341
|
-
value = callbackfn(value, arr[lp], lp, arr);
|
|
342
|
-
}
|
|
343
|
-
lp++;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
return value;
|
|
347
|
-
}
|
|
348
|
-
function strTrim(str) {
|
|
349
|
-
if (str) {
|
|
350
|
-
str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str[_DYN_REPLACE ] ? str[_DYN_REPLACE ](/^\s+|\s+$/g, STR_EMPTY) : str);
|
|
351
|
-
}
|
|
352
|
-
return str;
|
|
353
|
-
}
|
|
354
|
-
var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString");
|
|
355
|
-
var _objKeysDontEnums = [
|
|
356
|
-
"toString",
|
|
357
|
-
"toLocaleString",
|
|
358
|
-
"valueOf",
|
|
359
|
-
"hasOwnProperty",
|
|
360
|
-
"isPrototypeOf",
|
|
361
|
-
"propertyIsEnumerable",
|
|
362
|
-
"constructor"
|
|
363
|
-
];
|
|
364
|
-
function objKeys(obj) {
|
|
365
|
-
var objType = typeof obj;
|
|
366
|
-
if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) {
|
|
367
|
-
throwTypeError("objKeys called on non-object");
|
|
368
|
-
}
|
|
369
|
-
if (!_objKeysHasDontEnumBug && _objKeys) {
|
|
370
|
-
return _objKeys(obj);
|
|
371
|
-
}
|
|
372
|
-
var result = [];
|
|
373
|
-
for (var prop in obj) {
|
|
374
|
-
if (obj && ObjHasOwnProperty[_DYN_CALL ](obj, prop)) {
|
|
375
|
-
result[_DYN_PUSH ](prop);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
if (_objKeysHasDontEnumBug) {
|
|
379
|
-
var dontEnumsLength = _objKeysDontEnums[_DYN_LENGTH$1 ];
|
|
380
|
-
for (var lp = 0; lp < dontEnumsLength; lp++) {
|
|
381
|
-
if (obj && ObjHasOwnProperty[_DYN_CALL ](obj, _objKeysDontEnums[lp])) {
|
|
382
|
-
result[_DYN_PUSH ](_objKeysDontEnums[lp]);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return result;
|
|
387
|
-
}
|
|
388
|
-
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
389
|
-
if (_objDefineProperty$1) {
|
|
390
|
-
try {
|
|
391
|
-
var descriptor = {
|
|
392
|
-
enumerable: true,
|
|
393
|
-
configurable: true
|
|
394
|
-
};
|
|
395
|
-
if (getProp) {
|
|
396
|
-
descriptor.get = getProp;
|
|
397
|
-
}
|
|
398
|
-
if (setProp) {
|
|
399
|
-
descriptor.set = setProp;
|
|
400
|
-
}
|
|
401
|
-
_objDefineProperty$1(target, prop, descriptor);
|
|
402
|
-
return true;
|
|
403
|
-
}
|
|
404
|
-
catch (e) {
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
return false;
|
|
408
|
-
}
|
|
409
|
-
function _doNothing(value) {
|
|
410
|
-
return value;
|
|
411
|
-
}
|
|
412
|
-
function deepFreeze(obj) {
|
|
413
|
-
if (_objFreeze) {
|
|
414
|
-
objForEachKey(obj, function (name, value) {
|
|
415
|
-
if (isArray(value) || isObject(value)) {
|
|
416
|
-
_objFreeze(value);
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
return objFreeze(obj);
|
|
421
|
-
}
|
|
422
|
-
var objFreeze = _objFreeze || _doNothing;
|
|
423
|
-
function dateNow() {
|
|
424
|
-
var dt = Date;
|
|
425
|
-
return dt.now ? dt.now() : new dt().getTime();
|
|
426
|
-
}
|
|
427
|
-
function getExceptionName(object) {
|
|
428
|
-
if (isError(object)) {
|
|
429
|
-
return object[_DYN_NAME$1 ];
|
|
430
|
-
}
|
|
431
|
-
return STR_EMPTY;
|
|
432
|
-
}
|
|
433
|
-
function setValue(target, field, value, valChk, srcChk) {
|
|
434
|
-
var theValue = value;
|
|
435
|
-
if (target) {
|
|
436
|
-
theValue = target[field];
|
|
437
|
-
if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
|
|
438
|
-
theValue = value;
|
|
439
|
-
target[field] = theValue;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
return theValue;
|
|
443
|
-
}
|
|
444
|
-
function getCfgValue(theValue, defaultValue) {
|
|
445
|
-
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
446
|
-
}
|
|
447
|
-
function isTruthy(value) {
|
|
448
|
-
return !!value;
|
|
449
|
-
}
|
|
450
|
-
function throwError(message) {
|
|
451
|
-
throw new Error(message);
|
|
452
|
-
}
|
|
453
|
-
function createClassFromInterface(defaults) {
|
|
454
|
-
return /** @class */ (function () {
|
|
455
|
-
function class_1() {
|
|
456
|
-
var _this_1 = this;
|
|
457
|
-
if (defaults) {
|
|
458
|
-
objForEachKey(defaults, function (field, value) {
|
|
459
|
-
_this_1[field] = value;
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
return class_1;
|
|
464
|
-
}());
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function createEnumStyle(values) {
|
|
468
|
-
var enumClass = {};
|
|
469
|
-
objForEachKey(values, function (field, value) {
|
|
470
|
-
enumClass[field] = value;
|
|
471
|
-
enumClass[value] = field;
|
|
472
|
-
});
|
|
473
|
-
return deepFreeze(enumClass);
|
|
474
|
-
}
|
|
475
|
-
function createValueMap(values) {
|
|
476
|
-
var mapClass = {};
|
|
477
|
-
objForEachKey(values, function (field, value) {
|
|
478
|
-
mapClass[field] = value[1];
|
|
479
|
-
mapClass[value[0]] = value[1];
|
|
480
|
-
});
|
|
481
|
-
return deepFreeze(mapClass);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
391
|
/*!
|
|
485
392
|
* Microsoft Dynamic Proto Utility, 1.1.6
|
|
486
393
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
@@ -714,26 +621,107 @@
|
|
|
714
621
|
if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
|
|
715
622
|
useBaseInst = !!options[strUseBaseInst];
|
|
716
623
|
}
|
|
717
|
-
var instFuncs = _getInstanceFuncs(target);
|
|
718
|
-
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
719
|
-
delegateFunc(target, baseFuncs);
|
|
720
|
-
var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
|
|
721
|
-
if (setInstanceFunc && options) {
|
|
722
|
-
setInstanceFunc = !!options[strSetInstFuncs];
|
|
624
|
+
var instFuncs = _getInstanceFuncs(target);
|
|
625
|
+
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
626
|
+
delegateFunc(target, baseFuncs);
|
|
627
|
+
var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
|
|
628
|
+
if (setInstanceFunc && options) {
|
|
629
|
+
setInstanceFunc = !!options[strSetInstFuncs];
|
|
630
|
+
}
|
|
631
|
+
_populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
|
|
632
|
+
}
|
|
633
|
+
var perfDefaults = {
|
|
634
|
+
setInstFuncs: true,
|
|
635
|
+
useBaseInst: true
|
|
636
|
+
};
|
|
637
|
+
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
638
|
+
|
|
639
|
+
var _DYN_NAME$1 = "name";
|
|
640
|
+
var _DYN_PUSH = "push";
|
|
641
|
+
var _DYN_LENGTH$1 = "length";
|
|
642
|
+
var _DYN_MESSAGE_ID = "messageId";
|
|
643
|
+
var _DYN_MESSAGE$1 = "message";
|
|
644
|
+
var _DYN_DIAG_LOG = "diagLog";
|
|
645
|
+
var _DYN_USER_AGENT = "userAgent";
|
|
646
|
+
var _DYN_SUBSTR = "substr";
|
|
647
|
+
var _DYN_REPLACE = "replace";
|
|
648
|
+
var _DYN_ENABLE_DEBUG_EXCEPTI4 = "enableDebugExceptions";
|
|
649
|
+
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
650
|
+
var _DYN_TO_LOWER_CASE$1 = "toLowerCase";
|
|
651
|
+
var _DYN_CALL = "call";
|
|
652
|
+
var _DYN_TRACE_ID = "traceId";
|
|
653
|
+
var _DYN_SPAN_ID = "spanId";
|
|
654
|
+
var _DYN_TRACE_FLAGS = "traceFlags";
|
|
655
|
+
var _DYN_VERSION = "version";
|
|
656
|
+
|
|
657
|
+
var STR_EMPTY = "";
|
|
658
|
+
var STR_ERROR_TO_CONSOLE = "errorToConsole";
|
|
659
|
+
var STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
660
|
+
|
|
661
|
+
var _aiNamespace = null;
|
|
662
|
+
function _getExtensionNamespace() {
|
|
663
|
+
var target = getInst("Microsoft");
|
|
664
|
+
if (target) {
|
|
665
|
+
_aiNamespace = target["ApplicationInsights"];
|
|
666
|
+
}
|
|
667
|
+
return _aiNamespace;
|
|
668
|
+
}
|
|
669
|
+
function getDebugExt(config) {
|
|
670
|
+
var ns = _aiNamespace;
|
|
671
|
+
if (!ns && config.disableDbgExt !== true) {
|
|
672
|
+
ns = _aiNamespace || _getExtensionNamespace();
|
|
673
|
+
}
|
|
674
|
+
return ns ? ns["ChromeDbgExt"] : null;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
var cString = "String";
|
|
678
|
+
var strToISOString = "toISOString";
|
|
679
|
+
var strToString = "toString";
|
|
680
|
+
var DateProto = Date[strShimPrototype];
|
|
681
|
+
var _dateToISOString = DateProto[strToISOString] || _polyfillRequired("Date", strToISOString);
|
|
682
|
+
var _fnToString = ObjHasOwnProperty[strToString] || _polyfillRequired(cString, strToString);
|
|
683
|
+
_fnToString[_DYN_CALL ](ObjClass);
|
|
684
|
+
function _polyfillRequired(object, name) {
|
|
685
|
+
return function () {
|
|
686
|
+
throwUnsupported("Polyfill required for [" + name + "]");
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
function strContains(value, search) {
|
|
690
|
+
if (value && search) {
|
|
691
|
+
return strIndexOf(value, search) !== -1;
|
|
692
|
+
}
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
function toISOString(date) {
|
|
696
|
+
return _dateToISOString[_DYN_CALL ](date);
|
|
697
|
+
}
|
|
698
|
+
function dateNow() {
|
|
699
|
+
var dt = Date;
|
|
700
|
+
return dt.now ? dt.now() : new dt().getTime();
|
|
701
|
+
}
|
|
702
|
+
function getExceptionName(object) {
|
|
703
|
+
if (isError(object)) {
|
|
704
|
+
return object[_DYN_NAME$1 ];
|
|
723
705
|
}
|
|
724
|
-
|
|
706
|
+
return STR_EMPTY;
|
|
707
|
+
}
|
|
708
|
+
function getCfgValue(theValue, defaultValue) {
|
|
709
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
710
|
+
}
|
|
711
|
+
function createClassFromInterface(defaults) {
|
|
712
|
+
return /** @class */ (function () {
|
|
713
|
+
function class_1() {
|
|
714
|
+
var _this = this;
|
|
715
|
+
if (defaults) {
|
|
716
|
+
objForEachKey(defaults, function (field, value) {
|
|
717
|
+
_this[field] = value;
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
return class_1;
|
|
722
|
+
}());
|
|
725
723
|
}
|
|
726
|
-
var perfDefaults = {
|
|
727
|
-
setInstFuncs: true,
|
|
728
|
-
useBaseInst: true
|
|
729
|
-
};
|
|
730
|
-
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
731
724
|
|
|
732
|
-
var strWindow = "window";
|
|
733
|
-
var strDocument = "document";
|
|
734
|
-
var strDocumentMode = "documentMode";
|
|
735
|
-
var strNavigator = "navigator";
|
|
736
|
-
var strLocation = "location";
|
|
737
725
|
var strConsole = "console";
|
|
738
726
|
var strPerformance = "performance";
|
|
739
727
|
var strJSON = "JSON";
|
|
@@ -743,80 +731,30 @@
|
|
|
743
731
|
var strTrident = "trident/";
|
|
744
732
|
var _isTrident = null;
|
|
745
733
|
var _navUserAgentCheck = null;
|
|
746
|
-
var _enableMocks = false;
|
|
747
734
|
var _beaconsSupported = null;
|
|
748
|
-
function getGlobalInst(name) {
|
|
749
|
-
var gbl = getGlobal();
|
|
750
|
-
if (gbl && gbl[name]) {
|
|
751
|
-
return gbl[name];
|
|
752
|
-
}
|
|
753
|
-
if (name === strWindow && hasWindow()) {
|
|
754
|
-
return window;
|
|
755
|
-
}
|
|
756
|
-
return null;
|
|
757
|
-
}
|
|
758
|
-
function hasWindow() {
|
|
759
|
-
return Boolean(typeof window === strShimObject && window);
|
|
760
|
-
}
|
|
761
|
-
function getWindow() {
|
|
762
|
-
if (hasWindow()) {
|
|
763
|
-
return window;
|
|
764
|
-
}
|
|
765
|
-
return getGlobalInst(strWindow);
|
|
766
|
-
}
|
|
767
|
-
function hasDocument() {
|
|
768
|
-
return Boolean(typeof document === strShimObject && document);
|
|
769
|
-
}
|
|
770
|
-
function getDocument() {
|
|
771
|
-
if (hasDocument()) {
|
|
772
|
-
return document;
|
|
773
|
-
}
|
|
774
|
-
return getGlobalInst(strDocument);
|
|
775
|
-
}
|
|
776
|
-
function hasNavigator() {
|
|
777
|
-
return Boolean(typeof navigator === strShimObject && navigator);
|
|
778
|
-
}
|
|
779
|
-
function getNavigator() {
|
|
780
|
-
if (hasNavigator()) {
|
|
781
|
-
return navigator;
|
|
782
|
-
}
|
|
783
|
-
return getGlobalInst(strNavigator);
|
|
784
|
-
}
|
|
785
|
-
function getLocation(checkForMock) {
|
|
786
|
-
if (checkForMock && _enableMocks) {
|
|
787
|
-
var mockLocation = getGlobalInst("__mockLocation");
|
|
788
|
-
if (mockLocation) {
|
|
789
|
-
return mockLocation;
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
if (typeof location === strShimObject && location) {
|
|
793
|
-
return location;
|
|
794
|
-
}
|
|
795
|
-
return getGlobalInst(strLocation);
|
|
796
|
-
}
|
|
797
735
|
function getConsole() {
|
|
798
736
|
if (typeof console !== strShimUndefined) {
|
|
799
737
|
return console;
|
|
800
738
|
}
|
|
801
|
-
return
|
|
739
|
+
return getInst(strConsole);
|
|
802
740
|
}
|
|
803
741
|
function getPerformance() {
|
|
804
|
-
return
|
|
742
|
+
return getInst(strPerformance);
|
|
805
743
|
}
|
|
806
744
|
function hasJSON() {
|
|
807
|
-
return Boolean((typeof JSON === strShimObject && JSON) ||
|
|
745
|
+
return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
|
|
808
746
|
}
|
|
809
747
|
function getJSON() {
|
|
810
748
|
if (hasJSON()) {
|
|
811
|
-
return JSON ||
|
|
749
|
+
return JSON || getInst(strJSON);
|
|
812
750
|
}
|
|
813
751
|
return null;
|
|
814
752
|
}
|
|
815
753
|
function getCrypto() {
|
|
816
|
-
return
|
|
754
|
+
return getInst(strCrypto);
|
|
817
755
|
}
|
|
818
756
|
function getMsCrypto() {
|
|
819
|
-
return
|
|
757
|
+
return getInst(strMsCrypto);
|
|
820
758
|
}
|
|
821
759
|
function isIE() {
|
|
822
760
|
var nav = getNavigator();
|
|
@@ -827,36 +765,6 @@
|
|
|
827
765
|
}
|
|
828
766
|
return _isTrident;
|
|
829
767
|
}
|
|
830
|
-
function getIEVersion(userAgentStr) {
|
|
831
|
-
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
832
|
-
if (!userAgentStr) {
|
|
833
|
-
var navigator_1 = getNavigator() || {};
|
|
834
|
-
userAgentStr = navigator_1 ? (navigator_1[_DYN_USER_AGENT ] || STR_EMPTY)[_DYN_TO_LOWER_CASE$1 ]() : STR_EMPTY;
|
|
835
|
-
}
|
|
836
|
-
var ua = (userAgentStr || STR_EMPTY)[_DYN_TO_LOWER_CASE$1 ]();
|
|
837
|
-
if (strContains(ua, strMsie)) {
|
|
838
|
-
var doc = getDocument() || {};
|
|
839
|
-
return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
840
|
-
}
|
|
841
|
-
else if (strContains(ua, strTrident)) {
|
|
842
|
-
var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]);
|
|
843
|
-
if (tridentVer) {
|
|
844
|
-
return tridentVer + 4;
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
return null;
|
|
848
|
-
}
|
|
849
|
-
function dumpObj(object) {
|
|
850
|
-
var objectTypeDump = Object[strShimPrototype].toString[_DYN_CALL ](object);
|
|
851
|
-
var propertyValueDump = STR_EMPTY;
|
|
852
|
-
if (objectTypeDump === "[object Error]") {
|
|
853
|
-
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object[_DYN_NAME$1 ] + "'";
|
|
854
|
-
}
|
|
855
|
-
else if (hasJSON()) {
|
|
856
|
-
propertyValueDump = getJSON().stringify(object);
|
|
857
|
-
}
|
|
858
|
-
return objectTypeDump + propertyValueDump;
|
|
859
|
-
}
|
|
860
768
|
function isBeaconsSupported() {
|
|
861
769
|
if (_beaconsSupported === null) {
|
|
862
770
|
_beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
|
|
@@ -893,22 +801,6 @@
|
|
|
893
801
|
return value;
|
|
894
802
|
}
|
|
895
803
|
|
|
896
|
-
var _aiNamespace = null;
|
|
897
|
-
function _getExtensionNamespace() {
|
|
898
|
-
var target = getGlobalInst("Microsoft");
|
|
899
|
-
if (target) {
|
|
900
|
-
_aiNamespace = target["ApplicationInsights"];
|
|
901
|
-
}
|
|
902
|
-
return _aiNamespace;
|
|
903
|
-
}
|
|
904
|
-
function getDebugExt(config) {
|
|
905
|
-
var ns = _aiNamespace;
|
|
906
|
-
if (!ns && config.disableDbgExt !== true) {
|
|
907
|
-
ns = _aiNamespace || _getExtensionNamespace();
|
|
908
|
-
}
|
|
909
|
-
return ns ? ns["ChromeDbgExt"] : null;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
804
|
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
913
805
|
var AiUserActionablePrefix = "AI: ";
|
|
914
806
|
var AIInternalMessagePrefix = "AITR_";
|
|
@@ -1086,12 +978,6 @@
|
|
|
1086
978
|
catch (e) {
|
|
1087
979
|
}
|
|
1088
980
|
}
|
|
1089
|
-
function randomValue(maxValue) {
|
|
1090
|
-
if (maxValue > 0) {
|
|
1091
|
-
return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
|
|
1092
|
-
}
|
|
1093
|
-
return 0;
|
|
1094
|
-
}
|
|
1095
981
|
function random32(signed) {
|
|
1096
982
|
var value = 0;
|
|
1097
983
|
var c = getCrypto() || getMsCrypto();
|
|
@@ -1112,14 +998,6 @@
|
|
|
1112
998
|
}
|
|
1113
999
|
return value;
|
|
1114
1000
|
}
|
|
1115
|
-
function mwcRandomSeed(value) {
|
|
1116
|
-
if (!value) {
|
|
1117
|
-
_autoSeedMwc();
|
|
1118
|
-
}
|
|
1119
|
-
else {
|
|
1120
|
-
_mwcSeed(value);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
1001
|
function mwcRandom32(signed) {
|
|
1124
1002
|
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
1125
1003
|
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
@@ -1127,458 +1005,9 @@
|
|
|
1127
1005
|
if (!signed) {
|
|
1128
1006
|
value >>>= 0;
|
|
1129
1007
|
}
|
|
1130
|
-
return value;
|
|
1131
|
-
}
|
|
1132
|
-
function newId(maxLength) {
|
|
1133
|
-
if (maxLength === void 0) { maxLength = 22; }
|
|
1134
|
-
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1135
|
-
var number = random32() >>> 0;
|
|
1136
|
-
var chars = 0;
|
|
1137
|
-
var result = STR_EMPTY;
|
|
1138
|
-
while (result[_DYN_LENGTH$1 ] < maxLength) {
|
|
1139
|
-
chars++;
|
|
1140
|
-
result += base64chars.charAt(number & 0x3F);
|
|
1141
|
-
number >>>= 6;
|
|
1142
|
-
if (chars === 5) {
|
|
1143
|
-
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1144
|
-
chars = 0;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
return result;
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
var _objDefineProperty = ObjDefineProperty;
|
|
1151
|
-
var version = "3.0.0-beta.2208-03";
|
|
1152
|
-
var instanceName = "." + newId(6);
|
|
1153
|
-
var _dataUid = 0;
|
|
1154
|
-
function _createAccessor(target, prop, value) {
|
|
1155
|
-
if (_objDefineProperty) {
|
|
1156
|
-
try {
|
|
1157
|
-
_objDefineProperty(target, prop, {
|
|
1158
|
-
value: value,
|
|
1159
|
-
enumerable: false,
|
|
1160
|
-
configurable: true
|
|
1161
|
-
});
|
|
1162
|
-
return true;
|
|
1163
|
-
}
|
|
1164
|
-
catch (e) {
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
return false;
|
|
1168
|
-
}
|
|
1169
|
-
function _canAcceptData(target) {
|
|
1170
|
-
return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]);
|
|
1171
|
-
}
|
|
1172
|
-
function _getCache(data, target) {
|
|
1173
|
-
var theCache = target[data.id];
|
|
1174
|
-
if (!theCache) {
|
|
1175
|
-
theCache = {};
|
|
1176
|
-
try {
|
|
1177
|
-
if (_canAcceptData(target)) {
|
|
1178
|
-
if (!_createAccessor(target, data.id, theCache)) {
|
|
1179
|
-
target[data.id] = theCache;
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
catch (e) {
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
return theCache;
|
|
1187
|
-
}
|
|
1188
|
-
function createUniqueNamespace(name, includeVersion) {
|
|
1189
|
-
if (includeVersion === void 0) { includeVersion = false; }
|
|
1190
|
-
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName);
|
|
1191
|
-
}
|
|
1192
|
-
function createElmNodeData(name) {
|
|
1193
|
-
var data = {
|
|
1194
|
-
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version),
|
|
1195
|
-
accept: function (target) {
|
|
1196
|
-
return _canAcceptData(target);
|
|
1197
|
-
},
|
|
1198
|
-
get: function (target, name, defValue, addDefault) {
|
|
1199
|
-
var theCache = target[data.id];
|
|
1200
|
-
if (!theCache) {
|
|
1201
|
-
if (addDefault) {
|
|
1202
|
-
theCache = _getCache(data, target);
|
|
1203
|
-
theCache[normalizeJsName(name)] = defValue;
|
|
1204
|
-
}
|
|
1205
|
-
return defValue;
|
|
1206
|
-
}
|
|
1207
|
-
return theCache[normalizeJsName(name)];
|
|
1208
|
-
},
|
|
1209
|
-
kill: function (target, name) {
|
|
1210
|
-
if (target && target[name]) {
|
|
1211
|
-
try {
|
|
1212
|
-
delete target[name];
|
|
1213
|
-
}
|
|
1214
|
-
catch (e) {
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
};
|
|
1219
|
-
return data;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
var strToGMTString = "toGMTString";
|
|
1223
|
-
var strToUTCString = "toUTCString";
|
|
1224
|
-
var strCookie = "cookie";
|
|
1225
|
-
var strExpires = "expires";
|
|
1226
|
-
var strEnabled = "enabled";
|
|
1227
|
-
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
1228
|
-
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
1229
|
-
var strConfigCookieMgr = "_ckMgr";
|
|
1230
|
-
var _supportsCookies = null;
|
|
1231
|
-
var _allowUaSameSite = null;
|
|
1232
|
-
var _parsedCookieValue = null;
|
|
1233
|
-
var _doc = getDocument();
|
|
1234
|
-
var _cookieCache = {};
|
|
1235
|
-
var _globalCookieConfig = {};
|
|
1236
|
-
function _gblCookieMgr(config, logger) {
|
|
1237
|
-
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
1238
|
-
if (!inst) {
|
|
1239
|
-
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
1240
|
-
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
1241
|
-
}
|
|
1242
|
-
return inst;
|
|
1243
|
-
}
|
|
1244
|
-
function _isMgrEnabled(cookieMgr) {
|
|
1245
|
-
if (cookieMgr) {
|
|
1246
|
-
return cookieMgr.isEnabled();
|
|
1247
|
-
}
|
|
1248
|
-
return true;
|
|
1249
|
-
}
|
|
1250
|
-
function _createCookieMgrConfig(rootConfig) {
|
|
1251
|
-
var cookieMgrCfg = rootConfig[_DYN_COOKIE_CFG ] = rootConfig[_DYN_COOKIE_CFG ] || {};
|
|
1252
|
-
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
|
1253
|
-
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
|
1254
|
-
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
|
1255
|
-
var cookieEnabled = void 0;
|
|
1256
|
-
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
1257
|
-
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
1258
|
-
}
|
|
1259
|
-
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
1260
|
-
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
1261
|
-
}
|
|
1262
|
-
cookieMgrCfg[strEnabled] = cookieEnabled;
|
|
1263
|
-
}
|
|
1264
|
-
return cookieMgrCfg;
|
|
1265
|
-
}
|
|
1266
|
-
function createCookieMgr(rootConfig, logger) {
|
|
1267
|
-
var _a;
|
|
1268
|
-
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
|
1269
|
-
var _path = cookieMgrConfig.path || "/";
|
|
1270
|
-
var _domain = cookieMgrConfig.domain;
|
|
1271
|
-
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
|
1272
|
-
var cookieMgr = (_a = {
|
|
1273
|
-
isEnabled: function () {
|
|
1274
|
-
var enabled = _enabled && areCookiesSupported(logger);
|
|
1275
|
-
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
1276
|
-
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
1277
|
-
enabled = _isMgrEnabled(gblManager);
|
|
1278
|
-
}
|
|
1279
|
-
return enabled;
|
|
1280
|
-
}
|
|
1281
|
-
},
|
|
1282
|
-
_a[_DYN_SET_ENABLED ] = function (value) {
|
|
1283
|
-
_enabled = value !== false;
|
|
1284
|
-
},
|
|
1285
|
-
_a.set = function (name, value, maxAgeSec, domain, path) {
|
|
1286
|
-
var result = false;
|
|
1287
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
1288
|
-
var values = {};
|
|
1289
|
-
var theValue = strTrim(value || STR_EMPTY);
|
|
1290
|
-
var idx = theValue[_DYN_INDEX_OF$1 ](";");
|
|
1291
|
-
if (idx !== -1) {
|
|
1292
|
-
theValue = strTrim(value[_DYN_SUBSTRING$1 ](0, idx));
|
|
1293
|
-
values = _extractParts(value[_DYN_SUBSTRING$1 ](idx + 1));
|
|
1294
|
-
}
|
|
1295
|
-
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
|
1296
|
-
if (!isNullOrUndefined(maxAgeSec)) {
|
|
1297
|
-
var _isIE = isIE();
|
|
1298
|
-
if (isUndefined(values[strExpires])) {
|
|
1299
|
-
var nowMs = dateNow();
|
|
1300
|
-
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
1301
|
-
if (expireMs > 0) {
|
|
1302
|
-
var expiry = new Date();
|
|
1303
|
-
expiry.setTime(expireMs);
|
|
1304
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
if (!_isIE) {
|
|
1308
|
-
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
var location_1 = getLocation();
|
|
1312
|
-
if (location_1 && location_1.protocol === "https:") {
|
|
1313
|
-
setValue(values, "secure", null, null, isUndefined);
|
|
1314
|
-
if (_allowUaSameSite === null) {
|
|
1315
|
-
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
|
|
1316
|
-
}
|
|
1317
|
-
if (_allowUaSameSite) {
|
|
1318
|
-
setValue(values, "SameSite", "None", null, isUndefined);
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
setValue(values, "path", path || _path, null, isUndefined);
|
|
1322
|
-
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
1323
|
-
setCookieFn(name, _formatCookieValue(theValue, values));
|
|
1324
|
-
result = true;
|
|
1325
|
-
}
|
|
1326
|
-
return result;
|
|
1327
|
-
},
|
|
1328
|
-
_a.get = function (name) {
|
|
1329
|
-
var value = STR_EMPTY;
|
|
1330
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
1331
|
-
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1332
|
-
}
|
|
1333
|
-
return value;
|
|
1334
|
-
},
|
|
1335
|
-
_a.del = function (name, path) {
|
|
1336
|
-
var result = false;
|
|
1337
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
1338
|
-
result = cookieMgr.purge(name, path);
|
|
1339
|
-
}
|
|
1340
|
-
return result;
|
|
1341
|
-
},
|
|
1342
|
-
_a.purge = function (name, path) {
|
|
1343
|
-
var _a;
|
|
1344
|
-
var result = false;
|
|
1345
|
-
if (areCookiesSupported(logger)) {
|
|
1346
|
-
var values = (_a = {},
|
|
1347
|
-
_a["path"] = path ? path : "/",
|
|
1348
|
-
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
1349
|
-
_a);
|
|
1350
|
-
if (!isIE()) {
|
|
1351
|
-
values["max-age"] = "0";
|
|
1352
|
-
}
|
|
1353
|
-
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1354
|
-
delCookie(name, _formatCookieValue(STR_EMPTY, values));
|
|
1355
|
-
result = true;
|
|
1356
|
-
}
|
|
1357
|
-
return result;
|
|
1358
|
-
},
|
|
1359
|
-
_a);
|
|
1360
|
-
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
1361
|
-
return cookieMgr;
|
|
1362
|
-
}
|
|
1363
|
-
function areCookiesSupported(logger) {
|
|
1364
|
-
if (_supportsCookies === null) {
|
|
1365
|
-
_supportsCookies = false;
|
|
1366
|
-
try {
|
|
1367
|
-
var doc = _doc || {};
|
|
1368
|
-
_supportsCookies = doc[strCookie] !== undefined;
|
|
1369
|
-
}
|
|
1370
|
-
catch (e) {
|
|
1371
|
-
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
return _supportsCookies;
|
|
1375
|
-
}
|
|
1376
|
-
function _extractParts(theValue) {
|
|
1377
|
-
var values = {};
|
|
1378
|
-
if (theValue && theValue[_DYN_LENGTH$1 ]) {
|
|
1379
|
-
var parts = strTrim(theValue)[_DYN_SPLIT$1 ](";");
|
|
1380
|
-
arrForEach(parts, function (thePart) {
|
|
1381
|
-
thePart = strTrim(thePart || STR_EMPTY);
|
|
1382
|
-
if (thePart) {
|
|
1383
|
-
var idx = thePart[_DYN_INDEX_OF$1 ]("=");
|
|
1384
|
-
if (idx === -1) {
|
|
1385
|
-
values[thePart] = null;
|
|
1386
|
-
}
|
|
1387
|
-
else {
|
|
1388
|
-
values[strTrim(thePart[_DYN_SUBSTRING$1 ](0, idx))] = strTrim(thePart[_DYN_SUBSTRING$1 ](idx + 1));
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
return values;
|
|
1394
|
-
}
|
|
1395
|
-
function _formatDate(theDate, func) {
|
|
1396
|
-
if (isFunction(theDate[func])) {
|
|
1397
|
-
return theDate[func]();
|
|
1398
|
-
}
|
|
1399
|
-
return null;
|
|
1400
|
-
}
|
|
1401
|
-
function _formatCookieValue(value, values) {
|
|
1402
|
-
var cookieValue = value || STR_EMPTY;
|
|
1403
|
-
objForEachKey(values, function (name, theValue) {
|
|
1404
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY);
|
|
1405
|
-
});
|
|
1406
|
-
return cookieValue;
|
|
1407
|
-
}
|
|
1408
|
-
function _getCookieValue(name) {
|
|
1409
|
-
var cookieValue = STR_EMPTY;
|
|
1410
|
-
if (_doc) {
|
|
1411
|
-
var theCookie = _doc[strCookie] || STR_EMPTY;
|
|
1412
|
-
if (_parsedCookieValue !== theCookie) {
|
|
1413
|
-
_cookieCache = _extractParts(theCookie);
|
|
1414
|
-
_parsedCookieValue = theCookie;
|
|
1415
|
-
}
|
|
1416
|
-
cookieValue = strTrim(_cookieCache[name] || STR_EMPTY);
|
|
1417
|
-
}
|
|
1418
|
-
return cookieValue;
|
|
1419
|
-
}
|
|
1420
|
-
function _setCookieValue(name, cookieValue) {
|
|
1421
|
-
if (_doc) {
|
|
1422
|
-
_doc[strCookie] = name + "=" + cookieValue;
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
function uaDisallowsSameSiteNone(userAgent) {
|
|
1426
|
-
if (!isString(userAgent)) {
|
|
1427
|
-
return false;
|
|
1428
|
-
}
|
|
1429
|
-
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
|
1430
|
-
return true;
|
|
1431
|
-
}
|
|
1432
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
1433
|
-
return true;
|
|
1434
|
-
}
|
|
1435
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
1436
|
-
return true;
|
|
1437
|
-
}
|
|
1438
|
-
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
1439
|
-
return true;
|
|
1440
|
-
}
|
|
1441
|
-
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
|
1442
|
-
return true;
|
|
1443
|
-
}
|
|
1444
|
-
if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) {
|
|
1445
|
-
return true;
|
|
1446
|
-
}
|
|
1447
|
-
return false;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
var strOnPrefix = "on";
|
|
1451
|
-
var strAttachEvent = "attachEvent";
|
|
1452
|
-
var strAddEventHelper = "addEventListener";
|
|
1453
|
-
var strEvents = "events";
|
|
1454
|
-
createUniqueNamespace("aiEvtPageHide");
|
|
1455
|
-
createUniqueNamespace("aiEvtPageShow");
|
|
1456
|
-
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
1457
|
-
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
1458
|
-
var _guid = 1;
|
|
1459
|
-
var elmNodeData = createElmNodeData("events");
|
|
1460
|
-
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
1461
|
-
function _normalizeNamespace(name) {
|
|
1462
|
-
if (name && name[_DYN_REPLACE ]) {
|
|
1463
|
-
return name.replace(/^\s*\.*|\.*\s*$/g, STR_EMPTY);
|
|
1464
|
-
}
|
|
1465
|
-
return name;
|
|
1466
|
-
}
|
|
1467
|
-
function _getEvtNamespace(eventName, evtNamespace) {
|
|
1468
|
-
var _a;
|
|
1469
|
-
if (evtNamespace) {
|
|
1470
|
-
var theNamespace_1 = STR_EMPTY;
|
|
1471
|
-
if (isArray(evtNamespace)) {
|
|
1472
|
-
theNamespace_1 = STR_EMPTY;
|
|
1473
|
-
arrForEach(evtNamespace, function (name) {
|
|
1474
|
-
name = _normalizeNamespace(name);
|
|
1475
|
-
if (name) {
|
|
1476
|
-
if (name[0] !== ".") {
|
|
1477
|
-
name = "." + name;
|
|
1478
|
-
}
|
|
1479
|
-
theNamespace_1 += name;
|
|
1480
|
-
}
|
|
1481
|
-
});
|
|
1482
|
-
}
|
|
1483
|
-
else {
|
|
1484
|
-
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
1485
|
-
}
|
|
1486
|
-
if (theNamespace_1) {
|
|
1487
|
-
if (theNamespace_1[0] !== ".") {
|
|
1488
|
-
theNamespace_1 = "." + theNamespace_1;
|
|
1489
|
-
}
|
|
1490
|
-
eventName = (eventName || STR_EMPTY) + theNamespace_1;
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []);
|
|
1494
|
-
return _a = {},
|
|
1495
|
-
_a[_DYN_TYPE ] = parsedEvent[1],
|
|
1496
|
-
_a.ns = ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT$1 ](".").sort()).join("."),
|
|
1497
|
-
_a;
|
|
1498
|
-
}
|
|
1499
|
-
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
1500
|
-
if (addDefault === void 0) { addDefault = true; }
|
|
1501
|
-
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
1502
|
-
var registeredEvents = aiEvts[evtName];
|
|
1503
|
-
if (!registeredEvents) {
|
|
1504
|
-
registeredEvents = aiEvts[evtName] = [];
|
|
1505
|
-
}
|
|
1506
|
-
return registeredEvents;
|
|
1507
|
-
}
|
|
1508
|
-
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
1509
|
-
var result = false;
|
|
1510
|
-
if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) {
|
|
1511
|
-
if (obj[strAddEventHelper]) {
|
|
1512
|
-
obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
1513
|
-
result = true;
|
|
1514
|
-
}
|
|
1515
|
-
else if (obj[strAttachEvent]) {
|
|
1516
|
-
obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
1517
|
-
result = true;
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
return result;
|
|
1521
|
-
}
|
|
1522
|
-
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
1523
|
-
var _a;
|
|
1524
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
1525
|
-
var result = false;
|
|
1526
|
-
if (target) {
|
|
1527
|
-
try {
|
|
1528
|
-
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
1529
|
-
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
1530
|
-
if (result && elmNodeData.accept(target)) {
|
|
1531
|
-
var registeredEvent = (_a = {
|
|
1532
|
-
guid: _guid++,
|
|
1533
|
-
evtName: evtName
|
|
1534
|
-
},
|
|
1535
|
-
_a[_DYN_HANDLER ] = handlerRef,
|
|
1536
|
-
_a.capture = useCapture,
|
|
1537
|
-
_a);
|
|
1538
|
-
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH ](registeredEvent);
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
catch (e) {
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
return result;
|
|
1545
|
-
}
|
|
1546
|
-
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
1547
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
1548
|
-
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
1549
|
-
}
|
|
1550
|
-
function addEventHandler(eventName, callback, evtNamespace) {
|
|
1551
|
-
var result = false;
|
|
1552
|
-
var w = getWindow();
|
|
1553
|
-
if (w) {
|
|
1554
|
-
result = eventOn(w, eventName, callback, evtNamespace);
|
|
1555
|
-
result = eventOn(w["body"], eventName, callback, evtNamespace) || result;
|
|
1556
|
-
}
|
|
1557
|
-
var doc = getDocument();
|
|
1558
|
-
if (doc) {
|
|
1559
|
-
result = eventOn(doc, eventName, callback, evtNamespace) || result;
|
|
1560
|
-
}
|
|
1561
|
-
return result;
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
var _cookieMgrs = null;
|
|
1565
|
-
var _canUseCookies;
|
|
1566
|
-
function newGuid() {
|
|
1567
|
-
function randomHexDigit() {
|
|
1568
|
-
return randomValue(15);
|
|
1569
|
-
}
|
|
1570
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[_DYN_REPLACE ](GuidRegex, function (c) {
|
|
1571
|
-
var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8);
|
|
1572
|
-
return v.toString(16);
|
|
1573
|
-
});
|
|
1574
|
-
}
|
|
1575
|
-
function perfNow() {
|
|
1576
|
-
var perf = getPerformance();
|
|
1577
|
-
if (perf && perf.now) {
|
|
1578
|
-
return perf.now();
|
|
1579
|
-
}
|
|
1580
|
-
return dateNow();
|
|
1008
|
+
return value;
|
|
1581
1009
|
}
|
|
1010
|
+
|
|
1582
1011
|
function generateW3CId() {
|
|
1583
1012
|
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
1584
1013
|
var oct = STR_EMPTY, tmp;
|
|
@@ -1597,84 +1026,6 @@
|
|
|
1597
1026
|
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
|
1598
1027
|
return oct[_DYN_SUBSTR ](0, 8) + oct[_DYN_SUBSTR ](9, 4) + "4" + oct[_DYN_SUBSTR ](13, 3) + clockSequenceHi + oct[_DYN_SUBSTR ](16, 3) + oct[_DYN_SUBSTR ](19, 12);
|
|
1599
1028
|
}
|
|
1600
|
-
var CoreUtils = {
|
|
1601
|
-
_canUseCookies: undefined,
|
|
1602
|
-
isTypeof: isTypeof,
|
|
1603
|
-
isUndefined: isUndefined,
|
|
1604
|
-
isNullOrUndefined: isNullOrUndefined,
|
|
1605
|
-
hasOwnProperty: hasOwnProperty,
|
|
1606
|
-
isFunction: isFunction,
|
|
1607
|
-
isObject: isObject,
|
|
1608
|
-
isDate: isDate,
|
|
1609
|
-
isArray: isArray,
|
|
1610
|
-
isError: isError,
|
|
1611
|
-
isString: isString,
|
|
1612
|
-
isNumber: isNumber,
|
|
1613
|
-
isBoolean: isBoolean,
|
|
1614
|
-
toISOString: toISOString,
|
|
1615
|
-
arrForEach: arrForEach,
|
|
1616
|
-
arrIndexOf: arrIndexOf,
|
|
1617
|
-
arrMap: arrMap,
|
|
1618
|
-
arrReduce: arrReduce,
|
|
1619
|
-
strTrim: strTrim,
|
|
1620
|
-
objCreate: objCreateFn,
|
|
1621
|
-
objKeys: objKeys,
|
|
1622
|
-
objDefineAccessors: objDefineAccessors,
|
|
1623
|
-
addEventHandler: addEventHandler,
|
|
1624
|
-
dateNow: dateNow,
|
|
1625
|
-
isIE: isIE,
|
|
1626
|
-
disableCookies: disableCookies,
|
|
1627
|
-
newGuid: newGuid,
|
|
1628
|
-
perfNow: perfNow,
|
|
1629
|
-
newId: newId,
|
|
1630
|
-
randomValue: randomValue,
|
|
1631
|
-
random32: random32,
|
|
1632
|
-
mwcRandomSeed: mwcRandomSeed,
|
|
1633
|
-
mwcRandom32: mwcRandom32,
|
|
1634
|
-
generateW3CId: generateW3CId
|
|
1635
|
-
};
|
|
1636
|
-
var GuidRegex = /[xy]/g;
|
|
1637
|
-
function _legacyCookieMgr(config, logger) {
|
|
1638
|
-
var cookieMgr = _gblCookieMgr(config, logger);
|
|
1639
|
-
var legacyCanUseCookies = CoreUtils._canUseCookies;
|
|
1640
|
-
if (_cookieMgrs === null) {
|
|
1641
|
-
_cookieMgrs = [];
|
|
1642
|
-
_canUseCookies = legacyCanUseCookies;
|
|
1643
|
-
objDefineAccessors(CoreUtils, "_canUseCookies", function () {
|
|
1644
|
-
return _canUseCookies;
|
|
1645
|
-
}, function (value) {
|
|
1646
|
-
_canUseCookies = value;
|
|
1647
|
-
arrForEach(_cookieMgrs, function (mgr) {
|
|
1648
|
-
mgr[_DYN_SET_ENABLED ](value);
|
|
1649
|
-
});
|
|
1650
|
-
});
|
|
1651
|
-
}
|
|
1652
|
-
if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) {
|
|
1653
|
-
_cookieMgrs[_DYN_PUSH ](cookieMgr);
|
|
1654
|
-
}
|
|
1655
|
-
if (isBoolean(legacyCanUseCookies)) {
|
|
1656
|
-
cookieMgr[_DYN_SET_ENABLED ](legacyCanUseCookies);
|
|
1657
|
-
}
|
|
1658
|
-
if (isBoolean(_canUseCookies)) {
|
|
1659
|
-
cookieMgr[_DYN_SET_ENABLED ](_canUseCookies);
|
|
1660
|
-
}
|
|
1661
|
-
return cookieMgr;
|
|
1662
|
-
}
|
|
1663
|
-
function disableCookies() {
|
|
1664
|
-
_legacyCookieMgr()[_DYN_SET_ENABLED ](false);
|
|
1665
|
-
}
|
|
1666
|
-
function canUseCookies(logger) {
|
|
1667
|
-
return _legacyCookieMgr(null, logger).isEnabled();
|
|
1668
|
-
}
|
|
1669
|
-
function getCookie(logger, name) {
|
|
1670
|
-
return _legacyCookieMgr(null, logger).get(name);
|
|
1671
|
-
}
|
|
1672
|
-
function setCookie(logger, name, value, domain) {
|
|
1673
|
-
_legacyCookieMgr(null, logger).set(name, value, null, domain);
|
|
1674
|
-
}
|
|
1675
|
-
function deleteCookie(logger, name) {
|
|
1676
|
-
return _legacyCookieMgr(null, logger).del(name);
|
|
1677
|
-
}
|
|
1678
1029
|
|
|
1679
1030
|
var TRACE_PARENT_REGEX = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(-[^\s]*)?$/;
|
|
1680
1031
|
var DEFAULT_VERSION = "00";
|
|
@@ -1792,20 +1143,17 @@
|
|
|
1792
1143
|
var strNotSpecified = "not_specified";
|
|
1793
1144
|
var strIkey = "iKey";
|
|
1794
1145
|
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
}
|
|
1807
|
-
return event;
|
|
1808
|
-
}
|
|
1146
|
+
var RequestHeaders = createValueMap({
|
|
1147
|
+
requestContextHeader: [0 , "Request-Context"],
|
|
1148
|
+
requestContextTargetKey: [1 , "appId"],
|
|
1149
|
+
requestContextAppIdFormat: [2 , "appId=cid-v1:"],
|
|
1150
|
+
requestIdHeader: [3 , "Request-Id"],
|
|
1151
|
+
traceParentHeader: [4 , "traceparent"],
|
|
1152
|
+
traceStateHeader: [5 , "tracestate"],
|
|
1153
|
+
sdkContextHeader: [6 , "Sdk-Context"],
|
|
1154
|
+
sdkContextHeaderAppIdRequest: [7 , "appId"],
|
|
1155
|
+
requestContextHeaderLowerCase: [8 , "request-context"]
|
|
1156
|
+
});
|
|
1809
1157
|
|
|
1810
1158
|
var _DYN_SPLIT = "split";
|
|
1811
1159
|
var _DYN_LENGTH = "length";
|
|
@@ -1825,230 +1173,21 @@
|
|
|
1825
1173
|
var _DYN_STRINGIFY = "stringify";
|
|
1826
1174
|
var _DYN_MESSAGE = "message";
|
|
1827
1175
|
var _DYN_SIZE_IN_BYTES = "sizeInBytes";
|
|
1828
|
-
var _DYN_TYPE_NAME = "typeName";
|
|
1829
|
-
var _DYN_SEVERITY_LEVEL = "severityLevel";
|
|
1830
|
-
var _DYN_PROBLEM_GROUP = "problemGroup";
|
|
1831
|
-
var _DYN_IS_MANUAL = "isManual";
|
|
1832
|
-
var _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface";
|
|
1833
|
-
var _DYN_HAS_FULL_STACK = "hasFullStack";
|
|
1834
|
-
var _DYN_LEVEL = "level";
|
|
1835
|
-
var _DYN_METHOD = "method";
|
|
1836
|
-
var _DYN_ASSEMBLY = "assembly";
|
|
1837
|
-
var _DYN_FILE_NAME = "fileName";
|
|
1838
|
-
var _DYN_LINE = "line";
|
|
1839
|
-
var _DYN_DURATION = "duration";
|
|
1840
|
-
var _DYN_RECEIVED_RESPONSE = "receivedResponse";
|
|
1841
|
-
var _DYN_SUBSTRING = "substring";
|
|
1842
|
-
var _DYN_SANITIZE_KEY_AND_ADD2 = "sanitizeKeyAndAddUniqueness";
|
|
1843
|
-
var _DYN_SANITIZE_EXCEPTION = "sanitizeException";
|
|
1844
|
-
var _DYN_SANITIZE_PROPERTIES = "sanitizeProperties";
|
|
1845
|
-
var _DYN_SANITIZE_MEASUREMENT3 = "sanitizeMeasurements";
|
|
1846
|
-
|
|
1847
|
-
var strEmpty = "";
|
|
1848
|
-
function stringToBoolOrDefault(str, defaultValue) {
|
|
1849
|
-
if (defaultValue === void 0) { defaultValue = false; }
|
|
1850
|
-
if (str === undefined || str === null) {
|
|
1851
|
-
return defaultValue;
|
|
1852
|
-
}
|
|
1853
|
-
return str.toString()[_DYN_TO_LOWER_CASE ]() === "true";
|
|
1854
|
-
}
|
|
1855
|
-
function msToTimeSpan(totalms) {
|
|
1856
|
-
if (isNaN(totalms) || totalms < 0) {
|
|
1857
|
-
totalms = 0;
|
|
1858
|
-
}
|
|
1859
|
-
totalms = Math.round(totalms);
|
|
1860
|
-
var ms = strEmpty + totalms % 1000;
|
|
1861
|
-
var sec = strEmpty + Math.floor(totalms / 1000) % 60;
|
|
1862
|
-
var min = strEmpty + Math.floor(totalms / (1000 * 60)) % 60;
|
|
1863
|
-
var hour = strEmpty + Math.floor(totalms / (1000 * 60 * 60)) % 24;
|
|
1864
|
-
var days = Math.floor(totalms / (1000 * 60 * 60 * 24));
|
|
1865
|
-
ms = ms[_DYN_LENGTH ] === 1 ? "00" + ms : ms[_DYN_LENGTH ] === 2 ? "0" + ms : ms;
|
|
1866
|
-
sec = sec[_DYN_LENGTH ] < 2 ? "0" + sec : sec;
|
|
1867
|
-
min = min[_DYN_LENGTH ] < 2 ? "0" + min : min;
|
|
1868
|
-
hour = hour[_DYN_LENGTH ] < 2 ? "0" + hour : hour;
|
|
1869
|
-
return (days > 0 ? days + "." : strEmpty) + hour + ":" + min + ":" + sec + "." + ms;
|
|
1870
|
-
}
|
|
1871
|
-
function getExtensionByName(extensions, identifier) {
|
|
1872
|
-
var extension = null;
|
|
1873
|
-
arrForEach(extensions, function (value) {
|
|
1874
|
-
if (value.identifier === identifier) {
|
|
1875
|
-
extension = value;
|
|
1876
|
-
return -1;
|
|
1877
|
-
}
|
|
1878
|
-
});
|
|
1879
|
-
return extension;
|
|
1880
|
-
}
|
|
1881
|
-
function isCrossOriginError(message, url, lineNumber, columnNumber, error) {
|
|
1882
|
-
return !error && isString(message) && (message === "Script error." || message === "Script error");
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
var RequestHeaders = createValueMap({
|
|
1886
|
-
requestContextHeader: [0 , "Request-Context"],
|
|
1887
|
-
requestContextTargetKey: [1 , "appId"],
|
|
1888
|
-
requestContextAppIdFormat: [2 , "appId=cid-v1:"],
|
|
1889
|
-
requestIdHeader: [3 , "Request-Id"],
|
|
1890
|
-
traceParentHeader: [4 , "traceparent"],
|
|
1891
|
-
traceStateHeader: [5 , "tracestate"],
|
|
1892
|
-
sdkContextHeader: [6 , "Sdk-Context"],
|
|
1893
|
-
sdkContextHeaderAppIdRequest: [7 , "appId"],
|
|
1894
|
-
requestContextHeaderLowerCase: [8 , "request-context"]
|
|
1895
|
-
});
|
|
1896
|
-
|
|
1897
|
-
var StorageType = createEnumStyle({
|
|
1898
|
-
LocalStorage: 0 ,
|
|
1899
|
-
SessionStorage: 1
|
|
1900
|
-
});
|
|
1901
|
-
var DistributedTracingModes = createEnumStyle({
|
|
1902
|
-
AI: 0 ,
|
|
1903
|
-
AI_AND_W3C: 1 ,
|
|
1904
|
-
W3C: 2
|
|
1905
|
-
});
|
|
1906
|
-
|
|
1907
|
-
var _canUseLocalStorage = undefined;
|
|
1908
|
-
var _canUseSessionStorage = undefined;
|
|
1909
|
-
function _getLocalStorageObject() {
|
|
1910
|
-
if (utlCanUseLocalStorage()) {
|
|
1911
|
-
return _getVerifiedStorageObject(StorageType.LocalStorage);
|
|
1912
|
-
}
|
|
1913
|
-
return null;
|
|
1914
|
-
}
|
|
1915
|
-
function _getVerifiedStorageObject(storageType) {
|
|
1916
|
-
try {
|
|
1917
|
-
if (isNullOrUndefined(getGlobal())) {
|
|
1918
|
-
return null;
|
|
1919
|
-
}
|
|
1920
|
-
var uid = (new Date)[_DYN_TO_STRING ]();
|
|
1921
|
-
var storage = getGlobalInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage");
|
|
1922
|
-
storage.setItem(uid, uid);
|
|
1923
|
-
var fail = storage.getItem(uid) !== uid;
|
|
1924
|
-
storage[_DYN_REMOVE_ITEM ](uid);
|
|
1925
|
-
if (!fail) {
|
|
1926
|
-
return storage;
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
catch (exception) {
|
|
1930
|
-
}
|
|
1931
|
-
return null;
|
|
1932
|
-
}
|
|
1933
|
-
function _getSessionStorageObject() {
|
|
1934
|
-
if (utlCanUseSessionStorage()) {
|
|
1935
|
-
return _getVerifiedStorageObject(StorageType.SessionStorage);
|
|
1936
|
-
}
|
|
1937
|
-
return null;
|
|
1938
|
-
}
|
|
1939
|
-
function utlDisableStorage() {
|
|
1940
|
-
_canUseLocalStorage = false;
|
|
1941
|
-
_canUseSessionStorage = false;
|
|
1942
|
-
}
|
|
1943
|
-
function utlEnableStorage() {
|
|
1944
|
-
_canUseLocalStorage = utlCanUseLocalStorage(true);
|
|
1945
|
-
_canUseSessionStorage = utlCanUseSessionStorage(true);
|
|
1946
|
-
}
|
|
1947
|
-
function utlCanUseLocalStorage(reset) {
|
|
1948
|
-
if (reset || _canUseLocalStorage === undefined) {
|
|
1949
|
-
_canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
|
|
1950
|
-
}
|
|
1951
|
-
return _canUseLocalStorage;
|
|
1952
|
-
}
|
|
1953
|
-
function utlGetLocalStorage(logger, name) {
|
|
1954
|
-
var storage = _getLocalStorageObject();
|
|
1955
|
-
if (storage !== null) {
|
|
1956
|
-
try {
|
|
1957
|
-
return storage.getItem(name);
|
|
1958
|
-
}
|
|
1959
|
-
catch (e) {
|
|
1960
|
-
_canUseLocalStorage = false;
|
|
1961
|
-
_throwInternal(logger, 2 , 1 , "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
return null;
|
|
1965
|
-
}
|
|
1966
|
-
function utlSetLocalStorage(logger, name, data) {
|
|
1967
|
-
var storage = _getLocalStorageObject();
|
|
1968
|
-
if (storage !== null) {
|
|
1969
|
-
try {
|
|
1970
|
-
storage.setItem(name, data);
|
|
1971
|
-
return true;
|
|
1972
|
-
}
|
|
1973
|
-
catch (e) {
|
|
1974
|
-
_canUseLocalStorage = false;
|
|
1975
|
-
_throwInternal(logger, 2 , 3 , "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
return false;
|
|
1979
|
-
}
|
|
1980
|
-
function utlRemoveStorage(logger, name) {
|
|
1981
|
-
var storage = _getLocalStorageObject();
|
|
1982
|
-
if (storage !== null) {
|
|
1983
|
-
try {
|
|
1984
|
-
storage[_DYN_REMOVE_ITEM ](name);
|
|
1985
|
-
return true;
|
|
1986
|
-
}
|
|
1987
|
-
catch (e) {
|
|
1988
|
-
_canUseLocalStorage = false;
|
|
1989
|
-
_throwInternal(logger, 2 , 5 , "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
return false;
|
|
1993
|
-
}
|
|
1994
|
-
function utlCanUseSessionStorage(reset) {
|
|
1995
|
-
if (reset || _canUseSessionStorage === undefined) {
|
|
1996
|
-
_canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
|
|
1997
|
-
}
|
|
1998
|
-
return _canUseSessionStorage;
|
|
1999
|
-
}
|
|
2000
|
-
function utlGetSessionStorageKeys() {
|
|
2001
|
-
var keys = [];
|
|
2002
|
-
if (utlCanUseSessionStorage()) {
|
|
2003
|
-
objForEachKey(getGlobalInst("sessionStorage"), function (key) {
|
|
2004
|
-
keys.push(key);
|
|
2005
|
-
});
|
|
2006
|
-
}
|
|
2007
|
-
return keys;
|
|
2008
|
-
}
|
|
2009
|
-
function utlGetSessionStorage(logger, name) {
|
|
2010
|
-
var storage = _getSessionStorageObject();
|
|
2011
|
-
if (storage !== null) {
|
|
2012
|
-
try {
|
|
2013
|
-
return storage.getItem(name);
|
|
2014
|
-
}
|
|
2015
|
-
catch (e) {
|
|
2016
|
-
_canUseSessionStorage = false;
|
|
2017
|
-
_throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
return null;
|
|
2021
|
-
}
|
|
2022
|
-
function utlSetSessionStorage(logger, name, data) {
|
|
2023
|
-
var storage = _getSessionStorageObject();
|
|
2024
|
-
if (storage !== null) {
|
|
2025
|
-
try {
|
|
2026
|
-
storage.setItem(name, data);
|
|
2027
|
-
return true;
|
|
2028
|
-
}
|
|
2029
|
-
catch (e) {
|
|
2030
|
-
_canUseSessionStorage = false;
|
|
2031
|
-
_throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
return false;
|
|
2035
|
-
}
|
|
2036
|
-
function utlRemoveSessionStorage(logger, name) {
|
|
2037
|
-
var storage = _getSessionStorageObject();
|
|
2038
|
-
if (storage !== null) {
|
|
2039
|
-
try {
|
|
2040
|
-
storage[_DYN_REMOVE_ITEM ](name);
|
|
2041
|
-
return true;
|
|
2042
|
-
}
|
|
2043
|
-
catch (e) {
|
|
2044
|
-
_canUseSessionStorage = false;
|
|
2045
|
-
_throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
return false;
|
|
2049
|
-
}
|
|
1176
|
+
var _DYN_TYPE_NAME = "typeName";
|
|
1177
|
+
var _DYN_SEVERITY_LEVEL = "severityLevel";
|
|
1178
|
+
var _DYN_PROBLEM_GROUP = "problemGroup";
|
|
1179
|
+
var _DYN_IS_MANUAL = "isManual";
|
|
1180
|
+
var _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface";
|
|
1181
|
+
var _DYN_HAS_FULL_STACK = "hasFullStack";
|
|
1182
|
+
var _DYN_LEVEL = "level";
|
|
1183
|
+
var _DYN_METHOD = "method";
|
|
1184
|
+
var _DYN_ASSEMBLY = "assembly";
|
|
1185
|
+
var _DYN_FILE_NAME = "fileName";
|
|
1186
|
+
var _DYN_LINE = "line";
|
|
1187
|
+
var _DYN_DURATION = "duration";
|
|
1188
|
+
var _DYN_RECEIVED_RESPONSE = "receivedResponse";
|
|
1189
|
+
var _DYN_SUBSTRING = "substring";
|
|
2050
1190
|
|
|
2051
|
-
var _a;
|
|
2052
1191
|
function dataSanitizeKeyAndAddUniqueness(logger, key, map) {
|
|
2053
1192
|
var origLength = key[_DYN_LENGTH ];
|
|
2054
1193
|
var field = dataSanitizeKey(logger, key);
|
|
@@ -2079,9 +1218,9 @@
|
|
|
2079
1218
|
var valueTrunc;
|
|
2080
1219
|
if (value) {
|
|
2081
1220
|
maxLength = maxLength ? maxLength : 1024 ;
|
|
2082
|
-
value = strTrim(value);
|
|
2083
|
-
if (value
|
|
2084
|
-
valueTrunc = value[
|
|
1221
|
+
value = strTrim(value[_DYN_TO_STRING ]());
|
|
1222
|
+
if (value[_DYN_LENGTH ] > maxLength) {
|
|
1223
|
+
valueTrunc = value[_DYN_SUBSTRING ](0, maxLength);
|
|
2085
1224
|
_throwInternal(logger, 2 , 61 , "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
|
|
2086
1225
|
}
|
|
2087
1226
|
}
|
|
@@ -2148,7 +1287,7 @@
|
|
|
2148
1287
|
function dataSanitizeInput(logger, input, maxLength, _msgId) {
|
|
2149
1288
|
var inputTrunc;
|
|
2150
1289
|
if (input) {
|
|
2151
|
-
input = strTrim(input);
|
|
1290
|
+
input = strTrim(input[_DYN_TO_STRING ]());
|
|
2152
1291
|
if (input[_DYN_LENGTH ] > maxLength) {
|
|
2153
1292
|
inputTrunc = input[_DYN_SUBSTRING ](0, maxLength);
|
|
2154
1293
|
_throwInternal(logger, 2 , _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
|
|
@@ -2160,28 +1299,6 @@
|
|
|
2160
1299
|
var s = "00" + num;
|
|
2161
1300
|
return s.substr(s[_DYN_LENGTH ] - 3);
|
|
2162
1301
|
}
|
|
2163
|
-
var DataSanitizer = (_a = {
|
|
2164
|
-
MAX_NAME_LENGTH: 150 ,
|
|
2165
|
-
MAX_ID_LENGTH: 128 ,
|
|
2166
|
-
MAX_PROPERTY_LENGTH: 8192 ,
|
|
2167
|
-
MAX_STRING_LENGTH: 1024 ,
|
|
2168
|
-
MAX_URL_LENGTH: 2048 ,
|
|
2169
|
-
MAX_MESSAGE_LENGTH: 32768 ,
|
|
2170
|
-
MAX_EXCEPTION_LENGTH: 32768
|
|
2171
|
-
},
|
|
2172
|
-
_a[_DYN_SANITIZE_KEY_AND_ADD2 ] = dataSanitizeKeyAndAddUniqueness,
|
|
2173
|
-
_a.sanitizeKey = dataSanitizeKey,
|
|
2174
|
-
_a.sanitizeString = dataSanitizeString,
|
|
2175
|
-
_a.sanitizeUrl = dataSanitizeUrl,
|
|
2176
|
-
_a.sanitizeMessage = dataSanitizeMessage,
|
|
2177
|
-
_a[_DYN_SANITIZE_EXCEPTION ] = dataSanitizeException,
|
|
2178
|
-
_a[_DYN_SANITIZE_PROPERTIES ] = dataSanitizeProperties,
|
|
2179
|
-
_a[_DYN_SANITIZE_MEASUREMENT3 ] = dataSanitizeMeasurements,
|
|
2180
|
-
_a.sanitizeId = dataSanitizeId,
|
|
2181
|
-
_a.sanitizeInput = dataSanitizeInput,
|
|
2182
|
-
_a.padNumber = dsPadNumber,
|
|
2183
|
-
_a.trim = strTrim,
|
|
2184
|
-
_a);
|
|
2185
1302
|
|
|
2186
1303
|
var _document = getDocument() || {};
|
|
2187
1304
|
var _htmlAnchorIdx = 0;
|
|
@@ -2263,120 +1380,76 @@
|
|
|
2263
1380
|
"https://breeze.aimon.applicationinsights.io" + DEFAULT_BREEZE_PATH,
|
|
2264
1381
|
"https://dc-int.services.visualstudio.com" + DEFAULT_BREEZE_PATH
|
|
2265
1382
|
];
|
|
1383
|
+
var _correlationIdPrefix = "cid-v1:";
|
|
2266
1384
|
function isInternalApplicationInsightsEndpoint(endpointUrl) {
|
|
2267
1385
|
return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE ]()) !== -1;
|
|
2268
1386
|
}
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
removeSessionStorage: utlRemoveSessionStorage,
|
|
2283
|
-
disableCookies: disableCookies,
|
|
2284
|
-
canUseCookies: canUseCookies,
|
|
2285
|
-
disallowsSameSiteNone: uaDisallowsSameSiteNone,
|
|
2286
|
-
setCookie: setCookie,
|
|
2287
|
-
stringToBoolOrDefault: stringToBoolOrDefault,
|
|
2288
|
-
getCookie: getCookie,
|
|
2289
|
-
deleteCookie: deleteCookie,
|
|
2290
|
-
trim: strTrim,
|
|
2291
|
-
newId: newId,
|
|
2292
|
-
random32: function () {
|
|
2293
|
-
return random32(true);
|
|
2294
|
-
},
|
|
2295
|
-
generateW3CId: generateW3CId,
|
|
2296
|
-
isArray: isArray,
|
|
2297
|
-
isError: isError,
|
|
2298
|
-
isDate: isDate,
|
|
2299
|
-
toISOStringForIE8: toISOString,
|
|
2300
|
-
getIEVersion: getIEVersion,
|
|
2301
|
-
msToTimeSpan: msToTimeSpan,
|
|
2302
|
-
isCrossOriginError: isCrossOriginError,
|
|
2303
|
-
dump: dumpObj,
|
|
2304
|
-
getExceptionName: getExceptionName,
|
|
2305
|
-
addEventHandler: attachEvent,
|
|
2306
|
-
IsBeaconApiSupported: isBeaconsSupported,
|
|
2307
|
-
getExtension: getExtensionByName
|
|
2308
|
-
};
|
|
2309
|
-
var UrlHelper = {
|
|
2310
|
-
parseUrl: urlParseUrl,
|
|
2311
|
-
getAbsoluteUrl: urlGetAbsoluteUrl,
|
|
2312
|
-
getPathName: urlGetPathName,
|
|
2313
|
-
getCompleteUrl: urlGetCompleteUrl,
|
|
2314
|
-
parseHost: urlParseHost,
|
|
2315
|
-
parseFullHost: urlParseFullHost
|
|
2316
|
-
};
|
|
2317
|
-
var CorrelationIdHelper = {
|
|
2318
|
-
correlationIdPrefix: "cid-v1:",
|
|
2319
|
-
canIncludeCorrelationHeader: function (config, requestUrl, currentHost) {
|
|
2320
|
-
if (!requestUrl || (config && config.disableCorrelationHeaders)) {
|
|
2321
|
-
return false;
|
|
2322
|
-
}
|
|
2323
|
-
if (config && config[_DYN_CORRELATION_HEADER_E0 ]) {
|
|
2324
|
-
for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH ]; i++) {
|
|
2325
|
-
if (config[_DYN_CORRELATION_HEADER_E0 ][i].test(requestUrl)) {
|
|
2326
|
-
return false;
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE ]();
|
|
2331
|
-
if (requestHost && (requestHost[_DYN_INDEX_OF ](":443") !== -1 || requestHost[_DYN_INDEX_OF ](":80") !== -1)) {
|
|
2332
|
-
requestHost = (urlParseFullHost(requestUrl, true) || "")[_DYN_TO_LOWER_CASE ]();
|
|
2333
|
-
}
|
|
2334
|
-
if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) {
|
|
2335
|
-
return false;
|
|
2336
|
-
}
|
|
2337
|
-
var includedDomains = config && config.correlationHeaderDomains;
|
|
2338
|
-
if (includedDomains) {
|
|
2339
|
-
var matchExists_1;
|
|
2340
|
-
arrForEach(includedDomains, function (domain) {
|
|
2341
|
-
var regex = new RegExp(domain.toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*"));
|
|
2342
|
-
matchExists_1 = matchExists_1 || regex.test(requestHost);
|
|
2343
|
-
});
|
|
2344
|
-
if (!matchExists_1) {
|
|
1387
|
+
function correlationIdSetPrefix(prefix) {
|
|
1388
|
+
_correlationIdPrefix = prefix;
|
|
1389
|
+
}
|
|
1390
|
+
function correlationIdGetPrefix() {
|
|
1391
|
+
return _correlationIdPrefix;
|
|
1392
|
+
}
|
|
1393
|
+
function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHost) {
|
|
1394
|
+
if (!requestUrl || (config && config.disableCorrelationHeaders)) {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
if (config && config[_DYN_CORRELATION_HEADER_E0 ]) {
|
|
1398
|
+
for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH ]; i++) {
|
|
1399
|
+
if (config[_DYN_CORRELATION_HEADER_E0 ][i].test(requestUrl)) {
|
|
2345
1400
|
return false;
|
|
2346
1401
|
}
|
|
2347
1402
|
}
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
1403
|
+
}
|
|
1404
|
+
var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE ]();
|
|
1405
|
+
if (requestHost && (requestHost[_DYN_INDEX_OF ](":443") !== -1 || requestHost[_DYN_INDEX_OF ](":80") !== -1)) {
|
|
1406
|
+
requestHost = (urlParseFullHost(requestUrl, true) || "")[_DYN_TO_LOWER_CASE ]();
|
|
1407
|
+
}
|
|
1408
|
+
if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) {
|
|
1409
|
+
return false;
|
|
1410
|
+
}
|
|
1411
|
+
var includedDomains = config && config.correlationHeaderDomains;
|
|
1412
|
+
if (includedDomains) {
|
|
1413
|
+
var matchExists_1;
|
|
1414
|
+
arrForEach(includedDomains, function (domain) {
|
|
1415
|
+
var regex = new RegExp(domain.toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*"));
|
|
1416
|
+
matchExists_1 = matchExists_1 || regex.test(requestHost);
|
|
1417
|
+
});
|
|
1418
|
+
if (!matchExists_1) {
|
|
1419
|
+
return false;
|
|
2351
1420
|
}
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
1421
|
+
}
|
|
1422
|
+
var excludedDomains = config && config.correlationHeaderExcludedDomains;
|
|
1423
|
+
if (!excludedDomains || excludedDomains[_DYN_LENGTH ] === 0) {
|
|
1424
|
+
return true;
|
|
1425
|
+
}
|
|
1426
|
+
for (var i = 0; i < excludedDomains[_DYN_LENGTH ]; i++) {
|
|
1427
|
+
var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*"));
|
|
1428
|
+
if (regex.test(requestHost)) {
|
|
1429
|
+
return false;
|
|
2357
1430
|
}
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
1431
|
+
}
|
|
1432
|
+
return requestHost && requestHost[_DYN_LENGTH ] > 0;
|
|
1433
|
+
}
|
|
1434
|
+
function correlationIdGetCorrelationContext(responseHeader) {
|
|
1435
|
+
if (responseHeader) {
|
|
1436
|
+
var correlationId = correlationIdGetCorrelationContextValue(responseHeader, RequestHeaders[1 ]);
|
|
1437
|
+
if (correlationId && correlationId !== _correlationIdPrefix) {
|
|
1438
|
+
return correlationId;
|
|
2366
1439
|
}
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
function correlationIdGetCorrelationContextValue(responseHeader, key) {
|
|
1443
|
+
if (responseHeader) {
|
|
1444
|
+
var keyValues = responseHeader[_DYN_SPLIT ](",");
|
|
1445
|
+
for (var i = 0; i < keyValues[_DYN_LENGTH ]; ++i) {
|
|
1446
|
+
var keyValue = keyValues[i][_DYN_SPLIT ]("=");
|
|
1447
|
+
if (keyValue[_DYN_LENGTH ] === 2 && keyValue[0] === key) {
|
|
1448
|
+
return keyValue[1];
|
|
2376
1449
|
}
|
|
2377
1450
|
}
|
|
2378
1451
|
}
|
|
2379
|
-
}
|
|
1452
|
+
}
|
|
2380
1453
|
function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) {
|
|
2381
1454
|
var target, name = commandName, data = commandName;
|
|
2382
1455
|
if (absoluteUrl && absoluteUrl[_DYN_LENGTH ] > 0) {
|
|
@@ -2423,10 +1496,6 @@
|
|
|
2423
1496
|
}
|
|
2424
1497
|
return result;
|
|
2425
1498
|
}
|
|
2426
|
-
var DateTimeUtils = {
|
|
2427
|
-
Now: dateTimeUtilsNow,
|
|
2428
|
-
GetDuration: dateTimeUtilsDuration
|
|
2429
|
-
};
|
|
2430
1499
|
function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) {
|
|
2431
1500
|
var trace = telemetryTrace || {};
|
|
2432
1501
|
return {
|
|
@@ -3039,6 +2108,44 @@
|
|
|
3039
2108
|
return Metric;
|
|
3040
2109
|
}());
|
|
3041
2110
|
|
|
2111
|
+
var strEmpty = "";
|
|
2112
|
+
function stringToBoolOrDefault(str, defaultValue) {
|
|
2113
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
2114
|
+
if (str === undefined || str === null) {
|
|
2115
|
+
return defaultValue;
|
|
2116
|
+
}
|
|
2117
|
+
return str.toString()[_DYN_TO_LOWER_CASE ]() === "true";
|
|
2118
|
+
}
|
|
2119
|
+
function msToTimeSpan(totalms) {
|
|
2120
|
+
if (isNaN(totalms) || totalms < 0) {
|
|
2121
|
+
totalms = 0;
|
|
2122
|
+
}
|
|
2123
|
+
totalms = Math.round(totalms);
|
|
2124
|
+
var ms = strEmpty + totalms % 1000;
|
|
2125
|
+
var sec = strEmpty + Math.floor(totalms / 1000) % 60;
|
|
2126
|
+
var min = strEmpty + Math.floor(totalms / (1000 * 60)) % 60;
|
|
2127
|
+
var hour = strEmpty + Math.floor(totalms / (1000 * 60 * 60)) % 24;
|
|
2128
|
+
var days = Math.floor(totalms / (1000 * 60 * 60 * 24));
|
|
2129
|
+
ms = ms[_DYN_LENGTH ] === 1 ? "00" + ms : ms[_DYN_LENGTH ] === 2 ? "0" + ms : ms;
|
|
2130
|
+
sec = sec[_DYN_LENGTH ] < 2 ? "0" + sec : sec;
|
|
2131
|
+
min = min[_DYN_LENGTH ] < 2 ? "0" + min : min;
|
|
2132
|
+
hour = hour[_DYN_LENGTH ] < 2 ? "0" + hour : hour;
|
|
2133
|
+
return (days > 0 ? days + "." : strEmpty) + hour + ":" + min + ":" + sec + "." + ms;
|
|
2134
|
+
}
|
|
2135
|
+
function getExtensionByName(extensions, identifier) {
|
|
2136
|
+
var extension = null;
|
|
2137
|
+
arrForEach(extensions, function (value) {
|
|
2138
|
+
if (value.identifier === identifier) {
|
|
2139
|
+
extension = value;
|
|
2140
|
+
return -1;
|
|
2141
|
+
}
|
|
2142
|
+
});
|
|
2143
|
+
return extension;
|
|
2144
|
+
}
|
|
2145
|
+
function isCrossOriginError(message, url, lineNumber, columnNumber, error) {
|
|
2146
|
+
return !error && isString(message) && (message === "Script error." || message === "Script error");
|
|
2147
|
+
}
|
|
2148
|
+
|
|
3042
2149
|
var PageView = /** @class */ (function () {
|
|
3043
2150
|
function PageView(logger, name, url, durationMs, properties, measurements, id) {
|
|
3044
2151
|
this.aiDataContract = {
|
|
@@ -3339,6 +2446,175 @@
|
|
|
3339
2446
|
};
|
|
3340
2447
|
var CtxTagKeys = new ContextTagKeys();
|
|
3341
2448
|
|
|
2449
|
+
var StorageType = createEnumStyle({
|
|
2450
|
+
LocalStorage: 0 ,
|
|
2451
|
+
SessionStorage: 1
|
|
2452
|
+
});
|
|
2453
|
+
var DistributedTracingModes = createEnumStyle({
|
|
2454
|
+
AI: 0 ,
|
|
2455
|
+
AI_AND_W3C: 1 ,
|
|
2456
|
+
W3C: 2
|
|
2457
|
+
});
|
|
2458
|
+
|
|
2459
|
+
function createDomEvent(eventName) {
|
|
2460
|
+
var event = null;
|
|
2461
|
+
if (isFunction(Event)) {
|
|
2462
|
+
event = new Event(eventName);
|
|
2463
|
+
}
|
|
2464
|
+
else {
|
|
2465
|
+
var doc = getDocument();
|
|
2466
|
+
if (doc && doc.createEvent) {
|
|
2467
|
+
event = doc.createEvent("Event");
|
|
2468
|
+
event.initEvent(eventName, true, true);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
return event;
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
var _canUseLocalStorage = undefined;
|
|
2475
|
+
var _canUseSessionStorage = undefined;
|
|
2476
|
+
function _getLocalStorageObject() {
|
|
2477
|
+
if (utlCanUseLocalStorage()) {
|
|
2478
|
+
return _getVerifiedStorageObject(StorageType.LocalStorage);
|
|
2479
|
+
}
|
|
2480
|
+
return null;
|
|
2481
|
+
}
|
|
2482
|
+
function _getVerifiedStorageObject(storageType) {
|
|
2483
|
+
try {
|
|
2484
|
+
if (isNullOrUndefined(getGlobal())) {
|
|
2485
|
+
return null;
|
|
2486
|
+
}
|
|
2487
|
+
var uid = (new Date)[_DYN_TO_STRING ]();
|
|
2488
|
+
var storage = getInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage");
|
|
2489
|
+
storage.setItem(uid, uid);
|
|
2490
|
+
var fail = storage.getItem(uid) !== uid;
|
|
2491
|
+
storage[_DYN_REMOVE_ITEM ](uid);
|
|
2492
|
+
if (!fail) {
|
|
2493
|
+
return storage;
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
catch (exception) {
|
|
2497
|
+
}
|
|
2498
|
+
return null;
|
|
2499
|
+
}
|
|
2500
|
+
function _getSessionStorageObject() {
|
|
2501
|
+
if (utlCanUseSessionStorage()) {
|
|
2502
|
+
return _getVerifiedStorageObject(StorageType.SessionStorage);
|
|
2503
|
+
}
|
|
2504
|
+
return null;
|
|
2505
|
+
}
|
|
2506
|
+
function utlDisableStorage() {
|
|
2507
|
+
_canUseLocalStorage = false;
|
|
2508
|
+
_canUseSessionStorage = false;
|
|
2509
|
+
}
|
|
2510
|
+
function utlEnableStorage() {
|
|
2511
|
+
_canUseLocalStorage = utlCanUseLocalStorage(true);
|
|
2512
|
+
_canUseSessionStorage = utlCanUseSessionStorage(true);
|
|
2513
|
+
}
|
|
2514
|
+
function utlCanUseLocalStorage(reset) {
|
|
2515
|
+
if (reset || _canUseLocalStorage === undefined) {
|
|
2516
|
+
_canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
|
|
2517
|
+
}
|
|
2518
|
+
return _canUseLocalStorage;
|
|
2519
|
+
}
|
|
2520
|
+
function utlGetLocalStorage(logger, name) {
|
|
2521
|
+
var storage = _getLocalStorageObject();
|
|
2522
|
+
if (storage !== null) {
|
|
2523
|
+
try {
|
|
2524
|
+
return storage.getItem(name);
|
|
2525
|
+
}
|
|
2526
|
+
catch (e) {
|
|
2527
|
+
_canUseLocalStorage = false;
|
|
2528
|
+
_throwInternal(logger, 2 , 1 , "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
return null;
|
|
2532
|
+
}
|
|
2533
|
+
function utlSetLocalStorage(logger, name, data) {
|
|
2534
|
+
var storage = _getLocalStorageObject();
|
|
2535
|
+
if (storage !== null) {
|
|
2536
|
+
try {
|
|
2537
|
+
storage.setItem(name, data);
|
|
2538
|
+
return true;
|
|
2539
|
+
}
|
|
2540
|
+
catch (e) {
|
|
2541
|
+
_canUseLocalStorage = false;
|
|
2542
|
+
_throwInternal(logger, 2 , 3 , "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
return false;
|
|
2546
|
+
}
|
|
2547
|
+
function utlRemoveStorage(logger, name) {
|
|
2548
|
+
var storage = _getLocalStorageObject();
|
|
2549
|
+
if (storage !== null) {
|
|
2550
|
+
try {
|
|
2551
|
+
storage[_DYN_REMOVE_ITEM ](name);
|
|
2552
|
+
return true;
|
|
2553
|
+
}
|
|
2554
|
+
catch (e) {
|
|
2555
|
+
_canUseLocalStorage = false;
|
|
2556
|
+
_throwInternal(logger, 2 , 5 , "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
return false;
|
|
2560
|
+
}
|
|
2561
|
+
function utlCanUseSessionStorage(reset) {
|
|
2562
|
+
if (reset || _canUseSessionStorage === undefined) {
|
|
2563
|
+
_canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
|
|
2564
|
+
}
|
|
2565
|
+
return _canUseSessionStorage;
|
|
2566
|
+
}
|
|
2567
|
+
function utlGetSessionStorageKeys() {
|
|
2568
|
+
var keys = [];
|
|
2569
|
+
if (utlCanUseSessionStorage()) {
|
|
2570
|
+
objForEachKey(getInst("sessionStorage"), function (key) {
|
|
2571
|
+
keys.push(key);
|
|
2572
|
+
});
|
|
2573
|
+
}
|
|
2574
|
+
return keys;
|
|
2575
|
+
}
|
|
2576
|
+
function utlGetSessionStorage(logger, name) {
|
|
2577
|
+
var storage = _getSessionStorageObject();
|
|
2578
|
+
if (storage !== null) {
|
|
2579
|
+
try {
|
|
2580
|
+
return storage.getItem(name);
|
|
2581
|
+
}
|
|
2582
|
+
catch (e) {
|
|
2583
|
+
_canUseSessionStorage = false;
|
|
2584
|
+
_throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
return null;
|
|
2588
|
+
}
|
|
2589
|
+
function utlSetSessionStorage(logger, name, data) {
|
|
2590
|
+
var storage = _getSessionStorageObject();
|
|
2591
|
+
if (storage !== null) {
|
|
2592
|
+
try {
|
|
2593
|
+
storage.setItem(name, data);
|
|
2594
|
+
return true;
|
|
2595
|
+
}
|
|
2596
|
+
catch (e) {
|
|
2597
|
+
_canUseSessionStorage = false;
|
|
2598
|
+
_throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
return false;
|
|
2602
|
+
}
|
|
2603
|
+
function utlRemoveSessionStorage(logger, name) {
|
|
2604
|
+
var storage = _getSessionStorageObject();
|
|
2605
|
+
if (storage !== null) {
|
|
2606
|
+
try {
|
|
2607
|
+
storage[_DYN_REMOVE_ITEM ](name);
|
|
2608
|
+
return true;
|
|
2609
|
+
}
|
|
2610
|
+
catch (e) {
|
|
2611
|
+
_canUseSessionStorage = false;
|
|
2612
|
+
_throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
return false;
|
|
2616
|
+
}
|
|
2617
|
+
|
|
3342
2618
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
3343
2619
|
var BreezeChannelIdentifier = "AppInsightsChannelPlugin";
|
|
3344
2620
|
var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics";
|
|
@@ -3348,13 +2624,10 @@
|
|
|
3348
2624
|
exports.ConfigurationManager = ConfigurationManager;
|
|
3349
2625
|
exports.ConnectionStringParser = ConnectionStringParser;
|
|
3350
2626
|
exports.ContextTagKeys = ContextTagKeys;
|
|
3351
|
-
exports.CorrelationIdHelper = CorrelationIdHelper;
|
|
3352
2627
|
exports.CtxTagKeys = CtxTagKeys;
|
|
3353
2628
|
exports.DEFAULT_BREEZE_ENDPOINT = DEFAULT_BREEZE_ENDPOINT;
|
|
3354
2629
|
exports.DEFAULT_BREEZE_PATH = DEFAULT_BREEZE_PATH;
|
|
3355
2630
|
exports.Data = Data;
|
|
3356
|
-
exports.DataSanitizer = DataSanitizer;
|
|
3357
|
-
exports.DateTimeUtils = DateTimeUtils;
|
|
3358
2631
|
exports.DisabledPropertyName = DisabledPropertyName;
|
|
3359
2632
|
exports.DistributedTracingModes = DistributedTracingModes;
|
|
3360
2633
|
exports.Envelope = Envelope;
|
|
@@ -3373,8 +2646,11 @@
|
|
|
3373
2646
|
exports.SeverityLevel = SeverityLevel;
|
|
3374
2647
|
exports.TelemetryItemCreator = TelemetryItemCreator;
|
|
3375
2648
|
exports.Trace = Trace;
|
|
3376
|
-
exports.
|
|
3377
|
-
exports.
|
|
2649
|
+
exports.correlationIdCanIncludeCorrelationHeader = correlationIdCanIncludeCorrelationHeader;
|
|
2650
|
+
exports.correlationIdGetCorrelationContext = correlationIdGetCorrelationContext;
|
|
2651
|
+
exports.correlationIdGetCorrelationContextValue = correlationIdGetCorrelationContextValue;
|
|
2652
|
+
exports.correlationIdGetPrefix = correlationIdGetPrefix;
|
|
2653
|
+
exports.correlationIdSetPrefix = correlationIdSetPrefix;
|
|
3378
2654
|
exports.createDistributedTraceContextFromTrace = createDistributedTraceContextFromTrace;
|
|
3379
2655
|
exports.createDomEvent = createDomEvent;
|
|
3380
2656
|
exports.createTelemetryItem = createTelemetryItem;
|
|
@@ -3425,7 +2701,7 @@
|
|
|
3425
2701
|
exports.utlSetLocalStorage = utlSetLocalStorage;
|
|
3426
2702
|
exports.utlSetSessionStorage = utlSetSessionStorage;
|
|
3427
2703
|
|
|
3428
|
-
|
|
2704
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3429
2705
|
|
|
3430
2706
|
}));
|
|
3431
2707
|
//# sourceMappingURL=applicationinsights-common.js.map
|