@microsoft/1ds-core-js 3.1.6 → 3.1.7
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/bundle/ms.core-3.1.7.gbl.js +3589 -0
- package/bundle/ms.core-3.1.7.gbl.js.map +1 -0
- package/bundle/ms.core-3.1.7.gbl.min.js +7 -0
- package/bundle/{ms.core-3.1.6.gbl.min.js.map → ms.core-3.1.7.gbl.min.js.map} +1 -1
- package/bundle/ms.core-3.1.7.integrity.json +46 -0
- package/bundle/{ms.core-test.js → ms.core-3.1.7.js} +35 -5
- package/bundle/ms.core-3.1.7.js.map +1 -0
- package/bundle/{ms.core-test.min.js → ms.core-3.1.7.min.js} +3 -3
- package/bundle/{ms.core-3.1.6.min.js.map → ms.core-3.1.7.min.js.map} +1 -1
- package/bundle/{ms.core-3.1.6.gbl.js → ms.core.gbl.js} +34 -4
- package/bundle/ms.core.gbl.js.map +1 -0
- package/bundle/{ms.core-3.1.6.gbl.min.js → ms.core.gbl.min.js} +3 -3
- package/bundle/ms.core.gbl.min.js.map +1 -0
- package/bundle/ms.core.integrity.json +46 -0
- package/bundle/{ms.core-3.1.6.js → ms.core.js} +35 -5
- package/bundle/ms.core.js.map +1 -0
- package/bundle/{ms.core-3.1.6.min.js → ms.core.min.js} +3 -3
- package/bundle/ms.core.min.js.map +1 -0
- package/dist/ms.core.js +35 -5
- package/dist/ms.core.js.map +1 -1
- package/dist/ms.core.min.js +2 -2
- package/dist/ms.core.min.js.map +1 -1
- package/dist-esm/src/AppInsightsCore.js +1 -1
- package/dist-esm/src/BaseCore.js +1 -1
- package/dist-esm/src/DataModels.d.ts +5 -2
- package/dist-esm/src/DataModels.js +1 -1
- package/dist-esm/src/ESPromise.js +1 -1
- package/dist-esm/src/ESPromiseScheduler.js +1 -1
- package/dist-esm/src/Enums.js +1 -1
- package/dist-esm/src/Index.d.ts +3 -2
- package/dist-esm/src/Index.js +3 -3
- package/dist-esm/src/Index.js.map +1 -1
- package/dist-esm/src/Utils.d.ts +11 -1
- package/dist-esm/src/Utils.js +45 -2
- package/dist-esm/src/Utils.js.map +1 -1
- package/dist-esm/src/ValueSanitizer.js +1 -1
- package/package.json +1 -1
- package/src/DataModels.ts +5 -2
- package/src/Index.ts +4 -3
- package/src/Utils.ts +50 -1
- package/bundle/ms.core-3.1.6.gbl.js.map +0 -1
- package/bundle/ms.core-3.1.6.integrity.json +0 -46
- package/bundle/ms.core-3.1.6.js.map +0 -1
- package/bundle/ms.core-test.integrity.json +0 -26
- package/bundle/ms.core-test.js.map +0 -1
- package/bundle/ms.core-test.min.js.map +0 -1
|
@@ -0,0 +1,3589 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* 1DS JS SDK Core, 3.1.7
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
(function (exports) {
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
var strShimFunction = "function";
|
|
10
|
+
var strShimObject = "object";
|
|
11
|
+
var strShimUndefined = "undefined";
|
|
12
|
+
var strShimPrototype = "prototype";
|
|
13
|
+
var strShimHasOwnProperty = "hasOwnProperty";
|
|
14
|
+
var ObjClass = Object;
|
|
15
|
+
var ObjProto = ObjClass[strShimPrototype];
|
|
16
|
+
var ObjAssign = ObjClass["assign"];
|
|
17
|
+
var ObjCreate = ObjClass["create"];
|
|
18
|
+
var ObjDefineProperty = ObjClass["defineProperty"];
|
|
19
|
+
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];
|
|
20
|
+
|
|
21
|
+
function getGlobal() {
|
|
22
|
+
if (typeof globalThis !== strShimUndefined && globalThis) {
|
|
23
|
+
return globalThis;
|
|
24
|
+
}
|
|
25
|
+
if (typeof self !== strShimUndefined && self) {
|
|
26
|
+
return self;
|
|
27
|
+
}
|
|
28
|
+
if (typeof window !== strShimUndefined && window) {
|
|
29
|
+
return window;
|
|
30
|
+
}
|
|
31
|
+
if (typeof global !== strShimUndefined && global) {
|
|
32
|
+
return global;
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
function throwTypeError(message) {
|
|
37
|
+
throw new TypeError(message);
|
|
38
|
+
}
|
|
39
|
+
function objCreateFn(obj) {
|
|
40
|
+
var func = ObjCreate;
|
|
41
|
+
if (func) {
|
|
42
|
+
return func(obj);
|
|
43
|
+
}
|
|
44
|
+
if (obj == null) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
var type = typeof obj;
|
|
48
|
+
if (type !== strShimObject && type !== strShimFunction) {
|
|
49
|
+
throwTypeError('Object prototype may only be an Object:' + obj);
|
|
50
|
+
}
|
|
51
|
+
function tmpFunc() { }
|
|
52
|
+
tmpFunc[strShimPrototype] = obj;
|
|
53
|
+
return new tmpFunc();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
(getGlobal() || {})["Symbol"];
|
|
57
|
+
(getGlobal() || {})["Reflect"];
|
|
58
|
+
var __objAssignFnImpl = function (t) {
|
|
59
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
60
|
+
s = arguments[i];
|
|
61
|
+
for (var p in s) {
|
|
62
|
+
if (ObjProto[strShimHasOwnProperty].call(s, p)) {
|
|
63
|
+
t[p] = s[p];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return t;
|
|
68
|
+
};
|
|
69
|
+
var __assignFn = ObjAssign || __objAssignFnImpl;
|
|
70
|
+
var extendStaticsFn = function (d, b) {
|
|
71
|
+
extendStaticsFn = ObjClass["setPrototypeOf"] ||
|
|
72
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
73
|
+
function (d, b) {
|
|
74
|
+
for (var p in b) {
|
|
75
|
+
if (b[strShimHasOwnProperty](p)) {
|
|
76
|
+
d[p] = b[p];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return extendStaticsFn(d, b);
|
|
81
|
+
};
|
|
82
|
+
function __extendsFn(d, b) {
|
|
83
|
+
if (typeof b !== strShimFunction && b !== null) {
|
|
84
|
+
throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
85
|
+
}
|
|
86
|
+
extendStaticsFn(d, b);
|
|
87
|
+
function __() { this.constructor = d; }
|
|
88
|
+
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
|
|
89
|
+
}
|
|
90
|
+
function __spreadArrayFn(to, from) {
|
|
91
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
|
|
92
|
+
to[j] = from[i];
|
|
93
|
+
}
|
|
94
|
+
return to;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var MinChannelPriorty = 100;
|
|
98
|
+
|
|
99
|
+
var EventsDiscardedReason = {
|
|
100
|
+
Unknown: 0,
|
|
101
|
+
NonRetryableStatus: 1,
|
|
102
|
+
InvalidEvent: 2,
|
|
103
|
+
SizeLimitExceeded: 3,
|
|
104
|
+
KillSwitch: 4,
|
|
105
|
+
QueueFull: 5
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/*!
|
|
109
|
+
* Microsoft Dynamic Proto Utility, 1.1.4
|
|
110
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
111
|
+
*/
|
|
112
|
+
var Constructor = 'constructor';
|
|
113
|
+
var Prototype = 'prototype';
|
|
114
|
+
var strFunction = 'function';
|
|
115
|
+
var DynInstFuncTable = '_dynInstFuncs';
|
|
116
|
+
var DynProxyTag = '_isDynProxy';
|
|
117
|
+
var DynClassName = '_dynClass';
|
|
118
|
+
var DynClassNamePrefix = '_dynCls$';
|
|
119
|
+
var DynInstChkTag = '_dynInstChk';
|
|
120
|
+
var DynAllowInstChkTag = DynInstChkTag;
|
|
121
|
+
var DynProtoDefaultOptions = '_dfOpts';
|
|
122
|
+
var UnknownValue = '_unknown_';
|
|
123
|
+
var str__Proto = "__proto__";
|
|
124
|
+
var strUseBaseInst = 'useBaseInst';
|
|
125
|
+
var strSetInstFuncs = 'setInstFuncs';
|
|
126
|
+
var Obj = Object;
|
|
127
|
+
var _objGetPrototypeOf = Obj["getPrototypeOf"];
|
|
128
|
+
var _dynamicNames = 0;
|
|
129
|
+
function _hasOwnProperty(obj, prop) {
|
|
130
|
+
return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
|
|
131
|
+
}
|
|
132
|
+
function _isObjectOrArrayPrototype(target) {
|
|
133
|
+
return target && (target === Obj[Prototype] || target === Array[Prototype]);
|
|
134
|
+
}
|
|
135
|
+
function _isObjectArrayOrFunctionPrototype(target) {
|
|
136
|
+
return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
|
|
137
|
+
}
|
|
138
|
+
function _getObjProto(target) {
|
|
139
|
+
if (target) {
|
|
140
|
+
if (_objGetPrototypeOf) {
|
|
141
|
+
return _objGetPrototypeOf(target);
|
|
142
|
+
}
|
|
143
|
+
var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
144
|
+
if (newProto) {
|
|
145
|
+
return newProto;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
function _forEachProp(target, func) {
|
|
151
|
+
var props = [];
|
|
152
|
+
var getOwnProps = Obj["getOwnPropertyNames"];
|
|
153
|
+
if (getOwnProps) {
|
|
154
|
+
props = getOwnProps(target);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
for (var name_1 in target) {
|
|
158
|
+
if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
|
|
159
|
+
props.push(name_1);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (props && props.length > 0) {
|
|
164
|
+
for (var lp = 0; lp < props.length; lp++) {
|
|
165
|
+
func(props[lp]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function _isDynamicCandidate(target, funcName, skipOwn) {
|
|
170
|
+
return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
|
|
171
|
+
}
|
|
172
|
+
function _throwTypeError(message) {
|
|
173
|
+
throw new TypeError("DynamicProto: " + message);
|
|
174
|
+
}
|
|
175
|
+
function _getInstanceFuncs(thisTarget) {
|
|
176
|
+
var instFuncs = {};
|
|
177
|
+
_forEachProp(thisTarget, function (name) {
|
|
178
|
+
if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
|
|
179
|
+
instFuncs[name] = thisTarget[name];
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
return instFuncs;
|
|
183
|
+
}
|
|
184
|
+
function _hasVisited(values, value) {
|
|
185
|
+
for (var lp = values.length - 1; lp >= 0; lp--) {
|
|
186
|
+
if (values[lp] === value) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
193
|
+
function _instFuncProxy(target, funcHost, funcName) {
|
|
194
|
+
var theFunc = funcHost[funcName];
|
|
195
|
+
if (theFunc[DynProxyTag] && useBaseInst) {
|
|
196
|
+
var instFuncTable = target[DynInstFuncTable] || {};
|
|
197
|
+
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
198
|
+
theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return function () {
|
|
202
|
+
return theFunc.apply(target, arguments);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
var baseFuncs = {};
|
|
206
|
+
_forEachProp(instFuncs, function (name) {
|
|
207
|
+
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
208
|
+
});
|
|
209
|
+
var baseProto = _getObjProto(classProto);
|
|
210
|
+
var visited = [];
|
|
211
|
+
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
212
|
+
_forEachProp(baseProto, function (name) {
|
|
213
|
+
if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
|
|
214
|
+
baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
visited.push(baseProto);
|
|
218
|
+
baseProto = _getObjProto(baseProto);
|
|
219
|
+
}
|
|
220
|
+
return baseFuncs;
|
|
221
|
+
}
|
|
222
|
+
function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
223
|
+
var instFunc = null;
|
|
224
|
+
if (target && _hasOwnProperty(proto, DynClassName)) {
|
|
225
|
+
var instFuncTable = target[DynInstFuncTable] || {};
|
|
226
|
+
instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
|
|
227
|
+
if (!instFunc) {
|
|
228
|
+
_throwTypeError("Missing [" + funcName + "] " + strFunction);
|
|
229
|
+
}
|
|
230
|
+
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
231
|
+
var canAddInst = !_hasOwnProperty(target, funcName);
|
|
232
|
+
var objProto = _getObjProto(target);
|
|
233
|
+
var visited = [];
|
|
234
|
+
while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
235
|
+
var protoFunc = objProto[funcName];
|
|
236
|
+
if (protoFunc) {
|
|
237
|
+
canAddInst = (protoFunc === currentDynProtoProxy);
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
visited.push(objProto);
|
|
241
|
+
objProto = _getObjProto(objProto);
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
if (canAddInst) {
|
|
245
|
+
target[funcName] = instFunc;
|
|
246
|
+
}
|
|
247
|
+
instFunc[DynInstChkTag] = 1;
|
|
248
|
+
}
|
|
249
|
+
catch (e) {
|
|
250
|
+
instFuncTable[DynAllowInstChkTag] = false;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return instFunc;
|
|
255
|
+
}
|
|
256
|
+
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
257
|
+
var protoFunc = proto[funcName];
|
|
258
|
+
if (protoFunc === currentDynProtoProxy) {
|
|
259
|
+
protoFunc = _getObjProto(proto)[funcName];
|
|
260
|
+
}
|
|
261
|
+
if (typeof protoFunc !== strFunction) {
|
|
262
|
+
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
263
|
+
}
|
|
264
|
+
return protoFunc;
|
|
265
|
+
}
|
|
266
|
+
function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
|
|
267
|
+
function _createDynamicPrototype(proto, funcName) {
|
|
268
|
+
var dynProtoProxy = function () {
|
|
269
|
+
var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
|
|
270
|
+
return instFunc.apply(this, arguments);
|
|
271
|
+
};
|
|
272
|
+
dynProtoProxy[DynProxyTag] = 1;
|
|
273
|
+
return dynProtoProxy;
|
|
274
|
+
}
|
|
275
|
+
if (!_isObjectOrArrayPrototype(proto)) {
|
|
276
|
+
var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
|
|
277
|
+
var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
|
|
278
|
+
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
279
|
+
instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
|
|
280
|
+
}
|
|
281
|
+
_forEachProp(target, function (name) {
|
|
282
|
+
if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
|
|
283
|
+
instFuncs_1[name] = target[name];
|
|
284
|
+
delete target[name];
|
|
285
|
+
if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
|
|
286
|
+
proto[name] = _createDynamicPrototype(proto, name);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function _checkPrototype(classProto, thisTarget) {
|
|
293
|
+
if (_objGetPrototypeOf) {
|
|
294
|
+
var visited = [];
|
|
295
|
+
var thisProto = _getObjProto(thisTarget);
|
|
296
|
+
while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
|
|
297
|
+
if (thisProto === classProto) {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
visited.push(thisProto);
|
|
301
|
+
thisProto = _getObjProto(thisProto);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
function _getObjName(target, unknownValue) {
|
|
307
|
+
if (_hasOwnProperty(target, Prototype)) {
|
|
308
|
+
return target.name || unknownValue || UnknownValue;
|
|
309
|
+
}
|
|
310
|
+
return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
|
|
311
|
+
}
|
|
312
|
+
function dynamicProto(theClass, target, delegateFunc, options) {
|
|
313
|
+
if (!_hasOwnProperty(theClass, Prototype)) {
|
|
314
|
+
_throwTypeError("theClass is an invalid class definition.");
|
|
315
|
+
}
|
|
316
|
+
var classProto = theClass[Prototype];
|
|
317
|
+
if (!_checkPrototype(classProto, target)) {
|
|
318
|
+
_throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
|
|
319
|
+
}
|
|
320
|
+
var className = null;
|
|
321
|
+
if (_hasOwnProperty(classProto, DynClassName)) {
|
|
322
|
+
className = classProto[DynClassName];
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
|
|
326
|
+
_dynamicNames++;
|
|
327
|
+
classProto[DynClassName] = className;
|
|
328
|
+
}
|
|
329
|
+
var perfOptions = dynamicProto[DynProtoDefaultOptions];
|
|
330
|
+
var useBaseInst = !!perfOptions[strUseBaseInst];
|
|
331
|
+
if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
|
|
332
|
+
useBaseInst = !!options[strUseBaseInst];
|
|
333
|
+
}
|
|
334
|
+
var instFuncs = _getInstanceFuncs(target);
|
|
335
|
+
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
336
|
+
delegateFunc(target, baseFuncs);
|
|
337
|
+
var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
|
|
338
|
+
if (setInstanceFunc && options) {
|
|
339
|
+
setInstanceFunc = !!options[strSetInstFuncs];
|
|
340
|
+
}
|
|
341
|
+
_populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
|
|
342
|
+
}
|
|
343
|
+
var perfDefaults = {
|
|
344
|
+
setInstFuncs: true,
|
|
345
|
+
useBaseInst: true
|
|
346
|
+
};
|
|
347
|
+
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
348
|
+
|
|
349
|
+
exports.LoggingSeverity = void 0;
|
|
350
|
+
(function (LoggingSeverity) {
|
|
351
|
+
LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL";
|
|
352
|
+
LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING";
|
|
353
|
+
})(exports.LoggingSeverity || (exports.LoggingSeverity = {}));
|
|
354
|
+
var _InternalMessageId = {
|
|
355
|
+
BrowserDoesNotSupportLocalStorage: 0,
|
|
356
|
+
BrowserCannotReadLocalStorage: 1,
|
|
357
|
+
BrowserCannotReadSessionStorage: 2,
|
|
358
|
+
BrowserCannotWriteLocalStorage: 3,
|
|
359
|
+
BrowserCannotWriteSessionStorage: 4,
|
|
360
|
+
BrowserFailedRemovalFromLocalStorage: 5,
|
|
361
|
+
BrowserFailedRemovalFromSessionStorage: 6,
|
|
362
|
+
CannotSendEmptyTelemetry: 7,
|
|
363
|
+
ClientPerformanceMathError: 8,
|
|
364
|
+
ErrorParsingAISessionCookie: 9,
|
|
365
|
+
ErrorPVCalc: 10,
|
|
366
|
+
ExceptionWhileLoggingError: 11,
|
|
367
|
+
FailedAddingTelemetryToBuffer: 12,
|
|
368
|
+
FailedMonitorAjaxAbort: 13,
|
|
369
|
+
FailedMonitorAjaxDur: 14,
|
|
370
|
+
FailedMonitorAjaxOpen: 15,
|
|
371
|
+
FailedMonitorAjaxRSC: 16,
|
|
372
|
+
FailedMonitorAjaxSend: 17,
|
|
373
|
+
FailedMonitorAjaxGetCorrelationHeader: 18,
|
|
374
|
+
FailedToAddHandlerForOnBeforeUnload: 19,
|
|
375
|
+
FailedToSendQueuedTelemetry: 20,
|
|
376
|
+
FailedToReportDataLoss: 21,
|
|
377
|
+
FlushFailed: 22,
|
|
378
|
+
MessageLimitPerPVExceeded: 23,
|
|
379
|
+
MissingRequiredFieldSpecification: 24,
|
|
380
|
+
NavigationTimingNotSupported: 25,
|
|
381
|
+
OnError: 26,
|
|
382
|
+
SessionRenewalDateIsZero: 27,
|
|
383
|
+
SenderNotInitialized: 28,
|
|
384
|
+
StartTrackEventFailed: 29,
|
|
385
|
+
StopTrackEventFailed: 30,
|
|
386
|
+
StartTrackFailed: 31,
|
|
387
|
+
StopTrackFailed: 32,
|
|
388
|
+
TelemetrySampledAndNotSent: 33,
|
|
389
|
+
TrackEventFailed: 34,
|
|
390
|
+
TrackExceptionFailed: 35,
|
|
391
|
+
TrackMetricFailed: 36,
|
|
392
|
+
TrackPVFailed: 37,
|
|
393
|
+
TrackPVFailedCalc: 38,
|
|
394
|
+
TrackTraceFailed: 39,
|
|
395
|
+
TransmissionFailed: 40,
|
|
396
|
+
FailedToSetStorageBuffer: 41,
|
|
397
|
+
FailedToRestoreStorageBuffer: 42,
|
|
398
|
+
InvalidBackendResponse: 43,
|
|
399
|
+
FailedToFixDepricatedValues: 44,
|
|
400
|
+
InvalidDurationValue: 45,
|
|
401
|
+
TelemetryEnvelopeInvalid: 46,
|
|
402
|
+
CreateEnvelopeError: 47,
|
|
403
|
+
CannotSerializeObject: 48,
|
|
404
|
+
CannotSerializeObjectNonSerializable: 49,
|
|
405
|
+
CircularReferenceDetected: 50,
|
|
406
|
+
ClearAuthContextFailed: 51,
|
|
407
|
+
ExceptionTruncated: 52,
|
|
408
|
+
IllegalCharsInName: 53,
|
|
409
|
+
ItemNotInArray: 54,
|
|
410
|
+
MaxAjaxPerPVExceeded: 55,
|
|
411
|
+
MessageTruncated: 56,
|
|
412
|
+
NameTooLong: 57,
|
|
413
|
+
SampleRateOutOfRange: 58,
|
|
414
|
+
SetAuthContextFailed: 59,
|
|
415
|
+
SetAuthContextFailedAccountName: 60,
|
|
416
|
+
StringValueTooLong: 61,
|
|
417
|
+
StartCalledMoreThanOnce: 62,
|
|
418
|
+
StopCalledWithoutStart: 63,
|
|
419
|
+
TelemetryInitializerFailed: 64,
|
|
420
|
+
TrackArgumentsNotSpecified: 65,
|
|
421
|
+
UrlTooLong: 66,
|
|
422
|
+
SessionStorageBufferFull: 67,
|
|
423
|
+
CannotAccessCookie: 68,
|
|
424
|
+
IdTooLong: 69,
|
|
425
|
+
InvalidEvent: 70,
|
|
426
|
+
FailedMonitorAjaxSetRequestHeader: 71,
|
|
427
|
+
SendBrowserInfoOnUserInit: 72,
|
|
428
|
+
PluginException: 73,
|
|
429
|
+
NotificationException: 74,
|
|
430
|
+
SnippetScriptLoadFailure: 99,
|
|
431
|
+
InvalidInstrumentationKey: 100,
|
|
432
|
+
CannotParseAiBlobValue: 101,
|
|
433
|
+
InvalidContentBlob: 102,
|
|
434
|
+
TrackPageActionEventFailed: 103,
|
|
435
|
+
FailedAddingCustomDefinedRequestContext: 104
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
var strOnPrefix = "on";
|
|
439
|
+
var strAttachEvent = "attachEvent";
|
|
440
|
+
var strAddEventHelper = "addEventListener";
|
|
441
|
+
var strDetachEvent = "detachEvent";
|
|
442
|
+
var strRemoveEventListener = "removeEventListener";
|
|
443
|
+
var _objDefineProperty = ObjDefineProperty;
|
|
444
|
+
function objToString(obj) {
|
|
445
|
+
return ObjProto.toString.call(obj);
|
|
446
|
+
}
|
|
447
|
+
function isTypeof(value, theType) {
|
|
448
|
+
return typeof value === theType;
|
|
449
|
+
}
|
|
450
|
+
function isUndefined(value) {
|
|
451
|
+
return value === undefined || typeof value === strShimUndefined;
|
|
452
|
+
}
|
|
453
|
+
function isNullOrUndefined(value) {
|
|
454
|
+
return (value === null || isUndefined(value));
|
|
455
|
+
}
|
|
456
|
+
function isNotNullOrUndefined(value) {
|
|
457
|
+
return !isNullOrUndefined(value);
|
|
458
|
+
}
|
|
459
|
+
function hasOwnProperty(obj, prop) {
|
|
460
|
+
return obj && ObjHasOwnProperty.call(obj, prop);
|
|
461
|
+
}
|
|
462
|
+
function isObject(value) {
|
|
463
|
+
return typeof value === strShimObject;
|
|
464
|
+
}
|
|
465
|
+
function isFunction(value) {
|
|
466
|
+
return typeof value === strShimFunction;
|
|
467
|
+
}
|
|
468
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
469
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
470
|
+
var result = false;
|
|
471
|
+
if (!isNullOrUndefined(obj)) {
|
|
472
|
+
try {
|
|
473
|
+
if (!isNullOrUndefined(obj[strAddEventHelper])) {
|
|
474
|
+
obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);
|
|
475
|
+
result = true;
|
|
476
|
+
}
|
|
477
|
+
else if (!isNullOrUndefined(obj[strAttachEvent])) {
|
|
478
|
+
obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
479
|
+
result = true;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
catch (e) {
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return result;
|
|
486
|
+
}
|
|
487
|
+
function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
488
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
489
|
+
if (!isNullOrUndefined(obj)) {
|
|
490
|
+
try {
|
|
491
|
+
if (!isNullOrUndefined(obj[strRemoveEventListener])) {
|
|
492
|
+
obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);
|
|
493
|
+
}
|
|
494
|
+
else if (!isNullOrUndefined(obj[strDetachEvent])) {
|
|
495
|
+
obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
catch (e) {
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function normalizeJsName(name) {
|
|
503
|
+
var value = name;
|
|
504
|
+
var match = /([^\w\d_$])/g;
|
|
505
|
+
if (match.test(name)) {
|
|
506
|
+
value = name.replace(match, "_");
|
|
507
|
+
}
|
|
508
|
+
return value;
|
|
509
|
+
}
|
|
510
|
+
function objForEachKey(target, callbackfn) {
|
|
511
|
+
if (target) {
|
|
512
|
+
for (var prop in target) {
|
|
513
|
+
if (ObjHasOwnProperty.call(target, prop)) {
|
|
514
|
+
callbackfn.call(target, prop, target[prop]);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function strEndsWith(value, search) {
|
|
520
|
+
if (value && search) {
|
|
521
|
+
var searchLen = search.length;
|
|
522
|
+
var valLen = value.length;
|
|
523
|
+
if (value === search) {
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
else if (valLen >= searchLen) {
|
|
527
|
+
var pos = valLen - 1;
|
|
528
|
+
for (var lp = searchLen - 1; lp >= 0; lp--) {
|
|
529
|
+
if (value[pos] != search[lp]) {
|
|
530
|
+
return false;
|
|
531
|
+
}
|
|
532
|
+
pos--;
|
|
533
|
+
}
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return false;
|
|
538
|
+
}
|
|
539
|
+
function strStartsWith(value, checkValue) {
|
|
540
|
+
var result = false;
|
|
541
|
+
if (value && checkValue) {
|
|
542
|
+
var chkLen = checkValue.length;
|
|
543
|
+
if (value === checkValue) {
|
|
544
|
+
return true;
|
|
545
|
+
}
|
|
546
|
+
else if (value.length >= chkLen) {
|
|
547
|
+
for (var lp = 0; lp < chkLen; lp++) {
|
|
548
|
+
if (value[lp] !== checkValue[lp]) {
|
|
549
|
+
return false;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
result = true;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
557
|
+
function strContains(value, search) {
|
|
558
|
+
if (value && search) {
|
|
559
|
+
return value.indexOf(search) !== -1;
|
|
560
|
+
}
|
|
561
|
+
return false;
|
|
562
|
+
}
|
|
563
|
+
function isDate(obj) {
|
|
564
|
+
return objToString(obj) === "[object Date]";
|
|
565
|
+
}
|
|
566
|
+
function isArray(obj) {
|
|
567
|
+
return objToString(obj) === "[object Array]";
|
|
568
|
+
}
|
|
569
|
+
function isError(obj) {
|
|
570
|
+
return objToString(obj) === "[object Error]";
|
|
571
|
+
}
|
|
572
|
+
function isString(value) {
|
|
573
|
+
return typeof value === "string";
|
|
574
|
+
}
|
|
575
|
+
function isNumber(value) {
|
|
576
|
+
return typeof value === "number";
|
|
577
|
+
}
|
|
578
|
+
function isBoolean(value) {
|
|
579
|
+
return typeof value === "boolean";
|
|
580
|
+
}
|
|
581
|
+
function toISOString(date) {
|
|
582
|
+
if (isDate(date)) {
|
|
583
|
+
var pad = function (num) {
|
|
584
|
+
var r = String(num);
|
|
585
|
+
if (r.length === 1) {
|
|
586
|
+
r = "0" + r;
|
|
587
|
+
}
|
|
588
|
+
return r;
|
|
589
|
+
};
|
|
590
|
+
return date.getUTCFullYear()
|
|
591
|
+
+ "-" + pad(date.getUTCMonth() + 1)
|
|
592
|
+
+ "-" + pad(date.getUTCDate())
|
|
593
|
+
+ "T" + pad(date.getUTCHours())
|
|
594
|
+
+ ":" + pad(date.getUTCMinutes())
|
|
595
|
+
+ ":" + pad(date.getUTCSeconds())
|
|
596
|
+
+ "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
|
|
597
|
+
+ "Z";
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function arrForEach(arr, callbackfn, thisArg) {
|
|
601
|
+
var len = arr.length;
|
|
602
|
+
try {
|
|
603
|
+
for (var idx = 0; idx < len; idx++) {
|
|
604
|
+
if (idx in arr) {
|
|
605
|
+
if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
catch (e) {
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function arrIndexOf(arr, searchElement, fromIndex) {
|
|
615
|
+
var len = arr.length;
|
|
616
|
+
var from = fromIndex || 0;
|
|
617
|
+
try {
|
|
618
|
+
for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {
|
|
619
|
+
if (lp in arr && arr[lp] === searchElement) {
|
|
620
|
+
return lp;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
catch (e) {
|
|
625
|
+
}
|
|
626
|
+
return -1;
|
|
627
|
+
}
|
|
628
|
+
function arrMap(arr, callbackfn, thisArg) {
|
|
629
|
+
var len = arr.length;
|
|
630
|
+
var _this = thisArg || arr;
|
|
631
|
+
var results = new Array(len);
|
|
632
|
+
try {
|
|
633
|
+
for (var lp = 0; lp < len; lp++) {
|
|
634
|
+
if (lp in arr) {
|
|
635
|
+
results[lp] = callbackfn.call(_this, arr[lp], arr);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
catch (e) {
|
|
640
|
+
}
|
|
641
|
+
return results;
|
|
642
|
+
}
|
|
643
|
+
function arrReduce(arr, callbackfn, initialValue) {
|
|
644
|
+
var len = arr.length;
|
|
645
|
+
var lp = 0;
|
|
646
|
+
var value;
|
|
647
|
+
if (arguments.length >= 3) {
|
|
648
|
+
value = arguments[2];
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
while (lp < len && !(lp in arr)) {
|
|
652
|
+
lp++;
|
|
653
|
+
}
|
|
654
|
+
value = arr[lp++];
|
|
655
|
+
}
|
|
656
|
+
while (lp < len) {
|
|
657
|
+
if (lp in arr) {
|
|
658
|
+
value = callbackfn(value, arr[lp], lp, arr);
|
|
659
|
+
}
|
|
660
|
+
lp++;
|
|
661
|
+
}
|
|
662
|
+
return value;
|
|
663
|
+
}
|
|
664
|
+
function strTrim(str) {
|
|
665
|
+
if (typeof str !== "string") {
|
|
666
|
+
return str;
|
|
667
|
+
}
|
|
668
|
+
return str.replace(/^\s+|\s+$/g, "");
|
|
669
|
+
}
|
|
670
|
+
var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');
|
|
671
|
+
var _objKeysDontEnums = [
|
|
672
|
+
'toString',
|
|
673
|
+
'toLocaleString',
|
|
674
|
+
'valueOf',
|
|
675
|
+
'hasOwnProperty',
|
|
676
|
+
'isPrototypeOf',
|
|
677
|
+
'propertyIsEnumerable',
|
|
678
|
+
'constructor'
|
|
679
|
+
];
|
|
680
|
+
function objKeys(obj) {
|
|
681
|
+
var objType = typeof obj;
|
|
682
|
+
if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) {
|
|
683
|
+
throwTypeError('objKeys called on non-object');
|
|
684
|
+
}
|
|
685
|
+
var result = [];
|
|
686
|
+
for (var prop in obj) {
|
|
687
|
+
if (obj && ObjHasOwnProperty.call(obj, prop)) {
|
|
688
|
+
result.push(prop);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
if (_objKeysHasDontEnumBug) {
|
|
692
|
+
var dontEnumsLength = _objKeysDontEnums.length;
|
|
693
|
+
for (var lp = 0; lp < dontEnumsLength; lp++) {
|
|
694
|
+
if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) {
|
|
695
|
+
result.push(_objKeysDontEnums[lp]);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
return result;
|
|
700
|
+
}
|
|
701
|
+
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
702
|
+
if (_objDefineProperty) {
|
|
703
|
+
try {
|
|
704
|
+
var descriptor = {
|
|
705
|
+
enumerable: true,
|
|
706
|
+
configurable: true
|
|
707
|
+
};
|
|
708
|
+
if (getProp) {
|
|
709
|
+
descriptor.get = getProp;
|
|
710
|
+
}
|
|
711
|
+
if (setProp) {
|
|
712
|
+
descriptor.set = setProp;
|
|
713
|
+
}
|
|
714
|
+
_objDefineProperty(target, prop, descriptor);
|
|
715
|
+
return true;
|
|
716
|
+
}
|
|
717
|
+
catch (e) {
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return false;
|
|
721
|
+
}
|
|
722
|
+
function dateNow() {
|
|
723
|
+
var dt = Date;
|
|
724
|
+
if (dt.now) {
|
|
725
|
+
return dt.now();
|
|
726
|
+
}
|
|
727
|
+
return new dt().getTime();
|
|
728
|
+
}
|
|
729
|
+
function getExceptionName(object) {
|
|
730
|
+
if (isError(object)) {
|
|
731
|
+
return object.name;
|
|
732
|
+
}
|
|
733
|
+
return "";
|
|
734
|
+
}
|
|
735
|
+
function setValue(target, field, value, valChk, srcChk) {
|
|
736
|
+
var theValue = value;
|
|
737
|
+
if (target) {
|
|
738
|
+
theValue = target[field];
|
|
739
|
+
if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
|
|
740
|
+
theValue = value;
|
|
741
|
+
target[field] = theValue;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return theValue;
|
|
745
|
+
}
|
|
746
|
+
function getSetValue(target, field, defValue) {
|
|
747
|
+
var theValue;
|
|
748
|
+
if (target) {
|
|
749
|
+
theValue = target[field];
|
|
750
|
+
if (!theValue && isNullOrUndefined(theValue)) {
|
|
751
|
+
theValue = !isUndefined(defValue) ? defValue : {};
|
|
752
|
+
target[field] = theValue;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
theValue = !isUndefined(defValue) ? defValue : {};
|
|
757
|
+
}
|
|
758
|
+
return theValue;
|
|
759
|
+
}
|
|
760
|
+
function isNotTruthy(value) {
|
|
761
|
+
return !value;
|
|
762
|
+
}
|
|
763
|
+
function isTruthy(value) {
|
|
764
|
+
return !!value;
|
|
765
|
+
}
|
|
766
|
+
function throwError(message) {
|
|
767
|
+
throw new Error(message);
|
|
768
|
+
}
|
|
769
|
+
function proxyAssign(target, source, chkSet) {
|
|
770
|
+
if (target && source && target !== source && isObject(target) && isObject(source)) {
|
|
771
|
+
var _loop_1 = function (field) {
|
|
772
|
+
if (isString(field)) {
|
|
773
|
+
var value = source[field];
|
|
774
|
+
if (isFunction(value)) {
|
|
775
|
+
if (!chkSet || chkSet(field, true, source, target)) {
|
|
776
|
+
target[field] = (function (funcName) {
|
|
777
|
+
return function () {
|
|
778
|
+
var originalArguments = arguments;
|
|
779
|
+
return source[funcName].apply(source, originalArguments);
|
|
780
|
+
};
|
|
781
|
+
})(field);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
else if (!chkSet || chkSet(field, false, source, target)) {
|
|
785
|
+
if (hasOwnProperty(target, field)) {
|
|
786
|
+
delete target[field];
|
|
787
|
+
}
|
|
788
|
+
if (!objDefineAccessors(target, field, function () {
|
|
789
|
+
return source[field];
|
|
790
|
+
}, function (theValue) {
|
|
791
|
+
source[field] = theValue;
|
|
792
|
+
})) {
|
|
793
|
+
target[field] = value;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
for (var field in source) {
|
|
799
|
+
_loop_1(field);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
return target;
|
|
803
|
+
}
|
|
804
|
+
function optimizeObject(theObject) {
|
|
805
|
+
if (theObject) {
|
|
806
|
+
theObject = ObjClass(ObjAssign ? ObjAssign({}, theObject) : theObject);
|
|
807
|
+
}
|
|
808
|
+
return theObject;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
var strWindow = "window";
|
|
812
|
+
var strDocument = "document";
|
|
813
|
+
var strNavigator = "navigator";
|
|
814
|
+
var strHistory = "history";
|
|
815
|
+
var strLocation = "location";
|
|
816
|
+
var strConsole = "console";
|
|
817
|
+
var strPerformance = "performance";
|
|
818
|
+
var strJSON = "JSON";
|
|
819
|
+
var strCrypto = "crypto";
|
|
820
|
+
var strMsCrypto = "msCrypto";
|
|
821
|
+
var strReactNative = "ReactNative";
|
|
822
|
+
var strMsie = "msie";
|
|
823
|
+
var strTrident = "trident/";
|
|
824
|
+
var _isTrident = null;
|
|
825
|
+
var _navUserAgentCheck = null;
|
|
826
|
+
var _enableMocks = false;
|
|
827
|
+
var _useXDomainRequest = null;
|
|
828
|
+
var _beaconsSupported = null;
|
|
829
|
+
function _hasProperty(theClass, property) {
|
|
830
|
+
var supported = false;
|
|
831
|
+
if (theClass) {
|
|
832
|
+
try {
|
|
833
|
+
supported = property in theClass;
|
|
834
|
+
if (!supported) {
|
|
835
|
+
var proto = theClass[strShimPrototype];
|
|
836
|
+
if (proto) {
|
|
837
|
+
supported = property in proto;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
catch (e) {
|
|
842
|
+
}
|
|
843
|
+
if (!supported) {
|
|
844
|
+
try {
|
|
845
|
+
var tmp = new theClass();
|
|
846
|
+
supported = !isUndefined(tmp[property]);
|
|
847
|
+
}
|
|
848
|
+
catch (e) {
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return supported;
|
|
853
|
+
}
|
|
854
|
+
function setEnableEnvMocks(enabled) {
|
|
855
|
+
_enableMocks = enabled;
|
|
856
|
+
}
|
|
857
|
+
function getGlobalInst(name) {
|
|
858
|
+
var gbl = getGlobal();
|
|
859
|
+
if (gbl && gbl[name]) {
|
|
860
|
+
return gbl[name];
|
|
861
|
+
}
|
|
862
|
+
if (name === strWindow && hasWindow()) {
|
|
863
|
+
return window;
|
|
864
|
+
}
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
function hasWindow() {
|
|
868
|
+
return Boolean(typeof window === strShimObject && window);
|
|
869
|
+
}
|
|
870
|
+
function getWindow() {
|
|
871
|
+
if (hasWindow()) {
|
|
872
|
+
return window;
|
|
873
|
+
}
|
|
874
|
+
return getGlobalInst(strWindow);
|
|
875
|
+
}
|
|
876
|
+
function hasDocument() {
|
|
877
|
+
return Boolean(typeof document === strShimObject && document);
|
|
878
|
+
}
|
|
879
|
+
function getDocument() {
|
|
880
|
+
if (hasDocument()) {
|
|
881
|
+
return document;
|
|
882
|
+
}
|
|
883
|
+
return getGlobalInst(strDocument);
|
|
884
|
+
}
|
|
885
|
+
function hasNavigator() {
|
|
886
|
+
return Boolean(typeof navigator === strShimObject && navigator);
|
|
887
|
+
}
|
|
888
|
+
function getNavigator() {
|
|
889
|
+
if (hasNavigator()) {
|
|
890
|
+
return navigator;
|
|
891
|
+
}
|
|
892
|
+
return getGlobalInst(strNavigator);
|
|
893
|
+
}
|
|
894
|
+
function hasHistory() {
|
|
895
|
+
return Boolean(typeof history === strShimObject && history);
|
|
896
|
+
}
|
|
897
|
+
function getHistory() {
|
|
898
|
+
if (hasHistory()) {
|
|
899
|
+
return history;
|
|
900
|
+
}
|
|
901
|
+
return getGlobalInst(strHistory);
|
|
902
|
+
}
|
|
903
|
+
function getLocation(checkForMock) {
|
|
904
|
+
if (checkForMock && _enableMocks) {
|
|
905
|
+
var mockLocation = getGlobalInst("__mockLocation");
|
|
906
|
+
if (mockLocation) {
|
|
907
|
+
return mockLocation;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (typeof location === strShimObject && location) {
|
|
911
|
+
return location;
|
|
912
|
+
}
|
|
913
|
+
return getGlobalInst(strLocation);
|
|
914
|
+
}
|
|
915
|
+
function getConsole() {
|
|
916
|
+
if (typeof console !== strShimUndefined) {
|
|
917
|
+
return console;
|
|
918
|
+
}
|
|
919
|
+
return getGlobalInst(strConsole);
|
|
920
|
+
}
|
|
921
|
+
function getPerformance() {
|
|
922
|
+
return getGlobalInst(strPerformance);
|
|
923
|
+
}
|
|
924
|
+
function hasJSON() {
|
|
925
|
+
return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null);
|
|
926
|
+
}
|
|
927
|
+
function getJSON() {
|
|
928
|
+
if (hasJSON()) {
|
|
929
|
+
return JSON || getGlobalInst(strJSON);
|
|
930
|
+
}
|
|
931
|
+
return null;
|
|
932
|
+
}
|
|
933
|
+
function getCrypto() {
|
|
934
|
+
return getGlobalInst(strCrypto);
|
|
935
|
+
}
|
|
936
|
+
function getMsCrypto() {
|
|
937
|
+
return getGlobalInst(strMsCrypto);
|
|
938
|
+
}
|
|
939
|
+
function isReactNative() {
|
|
940
|
+
var nav = getNavigator();
|
|
941
|
+
if (nav && nav.product) {
|
|
942
|
+
return nav.product === strReactNative;
|
|
943
|
+
}
|
|
944
|
+
return false;
|
|
945
|
+
}
|
|
946
|
+
function isIE() {
|
|
947
|
+
var nav = getNavigator();
|
|
948
|
+
if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
|
|
949
|
+
_navUserAgentCheck = nav.userAgent;
|
|
950
|
+
var userAgent = (_navUserAgentCheck || "").toLowerCase();
|
|
951
|
+
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
952
|
+
}
|
|
953
|
+
return _isTrident;
|
|
954
|
+
}
|
|
955
|
+
function getIEVersion(userAgentStr) {
|
|
956
|
+
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
957
|
+
if (!userAgentStr) {
|
|
958
|
+
var navigator_1 = getNavigator() || {};
|
|
959
|
+
userAgentStr = navigator_1 ? (navigator_1.userAgent || "").toLowerCase() : "";
|
|
960
|
+
}
|
|
961
|
+
var ua = (userAgentStr || "").toLowerCase();
|
|
962
|
+
if (strContains(ua, strMsie)) {
|
|
963
|
+
return parseInt(ua.split(strMsie)[1]);
|
|
964
|
+
}
|
|
965
|
+
else if (strContains(ua, strTrident)) {
|
|
966
|
+
var tridentVer = parseInt(ua.split(strTrident)[1]);
|
|
967
|
+
if (tridentVer) {
|
|
968
|
+
return tridentVer + 4;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
return null;
|
|
972
|
+
}
|
|
973
|
+
function dumpObj(object) {
|
|
974
|
+
var objectTypeDump = Object[strShimPrototype].toString.call(object);
|
|
975
|
+
var propertyValueDump = "";
|
|
976
|
+
if (objectTypeDump === "[object Error]") {
|
|
977
|
+
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
978
|
+
}
|
|
979
|
+
else if (hasJSON()) {
|
|
980
|
+
propertyValueDump = getJSON().stringify(object);
|
|
981
|
+
}
|
|
982
|
+
return objectTypeDump + propertyValueDump;
|
|
983
|
+
}
|
|
984
|
+
function isBeaconsSupported() {
|
|
985
|
+
if (_beaconsSupported === null) {
|
|
986
|
+
_beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
|
|
987
|
+
}
|
|
988
|
+
return _beaconsSupported;
|
|
989
|
+
}
|
|
990
|
+
function isFetchSupported(withKeepAlive) {
|
|
991
|
+
var isSupported = false;
|
|
992
|
+
try {
|
|
993
|
+
var fetchApi = getGlobalInst("fetch");
|
|
994
|
+
isSupported = !!fetchApi;
|
|
995
|
+
var request = getGlobalInst("Request");
|
|
996
|
+
if (isSupported && withKeepAlive && request) {
|
|
997
|
+
isSupported = _hasProperty(request, "keepalive");
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
catch (e) {
|
|
1001
|
+
}
|
|
1002
|
+
return isSupported;
|
|
1003
|
+
}
|
|
1004
|
+
function useXDomainRequest() {
|
|
1005
|
+
if (_useXDomainRequest === null) {
|
|
1006
|
+
_useXDomainRequest = (typeof XDomainRequest !== undefined);
|
|
1007
|
+
if (_useXDomainRequest && isXhrSupported()) {
|
|
1008
|
+
_useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst("XMLHttpRequest"), "withCredentials");
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
return _useXDomainRequest;
|
|
1012
|
+
}
|
|
1013
|
+
function isXhrSupported() {
|
|
1014
|
+
var isSupported = false;
|
|
1015
|
+
try {
|
|
1016
|
+
var xmlHttpRequest = getGlobalInst("XMLHttpRequest");
|
|
1017
|
+
isSupported = !!xmlHttpRequest;
|
|
1018
|
+
}
|
|
1019
|
+
catch (e) {
|
|
1020
|
+
}
|
|
1021
|
+
return isSupported;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
1025
|
+
var AiUserActionablePrefix = "AI: ";
|
|
1026
|
+
var AIInternalMessagePrefix = "AITR_";
|
|
1027
|
+
function _sanitizeDiagnosticText(text) {
|
|
1028
|
+
if (text) {
|
|
1029
|
+
return "\"" + text.replace(/\"/g, "") + "\"";
|
|
1030
|
+
}
|
|
1031
|
+
return "";
|
|
1032
|
+
}
|
|
1033
|
+
var _InternalLogMessage = /** @class */ (function () {
|
|
1034
|
+
function _InternalLogMessage(msgId, msg, isUserAct, properties) {
|
|
1035
|
+
if (isUserAct === void 0) { isUserAct = false; }
|
|
1036
|
+
var _self = this;
|
|
1037
|
+
_self.messageId = msgId;
|
|
1038
|
+
_self.message =
|
|
1039
|
+
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
1040
|
+
msgId;
|
|
1041
|
+
var strProps = "";
|
|
1042
|
+
if (hasJSON()) {
|
|
1043
|
+
strProps = getJSON().stringify(properties);
|
|
1044
|
+
}
|
|
1045
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : "") +
|
|
1046
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : "");
|
|
1047
|
+
_self.message += diagnosticText;
|
|
1048
|
+
}
|
|
1049
|
+
_InternalLogMessage.dataType = "MessageData";
|
|
1050
|
+
return _InternalLogMessage;
|
|
1051
|
+
}());
|
|
1052
|
+
function safeGetLogger(core, config) {
|
|
1053
|
+
return (core || {}).logger || new DiagnosticLogger(config);
|
|
1054
|
+
}
|
|
1055
|
+
var DiagnosticLogger = /** @class */ (function () {
|
|
1056
|
+
function DiagnosticLogger(config) {
|
|
1057
|
+
this.identifier = 'DiagnosticLogger';
|
|
1058
|
+
this.queue = [];
|
|
1059
|
+
var _messageCount = 0;
|
|
1060
|
+
var _messageLogged = {};
|
|
1061
|
+
dynamicProto(DiagnosticLogger, this, function (_self) {
|
|
1062
|
+
if (isNullOrUndefined(config)) {
|
|
1063
|
+
config = {};
|
|
1064
|
+
}
|
|
1065
|
+
_self.consoleLoggingLevel = function () { return _getConfigValue('loggingLevelConsole', 0); };
|
|
1066
|
+
_self.telemetryLoggingLevel = function () { return _getConfigValue('loggingLevelTelemetry', 1); };
|
|
1067
|
+
_self.maxInternalMessageLimit = function () { return _getConfigValue('maxMessageLimit', 25); };
|
|
1068
|
+
_self.enableDebugExceptions = function () { return _getConfigValue('enableDebugExceptions', false); };
|
|
1069
|
+
_self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {
|
|
1070
|
+
if (isUserAct === void 0) { isUserAct = false; }
|
|
1071
|
+
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
1072
|
+
if (_self.enableDebugExceptions()) {
|
|
1073
|
+
throw message;
|
|
1074
|
+
}
|
|
1075
|
+
else {
|
|
1076
|
+
if (!isUndefined(message.message)) {
|
|
1077
|
+
var logLevel = _self.consoleLoggingLevel();
|
|
1078
|
+
if (isUserAct) {
|
|
1079
|
+
var messageKey = +message.messageId;
|
|
1080
|
+
if (!_messageLogged[messageKey] && logLevel >= exports.LoggingSeverity.WARNING) {
|
|
1081
|
+
_self.warnToConsole(message.message);
|
|
1082
|
+
_messageLogged[messageKey] = true;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
else {
|
|
1086
|
+
if (logLevel >= exports.LoggingSeverity.WARNING) {
|
|
1087
|
+
_self.warnToConsole(message.message);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
_self.logInternalMessage(severity, message);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
_self.warnToConsole = function (message) {
|
|
1095
|
+
var theConsole = getConsole();
|
|
1096
|
+
if (!!theConsole) {
|
|
1097
|
+
var logFunc = 'log';
|
|
1098
|
+
if (theConsole.warn) {
|
|
1099
|
+
logFunc = 'warn';
|
|
1100
|
+
}
|
|
1101
|
+
if (isFunction(theConsole[logFunc])) {
|
|
1102
|
+
theConsole[logFunc](message);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
};
|
|
1106
|
+
_self.resetInternalMessageCount = function () {
|
|
1107
|
+
_messageCount = 0;
|
|
1108
|
+
_messageLogged = {};
|
|
1109
|
+
};
|
|
1110
|
+
_self.logInternalMessage = function (severity, message) {
|
|
1111
|
+
if (_areInternalMessagesThrottled()) {
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
var logMessage = true;
|
|
1115
|
+
var messageKey = AIInternalMessagePrefix + message.messageId;
|
|
1116
|
+
if (_messageLogged[messageKey]) {
|
|
1117
|
+
logMessage = false;
|
|
1118
|
+
}
|
|
1119
|
+
else {
|
|
1120
|
+
_messageLogged[messageKey] = true;
|
|
1121
|
+
}
|
|
1122
|
+
if (logMessage) {
|
|
1123
|
+
if (severity <= _self.telemetryLoggingLevel()) {
|
|
1124
|
+
_self.queue.push(message);
|
|
1125
|
+
_messageCount++;
|
|
1126
|
+
}
|
|
1127
|
+
if (_messageCount === _self.maxInternalMessageLimit()) {
|
|
1128
|
+
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
1129
|
+
var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);
|
|
1130
|
+
_self.queue.push(throttleMessage);
|
|
1131
|
+
_self.warnToConsole(throttleLimitMessage);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
function _getConfigValue(name, defValue) {
|
|
1136
|
+
var value = config[name];
|
|
1137
|
+
if (!isNullOrUndefined(value)) {
|
|
1138
|
+
return value;
|
|
1139
|
+
}
|
|
1140
|
+
return defValue;
|
|
1141
|
+
}
|
|
1142
|
+
function _areInternalMessagesThrottled() {
|
|
1143
|
+
return _messageCount >= _self.maxInternalMessageLimit();
|
|
1144
|
+
}
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
return DiagnosticLogger;
|
|
1148
|
+
}());
|
|
1149
|
+
|
|
1150
|
+
var strExecutionContextKey = "ctx";
|
|
1151
|
+
var _defaultPerfManager = null;
|
|
1152
|
+
var PerfEvent = /** @class */ (function () {
|
|
1153
|
+
function PerfEvent(name, payloadDetails, isAsync) {
|
|
1154
|
+
var _self = this;
|
|
1155
|
+
var accessorDefined = false;
|
|
1156
|
+
_self.start = dateNow();
|
|
1157
|
+
_self.name = name;
|
|
1158
|
+
_self.isAsync = isAsync;
|
|
1159
|
+
_self.isChildEvt = function () { return false; };
|
|
1160
|
+
if (isFunction(payloadDetails)) {
|
|
1161
|
+
var theDetails_1;
|
|
1162
|
+
accessorDefined = objDefineAccessors(_self, 'payload', function () {
|
|
1163
|
+
if (!theDetails_1 && isFunction(payloadDetails)) {
|
|
1164
|
+
theDetails_1 = payloadDetails();
|
|
1165
|
+
payloadDetails = null;
|
|
1166
|
+
}
|
|
1167
|
+
return theDetails_1;
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
_self.getCtx = function (key) {
|
|
1171
|
+
if (key) {
|
|
1172
|
+
if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) {
|
|
1173
|
+
return _self[key];
|
|
1174
|
+
}
|
|
1175
|
+
return (_self[strExecutionContextKey] || {})[key];
|
|
1176
|
+
}
|
|
1177
|
+
return null;
|
|
1178
|
+
};
|
|
1179
|
+
_self.setCtx = function (key, value) {
|
|
1180
|
+
if (key) {
|
|
1181
|
+
if (key === PerfEvent.ParentContextKey) {
|
|
1182
|
+
if (!_self[key]) {
|
|
1183
|
+
_self.isChildEvt = function () { return true; };
|
|
1184
|
+
}
|
|
1185
|
+
_self[key] = value;
|
|
1186
|
+
}
|
|
1187
|
+
else if (key === PerfEvent.ChildrenContextKey) {
|
|
1188
|
+
_self[key] = value;
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
1192
|
+
ctx[key] = value;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
_self.complete = function () {
|
|
1197
|
+
var childTime = 0;
|
|
1198
|
+
var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey);
|
|
1199
|
+
if (isArray(childEvts)) {
|
|
1200
|
+
for (var lp = 0; lp < childEvts.length; lp++) {
|
|
1201
|
+
var childEvt = childEvts[lp];
|
|
1202
|
+
if (childEvt) {
|
|
1203
|
+
childTime += childEvt.time;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
_self.time = dateNow() - _self.start;
|
|
1208
|
+
_self.exTime = _self.time - childTime;
|
|
1209
|
+
_self.complete = function () { };
|
|
1210
|
+
if (!accessorDefined && isFunction(payloadDetails)) {
|
|
1211
|
+
_self.payload = payloadDetails();
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
PerfEvent.ParentContextKey = "parent";
|
|
1216
|
+
PerfEvent.ChildrenContextKey = "childEvts";
|
|
1217
|
+
return PerfEvent;
|
|
1218
|
+
}());
|
|
1219
|
+
var PerfManager = /** @class */ (function () {
|
|
1220
|
+
function PerfManager(manager) {
|
|
1221
|
+
this.ctx = {};
|
|
1222
|
+
dynamicProto(PerfManager, this, function (_self) {
|
|
1223
|
+
_self.create = function (src, payloadDetails, isAsync) {
|
|
1224
|
+
return new PerfEvent(src, payloadDetails, isAsync);
|
|
1225
|
+
};
|
|
1226
|
+
_self.fire = function (perfEvent) {
|
|
1227
|
+
if (perfEvent) {
|
|
1228
|
+
perfEvent.complete();
|
|
1229
|
+
if (manager && isFunction(manager.perfEvent)) {
|
|
1230
|
+
manager.perfEvent(perfEvent);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
};
|
|
1234
|
+
_self.setCtx = function (key, value) {
|
|
1235
|
+
if (key) {
|
|
1236
|
+
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
1237
|
+
ctx[key] = value;
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
_self.getCtx = function (key) {
|
|
1241
|
+
return (_self[strExecutionContextKey] || {})[key];
|
|
1242
|
+
};
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
return PerfManager;
|
|
1246
|
+
}());
|
|
1247
|
+
var doPerfActiveKey = "CoreUtils.doPerf";
|
|
1248
|
+
function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
1249
|
+
if (mgrSource) {
|
|
1250
|
+
var perfMgr = mgrSource;
|
|
1251
|
+
if (isFunction(perfMgr["getPerfMgr"])) {
|
|
1252
|
+
perfMgr = perfMgr["getPerfMgr"]();
|
|
1253
|
+
}
|
|
1254
|
+
if (perfMgr) {
|
|
1255
|
+
var perfEvt = void 0;
|
|
1256
|
+
var currentActive = perfMgr.getCtx(doPerfActiveKey);
|
|
1257
|
+
try {
|
|
1258
|
+
perfEvt = perfMgr.create(getSource(), details, isAsync);
|
|
1259
|
+
if (perfEvt) {
|
|
1260
|
+
if (currentActive && perfEvt.setCtx) {
|
|
1261
|
+
perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive);
|
|
1262
|
+
if (currentActive.getCtx && currentActive.setCtx) {
|
|
1263
|
+
var children = currentActive.getCtx(PerfEvent.ChildrenContextKey);
|
|
1264
|
+
if (!children) {
|
|
1265
|
+
children = [];
|
|
1266
|
+
currentActive.setCtx(PerfEvent.ChildrenContextKey, children);
|
|
1267
|
+
}
|
|
1268
|
+
children.push(perfEvt);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
perfMgr.setCtx(doPerfActiveKey, perfEvt);
|
|
1272
|
+
return func(perfEvt);
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
catch (ex) {
|
|
1276
|
+
if (perfEvt && perfEvt.setCtx) {
|
|
1277
|
+
perfEvt.setCtx("exception", ex);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
finally {
|
|
1281
|
+
if (perfEvt) {
|
|
1282
|
+
perfMgr.fire(perfEvt);
|
|
1283
|
+
}
|
|
1284
|
+
perfMgr.setCtx(doPerfActiveKey, currentActive);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
return func();
|
|
1289
|
+
}
|
|
1290
|
+
function getGblPerfMgr() {
|
|
1291
|
+
return _defaultPerfManager;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
var TelemetryPluginChain = /** @class */ (function () {
|
|
1295
|
+
function TelemetryPluginChain(plugin, defItemCtx) {
|
|
1296
|
+
var _self = this;
|
|
1297
|
+
var _nextProxy = null;
|
|
1298
|
+
var _hasProcessTelemetry = isFunction(plugin.processTelemetry);
|
|
1299
|
+
var _hasSetNext = isFunction(plugin.setNextPlugin);
|
|
1300
|
+
_self._hasRun = false;
|
|
1301
|
+
_self.getPlugin = function () {
|
|
1302
|
+
return plugin;
|
|
1303
|
+
};
|
|
1304
|
+
_self.getNext = function () {
|
|
1305
|
+
return _nextProxy;
|
|
1306
|
+
};
|
|
1307
|
+
_self.setNext = function (nextPlugin) {
|
|
1308
|
+
_nextProxy = nextPlugin;
|
|
1309
|
+
};
|
|
1310
|
+
_self.processTelemetry = function (env, itemCtx) {
|
|
1311
|
+
if (!itemCtx) {
|
|
1312
|
+
itemCtx = defItemCtx;
|
|
1313
|
+
}
|
|
1314
|
+
var identifier = plugin ? plugin.identifier : "TelemetryPluginChain";
|
|
1315
|
+
doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + ":processTelemetry"; }, function () {
|
|
1316
|
+
if (plugin && _hasProcessTelemetry) {
|
|
1317
|
+
_self._hasRun = true;
|
|
1318
|
+
try {
|
|
1319
|
+
itemCtx.setNext(_nextProxy);
|
|
1320
|
+
if (_hasSetNext) {
|
|
1321
|
+
plugin.setNextPlugin(_nextProxy);
|
|
1322
|
+
}
|
|
1323
|
+
_nextProxy && (_nextProxy._hasRun = false);
|
|
1324
|
+
plugin.processTelemetry(env, itemCtx);
|
|
1325
|
+
}
|
|
1326
|
+
catch (error) {
|
|
1327
|
+
var hasRun = _nextProxy && _nextProxy._hasRun;
|
|
1328
|
+
if (!_nextProxy || !hasRun) {
|
|
1329
|
+
itemCtx.diagLog().throwInternal(exports.LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + dumpObj(error));
|
|
1330
|
+
}
|
|
1331
|
+
if (_nextProxy && !hasRun) {
|
|
1332
|
+
_nextProxy.processTelemetry(env, itemCtx);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
else if (_nextProxy) {
|
|
1337
|
+
_self._hasRun = true;
|
|
1338
|
+
_nextProxy.processTelemetry(env, itemCtx);
|
|
1339
|
+
}
|
|
1340
|
+
}, function () { return ({ item: env }); }, !(env.sync));
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
return TelemetryPluginChain;
|
|
1344
|
+
}());
|
|
1345
|
+
|
|
1346
|
+
function _createProxyChain(plugins, itemCtx) {
|
|
1347
|
+
var proxies = [];
|
|
1348
|
+
if (plugins && plugins.length > 0) {
|
|
1349
|
+
var lastProxy = null;
|
|
1350
|
+
for (var idx = 0; idx < plugins.length; idx++) {
|
|
1351
|
+
var thePlugin = plugins[idx];
|
|
1352
|
+
if (thePlugin && isFunction(thePlugin.processTelemetry)) {
|
|
1353
|
+
var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);
|
|
1354
|
+
proxies.push(newProxy);
|
|
1355
|
+
if (lastProxy) {
|
|
1356
|
+
lastProxy.setNext(newProxy);
|
|
1357
|
+
}
|
|
1358
|
+
lastProxy = newProxy;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
return proxies.length > 0 ? proxies[0] : null;
|
|
1363
|
+
}
|
|
1364
|
+
function _copyProxyChain(proxy, itemCtx, startAt) {
|
|
1365
|
+
var plugins = [];
|
|
1366
|
+
var add = startAt ? false : true;
|
|
1367
|
+
if (proxy) {
|
|
1368
|
+
while (proxy) {
|
|
1369
|
+
var thePlugin = proxy.getPlugin();
|
|
1370
|
+
if (add || thePlugin === startAt) {
|
|
1371
|
+
add = true;
|
|
1372
|
+
plugins.push(thePlugin);
|
|
1373
|
+
}
|
|
1374
|
+
proxy = proxy.getNext();
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
if (!add) {
|
|
1378
|
+
plugins.push(startAt);
|
|
1379
|
+
}
|
|
1380
|
+
return _createProxyChain(plugins, itemCtx);
|
|
1381
|
+
}
|
|
1382
|
+
function _copyPluginChain(srcPlugins, itemCtx, startAt) {
|
|
1383
|
+
var plugins = srcPlugins;
|
|
1384
|
+
var add = false;
|
|
1385
|
+
if (startAt && srcPlugins) {
|
|
1386
|
+
plugins = [];
|
|
1387
|
+
arrForEach(srcPlugins, function (thePlugin) {
|
|
1388
|
+
if (add || thePlugin === startAt) {
|
|
1389
|
+
add = true;
|
|
1390
|
+
plugins.push(thePlugin);
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
if (startAt && !add) {
|
|
1395
|
+
if (!plugins) {
|
|
1396
|
+
plugins = [];
|
|
1397
|
+
}
|
|
1398
|
+
plugins.push(startAt);
|
|
1399
|
+
}
|
|
1400
|
+
return _createProxyChain(plugins, itemCtx);
|
|
1401
|
+
}
|
|
1402
|
+
var ProcessTelemetryContext = /** @class */ (function () {
|
|
1403
|
+
function ProcessTelemetryContext(plugins, config, core, startAt) {
|
|
1404
|
+
var _self = this;
|
|
1405
|
+
var _nextProxy = null;
|
|
1406
|
+
if (startAt !== null) {
|
|
1407
|
+
if (plugins && isFunction(plugins.getPlugin)) {
|
|
1408
|
+
_nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());
|
|
1409
|
+
}
|
|
1410
|
+
else {
|
|
1411
|
+
if (startAt) {
|
|
1412
|
+
_nextProxy = _copyPluginChain(plugins, _self, startAt);
|
|
1413
|
+
}
|
|
1414
|
+
else if (isUndefined(startAt)) {
|
|
1415
|
+
_nextProxy = _createProxyChain(plugins, _self);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
_self.core = function () {
|
|
1420
|
+
return core;
|
|
1421
|
+
};
|
|
1422
|
+
_self.diagLog = function () {
|
|
1423
|
+
return safeGetLogger(core, config);
|
|
1424
|
+
};
|
|
1425
|
+
_self.getCfg = function () {
|
|
1426
|
+
return config;
|
|
1427
|
+
};
|
|
1428
|
+
_self.getExtCfg = function (identifier, defaultValue) {
|
|
1429
|
+
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1430
|
+
var theConfig;
|
|
1431
|
+
if (config) {
|
|
1432
|
+
var extConfig = config.extensionConfig;
|
|
1433
|
+
if (extConfig && identifier) {
|
|
1434
|
+
theConfig = extConfig[identifier];
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
return (theConfig ? theConfig : defaultValue);
|
|
1438
|
+
};
|
|
1439
|
+
_self.getConfig = function (identifier, field, defaultValue) {
|
|
1440
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
1441
|
+
var theValue;
|
|
1442
|
+
var extConfig = _self.getExtCfg(identifier, null);
|
|
1443
|
+
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
1444
|
+
theValue = extConfig[field];
|
|
1445
|
+
}
|
|
1446
|
+
else if (config && !isNullOrUndefined(config[field])) {
|
|
1447
|
+
theValue = config[field];
|
|
1448
|
+
}
|
|
1449
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1450
|
+
};
|
|
1451
|
+
_self.hasNext = function () {
|
|
1452
|
+
return _nextProxy != null;
|
|
1453
|
+
};
|
|
1454
|
+
_self.getNext = function () {
|
|
1455
|
+
return _nextProxy;
|
|
1456
|
+
};
|
|
1457
|
+
_self.setNext = function (nextPlugin) {
|
|
1458
|
+
_nextProxy = nextPlugin;
|
|
1459
|
+
};
|
|
1460
|
+
_self.processNext = function (env) {
|
|
1461
|
+
var nextPlugin = _nextProxy;
|
|
1462
|
+
if (nextPlugin) {
|
|
1463
|
+
_nextProxy = nextPlugin.getNext();
|
|
1464
|
+
nextPlugin.processTelemetry(env, _self);
|
|
1465
|
+
}
|
|
1466
|
+
};
|
|
1467
|
+
_self.createNew = function (plugins, startAt) {
|
|
1468
|
+
if (plugins === void 0) { plugins = null; }
|
|
1469
|
+
return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
return ProcessTelemetryContext;
|
|
1473
|
+
}());
|
|
1474
|
+
|
|
1475
|
+
var strIKey = "iKey";
|
|
1476
|
+
var strExtensionConfig = "extensionConfig";
|
|
1477
|
+
|
|
1478
|
+
var strGetPlugin = "getPlugin";
|
|
1479
|
+
var BaseTelemetryPlugin = /** @class */ (function () {
|
|
1480
|
+
function BaseTelemetryPlugin() {
|
|
1481
|
+
var _self = this;
|
|
1482
|
+
var _isinitialized = false;
|
|
1483
|
+
var _rootCtx = null;
|
|
1484
|
+
var _nextPlugin = null;
|
|
1485
|
+
_self.core = null;
|
|
1486
|
+
_self.diagLog = function (itemCtx) {
|
|
1487
|
+
return _self._getTelCtx(itemCtx).diagLog();
|
|
1488
|
+
};
|
|
1489
|
+
_self.isInitialized = function () {
|
|
1490
|
+
return _isinitialized;
|
|
1491
|
+
};
|
|
1492
|
+
_self.setInitialized = function (isInitialized) {
|
|
1493
|
+
_isinitialized = isInitialized;
|
|
1494
|
+
};
|
|
1495
|
+
_self.setNextPlugin = function (next) {
|
|
1496
|
+
_nextPlugin = next;
|
|
1497
|
+
};
|
|
1498
|
+
_self.processNext = function (env, itemCtx) {
|
|
1499
|
+
if (itemCtx) {
|
|
1500
|
+
itemCtx.processNext(env);
|
|
1501
|
+
}
|
|
1502
|
+
else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
|
|
1503
|
+
_nextPlugin.processTelemetry(env, null);
|
|
1504
|
+
}
|
|
1505
|
+
};
|
|
1506
|
+
_self._getTelCtx = function (currentCtx) {
|
|
1507
|
+
if (currentCtx === void 0) { currentCtx = null; }
|
|
1508
|
+
var itemCtx = currentCtx;
|
|
1509
|
+
if (!itemCtx) {
|
|
1510
|
+
var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);
|
|
1511
|
+
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1512
|
+
itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
|
|
1513
|
+
}
|
|
1514
|
+
else {
|
|
1515
|
+
itemCtx = rootCtx.createNew(null, _nextPlugin);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
return itemCtx;
|
|
1519
|
+
};
|
|
1520
|
+
_self._baseTelInit = function (config, core, extensions, pluginChain) {
|
|
1521
|
+
if (config) {
|
|
1522
|
+
setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
|
|
1523
|
+
}
|
|
1524
|
+
if (!pluginChain && core) {
|
|
1525
|
+
pluginChain = core.getProcessTelContext().getNext();
|
|
1526
|
+
}
|
|
1527
|
+
var nextPlugin = _nextPlugin;
|
|
1528
|
+
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1529
|
+
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
1530
|
+
}
|
|
1531
|
+
_self.core = core;
|
|
1532
|
+
_rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
1533
|
+
_isinitialized = true;
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1536
|
+
BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {
|
|
1537
|
+
this._baseTelInit(config, core, extensions, pluginChain);
|
|
1538
|
+
};
|
|
1539
|
+
return BaseTelemetryPlugin;
|
|
1540
|
+
}());
|
|
1541
|
+
|
|
1542
|
+
var processTelemetry = "processTelemetry";
|
|
1543
|
+
var priority = "priority";
|
|
1544
|
+
var setNextPlugin = "setNextPlugin";
|
|
1545
|
+
var isInitialized = "isInitialized";
|
|
1546
|
+
function initializePlugins(processContext, extensions) {
|
|
1547
|
+
var initPlugins = [];
|
|
1548
|
+
var lastPlugin = null;
|
|
1549
|
+
var proxy = processContext.getNext();
|
|
1550
|
+
while (proxy) {
|
|
1551
|
+
var thePlugin = proxy.getPlugin();
|
|
1552
|
+
if (thePlugin) {
|
|
1553
|
+
if (lastPlugin &&
|
|
1554
|
+
isFunction(lastPlugin[setNextPlugin]) &&
|
|
1555
|
+
isFunction(thePlugin[processTelemetry])) {
|
|
1556
|
+
lastPlugin[setNextPlugin](thePlugin);
|
|
1557
|
+
}
|
|
1558
|
+
if (!isFunction(thePlugin[isInitialized]) || !thePlugin[isInitialized]()) {
|
|
1559
|
+
initPlugins.push(thePlugin);
|
|
1560
|
+
}
|
|
1561
|
+
lastPlugin = thePlugin;
|
|
1562
|
+
proxy = proxy.getNext();
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
arrForEach(initPlugins, function (thePlugin) {
|
|
1566
|
+
thePlugin.initialize(processContext.getCfg(), processContext.core(), extensions, processContext.getNext());
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1569
|
+
function sortPlugins(plugins) {
|
|
1570
|
+
return plugins.sort(function (extA, extB) {
|
|
1571
|
+
var result = 0;
|
|
1572
|
+
var bHasProcess = isFunction(extB[processTelemetry]);
|
|
1573
|
+
if (isFunction(extA[processTelemetry])) {
|
|
1574
|
+
result = bHasProcess ? extA[priority] - extB[priority] : 1;
|
|
1575
|
+
}
|
|
1576
|
+
else if (bHasProcess) {
|
|
1577
|
+
result = -1;
|
|
1578
|
+
}
|
|
1579
|
+
return result;
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
var ChannelControllerPriority = 500;
|
|
1584
|
+
var ChannelValidationMessage = "Channel has invalid priority";
|
|
1585
|
+
var ChannelController = /** @class */ (function (_super) {
|
|
1586
|
+
__extendsFn(ChannelController, _super);
|
|
1587
|
+
function ChannelController() {
|
|
1588
|
+
var _this = _super.call(this) || this;
|
|
1589
|
+
_this.identifier = "ChannelControllerPlugin";
|
|
1590
|
+
_this.priority = ChannelControllerPriority;
|
|
1591
|
+
var _channelQueue;
|
|
1592
|
+
dynamicProto(ChannelController, _this, function (_self, _base) {
|
|
1593
|
+
_self.setNextPlugin = function (next) {
|
|
1594
|
+
};
|
|
1595
|
+
_self.processTelemetry = function (item, itemCtx) {
|
|
1596
|
+
if (_channelQueue) {
|
|
1597
|
+
arrForEach(_channelQueue, function (queues) {
|
|
1598
|
+
if (queues.length > 0) {
|
|
1599
|
+
var chainCtx = _this._getTelCtx(itemCtx).createNew(queues);
|
|
1600
|
+
chainCtx.processNext(item);
|
|
1601
|
+
}
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
};
|
|
1605
|
+
_self.getChannelControls = function () {
|
|
1606
|
+
return _channelQueue;
|
|
1607
|
+
};
|
|
1608
|
+
_self.initialize = function (config, core, extensions) {
|
|
1609
|
+
if (_self.isInitialized()) {
|
|
1610
|
+
return;
|
|
1611
|
+
}
|
|
1612
|
+
_base.initialize(config, core, extensions);
|
|
1613
|
+
_createChannelQueues((config || {}).channels, extensions);
|
|
1614
|
+
arrForEach(_channelQueue, function (queue) { return initializePlugins(new ProcessTelemetryContext(queue, config, core), extensions); });
|
|
1615
|
+
};
|
|
1616
|
+
});
|
|
1617
|
+
function _checkQueuePriority(queue) {
|
|
1618
|
+
arrForEach(queue, function (queueItem) {
|
|
1619
|
+
if (queueItem.priority < ChannelControllerPriority) {
|
|
1620
|
+
throwError(ChannelValidationMessage + queueItem.identifier);
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
function _addChannelQueue(queue) {
|
|
1625
|
+
if (queue && queue.length > 0) {
|
|
1626
|
+
queue = queue.sort(function (a, b) {
|
|
1627
|
+
return a.priority - b.priority;
|
|
1628
|
+
});
|
|
1629
|
+
_checkQueuePriority(queue);
|
|
1630
|
+
_channelQueue.push(queue);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
function _createChannelQueues(channels, extensions) {
|
|
1634
|
+
_channelQueue = [];
|
|
1635
|
+
if (channels) {
|
|
1636
|
+
arrForEach(channels, function (queue) { return _addChannelQueue(queue); });
|
|
1637
|
+
}
|
|
1638
|
+
if (extensions) {
|
|
1639
|
+
var extensionQueue_1 = [];
|
|
1640
|
+
arrForEach(extensions, function (plugin) {
|
|
1641
|
+
if (plugin.priority > ChannelControllerPriority) {
|
|
1642
|
+
extensionQueue_1.push(plugin);
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
_addChannelQueue(extensionQueue_1);
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
return _this;
|
|
1649
|
+
}
|
|
1650
|
+
ChannelController._staticInit = (function () {
|
|
1651
|
+
var proto = ChannelController.prototype;
|
|
1652
|
+
objDefineAccessors(proto, "ChannelControls", proto.getChannelControls);
|
|
1653
|
+
objDefineAccessors(proto, "channelQueue", proto.getChannelControls);
|
|
1654
|
+
})();
|
|
1655
|
+
return ChannelController;
|
|
1656
|
+
}(BaseTelemetryPlugin));
|
|
1657
|
+
|
|
1658
|
+
var strToGMTString = "toGMTString";
|
|
1659
|
+
var strToUTCString = "toUTCString";
|
|
1660
|
+
var strCookie = "cookie";
|
|
1661
|
+
var strExpires = "expires";
|
|
1662
|
+
var strEnabled = "enabled";
|
|
1663
|
+
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
1664
|
+
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
1665
|
+
var strConfigCookieMgr = "_ckMgr";
|
|
1666
|
+
var strEmpty = "";
|
|
1667
|
+
var _supportsCookies = null;
|
|
1668
|
+
var _allowUaSameSite = null;
|
|
1669
|
+
var _parsedCookieValue = null;
|
|
1670
|
+
var _doc = getDocument();
|
|
1671
|
+
var _cookieCache = {};
|
|
1672
|
+
var _globalCookieConfig = {};
|
|
1673
|
+
function _gblCookieMgr(config, logger) {
|
|
1674
|
+
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
1675
|
+
if (!inst) {
|
|
1676
|
+
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
1677
|
+
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
1678
|
+
}
|
|
1679
|
+
return inst;
|
|
1680
|
+
}
|
|
1681
|
+
function _isMgrEnabled(cookieMgr) {
|
|
1682
|
+
if (cookieMgr) {
|
|
1683
|
+
return cookieMgr.isEnabled();
|
|
1684
|
+
}
|
|
1685
|
+
return true;
|
|
1686
|
+
}
|
|
1687
|
+
function _createCookieMgrConfig(rootConfig) {
|
|
1688
|
+
var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {};
|
|
1689
|
+
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
|
1690
|
+
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
|
1691
|
+
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
|
1692
|
+
var cookieEnabled = void 0;
|
|
1693
|
+
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
1694
|
+
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
1695
|
+
}
|
|
1696
|
+
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
1697
|
+
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
1698
|
+
}
|
|
1699
|
+
cookieMgrCfg[strEnabled] = cookieEnabled;
|
|
1700
|
+
}
|
|
1701
|
+
return cookieMgrCfg;
|
|
1702
|
+
}
|
|
1703
|
+
function safeGetCookieMgr(core, config) {
|
|
1704
|
+
var cookieMgr;
|
|
1705
|
+
if (core) {
|
|
1706
|
+
cookieMgr = core.getCookieMgr();
|
|
1707
|
+
}
|
|
1708
|
+
else if (config) {
|
|
1709
|
+
var cookieCfg = config.cookieCfg;
|
|
1710
|
+
if (cookieCfg[strConfigCookieMgr]) {
|
|
1711
|
+
cookieMgr = cookieCfg[strConfigCookieMgr];
|
|
1712
|
+
}
|
|
1713
|
+
else {
|
|
1714
|
+
cookieMgr = createCookieMgr(config);
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
if (!cookieMgr) {
|
|
1718
|
+
cookieMgr = _gblCookieMgr(config, (core || {}).logger);
|
|
1719
|
+
}
|
|
1720
|
+
return cookieMgr;
|
|
1721
|
+
}
|
|
1722
|
+
function createCookieMgr(rootConfig, logger) {
|
|
1723
|
+
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
|
1724
|
+
var _path = cookieMgrConfig.path || "/";
|
|
1725
|
+
var _domain = cookieMgrConfig.domain;
|
|
1726
|
+
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
|
1727
|
+
var cookieMgr = {
|
|
1728
|
+
isEnabled: function () {
|
|
1729
|
+
var enabled = _enabled && areCookiesSupported(logger);
|
|
1730
|
+
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
1731
|
+
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
1732
|
+
enabled = _isMgrEnabled(gblManager);
|
|
1733
|
+
}
|
|
1734
|
+
return enabled;
|
|
1735
|
+
},
|
|
1736
|
+
setEnabled: function (value) {
|
|
1737
|
+
_enabled = value !== false;
|
|
1738
|
+
},
|
|
1739
|
+
set: function (name, value, maxAgeSec, domain, path) {
|
|
1740
|
+
var result = false;
|
|
1741
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1742
|
+
var values = {};
|
|
1743
|
+
var theValue = strTrim(value || strEmpty);
|
|
1744
|
+
var idx = theValue.indexOf(";");
|
|
1745
|
+
if (idx !== -1) {
|
|
1746
|
+
theValue = strTrim(value.substring(0, idx));
|
|
1747
|
+
values = _extractParts(value.substring(idx + 1));
|
|
1748
|
+
}
|
|
1749
|
+
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
|
1750
|
+
if (!isNullOrUndefined(maxAgeSec)) {
|
|
1751
|
+
var _isIE = isIE();
|
|
1752
|
+
if (isUndefined(values[strExpires])) {
|
|
1753
|
+
var nowMs = dateNow();
|
|
1754
|
+
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
1755
|
+
if (expireMs > 0) {
|
|
1756
|
+
var expiry = new Date();
|
|
1757
|
+
expiry.setTime(expireMs);
|
|
1758
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
if (!_isIE) {
|
|
1762
|
+
setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
var location_1 = getLocation();
|
|
1766
|
+
if (location_1 && location_1.protocol === "https:") {
|
|
1767
|
+
setValue(values, "secure", null, null, isUndefined);
|
|
1768
|
+
if (_allowUaSameSite === null) {
|
|
1769
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent);
|
|
1770
|
+
}
|
|
1771
|
+
if (_allowUaSameSite) {
|
|
1772
|
+
setValue(values, "SameSite", "None", null, isUndefined);
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
setValue(values, "path", path || _path, null, isUndefined);
|
|
1776
|
+
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
1777
|
+
setCookieFn(name, _formatCookieValue(theValue, values));
|
|
1778
|
+
result = true;
|
|
1779
|
+
}
|
|
1780
|
+
return result;
|
|
1781
|
+
},
|
|
1782
|
+
get: function (name) {
|
|
1783
|
+
var value = strEmpty;
|
|
1784
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1785
|
+
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1786
|
+
}
|
|
1787
|
+
return value;
|
|
1788
|
+
},
|
|
1789
|
+
del: function (name, path) {
|
|
1790
|
+
var result = false;
|
|
1791
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1792
|
+
result = cookieMgr.purge(name, path);
|
|
1793
|
+
}
|
|
1794
|
+
return result;
|
|
1795
|
+
},
|
|
1796
|
+
purge: function (name, path) {
|
|
1797
|
+
var _a;
|
|
1798
|
+
var result = false;
|
|
1799
|
+
if (areCookiesSupported(logger)) {
|
|
1800
|
+
var values = (_a = {},
|
|
1801
|
+
_a["path"] = path ? path : "/",
|
|
1802
|
+
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
1803
|
+
_a);
|
|
1804
|
+
if (!isIE()) {
|
|
1805
|
+
values["max-age"] = "0";
|
|
1806
|
+
}
|
|
1807
|
+
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1808
|
+
delCookie(name, _formatCookieValue(strEmpty, values));
|
|
1809
|
+
result = true;
|
|
1810
|
+
}
|
|
1811
|
+
return result;
|
|
1812
|
+
}
|
|
1813
|
+
};
|
|
1814
|
+
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
1815
|
+
return cookieMgr;
|
|
1816
|
+
}
|
|
1817
|
+
function areCookiesSupported(logger) {
|
|
1818
|
+
if (_supportsCookies === null) {
|
|
1819
|
+
_supportsCookies = false;
|
|
1820
|
+
try {
|
|
1821
|
+
var doc = _doc || {};
|
|
1822
|
+
_supportsCookies = doc[strCookie] !== undefined;
|
|
1823
|
+
}
|
|
1824
|
+
catch (e) {
|
|
1825
|
+
logger && logger.throwInternal(exports.LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
return _supportsCookies;
|
|
1829
|
+
}
|
|
1830
|
+
function _extractParts(theValue) {
|
|
1831
|
+
var values = {};
|
|
1832
|
+
if (theValue && theValue.length) {
|
|
1833
|
+
var parts = strTrim(theValue).split(";");
|
|
1834
|
+
arrForEach(parts, function (thePart) {
|
|
1835
|
+
thePart = strTrim(thePart || strEmpty);
|
|
1836
|
+
if (thePart) {
|
|
1837
|
+
var idx = thePart.indexOf("=");
|
|
1838
|
+
if (idx === -1) {
|
|
1839
|
+
values[thePart] = null;
|
|
1840
|
+
}
|
|
1841
|
+
else {
|
|
1842
|
+
values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1));
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
return values;
|
|
1848
|
+
}
|
|
1849
|
+
function _formatDate(theDate, func) {
|
|
1850
|
+
if (isFunction(theDate[func])) {
|
|
1851
|
+
return theDate[func]();
|
|
1852
|
+
}
|
|
1853
|
+
return null;
|
|
1854
|
+
}
|
|
1855
|
+
function _formatCookieValue(value, values) {
|
|
1856
|
+
var cookieValue = value || strEmpty;
|
|
1857
|
+
objForEachKey(values, function (name, theValue) {
|
|
1858
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty);
|
|
1859
|
+
});
|
|
1860
|
+
return cookieValue;
|
|
1861
|
+
}
|
|
1862
|
+
function _getCookieValue(name) {
|
|
1863
|
+
var cookieValue = strEmpty;
|
|
1864
|
+
if (_doc) {
|
|
1865
|
+
var theCookie = _doc[strCookie] || strEmpty;
|
|
1866
|
+
if (_parsedCookieValue !== theCookie) {
|
|
1867
|
+
_cookieCache = _extractParts(theCookie);
|
|
1868
|
+
_parsedCookieValue = theCookie;
|
|
1869
|
+
}
|
|
1870
|
+
cookieValue = strTrim(_cookieCache[name] || strEmpty);
|
|
1871
|
+
}
|
|
1872
|
+
return cookieValue;
|
|
1873
|
+
}
|
|
1874
|
+
function _setCookieValue(name, cookieValue) {
|
|
1875
|
+
if (_doc) {
|
|
1876
|
+
_doc[strCookie] = name + "=" + cookieValue;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
function uaDisallowsSameSiteNone(userAgent) {
|
|
1880
|
+
if (!isString(userAgent)) {
|
|
1881
|
+
return false;
|
|
1882
|
+
}
|
|
1883
|
+
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
|
1884
|
+
return true;
|
|
1885
|
+
}
|
|
1886
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
1887
|
+
return true;
|
|
1888
|
+
}
|
|
1889
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
1890
|
+
return true;
|
|
1891
|
+
}
|
|
1892
|
+
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
1893
|
+
return true;
|
|
1894
|
+
}
|
|
1895
|
+
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
|
1896
|
+
return true;
|
|
1897
|
+
}
|
|
1898
|
+
if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) {
|
|
1899
|
+
return true;
|
|
1900
|
+
}
|
|
1901
|
+
return false;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
var validationError = "Extensions must provide callback to initialize";
|
|
1905
|
+
var strNotificationManager = "_notificationManager";
|
|
1906
|
+
function _createPerfManager(core, notificationMgr) {
|
|
1907
|
+
return new PerfManager(notificationMgr);
|
|
1908
|
+
}
|
|
1909
|
+
var BaseCore$2 = /** @class */ (function () {
|
|
1910
|
+
function BaseCore() {
|
|
1911
|
+
var _isInitialized = false;
|
|
1912
|
+
var _eventQueue;
|
|
1913
|
+
var _channelController;
|
|
1914
|
+
var _notificationManager;
|
|
1915
|
+
var _perfManager;
|
|
1916
|
+
var _cookieManager;
|
|
1917
|
+
dynamicProto(BaseCore, this, function (_self) {
|
|
1918
|
+
_self._extensions = new Array();
|
|
1919
|
+
_channelController = new ChannelController();
|
|
1920
|
+
_self.logger = objCreateFn({
|
|
1921
|
+
throwInternal: function (severity, msgId, msg, properties, isUserAct) {
|
|
1922
|
+
},
|
|
1923
|
+
warnToConsole: function (message) { },
|
|
1924
|
+
resetInternalMessageCount: function () { }
|
|
1925
|
+
});
|
|
1926
|
+
_eventQueue = [];
|
|
1927
|
+
_self.isInitialized = function () { return _isInitialized; };
|
|
1928
|
+
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
1929
|
+
if (_self.isInitialized()) {
|
|
1930
|
+
throwError("Core should not be initialized more than once");
|
|
1931
|
+
}
|
|
1932
|
+
if (!config || isNullOrUndefined(config.instrumentationKey)) {
|
|
1933
|
+
throwError("Please provide instrumentation key");
|
|
1934
|
+
}
|
|
1935
|
+
_notificationManager = notificationManager;
|
|
1936
|
+
_self[strNotificationManager] = notificationManager;
|
|
1937
|
+
_self.config = config || {};
|
|
1938
|
+
if (_self.config.enablePerfMgr) {
|
|
1939
|
+
setValue(_self.config, "createPerfMgr", _createPerfManager);
|
|
1940
|
+
}
|
|
1941
|
+
config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions;
|
|
1942
|
+
var extConfig = getSetValue(config, strExtensionConfig);
|
|
1943
|
+
extConfig.NotificationManager = notificationManager;
|
|
1944
|
+
if (logger) {
|
|
1945
|
+
_self.logger = logger;
|
|
1946
|
+
}
|
|
1947
|
+
var allExtensions = [];
|
|
1948
|
+
allExtensions.push.apply(allExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions));
|
|
1949
|
+
allExtensions = sortPlugins(allExtensions);
|
|
1950
|
+
var coreExtensions = [];
|
|
1951
|
+
var extPriorities = {};
|
|
1952
|
+
arrForEach(allExtensions, function (ext) {
|
|
1953
|
+
if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) {
|
|
1954
|
+
throwError(validationError);
|
|
1955
|
+
}
|
|
1956
|
+
var extPriority = ext.priority;
|
|
1957
|
+
var identifier = ext.identifier;
|
|
1958
|
+
if (ext && extPriority) {
|
|
1959
|
+
if (!isNullOrUndefined(extPriorities[extPriority])) {
|
|
1960
|
+
logger.warnToConsole("Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier);
|
|
1961
|
+
}
|
|
1962
|
+
else {
|
|
1963
|
+
extPriorities[extPriority] = identifier;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
if (!extPriority || extPriority < _channelController.priority) {
|
|
1967
|
+
coreExtensions.push(ext);
|
|
1968
|
+
}
|
|
1969
|
+
});
|
|
1970
|
+
allExtensions.push(_channelController);
|
|
1971
|
+
coreExtensions.push(_channelController);
|
|
1972
|
+
allExtensions = sortPlugins(allExtensions);
|
|
1973
|
+
_self._extensions = allExtensions;
|
|
1974
|
+
initializePlugins(new ProcessTelemetryContext([_channelController], config, _self), allExtensions);
|
|
1975
|
+
initializePlugins(new ProcessTelemetryContext(coreExtensions, config, _self), allExtensions);
|
|
1976
|
+
_self._extensions = coreExtensions;
|
|
1977
|
+
if (_self.getTransmissionControls().length === 0) {
|
|
1978
|
+
throwError("No channels available");
|
|
1979
|
+
}
|
|
1980
|
+
_isInitialized = true;
|
|
1981
|
+
_self.releaseQueue();
|
|
1982
|
+
};
|
|
1983
|
+
_self.getTransmissionControls = function () {
|
|
1984
|
+
return _channelController.getChannelControls();
|
|
1985
|
+
};
|
|
1986
|
+
_self.track = function (telemetryItem) {
|
|
1987
|
+
setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy);
|
|
1988
|
+
setValue(telemetryItem, "time", toISOString(new Date()), null, isNotTruthy);
|
|
1989
|
+
setValue(telemetryItem, "ver", "4.0", null, isNullOrUndefined);
|
|
1990
|
+
if (_self.isInitialized()) {
|
|
1991
|
+
_self.getProcessTelContext().processNext(telemetryItem);
|
|
1992
|
+
}
|
|
1993
|
+
else {
|
|
1994
|
+
_eventQueue.push(telemetryItem);
|
|
1995
|
+
}
|
|
1996
|
+
};
|
|
1997
|
+
_self.getProcessTelContext = function () {
|
|
1998
|
+
var extensions = _self._extensions;
|
|
1999
|
+
var thePlugins = extensions;
|
|
2000
|
+
if (!extensions || extensions.length === 0) {
|
|
2001
|
+
thePlugins = [_channelController];
|
|
2002
|
+
}
|
|
2003
|
+
return new ProcessTelemetryContext(thePlugins, _self.config, _self);
|
|
2004
|
+
};
|
|
2005
|
+
_self.getNotifyMgr = function () {
|
|
2006
|
+
if (!_notificationManager) {
|
|
2007
|
+
_notificationManager = objCreateFn({
|
|
2008
|
+
addNotificationListener: function (listener) { },
|
|
2009
|
+
removeNotificationListener: function (listener) { },
|
|
2010
|
+
eventsSent: function (events) { },
|
|
2011
|
+
eventsDiscarded: function (events, reason) { },
|
|
2012
|
+
eventsSendRequest: function (sendReason, isAsync) { }
|
|
2013
|
+
});
|
|
2014
|
+
_self[strNotificationManager] = _notificationManager;
|
|
2015
|
+
}
|
|
2016
|
+
return _notificationManager;
|
|
2017
|
+
};
|
|
2018
|
+
_self.getCookieMgr = function () {
|
|
2019
|
+
if (!_cookieManager) {
|
|
2020
|
+
_cookieManager = createCookieMgr(_self.config, _self.logger);
|
|
2021
|
+
}
|
|
2022
|
+
return _cookieManager;
|
|
2023
|
+
};
|
|
2024
|
+
_self.setCookieMgr = function (cookieMgr) {
|
|
2025
|
+
_cookieManager = cookieMgr;
|
|
2026
|
+
};
|
|
2027
|
+
_self.getPerfMgr = function () {
|
|
2028
|
+
if (!_perfManager) {
|
|
2029
|
+
if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) {
|
|
2030
|
+
_perfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr());
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
return _perfManager || getGblPerfMgr();
|
|
2034
|
+
};
|
|
2035
|
+
_self.setPerfMgr = function (perfMgr) {
|
|
2036
|
+
_perfManager = perfMgr;
|
|
2037
|
+
};
|
|
2038
|
+
_self.eventCnt = function () {
|
|
2039
|
+
return _eventQueue.length;
|
|
2040
|
+
};
|
|
2041
|
+
_self.releaseQueue = function () {
|
|
2042
|
+
if (_eventQueue.length > 0) {
|
|
2043
|
+
arrForEach(_eventQueue, function (event) {
|
|
2044
|
+
_self.getProcessTelContext().processNext(event);
|
|
2045
|
+
});
|
|
2046
|
+
_eventQueue = [];
|
|
2047
|
+
}
|
|
2048
|
+
};
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
return BaseCore;
|
|
2052
|
+
}());
|
|
2053
|
+
|
|
2054
|
+
var NotificationManager = /** @class */ (function () {
|
|
2055
|
+
function NotificationManager(config) {
|
|
2056
|
+
this.listeners = [];
|
|
2057
|
+
var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll;
|
|
2058
|
+
dynamicProto(NotificationManager, this, function (_self) {
|
|
2059
|
+
_self.addNotificationListener = function (listener) {
|
|
2060
|
+
_self.listeners.push(listener);
|
|
2061
|
+
};
|
|
2062
|
+
_self.removeNotificationListener = function (listener) {
|
|
2063
|
+
var index = arrIndexOf(_self.listeners, listener);
|
|
2064
|
+
while (index > -1) {
|
|
2065
|
+
_self.listeners.splice(index, 1);
|
|
2066
|
+
index = arrIndexOf(_self.listeners, listener);
|
|
2067
|
+
}
|
|
2068
|
+
};
|
|
2069
|
+
_self.eventsSent = function (events) {
|
|
2070
|
+
arrForEach(_self.listeners, function (listener) {
|
|
2071
|
+
if (listener && listener.eventsSent) {
|
|
2072
|
+
setTimeout(function () { return listener.eventsSent(events); }, 0);
|
|
2073
|
+
}
|
|
2074
|
+
});
|
|
2075
|
+
};
|
|
2076
|
+
_self.eventsDiscarded = function (events, reason) {
|
|
2077
|
+
arrForEach(_self.listeners, function (listener) {
|
|
2078
|
+
if (listener && listener.eventsDiscarded) {
|
|
2079
|
+
setTimeout(function () { return listener.eventsDiscarded(events, reason); }, 0);
|
|
2080
|
+
}
|
|
2081
|
+
});
|
|
2082
|
+
};
|
|
2083
|
+
_self.eventsSendRequest = function (sendReason, isAsync) {
|
|
2084
|
+
arrForEach(_self.listeners, function (listener) {
|
|
2085
|
+
if (listener && listener.eventsSendRequest) {
|
|
2086
|
+
if (isAsync) {
|
|
2087
|
+
setTimeout(function () { return listener.eventsSendRequest(sendReason, isAsync); }, 0);
|
|
2088
|
+
}
|
|
2089
|
+
else {
|
|
2090
|
+
try {
|
|
2091
|
+
listener.eventsSendRequest(sendReason, isAsync);
|
|
2092
|
+
}
|
|
2093
|
+
catch (e) {
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
});
|
|
2098
|
+
};
|
|
2099
|
+
_self.perfEvent = function (perfEvent) {
|
|
2100
|
+
if (perfEvent) {
|
|
2101
|
+
if (perfEvtsSendAll || !perfEvent.isChildEvt()) {
|
|
2102
|
+
arrForEach(_self.listeners, function (listener) {
|
|
2103
|
+
if (listener && listener.perfEvent) {
|
|
2104
|
+
if (perfEvent.isAsync) {
|
|
2105
|
+
setTimeout(function () { return listener.perfEvent(perfEvent); }, 0);
|
|
2106
|
+
}
|
|
2107
|
+
else {
|
|
2108
|
+
try {
|
|
2109
|
+
listener.perfEvent(perfEvent);
|
|
2110
|
+
}
|
|
2111
|
+
catch (e) {
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
};
|
|
2119
|
+
});
|
|
2120
|
+
}
|
|
2121
|
+
return NotificationManager;
|
|
2122
|
+
}());
|
|
2123
|
+
|
|
2124
|
+
var AppInsightsCore$2 = /** @class */ (function (_super) {
|
|
2125
|
+
__extendsFn(AppInsightsCore, _super);
|
|
2126
|
+
function AppInsightsCore() {
|
|
2127
|
+
var _this = _super.call(this) || this;
|
|
2128
|
+
dynamicProto(AppInsightsCore, _this, function (_self, _base) {
|
|
2129
|
+
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
2130
|
+
_base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config));
|
|
2131
|
+
};
|
|
2132
|
+
_self.track = function (telemetryItem) {
|
|
2133
|
+
doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () {
|
|
2134
|
+
if (telemetryItem === null) {
|
|
2135
|
+
_notifyInvalidEvent(telemetryItem);
|
|
2136
|
+
throwError("Invalid telemetry item");
|
|
2137
|
+
}
|
|
2138
|
+
_validateTelemetryItem(telemetryItem);
|
|
2139
|
+
_base.track(telemetryItem);
|
|
2140
|
+
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
2141
|
+
};
|
|
2142
|
+
_self.addNotificationListener = function (listener) {
|
|
2143
|
+
var manager = _self.getNotifyMgr();
|
|
2144
|
+
if (manager) {
|
|
2145
|
+
manager.addNotificationListener(listener);
|
|
2146
|
+
}
|
|
2147
|
+
};
|
|
2148
|
+
_self.removeNotificationListener = function (listener) {
|
|
2149
|
+
var manager = _self.getNotifyMgr();
|
|
2150
|
+
if (manager) {
|
|
2151
|
+
manager.removeNotificationListener(listener);
|
|
2152
|
+
}
|
|
2153
|
+
};
|
|
2154
|
+
_self.pollInternalLogs = function (eventName) {
|
|
2155
|
+
var interval = _self.config.diagnosticLogInterval;
|
|
2156
|
+
if (!interval || !(interval > 0)) {
|
|
2157
|
+
interval = 10000;
|
|
2158
|
+
}
|
|
2159
|
+
return setInterval(function () {
|
|
2160
|
+
var queue = _self.logger ? _self.logger.queue : [];
|
|
2161
|
+
arrForEach(queue, function (logMessage) {
|
|
2162
|
+
var item = {
|
|
2163
|
+
name: eventName ? eventName : "InternalMessageId: " + logMessage.messageId,
|
|
2164
|
+
iKey: _self.config.instrumentationKey,
|
|
2165
|
+
time: toISOString(new Date()),
|
|
2166
|
+
baseType: _InternalLogMessage.dataType,
|
|
2167
|
+
baseData: { message: logMessage.message }
|
|
2168
|
+
};
|
|
2169
|
+
_self.track(item);
|
|
2170
|
+
});
|
|
2171
|
+
queue.length = 0;
|
|
2172
|
+
}, interval);
|
|
2173
|
+
};
|
|
2174
|
+
function _validateTelemetryItem(telemetryItem) {
|
|
2175
|
+
if (isNullOrUndefined(telemetryItem.name)) {
|
|
2176
|
+
_notifyInvalidEvent(telemetryItem);
|
|
2177
|
+
throw Error("telemetry name required");
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
function _notifyInvalidEvent(telemetryItem) {
|
|
2181
|
+
var manager = _self.getNotifyMgr();
|
|
2182
|
+
if (manager) {
|
|
2183
|
+
manager.eventsDiscarded([telemetryItem], EventsDiscardedReason.InvalidEvent);
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
});
|
|
2187
|
+
return _this;
|
|
2188
|
+
}
|
|
2189
|
+
return AppInsightsCore;
|
|
2190
|
+
}(BaseCore$2));
|
|
2191
|
+
|
|
2192
|
+
var UInt32Mask = 0x100000000;
|
|
2193
|
+
var MaxUInt32 = 0xffffffff;
|
|
2194
|
+
var _mwcSeeded = false;
|
|
2195
|
+
var _mwcW = 123456789;
|
|
2196
|
+
var _mwcZ = 987654321;
|
|
2197
|
+
function _mwcSeed(seedValue) {
|
|
2198
|
+
if (seedValue < 0) {
|
|
2199
|
+
seedValue >>>= 0;
|
|
2200
|
+
}
|
|
2201
|
+
_mwcW = (123456789 + seedValue) & MaxUInt32;
|
|
2202
|
+
_mwcZ = (987654321 - seedValue) & MaxUInt32;
|
|
2203
|
+
_mwcSeeded = true;
|
|
2204
|
+
}
|
|
2205
|
+
function _autoSeedMwc() {
|
|
2206
|
+
try {
|
|
2207
|
+
var now = dateNow() & 0x7fffffff;
|
|
2208
|
+
_mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
|
|
2209
|
+
}
|
|
2210
|
+
catch (e) {
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
function randomValue(maxValue) {
|
|
2214
|
+
if (maxValue > 0) {
|
|
2215
|
+
return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
|
|
2216
|
+
}
|
|
2217
|
+
return 0;
|
|
2218
|
+
}
|
|
2219
|
+
function random32(signed) {
|
|
2220
|
+
var value;
|
|
2221
|
+
var c = getCrypto() || getMsCrypto();
|
|
2222
|
+
if (c && c.getRandomValues) {
|
|
2223
|
+
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
2224
|
+
}
|
|
2225
|
+
else if (isIE()) {
|
|
2226
|
+
if (!_mwcSeeded) {
|
|
2227
|
+
_autoSeedMwc();
|
|
2228
|
+
}
|
|
2229
|
+
value = mwcRandom32() & MaxUInt32;
|
|
2230
|
+
}
|
|
2231
|
+
else {
|
|
2232
|
+
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
2233
|
+
}
|
|
2234
|
+
if (!signed) {
|
|
2235
|
+
value >>>= 0;
|
|
2236
|
+
}
|
|
2237
|
+
return value;
|
|
2238
|
+
}
|
|
2239
|
+
function mwcRandomSeed(value) {
|
|
2240
|
+
if (!value) {
|
|
2241
|
+
_autoSeedMwc();
|
|
2242
|
+
}
|
|
2243
|
+
else {
|
|
2244
|
+
_mwcSeed(value);
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
function mwcRandom32(signed) {
|
|
2248
|
+
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
2249
|
+
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
2250
|
+
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
2251
|
+
if (!signed) {
|
|
2252
|
+
value >>>= 0;
|
|
2253
|
+
}
|
|
2254
|
+
return value;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
function addEventHandler(eventName, callback) {
|
|
2258
|
+
var result = false;
|
|
2259
|
+
var w = getWindow();
|
|
2260
|
+
if (w) {
|
|
2261
|
+
result = attachEvent(w, eventName, callback);
|
|
2262
|
+
result = attachEvent(w["body"], eventName, callback) || result;
|
|
2263
|
+
}
|
|
2264
|
+
var doc = getDocument();
|
|
2265
|
+
if (doc) {
|
|
2266
|
+
result = attachEvent(doc, eventName, callback) || result;
|
|
2267
|
+
}
|
|
2268
|
+
return result;
|
|
2269
|
+
}
|
|
2270
|
+
function newGuid() {
|
|
2271
|
+
function randomHexDigit() {
|
|
2272
|
+
return randomValue(15);
|
|
2273
|
+
}
|
|
2274
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) {
|
|
2275
|
+
var r = (randomHexDigit() | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);
|
|
2276
|
+
return v.toString(16);
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
function perfNow() {
|
|
2280
|
+
var perf = getPerformance();
|
|
2281
|
+
if (perf && perf.now) {
|
|
2282
|
+
return perf.now();
|
|
2283
|
+
}
|
|
2284
|
+
return dateNow();
|
|
2285
|
+
}
|
|
2286
|
+
function newId(maxLength) {
|
|
2287
|
+
if (maxLength === void 0) { maxLength = 22; }
|
|
2288
|
+
var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
2289
|
+
var number = random32() >>> 0;
|
|
2290
|
+
var chars = 0;
|
|
2291
|
+
var result = "";
|
|
2292
|
+
while (result.length < maxLength) {
|
|
2293
|
+
chars++;
|
|
2294
|
+
result += base64chars.charAt(number & 0x3F);
|
|
2295
|
+
number >>>= 6;
|
|
2296
|
+
if (chars === 5) {
|
|
2297
|
+
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
2298
|
+
chars = 0;
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
return result;
|
|
2302
|
+
}
|
|
2303
|
+
function generateW3CId() {
|
|
2304
|
+
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
2305
|
+
var oct = "", tmp;
|
|
2306
|
+
for (var a = 0; a < 4; a++) {
|
|
2307
|
+
tmp = random32();
|
|
2308
|
+
oct +=
|
|
2309
|
+
hexValues[tmp & 0xF] +
|
|
2310
|
+
hexValues[tmp >> 4 & 0xF] +
|
|
2311
|
+
hexValues[tmp >> 8 & 0xF] +
|
|
2312
|
+
hexValues[tmp >> 12 & 0xF] +
|
|
2313
|
+
hexValues[tmp >> 16 & 0xF] +
|
|
2314
|
+
hexValues[tmp >> 20 & 0xF] +
|
|
2315
|
+
hexValues[tmp >> 24 & 0xF] +
|
|
2316
|
+
hexValues[tmp >> 28 & 0xF];
|
|
2317
|
+
}
|
|
2318
|
+
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
|
2319
|
+
return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);
|
|
2320
|
+
}
|
|
2321
|
+
var GuidRegex = /[xy]/g;
|
|
2322
|
+
var EventHelper = {
|
|
2323
|
+
Attach: attachEvent,
|
|
2324
|
+
AttachEvent: attachEvent,
|
|
2325
|
+
Detach: detachEvent,
|
|
2326
|
+
DetachEvent: detachEvent
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2329
|
+
var ValueKind = {
|
|
2330
|
+
NotSet: 0,
|
|
2331
|
+
Pii_DistinguishedName: 1,
|
|
2332
|
+
Pii_GenericData: 2,
|
|
2333
|
+
Pii_IPV4Address: 3,
|
|
2334
|
+
Pii_IPv6Address: 4,
|
|
2335
|
+
Pii_MailSubject: 5,
|
|
2336
|
+
Pii_PhoneNumber: 6,
|
|
2337
|
+
Pii_QueryString: 7,
|
|
2338
|
+
Pii_SipAddress: 8,
|
|
2339
|
+
Pii_SmtpAddress: 9,
|
|
2340
|
+
Pii_Identity: 10,
|
|
2341
|
+
Pii_Uri: 11,
|
|
2342
|
+
Pii_Fqdn: 12,
|
|
2343
|
+
Pii_IPV4AddressLegacy: 13,
|
|
2344
|
+
CustomerContent_GenericContent: 32
|
|
2345
|
+
};
|
|
2346
|
+
var EventLatency = {
|
|
2347
|
+
Normal: 1 ,
|
|
2348
|
+
CostDeferred: 2 ,
|
|
2349
|
+
RealTime: 3 ,
|
|
2350
|
+
Immediate: 4
|
|
2351
|
+
};
|
|
2352
|
+
var EventPropertyType = {
|
|
2353
|
+
Unspecified: 0,
|
|
2354
|
+
String: 1,
|
|
2355
|
+
Int32: 2,
|
|
2356
|
+
UInt32: 3,
|
|
2357
|
+
Int64: 4,
|
|
2358
|
+
UInt64: 5,
|
|
2359
|
+
Double: 6,
|
|
2360
|
+
Bool: 7,
|
|
2361
|
+
Guid: 8,
|
|
2362
|
+
DateTime: 9
|
|
2363
|
+
};
|
|
2364
|
+
var EventPersistence = {
|
|
2365
|
+
Normal: 1 ,
|
|
2366
|
+
Critical: 2
|
|
2367
|
+
};
|
|
2368
|
+
var TraceLevel = {
|
|
2369
|
+
NONE: 0,
|
|
2370
|
+
ERROR: 1,
|
|
2371
|
+
WARNING: 2,
|
|
2372
|
+
INFORMATION: 3
|
|
2373
|
+
};
|
|
2374
|
+
var _ExtendedInternalMessageId = __assignFn(__assignFn({}, _InternalMessageId), { AuthHandShakeError: 501, AuthRedirectFail: 502, BrowserCannotReadLocalStorage: 503, BrowserCannotWriteLocalStorage: 504, BrowserDoesNotSupportLocalStorage: 505, CannotParseBiBlobValue: 506, CannotParseDataAttribute: 507, CVPluginNotAvailable: 508, DroppedEvent: 509, ErrorParsingAISessionCookie: 510, ErrorProvidedChannels: 511, FailedToGetCookies: 512, FailedToInitializeCorrelationVector: 513, FailedToInitializeSDK: 514, InvalidContentBlob: 515, InvalidCorrelationValue: 516, SessionRenewalDateIsZero: 517, SendPostOnCompleteFailure: 518, PostResponseHandler: 519, SDKNotInitialized: 520 });
|
|
2375
|
+
|
|
2376
|
+
var _a;
|
|
2377
|
+
var Version = '3.1.7';
|
|
2378
|
+
var FullVersionString = "1DS-Web-JS-" + Version;
|
|
2379
|
+
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
2380
|
+
var strWithCredentials = "withCredentials";
|
|
2381
|
+
var _fieldTypeEventPropMap = (_a = {},
|
|
2382
|
+
_a[0 ] = EventPropertyType.Unspecified,
|
|
2383
|
+
_a[2 ] = EventPropertyType.Double,
|
|
2384
|
+
_a[1 ] = EventPropertyType.String,
|
|
2385
|
+
_a[3 ] = EventPropertyType.Bool,
|
|
2386
|
+
_a[4096 | 2 ] = EventPropertyType.Double,
|
|
2387
|
+
_a[4096 | 1 ] = EventPropertyType.String,
|
|
2388
|
+
_a[4096 | 3 ] = EventPropertyType.Bool,
|
|
2389
|
+
_a);
|
|
2390
|
+
var uInt8ArraySupported = null;
|
|
2391
|
+
var isDocumentObjectAvailable = Boolean(getDocument());
|
|
2392
|
+
var isWindowObjectAvailable = Boolean(getWindow());
|
|
2393
|
+
function isValueAssigned(value) {
|
|
2394
|
+
return !(value === "" || isNullOrUndefined(value));
|
|
2395
|
+
}
|
|
2396
|
+
function getTenantId(apiKey) {
|
|
2397
|
+
if (apiKey) {
|
|
2398
|
+
var indexTenantId = apiKey.indexOf("-");
|
|
2399
|
+
if (indexTenantId > -1) {
|
|
2400
|
+
return apiKey.substring(0, indexTenantId);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
return "";
|
|
2404
|
+
}
|
|
2405
|
+
function isUint8ArrayAvailable() {
|
|
2406
|
+
if (uInt8ArraySupported === null) {
|
|
2407
|
+
uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();
|
|
2408
|
+
}
|
|
2409
|
+
return uInt8ArraySupported;
|
|
2410
|
+
}
|
|
2411
|
+
function isLatency(value) {
|
|
2412
|
+
if (value && isNumber(value) && value >= EventLatency.Normal && value <= EventLatency.Immediate) {
|
|
2413
|
+
return true;
|
|
2414
|
+
}
|
|
2415
|
+
return false;
|
|
2416
|
+
}
|
|
2417
|
+
function sanitizeProperty(name, property, stringifyObjects) {
|
|
2418
|
+
if ((!property && !isValueAssigned(property)) || typeof name !== "string") {
|
|
2419
|
+
return null;
|
|
2420
|
+
}
|
|
2421
|
+
var propType = typeof property;
|
|
2422
|
+
if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) {
|
|
2423
|
+
property = { value: property };
|
|
2424
|
+
}
|
|
2425
|
+
else if (propType === "object" && !property.hasOwnProperty("value")) {
|
|
2426
|
+
property = { value: stringifyObjects ? JSON.stringify(property) : property };
|
|
2427
|
+
}
|
|
2428
|
+
else if (isNullOrUndefined(property.value)
|
|
2429
|
+
|| property.value === "" || (!isString(property.value)
|
|
2430
|
+
&& !isNumber(property.value) && !isBoolean(property.value)
|
|
2431
|
+
&& !isArray(property.value))) {
|
|
2432
|
+
return null;
|
|
2433
|
+
}
|
|
2434
|
+
if (isArray(property.value) &&
|
|
2435
|
+
!isArrayValid(property.value)) {
|
|
2436
|
+
return null;
|
|
2437
|
+
}
|
|
2438
|
+
if (!isNullOrUndefined(property.kind)) {
|
|
2439
|
+
if (isArray(property.value) || !isValueKind(property.kind)) {
|
|
2440
|
+
return null;
|
|
2441
|
+
}
|
|
2442
|
+
property.value = property.value.toString();
|
|
2443
|
+
}
|
|
2444
|
+
return property;
|
|
2445
|
+
}
|
|
2446
|
+
function getCommonSchemaMetaData(value, kind, type) {
|
|
2447
|
+
var encodedTypeValue = -1;
|
|
2448
|
+
if (!isUndefined(value)) {
|
|
2449
|
+
if (kind > 0) {
|
|
2450
|
+
if (kind === 32) {
|
|
2451
|
+
encodedTypeValue = (1 << 13);
|
|
2452
|
+
}
|
|
2453
|
+
else if (kind <= 13) {
|
|
2454
|
+
encodedTypeValue = (kind << 5);
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
if (isDataType(type)) {
|
|
2458
|
+
if (encodedTypeValue === -1) {
|
|
2459
|
+
encodedTypeValue = 0;
|
|
2460
|
+
}
|
|
2461
|
+
encodedTypeValue |= type;
|
|
2462
|
+
}
|
|
2463
|
+
else {
|
|
2464
|
+
var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;
|
|
2465
|
+
if (encodedTypeValue !== -1 && propType !== -1) {
|
|
2466
|
+
encodedTypeValue |= propType;
|
|
2467
|
+
}
|
|
2468
|
+
else if (propType === EventPropertyType.Double) {
|
|
2469
|
+
encodedTypeValue = propType;
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
return encodedTypeValue;
|
|
2474
|
+
}
|
|
2475
|
+
function disableCookies() {
|
|
2476
|
+
safeGetCookieMgr(null).setEnabled(false);
|
|
2477
|
+
}
|
|
2478
|
+
function setCookie(name, value, days) {
|
|
2479
|
+
if (areCookiesSupported(null)) {
|
|
2480
|
+
safeGetCookieMgr(null).set(name, value, days * 86400, null, "/");
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
function deleteCookie(name) {
|
|
2484
|
+
if (areCookiesSupported(null)) {
|
|
2485
|
+
safeGetCookieMgr(null).del(name);
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
function getCookie(name) {
|
|
2489
|
+
if (areCookiesSupported(null)) {
|
|
2490
|
+
return getCookieValue(safeGetCookieMgr(null), name);
|
|
2491
|
+
}
|
|
2492
|
+
return "";
|
|
2493
|
+
}
|
|
2494
|
+
function getCookieValue(cookieMgr, name, decode) {
|
|
2495
|
+
if (decode === void 0) { decode = true; }
|
|
2496
|
+
var cookieValue;
|
|
2497
|
+
if (cookieMgr) {
|
|
2498
|
+
cookieValue = cookieMgr.get(name);
|
|
2499
|
+
if (decode && cookieValue && decodeURIComponent) {
|
|
2500
|
+
cookieValue = decodeURIComponent(cookieValue);
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
return cookieValue || "";
|
|
2504
|
+
}
|
|
2505
|
+
function createGuid(style) {
|
|
2506
|
+
if (style === void 0) { style = "D" ; }
|
|
2507
|
+
var theGuid = newGuid();
|
|
2508
|
+
if (style === "B" ) {
|
|
2509
|
+
theGuid = "{" + theGuid + "}";
|
|
2510
|
+
}
|
|
2511
|
+
else if (style === "P" ) {
|
|
2512
|
+
theGuid = "(" + theGuid + ")";
|
|
2513
|
+
}
|
|
2514
|
+
else if (style === "N" ) {
|
|
2515
|
+
theGuid = theGuid.replace(/-/g, "");
|
|
2516
|
+
}
|
|
2517
|
+
return theGuid;
|
|
2518
|
+
}
|
|
2519
|
+
function extend(obj, obj2, obj3, obj4, obj5) {
|
|
2520
|
+
var extended = {};
|
|
2521
|
+
var deep = false;
|
|
2522
|
+
var i = 0;
|
|
2523
|
+
var length = arguments.length;
|
|
2524
|
+
var objProto = Object[strShimPrototype];
|
|
2525
|
+
var theArgs = arguments;
|
|
2526
|
+
if (objProto.toString.call(theArgs[0]) === "[object Boolean]") {
|
|
2527
|
+
deep = theArgs[0];
|
|
2528
|
+
i++;
|
|
2529
|
+
}
|
|
2530
|
+
for (; i < length; i++) {
|
|
2531
|
+
var obj = theArgs[i];
|
|
2532
|
+
objForEachKey(obj, function (prop, value) {
|
|
2533
|
+
if (deep && value && isObject(value)) {
|
|
2534
|
+
if (isArray(value)) {
|
|
2535
|
+
extended[prop] = extended[prop] || [];
|
|
2536
|
+
arrForEach(value, function (arrayValue, arrayIndex) {
|
|
2537
|
+
if (arrayValue && isObject(arrayValue)) {
|
|
2538
|
+
extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);
|
|
2539
|
+
}
|
|
2540
|
+
else {
|
|
2541
|
+
extended[prop][arrayIndex] = arrayValue;
|
|
2542
|
+
}
|
|
2543
|
+
});
|
|
2544
|
+
}
|
|
2545
|
+
else {
|
|
2546
|
+
extended[prop] = extend(true, extended[prop], value);
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
else {
|
|
2550
|
+
extended[prop] = value;
|
|
2551
|
+
}
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2554
|
+
return extended;
|
|
2555
|
+
}
|
|
2556
|
+
var getTime = perfNow;
|
|
2557
|
+
function isValueKind(value) {
|
|
2558
|
+
if (value === ValueKind.NotSet || ((value > ValueKind.NotSet && value <= ValueKind.Pii_IPV4AddressLegacy) || value === ValueKind.CustomerContent_GenericContent)) {
|
|
2559
|
+
return true;
|
|
2560
|
+
}
|
|
2561
|
+
return false;
|
|
2562
|
+
}
|
|
2563
|
+
function isDataType(value) {
|
|
2564
|
+
if (value >= 0 && value <= 9) {
|
|
2565
|
+
return true;
|
|
2566
|
+
}
|
|
2567
|
+
return false;
|
|
2568
|
+
}
|
|
2569
|
+
function isSafariOrFirefox() {
|
|
2570
|
+
var nav = getNavigator();
|
|
2571
|
+
if (!isUndefined(nav) && nav.userAgent) {
|
|
2572
|
+
var ua = nav.userAgent.toLowerCase();
|
|
2573
|
+
if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) {
|
|
2574
|
+
return true;
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
return false;
|
|
2578
|
+
}
|
|
2579
|
+
function isArrayValid(value) {
|
|
2580
|
+
return value.length > 0;
|
|
2581
|
+
}
|
|
2582
|
+
function addPageHideEventListener(listener) {
|
|
2583
|
+
function _handlePageVisibility(evt) {
|
|
2584
|
+
var doc = getDocument();
|
|
2585
|
+
if (listener && doc && doc.visibilityState === 'hidden') {
|
|
2586
|
+
listener(evt);
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
var pageUnloadAdded = addEventHandler("pagehide", listener);
|
|
2590
|
+
return addEventHandler("visibilitychange", _handlePageVisibility) || pageUnloadAdded;
|
|
2591
|
+
}
|
|
2592
|
+
function addPageShowEventListener(listener) {
|
|
2593
|
+
function _handlePageVisibility(evt) {
|
|
2594
|
+
var doc = getDocument();
|
|
2595
|
+
if (listener && doc && doc.visibilityState === 'visible') {
|
|
2596
|
+
listener(evt);
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
var pageUnloadAdded = addEventHandler("pageshow", listener);
|
|
2600
|
+
return addEventHandler("visibilitychange", _handlePageVisibility) || pageUnloadAdded;
|
|
2601
|
+
}
|
|
2602
|
+
function addPageUnloadEventListener(listener) {
|
|
2603
|
+
var pageUnloadAdded = addEventHandler("beforeunload", listener);
|
|
2604
|
+
pageUnloadAdded = addEventHandler("unload", listener) || pageUnloadAdded;
|
|
2605
|
+
return addEventHandler("pagehide", listener) || pageUnloadAdded;
|
|
2606
|
+
}
|
|
2607
|
+
function setProcessTelemetryTimings(event, identifier) {
|
|
2608
|
+
var evt = event;
|
|
2609
|
+
evt.timings = evt.timings || {};
|
|
2610
|
+
evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {};
|
|
2611
|
+
evt.timings.processTelemetryStart[identifier] = getTime();
|
|
2612
|
+
}
|
|
2613
|
+
function getFieldValueType(value) {
|
|
2614
|
+
var theType = 0 ;
|
|
2615
|
+
if (value !== null && value !== undefined) {
|
|
2616
|
+
var objType = typeof value;
|
|
2617
|
+
if (objType === "string") {
|
|
2618
|
+
theType = 1 ;
|
|
2619
|
+
}
|
|
2620
|
+
else if (objType === "number") {
|
|
2621
|
+
theType = 2 ;
|
|
2622
|
+
}
|
|
2623
|
+
else if (objType === "boolean") {
|
|
2624
|
+
theType = 3 ;
|
|
2625
|
+
}
|
|
2626
|
+
else if (objType === strShimObject) {
|
|
2627
|
+
theType = 4 ;
|
|
2628
|
+
if (isArray(value)) {
|
|
2629
|
+
theType = 4096 ;
|
|
2630
|
+
if (value.length > 0) {
|
|
2631
|
+
theType |= getFieldValueType(value[0]);
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
else if (hasOwnProperty(value, "value")) {
|
|
2635
|
+
theType = 8192 | getFieldValueType(value.value);
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
return theType;
|
|
2640
|
+
}
|
|
2641
|
+
var Utils = {
|
|
2642
|
+
Version: Version,
|
|
2643
|
+
FullVersionString: FullVersionString,
|
|
2644
|
+
strUndefined: strShimUndefined,
|
|
2645
|
+
strObject: strShimObject,
|
|
2646
|
+
Undefined: strShimUndefined,
|
|
2647
|
+
arrForEach: arrForEach,
|
|
2648
|
+
arrIndexOf: arrIndexOf,
|
|
2649
|
+
arrMap: arrMap,
|
|
2650
|
+
arrReduce: arrReduce,
|
|
2651
|
+
objKeys: objKeys,
|
|
2652
|
+
toISOString: toISOString,
|
|
2653
|
+
isReactNative: isReactNative,
|
|
2654
|
+
isString: isString,
|
|
2655
|
+
isNumber: isNumber,
|
|
2656
|
+
isBoolean: isBoolean,
|
|
2657
|
+
isFunction: isFunction,
|
|
2658
|
+
isArray: isArray,
|
|
2659
|
+
isObject: isObject,
|
|
2660
|
+
strTrim: strTrim,
|
|
2661
|
+
isDocumentObjectAvailable: isDocumentObjectAvailable,
|
|
2662
|
+
isWindowObjectAvailable: isWindowObjectAvailable,
|
|
2663
|
+
isValueAssigned: isValueAssigned,
|
|
2664
|
+
getTenantId: getTenantId,
|
|
2665
|
+
isBeaconsSupported: isBeaconsSupported,
|
|
2666
|
+
isUint8ArrayAvailable: isUint8ArrayAvailable,
|
|
2667
|
+
isLatency: isLatency,
|
|
2668
|
+
sanitizeProperty: sanitizeProperty,
|
|
2669
|
+
getISOString: toISOString,
|
|
2670
|
+
useXDomainRequest: useXDomainRequest,
|
|
2671
|
+
getCommonSchemaMetaData: getCommonSchemaMetaData,
|
|
2672
|
+
cookieAvailable: areCookiesSupported,
|
|
2673
|
+
disallowsSameSiteNone: uaDisallowsSameSiteNone,
|
|
2674
|
+
setCookie: setCookie,
|
|
2675
|
+
deleteCookie: deleteCookie,
|
|
2676
|
+
getCookie: getCookie,
|
|
2677
|
+
createGuid: createGuid,
|
|
2678
|
+
extend: extend,
|
|
2679
|
+
getTime: getTime,
|
|
2680
|
+
isValueKind: isValueKind,
|
|
2681
|
+
isArrayValid: isArrayValid,
|
|
2682
|
+
objDefineAccessors: objDefineAccessors,
|
|
2683
|
+
addPageUnloadEventListener: addPageUnloadEventListener,
|
|
2684
|
+
setProcessTelemetryTimings: setProcessTelemetryTimings,
|
|
2685
|
+
addEventHandler: addEventHandler,
|
|
2686
|
+
getFieldValueType: getFieldValueType,
|
|
2687
|
+
strEndsWith: strEndsWith,
|
|
2688
|
+
objForEachKey: objForEachKey
|
|
2689
|
+
};
|
|
2690
|
+
var CoreUtils = {
|
|
2691
|
+
_canUseCookies: undefined,
|
|
2692
|
+
isTypeof: isTypeof,
|
|
2693
|
+
isUndefined: isUndefined,
|
|
2694
|
+
isNullOrUndefined: isNullOrUndefined,
|
|
2695
|
+
hasOwnProperty: hasOwnProperty,
|
|
2696
|
+
isFunction: isFunction,
|
|
2697
|
+
isObject: isObject,
|
|
2698
|
+
isDate: isDate,
|
|
2699
|
+
isArray: isArray,
|
|
2700
|
+
isError: isError,
|
|
2701
|
+
isString: isString,
|
|
2702
|
+
isNumber: isNumber,
|
|
2703
|
+
isBoolean: isBoolean,
|
|
2704
|
+
toISOString: toISOString,
|
|
2705
|
+
arrForEach: arrForEach,
|
|
2706
|
+
arrIndexOf: arrIndexOf,
|
|
2707
|
+
arrMap: arrMap,
|
|
2708
|
+
arrReduce: arrReduce,
|
|
2709
|
+
strTrim: strTrim,
|
|
2710
|
+
objCreate: objCreateFn,
|
|
2711
|
+
objKeys: objKeys,
|
|
2712
|
+
objDefineAccessors: objDefineAccessors,
|
|
2713
|
+
addEventHandler: addEventHandler,
|
|
2714
|
+
dateNow: dateNow,
|
|
2715
|
+
isIE: isIE,
|
|
2716
|
+
disableCookies: disableCookies,
|
|
2717
|
+
newGuid: newGuid,
|
|
2718
|
+
perfNow: perfNow,
|
|
2719
|
+
newId: newId,
|
|
2720
|
+
randomValue: randomValue,
|
|
2721
|
+
random32: random32,
|
|
2722
|
+
mwcRandomSeed: mwcRandomSeed,
|
|
2723
|
+
mwcRandom32: mwcRandom32,
|
|
2724
|
+
generateW3CId: generateW3CId
|
|
2725
|
+
};
|
|
2726
|
+
function isChromium() {
|
|
2727
|
+
return !!getGlobalInst("chrome");
|
|
2728
|
+
}
|
|
2729
|
+
function openXhr(method, urlString, withCredentials, disabled, isSync) {
|
|
2730
|
+
if (disabled === void 0) { disabled = false; }
|
|
2731
|
+
if (isSync === void 0) { isSync = false; }
|
|
2732
|
+
function _wrapSetXhrProp(xhr, prop, value) {
|
|
2733
|
+
try {
|
|
2734
|
+
xhr[prop] = value;
|
|
2735
|
+
}
|
|
2736
|
+
catch (e) {
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
var xhr = new XMLHttpRequest();
|
|
2740
|
+
if (disabled) {
|
|
2741
|
+
_wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);
|
|
2742
|
+
}
|
|
2743
|
+
if (withCredentials) {
|
|
2744
|
+
_wrapSetXhrProp(xhr, strWithCredentials, withCredentials);
|
|
2745
|
+
}
|
|
2746
|
+
xhr.open(method, urlString, !isSync);
|
|
2747
|
+
if (withCredentials) {
|
|
2748
|
+
_wrapSetXhrProp(xhr, strWithCredentials, withCredentials);
|
|
2749
|
+
}
|
|
2750
|
+
return xhr;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
var PropVersion = "version";
|
|
2754
|
+
var properties = "properties";
|
|
2755
|
+
var AppInsightsCore = /** @class */ (function (_super) {
|
|
2756
|
+
__extendsFn(AppInsightsCore, _super);
|
|
2757
|
+
function AppInsightsCore() {
|
|
2758
|
+
var _this = _super.call(this) || this;
|
|
2759
|
+
_this.pluginVersionStringArr = [];
|
|
2760
|
+
_this.pluginVersionString = "";
|
|
2761
|
+
dynamicProto(AppInsightsCore, _this, function (_self, _base) {
|
|
2762
|
+
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
2763
|
+
doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () {
|
|
2764
|
+
if (config) {
|
|
2765
|
+
if (!config.endpointUrl) {
|
|
2766
|
+
config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
|
|
2767
|
+
}
|
|
2768
|
+
var propertyStorageOverride = config.propertyStorageOverride;
|
|
2769
|
+
if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {
|
|
2770
|
+
throw new Error("Invalid property storage override passed.");
|
|
2771
|
+
}
|
|
2772
|
+
if (config.channels) {
|
|
2773
|
+
arrForEach(config.channels, function (channels) {
|
|
2774
|
+
if (channels) {
|
|
2775
|
+
arrForEach(channels, function (channel) {
|
|
2776
|
+
if (channel.identifier && channel.version) {
|
|
2777
|
+
var ver = channel.identifier + "=" + channel.version;
|
|
2778
|
+
_self.pluginVersionStringArr.push(ver);
|
|
2779
|
+
}
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
_self.getWParam = function () {
|
|
2786
|
+
return typeof document !== "undefined" ? 0 : -1;
|
|
2787
|
+
};
|
|
2788
|
+
if (extensions) {
|
|
2789
|
+
arrForEach(extensions, function (ext) {
|
|
2790
|
+
if (ext && ext.identifier && ext.version) {
|
|
2791
|
+
var ver = ext.identifier + "=" + ext.version;
|
|
2792
|
+
_self.pluginVersionStringArr.push(ver);
|
|
2793
|
+
}
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
_self.pluginVersionString = _self.pluginVersionStringArr.join(";");
|
|
2797
|
+
try {
|
|
2798
|
+
_base.initialize(config, extensions, logger, notificationManager);
|
|
2799
|
+
}
|
|
2800
|
+
catch (e) {
|
|
2801
|
+
_self.logger.throwInternal(exports.LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.ErrorProvidedChannels, "Channels must be provided through config.channels only");
|
|
2802
|
+
}
|
|
2803
|
+
_self.pollInternalLogs("InternalLog");
|
|
2804
|
+
}, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });
|
|
2805
|
+
};
|
|
2806
|
+
_self.track = function (item) {
|
|
2807
|
+
doPerf(_self, function () { return "AppInsightsCore.track"; }, function () {
|
|
2808
|
+
var telemetryItem = item;
|
|
2809
|
+
if (telemetryItem) {
|
|
2810
|
+
telemetryItem.timings = telemetryItem.timings || {};
|
|
2811
|
+
telemetryItem.timings.trackStart = getTime();
|
|
2812
|
+
if (!isLatency(telemetryItem.latency)) {
|
|
2813
|
+
telemetryItem.latency = EventLatency.Normal;
|
|
2814
|
+
}
|
|
2815
|
+
var itemExt = telemetryItem.ext = telemetryItem.ext || {};
|
|
2816
|
+
itemExt.sdk = itemExt.sdk || {};
|
|
2817
|
+
itemExt.sdk.ver = FullVersionString;
|
|
2818
|
+
var baseData = telemetryItem.baseData = telemetryItem.baseData || {};
|
|
2819
|
+
if (!baseData[properties]) {
|
|
2820
|
+
baseData[properties] = {};
|
|
2821
|
+
}
|
|
2822
|
+
var itemProperties = baseData[properties];
|
|
2823
|
+
if (!itemProperties[PropVersion]) {
|
|
2824
|
+
itemProperties[PropVersion] = "";
|
|
2825
|
+
}
|
|
2826
|
+
if (_self.pluginVersionString !== "") {
|
|
2827
|
+
itemProperties[PropVersion] = _self.pluginVersionString;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
_base.track(telemetryItem);
|
|
2831
|
+
}, function () { return ({ item: item }); }, !(item.sync));
|
|
2832
|
+
};
|
|
2833
|
+
});
|
|
2834
|
+
return _this;
|
|
2835
|
+
}
|
|
2836
|
+
return AppInsightsCore;
|
|
2837
|
+
}(AppInsightsCore$2));
|
|
2838
|
+
var AppInsightsCore$1 = AppInsightsCore;
|
|
2839
|
+
|
|
2840
|
+
var BaseCore = /** @class */ (function (_super) {
|
|
2841
|
+
__extendsFn(BaseCore, _super);
|
|
2842
|
+
function BaseCore() {
|
|
2843
|
+
var _this = _super.call(this) || this;
|
|
2844
|
+
dynamicProto(BaseCore, _this, function (_self, _base) {
|
|
2845
|
+
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
2846
|
+
if (config) {
|
|
2847
|
+
if (!config.endpointUrl) {
|
|
2848
|
+
config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
_self.getWParam = function () {
|
|
2852
|
+
return isDocumentObjectAvailable ? 0 : -1;
|
|
2853
|
+
};
|
|
2854
|
+
try {
|
|
2855
|
+
_base.initialize(config, extensions, logger, notificationManager);
|
|
2856
|
+
}
|
|
2857
|
+
catch (e) {
|
|
2858
|
+
_self.logger.throwInternal(exports.LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.ErrorProvidedChannels, "Channels must be provided through config.channels only");
|
|
2859
|
+
}
|
|
2860
|
+
};
|
|
2861
|
+
_self.track = function (item) {
|
|
2862
|
+
var telemetryItem = item;
|
|
2863
|
+
if (telemetryItem) {
|
|
2864
|
+
var ext = telemetryItem.ext = telemetryItem.ext || {};
|
|
2865
|
+
ext.sdk = ext.sdk || {};
|
|
2866
|
+
ext.sdk.ver = FullVersionString;
|
|
2867
|
+
}
|
|
2868
|
+
_base.track(telemetryItem);
|
|
2869
|
+
};
|
|
2870
|
+
});
|
|
2871
|
+
return _this;
|
|
2872
|
+
}
|
|
2873
|
+
return BaseCore;
|
|
2874
|
+
}(BaseCore$2));
|
|
2875
|
+
var BaseCore$1 = BaseCore;
|
|
2876
|
+
|
|
2877
|
+
var _isFunction = isFunction;
|
|
2878
|
+
function _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) {
|
|
2879
|
+
return function (value) {
|
|
2880
|
+
values[index] = value;
|
|
2881
|
+
resolvedCallback();
|
|
2882
|
+
};
|
|
2883
|
+
}
|
|
2884
|
+
var ESPromise = /** @class */ (function () {
|
|
2885
|
+
function ESPromise(resolverFunc) {
|
|
2886
|
+
var _state = 0 ;
|
|
2887
|
+
var _settledValue = null;
|
|
2888
|
+
var _queue = [];
|
|
2889
|
+
dynamicProto(ESPromise, this, function (_this) {
|
|
2890
|
+
_this.then = function (onResolved, onRejected) {
|
|
2891
|
+
return new ESPromise(function (resolve, reject) {
|
|
2892
|
+
_enqueue(onResolved, onRejected, resolve, reject);
|
|
2893
|
+
});
|
|
2894
|
+
};
|
|
2895
|
+
_this["catch"] = function (onRejected) {
|
|
2896
|
+
return _this.then(null, onRejected);
|
|
2897
|
+
};
|
|
2898
|
+
});
|
|
2899
|
+
function _enqueue(onResolved, onRejected, resolve, reject) {
|
|
2900
|
+
_queue.push(function () {
|
|
2901
|
+
var value;
|
|
2902
|
+
try {
|
|
2903
|
+
if (_state === 1 ) {
|
|
2904
|
+
value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue;
|
|
2905
|
+
}
|
|
2906
|
+
else {
|
|
2907
|
+
value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue;
|
|
2908
|
+
}
|
|
2909
|
+
if (value instanceof ESPromise) {
|
|
2910
|
+
value.then(resolve, reject);
|
|
2911
|
+
}
|
|
2912
|
+
else if (_state === 2 && !_isFunction(onRejected)) {
|
|
2913
|
+
reject(value);
|
|
2914
|
+
}
|
|
2915
|
+
else {
|
|
2916
|
+
resolve(value);
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
catch (error) {
|
|
2920
|
+
reject(error);
|
|
2921
|
+
return;
|
|
2922
|
+
}
|
|
2923
|
+
});
|
|
2924
|
+
if (_state !== 0 ) {
|
|
2925
|
+
_processQueue();
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
function _processQueue() {
|
|
2929
|
+
if (_queue.length > 0) {
|
|
2930
|
+
var pending_1 = _queue.slice();
|
|
2931
|
+
_queue = [];
|
|
2932
|
+
setTimeout(function () {
|
|
2933
|
+
for (var i = 0, len = pending_1.length; i < len; ++i) {
|
|
2934
|
+
try {
|
|
2935
|
+
pending_1[i]();
|
|
2936
|
+
}
|
|
2937
|
+
catch (e) {
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
}, 0);
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
function _resolve(value) {
|
|
2944
|
+
if (_state === 0 ) {
|
|
2945
|
+
_settledValue = value;
|
|
2946
|
+
_state = 1 ;
|
|
2947
|
+
_processQueue();
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
function _reject(reason) {
|
|
2951
|
+
if (_state === 0 ) {
|
|
2952
|
+
_settledValue = reason;
|
|
2953
|
+
_state = 2 ;
|
|
2954
|
+
_processQueue();
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
(function _initialize() {
|
|
2958
|
+
if (!_isFunction(resolverFunc)) {
|
|
2959
|
+
throw new TypeError("ESPromise: resolvedFunc argument is not a Function");
|
|
2960
|
+
}
|
|
2961
|
+
try {
|
|
2962
|
+
resolverFunc(_resolve, _reject);
|
|
2963
|
+
}
|
|
2964
|
+
catch (error) {
|
|
2965
|
+
_reject(error);
|
|
2966
|
+
}
|
|
2967
|
+
})();
|
|
2968
|
+
}
|
|
2969
|
+
ESPromise.resolve = function (value) {
|
|
2970
|
+
if (value instanceof ESPromise) {
|
|
2971
|
+
return value;
|
|
2972
|
+
}
|
|
2973
|
+
else if (value && _isFunction(value.then)) {
|
|
2974
|
+
return new ESPromise(function (resolve, reject) {
|
|
2975
|
+
try {
|
|
2976
|
+
value.then(resolve, reject);
|
|
2977
|
+
}
|
|
2978
|
+
catch (error) {
|
|
2979
|
+
reject(error);
|
|
2980
|
+
}
|
|
2981
|
+
});
|
|
2982
|
+
}
|
|
2983
|
+
return new ESPromise(function (resolve) {
|
|
2984
|
+
resolve(value);
|
|
2985
|
+
});
|
|
2986
|
+
};
|
|
2987
|
+
ESPromise.reject = function (reason) {
|
|
2988
|
+
return new ESPromise(function (resolve, reject) {
|
|
2989
|
+
reject(reason);
|
|
2990
|
+
});
|
|
2991
|
+
};
|
|
2992
|
+
ESPromise.all = function (iterable) {
|
|
2993
|
+
if (!iterable || !iterable.length) {
|
|
2994
|
+
return;
|
|
2995
|
+
}
|
|
2996
|
+
return new ESPromise(function (resolve, reject) {
|
|
2997
|
+
try {
|
|
2998
|
+
var values_1 = [];
|
|
2999
|
+
var pending_2 = 0;
|
|
3000
|
+
for (var lp = 0; lp < iterable.length; lp++) {
|
|
3001
|
+
var item = iterable[lp];
|
|
3002
|
+
if (item && _isFunction(item.then)) {
|
|
3003
|
+
pending_2++;
|
|
3004
|
+
item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () {
|
|
3005
|
+
if (--pending_2 === 0) {
|
|
3006
|
+
resolve(values_1);
|
|
3007
|
+
}
|
|
3008
|
+
}), reject);
|
|
3009
|
+
}
|
|
3010
|
+
else {
|
|
3011
|
+
values_1[lp] = item;
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
if (pending_2 === 0) {
|
|
3015
|
+
setTimeout(function () {
|
|
3016
|
+
resolve(values_1);
|
|
3017
|
+
}, 0);
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
catch (error) {
|
|
3021
|
+
reject(error);
|
|
3022
|
+
}
|
|
3023
|
+
});
|
|
3024
|
+
};
|
|
3025
|
+
ESPromise.race = function (iterable) {
|
|
3026
|
+
return new ESPromise(function (resolve, reject) {
|
|
3027
|
+
if (!iterable || !iterable.length) {
|
|
3028
|
+
return;
|
|
3029
|
+
}
|
|
3030
|
+
try {
|
|
3031
|
+
var _loop_1 = function (lp) {
|
|
3032
|
+
var item = iterable[lp];
|
|
3033
|
+
if (item && _isFunction(item.then)) {
|
|
3034
|
+
item.then(resolve, reject);
|
|
3035
|
+
}
|
|
3036
|
+
else {
|
|
3037
|
+
setTimeout(function () {
|
|
3038
|
+
resolve(item);
|
|
3039
|
+
}, 0);
|
|
3040
|
+
}
|
|
3041
|
+
};
|
|
3042
|
+
for (var lp = 0; lp < iterable.length; lp++) {
|
|
3043
|
+
_loop_1(lp);
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
catch (error) {
|
|
3047
|
+
reject(error);
|
|
3048
|
+
}
|
|
3049
|
+
});
|
|
3050
|
+
};
|
|
3051
|
+
return ESPromise;
|
|
3052
|
+
}());
|
|
3053
|
+
var ESPromise$1 = ESPromise;
|
|
3054
|
+
|
|
3055
|
+
var LazyRejectPeriod = 600000;
|
|
3056
|
+
var _schedulerId = 0;
|
|
3057
|
+
var _running = [];
|
|
3058
|
+
var _waiting = [];
|
|
3059
|
+
var _timedOut = [];
|
|
3060
|
+
function _getTime() {
|
|
3061
|
+
return new Date().getTime();
|
|
3062
|
+
}
|
|
3063
|
+
var ESPromiseScheduler = /** @class */ (function () {
|
|
3064
|
+
function ESPromiseScheduler(name, diagLog) {
|
|
3065
|
+
var _promiseId = 0;
|
|
3066
|
+
var _scheduledName = (name || "<unnamed>") + "." + _schedulerId;
|
|
3067
|
+
_schedulerId++;
|
|
3068
|
+
dynamicProto(ESPromiseScheduler, this, function (_this) {
|
|
3069
|
+
var _lastEvent = null;
|
|
3070
|
+
var _eventCount = 0;
|
|
3071
|
+
_this.scheduleEvent = function (startEventAction, eventName, timeout) {
|
|
3072
|
+
var uniqueId = _scheduledName + "." + _eventCount;
|
|
3073
|
+
_eventCount++;
|
|
3074
|
+
if (eventName) {
|
|
3075
|
+
uniqueId += "-(" + eventName + ")";
|
|
3076
|
+
}
|
|
3077
|
+
var uniqueEventId = uniqueId + "{" + _promiseId + "}";
|
|
3078
|
+
_promiseId++;
|
|
3079
|
+
var newScheduledEvent = {
|
|
3080
|
+
evt: null,
|
|
3081
|
+
tm: _getTime(),
|
|
3082
|
+
id: uniqueEventId,
|
|
3083
|
+
isRunning: false,
|
|
3084
|
+
isAborted: false
|
|
3085
|
+
};
|
|
3086
|
+
if (!_lastEvent) {
|
|
3087
|
+
newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent);
|
|
3088
|
+
}
|
|
3089
|
+
else {
|
|
3090
|
+
newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent);
|
|
3091
|
+
}
|
|
3092
|
+
_lastEvent = newScheduledEvent;
|
|
3093
|
+
_lastEvent.evt._schId = uniqueEventId;
|
|
3094
|
+
return newScheduledEvent.evt;
|
|
3095
|
+
function _abortAndRemoveOldEvents(eventQueue) {
|
|
3096
|
+
var now = _getTime();
|
|
3097
|
+
var expired = now - LazyRejectPeriod;
|
|
3098
|
+
var len = eventQueue.length;
|
|
3099
|
+
var lp = 0;
|
|
3100
|
+
while (lp < len) {
|
|
3101
|
+
var evt = eventQueue[lp];
|
|
3102
|
+
if (evt && evt.tm < expired) {
|
|
3103
|
+
var message = null;
|
|
3104
|
+
if (evt.abort) {
|
|
3105
|
+
message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)";
|
|
3106
|
+
evt.abort(message);
|
|
3107
|
+
}
|
|
3108
|
+
else {
|
|
3109
|
+
message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)";
|
|
3110
|
+
}
|
|
3111
|
+
_warnLog(message);
|
|
3112
|
+
eventQueue.splice(lp, 1);
|
|
3113
|
+
len--;
|
|
3114
|
+
}
|
|
3115
|
+
else {
|
|
3116
|
+
lp++;
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
function _cleanup(eventId, completed) {
|
|
3121
|
+
var toQueue = false;
|
|
3122
|
+
var removed = _removeQueuedEvent(_running, eventId);
|
|
3123
|
+
if (!removed) {
|
|
3124
|
+
removed = _removeQueuedEvent(_timedOut, eventId);
|
|
3125
|
+
toQueue = true;
|
|
3126
|
+
}
|
|
3127
|
+
if (removed) {
|
|
3128
|
+
if (removed.to) {
|
|
3129
|
+
clearTimeout(removed.to);
|
|
3130
|
+
removed.to = null;
|
|
3131
|
+
}
|
|
3132
|
+
var tm = _getTime() - removed.tm;
|
|
3133
|
+
if (completed) {
|
|
3134
|
+
if (!toQueue) {
|
|
3135
|
+
_debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms");
|
|
3136
|
+
}
|
|
3137
|
+
else {
|
|
3138
|
+
_warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms");
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
else {
|
|
3142
|
+
_timedOut.push(removed);
|
|
3143
|
+
_warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms");
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
else {
|
|
3147
|
+
_debugLog("Failed to remove [" + eventId + "] from running queue");
|
|
3148
|
+
}
|
|
3149
|
+
if (_lastEvent && _lastEvent.id === eventId) {
|
|
3150
|
+
_lastEvent = null;
|
|
3151
|
+
}
|
|
3152
|
+
_abortAndRemoveOldEvents(_running);
|
|
3153
|
+
_abortAndRemoveOldEvents(_waiting);
|
|
3154
|
+
_abortAndRemoveOldEvents(_timedOut);
|
|
3155
|
+
}
|
|
3156
|
+
function _removeScheduledEvent(eventId, callback) {
|
|
3157
|
+
return function (value) {
|
|
3158
|
+
_cleanup(eventId, true);
|
|
3159
|
+
callback && callback(value);
|
|
3160
|
+
return value;
|
|
3161
|
+
};
|
|
3162
|
+
}
|
|
3163
|
+
function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) {
|
|
3164
|
+
startResult.then(function (value) {
|
|
3165
|
+
if (value instanceof ESPromise$1) {
|
|
3166
|
+
_debugLog("Event [" + eventId + "] returned a promise -- waiting");
|
|
3167
|
+
_waitForFinalResult(eventId, value, schEventResolve, schEventReject);
|
|
3168
|
+
return value;
|
|
3169
|
+
}
|
|
3170
|
+
else {
|
|
3171
|
+
return _removeScheduledEvent(eventId, schEventResolve)(value);
|
|
3172
|
+
}
|
|
3173
|
+
}, _removeScheduledEvent(eventId, schEventReject));
|
|
3174
|
+
}
|
|
3175
|
+
function _createScheduledEvent(eventDetails, startEvent) {
|
|
3176
|
+
var eventId = eventDetails.id;
|
|
3177
|
+
return new ESPromise$1(function (schEventResolve, schEventReject) {
|
|
3178
|
+
_debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms");
|
|
3179
|
+
eventDetails.isRunning = true;
|
|
3180
|
+
eventDetails.abort = function (message) {
|
|
3181
|
+
eventDetails.abort = null;
|
|
3182
|
+
eventDetails.isAborted = true;
|
|
3183
|
+
_cleanup(eventId, false);
|
|
3184
|
+
schEventReject(new Error(message));
|
|
3185
|
+
};
|
|
3186
|
+
var startResult = startEvent(eventId);
|
|
3187
|
+
if (startResult instanceof ESPromise$1) {
|
|
3188
|
+
if (timeout) {
|
|
3189
|
+
eventDetails.to = setTimeout(function () {
|
|
3190
|
+
_cleanup(eventId, false);
|
|
3191
|
+
schEventReject(new Error("Timed out after [" + timeout + "] ms"));
|
|
3192
|
+
}, timeout);
|
|
3193
|
+
}
|
|
3194
|
+
_waitForFinalResult(eventId, startResult, function (theResult) {
|
|
3195
|
+
_debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms");
|
|
3196
|
+
schEventResolve(theResult);
|
|
3197
|
+
}, schEventReject);
|
|
3198
|
+
}
|
|
3199
|
+
else {
|
|
3200
|
+
_debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise");
|
|
3201
|
+
schEventResolve();
|
|
3202
|
+
}
|
|
3203
|
+
});
|
|
3204
|
+
}
|
|
3205
|
+
function _startWaitingEvent(eventDetails) {
|
|
3206
|
+
var now = _getTime();
|
|
3207
|
+
eventDetails.wTm = now - eventDetails.tm;
|
|
3208
|
+
eventDetails.tm = now;
|
|
3209
|
+
if (eventDetails.isAborted) {
|
|
3210
|
+
return ESPromise$1.reject(new Error("[" + uniqueId + "] was aborted"));
|
|
3211
|
+
}
|
|
3212
|
+
_running.push(eventDetails);
|
|
3213
|
+
return _createScheduledEvent(eventDetails, startEventAction);
|
|
3214
|
+
}
|
|
3215
|
+
function _waitForPreviousEvent(eventDetails, waitForEvent) {
|
|
3216
|
+
var waitEvent = new ESPromise$1(function (waitResolve, waitReject) {
|
|
3217
|
+
var runTime = _getTime() - waitForEvent.tm;
|
|
3218
|
+
var prevId = waitForEvent.id;
|
|
3219
|
+
_debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running");
|
|
3220
|
+
eventDetails.abort = function (message) {
|
|
3221
|
+
eventDetails.abort = null;
|
|
3222
|
+
_removeQueuedEvent(_waiting, uniqueId);
|
|
3223
|
+
eventDetails.isAborted = true;
|
|
3224
|
+
waitReject(new Error(message));
|
|
3225
|
+
};
|
|
3226
|
+
waitForEvent.evt.then(function (value) {
|
|
3227
|
+
_removeQueuedEvent(_waiting, uniqueId);
|
|
3228
|
+
_startWaitingEvent(eventDetails).then(waitResolve, waitReject);
|
|
3229
|
+
}, function (reason) {
|
|
3230
|
+
_removeQueuedEvent(_waiting, uniqueId);
|
|
3231
|
+
_startWaitingEvent(eventDetails).then(waitResolve, waitReject);
|
|
3232
|
+
});
|
|
3233
|
+
});
|
|
3234
|
+
_waiting.push(eventDetails);
|
|
3235
|
+
return waitEvent;
|
|
3236
|
+
}
|
|
3237
|
+
};
|
|
3238
|
+
function _removeQueuedEvent(queue, eventId) {
|
|
3239
|
+
for (var lp = 0; lp < queue.length; lp++) {
|
|
3240
|
+
if (queue[lp].id === eventId) {
|
|
3241
|
+
return queue.splice(lp, 1)[0];
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3244
|
+
return null;
|
|
3245
|
+
}
|
|
3246
|
+
});
|
|
3247
|
+
function _debugLog(message) {
|
|
3248
|
+
var global = getGlobal();
|
|
3249
|
+
if (global && global["QUnit"]) {
|
|
3250
|
+
console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message);
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
function _warnLog(message) {
|
|
3254
|
+
diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message);
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
ESPromiseScheduler.incomplete = function () {
|
|
3258
|
+
return _running;
|
|
3259
|
+
};
|
|
3260
|
+
ESPromiseScheduler.waitingToStart = function () {
|
|
3261
|
+
return _waiting;
|
|
3262
|
+
};
|
|
3263
|
+
return ESPromiseScheduler;
|
|
3264
|
+
}());
|
|
3265
|
+
var ESPromiseScheduler$1 = ESPromiseScheduler;
|
|
3266
|
+
|
|
3267
|
+
var ValueSanitizer = /** @class */ (function () {
|
|
3268
|
+
function ValueSanitizer(fieldSanitizerProvider) {
|
|
3269
|
+
var _self = this;
|
|
3270
|
+
var _sanitizerMap = {};
|
|
3271
|
+
var _sanitizers = [];
|
|
3272
|
+
var _fieldSanitizers = [];
|
|
3273
|
+
if (fieldSanitizerProvider) {
|
|
3274
|
+
_fieldSanitizers.push(fieldSanitizerProvider);
|
|
3275
|
+
}
|
|
3276
|
+
function _getFieldSanitizer(path, name) {
|
|
3277
|
+
var result;
|
|
3278
|
+
var fieldLookup = _sanitizerMap[path];
|
|
3279
|
+
if (fieldLookup) {
|
|
3280
|
+
result = fieldLookup[name];
|
|
3281
|
+
}
|
|
3282
|
+
if (!result && result !== null) {
|
|
3283
|
+
if (isString(path) && isString(name)) {
|
|
3284
|
+
if (_fieldSanitizers.length > 0) {
|
|
3285
|
+
for (var lp = 0; lp < _fieldSanitizers.length; lp++) {
|
|
3286
|
+
if (_fieldSanitizers[lp].handleField(path, name)) {
|
|
3287
|
+
result = {
|
|
3288
|
+
canHandle: true,
|
|
3289
|
+
fieldHandler: _fieldSanitizers[lp]
|
|
3290
|
+
};
|
|
3291
|
+
break;
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3295
|
+
else if (_sanitizers.length === 0) {
|
|
3296
|
+
result = {
|
|
3297
|
+
canHandle: true
|
|
3298
|
+
};
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
if (!result && result !== null) {
|
|
3302
|
+
result = null;
|
|
3303
|
+
for (var lp = 0; lp < _sanitizers.length; lp++) {
|
|
3304
|
+
if (_sanitizers[lp].handleField(path, name)) {
|
|
3305
|
+
result = {
|
|
3306
|
+
canHandle: true,
|
|
3307
|
+
handler: _sanitizers[lp],
|
|
3308
|
+
fieldHandler: null
|
|
3309
|
+
};
|
|
3310
|
+
break;
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3314
|
+
if (!fieldLookup) {
|
|
3315
|
+
fieldLookup = _sanitizerMap[path] = {};
|
|
3316
|
+
}
|
|
3317
|
+
fieldLookup[name] = result;
|
|
3318
|
+
}
|
|
3319
|
+
return result;
|
|
3320
|
+
}
|
|
3321
|
+
_self.addSanitizer = function (newSanitizer) {
|
|
3322
|
+
if (newSanitizer) {
|
|
3323
|
+
_sanitizers.push(newSanitizer);
|
|
3324
|
+
_sanitizerMap = {};
|
|
3325
|
+
}
|
|
3326
|
+
};
|
|
3327
|
+
_self.addFieldSanitizer = function (fieldSanitizer) {
|
|
3328
|
+
if (fieldSanitizer) {
|
|
3329
|
+
_fieldSanitizers.push(fieldSanitizer);
|
|
3330
|
+
_sanitizerMap = {};
|
|
3331
|
+
}
|
|
3332
|
+
};
|
|
3333
|
+
_self.handleField = function (path, name) {
|
|
3334
|
+
var mapValue = _getFieldSanitizer(path, name);
|
|
3335
|
+
return mapValue ? mapValue.canHandle : false;
|
|
3336
|
+
};
|
|
3337
|
+
_self.value = function (path, name, value, stringifyObjects) {
|
|
3338
|
+
var mapValue = _getFieldSanitizer(path, name);
|
|
3339
|
+
if (mapValue && mapValue.canHandle) {
|
|
3340
|
+
if (!mapValue || !mapValue.canHandle) {
|
|
3341
|
+
return null;
|
|
3342
|
+
}
|
|
3343
|
+
if (mapValue.handler) {
|
|
3344
|
+
return mapValue.handler.value(path, name, value, stringifyObjects);
|
|
3345
|
+
}
|
|
3346
|
+
if (!isString(name) || isNullOrUndefined(value) || value === "") {
|
|
3347
|
+
return null;
|
|
3348
|
+
}
|
|
3349
|
+
var property = null;
|
|
3350
|
+
var fieldType = getFieldValueType(value);
|
|
3351
|
+
if ((fieldType & 8192 ) === 8192 ) {
|
|
3352
|
+
var subType = fieldType & ~8192 ;
|
|
3353
|
+
property = value;
|
|
3354
|
+
if (!isValueAssigned(property.value) ||
|
|
3355
|
+
(subType !== 1 &&
|
|
3356
|
+
subType !== 2 &&
|
|
3357
|
+
subType !== 3 &&
|
|
3358
|
+
(subType & 4096 ) !== 4096 )) {
|
|
3359
|
+
return null;
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
else if (fieldType === 1 ||
|
|
3363
|
+
fieldType === 2 ||
|
|
3364
|
+
fieldType === 3 ||
|
|
3365
|
+
(fieldType & 4096 ) === 4096 ) {
|
|
3366
|
+
property = _convertToProperty(path, name, value);
|
|
3367
|
+
}
|
|
3368
|
+
else if (fieldType === 4 ) {
|
|
3369
|
+
property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value);
|
|
3370
|
+
}
|
|
3371
|
+
if (property) {
|
|
3372
|
+
return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3375
|
+
return null;
|
|
3376
|
+
};
|
|
3377
|
+
_self.property = function (path, name, property, stringifyObjects) {
|
|
3378
|
+
var mapValue = _getFieldSanitizer(path, name);
|
|
3379
|
+
if (!mapValue || !mapValue.canHandle) {
|
|
3380
|
+
return null;
|
|
3381
|
+
}
|
|
3382
|
+
if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) {
|
|
3383
|
+
return null;
|
|
3384
|
+
}
|
|
3385
|
+
var fieldType = getFieldValueType(property.value);
|
|
3386
|
+
if (fieldType === 0 ) {
|
|
3387
|
+
return null;
|
|
3388
|
+
}
|
|
3389
|
+
return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);
|
|
3390
|
+
};
|
|
3391
|
+
function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) {
|
|
3392
|
+
if (mapValue.handler) {
|
|
3393
|
+
return mapValue.handler.property(path, name, property, stringifyObjects);
|
|
3394
|
+
}
|
|
3395
|
+
if (!isNullOrUndefined(property.kind)) {
|
|
3396
|
+
if ((fieldType & 4096 ) === 4096 || !isValueKind(property.kind)) {
|
|
3397
|
+
return null;
|
|
3398
|
+
}
|
|
3399
|
+
property.value = property.value.toString();
|
|
3400
|
+
}
|
|
3401
|
+
return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property);
|
|
3402
|
+
}
|
|
3403
|
+
function _convertToProperty(path, name, value) {
|
|
3404
|
+
if (isValueAssigned(value)) {
|
|
3405
|
+
return { value: value };
|
|
3406
|
+
}
|
|
3407
|
+
return null;
|
|
3408
|
+
}
|
|
3409
|
+
function _callFieldSanitizer(fieldProvider, path, name, theType, property) {
|
|
3410
|
+
if (property && fieldProvider) {
|
|
3411
|
+
var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType);
|
|
3412
|
+
if (sanitizer) {
|
|
3413
|
+
if (theType === 4 ) {
|
|
3414
|
+
var newValue_1 = {};
|
|
3415
|
+
var propValue = property.value;
|
|
3416
|
+
objForEachKey(propValue, function (propKey, theValue) {
|
|
3417
|
+
var newPath = path + "." + name;
|
|
3418
|
+
if (isValueAssigned(theValue)) {
|
|
3419
|
+
var newProp = _convertToProperty(newPath, propKey, theValue);
|
|
3420
|
+
newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp);
|
|
3421
|
+
if (newProp) {
|
|
3422
|
+
newValue_1[propKey] = newProp.value;
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
});
|
|
3426
|
+
property.value = newValue_1;
|
|
3427
|
+
}
|
|
3428
|
+
else {
|
|
3429
|
+
var details = {
|
|
3430
|
+
path: path,
|
|
3431
|
+
name: name,
|
|
3432
|
+
type: theType,
|
|
3433
|
+
prop: property,
|
|
3434
|
+
sanitizer: _self
|
|
3435
|
+
};
|
|
3436
|
+
property = sanitizer.call(_self, details);
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
return property;
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
ValueSanitizer.getFieldType = getFieldValueType;
|
|
3444
|
+
return ValueSanitizer;
|
|
3445
|
+
}());
|
|
3446
|
+
|
|
3447
|
+
exports.AppInsightsCore = AppInsightsCore$1;
|
|
3448
|
+
exports.BaseCore = BaseCore$1;
|
|
3449
|
+
exports.BaseTelemetryPlugin = BaseTelemetryPlugin;
|
|
3450
|
+
exports.CoreUtils = CoreUtils;
|
|
3451
|
+
exports.DiagnosticLogger = DiagnosticLogger;
|
|
3452
|
+
exports.ESPromise = ESPromise$1;
|
|
3453
|
+
exports.ESPromiseScheduler = ESPromiseScheduler$1;
|
|
3454
|
+
exports.EventHelper = EventHelper;
|
|
3455
|
+
exports.EventLatency = EventLatency;
|
|
3456
|
+
exports.EventPersistence = EventPersistence;
|
|
3457
|
+
exports.EventPropertyType = EventPropertyType;
|
|
3458
|
+
exports.EventsDiscardedReason = EventsDiscardedReason;
|
|
3459
|
+
exports.FullVersionString = FullVersionString;
|
|
3460
|
+
exports.InternalAppInsightsCore = AppInsightsCore$2;
|
|
3461
|
+
exports.InternalBaseCore = BaseCore$2;
|
|
3462
|
+
exports.MinChannelPriorty = MinChannelPriorty;
|
|
3463
|
+
exports.NotificationManager = NotificationManager;
|
|
3464
|
+
exports.PerfEvent = PerfEvent;
|
|
3465
|
+
exports.PerfManager = PerfManager;
|
|
3466
|
+
exports.ProcessTelemetryContext = ProcessTelemetryContext;
|
|
3467
|
+
exports.TraceLevel = TraceLevel;
|
|
3468
|
+
exports.Undefined = strShimUndefined;
|
|
3469
|
+
exports.Utils = Utils;
|
|
3470
|
+
exports.ValueKind = ValueKind;
|
|
3471
|
+
exports.ValueSanitizer = ValueSanitizer;
|
|
3472
|
+
exports.Version = Version;
|
|
3473
|
+
exports._ExtendedInternalMessageId = _ExtendedInternalMessageId;
|
|
3474
|
+
exports._InternalLogMessage = _InternalLogMessage;
|
|
3475
|
+
exports._InternalMessageId = _InternalMessageId;
|
|
3476
|
+
exports.addEventHandler = addEventHandler;
|
|
3477
|
+
exports.addPageHideEventListener = addPageHideEventListener;
|
|
3478
|
+
exports.addPageShowEventListener = addPageShowEventListener;
|
|
3479
|
+
exports.addPageUnloadEventListener = addPageUnloadEventListener;
|
|
3480
|
+
exports.areCookiesSupported = areCookiesSupported;
|
|
3481
|
+
exports.arrForEach = arrForEach;
|
|
3482
|
+
exports.arrIndexOf = arrIndexOf;
|
|
3483
|
+
exports.arrMap = arrMap;
|
|
3484
|
+
exports.arrReduce = arrReduce;
|
|
3485
|
+
exports.attachEvent = attachEvent;
|
|
3486
|
+
exports.cookieAvailable = areCookiesSupported;
|
|
3487
|
+
exports.createCookieMgr = createCookieMgr;
|
|
3488
|
+
exports.createGuid = createGuid;
|
|
3489
|
+
exports.dateNow = dateNow;
|
|
3490
|
+
exports.deleteCookie = deleteCookie;
|
|
3491
|
+
exports.detachEvent = detachEvent;
|
|
3492
|
+
exports.disableCookies = disableCookies;
|
|
3493
|
+
exports.disallowsSameSiteNone = uaDisallowsSameSiteNone;
|
|
3494
|
+
exports.doPerf = doPerf;
|
|
3495
|
+
exports.dumpObj = dumpObj;
|
|
3496
|
+
exports.extend = extend;
|
|
3497
|
+
exports.generateW3CId = generateW3CId;
|
|
3498
|
+
exports.getCommonSchemaMetaData = getCommonSchemaMetaData;
|
|
3499
|
+
exports.getConsole = getConsole;
|
|
3500
|
+
exports.getCookie = getCookie;
|
|
3501
|
+
exports.getCookieValue = getCookieValue;
|
|
3502
|
+
exports.getCrypto = getCrypto;
|
|
3503
|
+
exports.getDocument = getDocument;
|
|
3504
|
+
exports.getExceptionName = getExceptionName;
|
|
3505
|
+
exports.getFieldValueType = getFieldValueType;
|
|
3506
|
+
exports.getGlobal = getGlobal;
|
|
3507
|
+
exports.getGlobalInst = getGlobalInst;
|
|
3508
|
+
exports.getHistory = getHistory;
|
|
3509
|
+
exports.getIEVersion = getIEVersion;
|
|
3510
|
+
exports.getISOString = toISOString;
|
|
3511
|
+
exports.getJSON = getJSON;
|
|
3512
|
+
exports.getLocation = getLocation;
|
|
3513
|
+
exports.getMsCrypto = getMsCrypto;
|
|
3514
|
+
exports.getNavigator = getNavigator;
|
|
3515
|
+
exports.getPerformance = getPerformance;
|
|
3516
|
+
exports.getSetValue = getSetValue;
|
|
3517
|
+
exports.getTenantId = getTenantId;
|
|
3518
|
+
exports.getTime = getTime;
|
|
3519
|
+
exports.getWindow = getWindow;
|
|
3520
|
+
exports.hasDocument = hasDocument;
|
|
3521
|
+
exports.hasHistory = hasHistory;
|
|
3522
|
+
exports.hasJSON = hasJSON;
|
|
3523
|
+
exports.hasNavigator = hasNavigator;
|
|
3524
|
+
exports.hasOwnProperty = hasOwnProperty;
|
|
3525
|
+
exports.hasWindow = hasWindow;
|
|
3526
|
+
exports.isArray = isArray;
|
|
3527
|
+
exports.isArrayValid = isArrayValid;
|
|
3528
|
+
exports.isBeaconsSupported = isBeaconsSupported;
|
|
3529
|
+
exports.isBoolean = isBoolean;
|
|
3530
|
+
exports.isChromium = isChromium;
|
|
3531
|
+
exports.isDate = isDate;
|
|
3532
|
+
exports.isDocumentObjectAvailable = isDocumentObjectAvailable;
|
|
3533
|
+
exports.isError = isError;
|
|
3534
|
+
exports.isFetchSupported = isFetchSupported;
|
|
3535
|
+
exports.isFunction = isFunction;
|
|
3536
|
+
exports.isIE = isIE;
|
|
3537
|
+
exports.isLatency = isLatency;
|
|
3538
|
+
exports.isNotTruthy = isNotTruthy;
|
|
3539
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
3540
|
+
exports.isNumber = isNumber;
|
|
3541
|
+
exports.isObject = isObject;
|
|
3542
|
+
exports.isReactNative = isReactNative;
|
|
3543
|
+
exports.isString = isString;
|
|
3544
|
+
exports.isTruthy = isTruthy;
|
|
3545
|
+
exports.isTypeof = isTypeof;
|
|
3546
|
+
exports.isUint8ArrayAvailable = isUint8ArrayAvailable;
|
|
3547
|
+
exports.isUndefined = isUndefined;
|
|
3548
|
+
exports.isValueAssigned = isValueAssigned;
|
|
3549
|
+
exports.isValueKind = isValueKind;
|
|
3550
|
+
exports.isWindowObjectAvailable = isWindowObjectAvailable;
|
|
3551
|
+
exports.isXhrSupported = isXhrSupported;
|
|
3552
|
+
exports.newGuid = newGuid;
|
|
3553
|
+
exports.newId = newId;
|
|
3554
|
+
exports.normalizeJsName = normalizeJsName;
|
|
3555
|
+
exports.objCreate = objCreateFn;
|
|
3556
|
+
exports.objDefineAccessors = objDefineAccessors;
|
|
3557
|
+
exports.objForEachKey = objForEachKey;
|
|
3558
|
+
exports.objKeys = objKeys;
|
|
3559
|
+
exports.openXhr = openXhr;
|
|
3560
|
+
exports.optimizeObject = optimizeObject;
|
|
3561
|
+
exports.perfNow = perfNow;
|
|
3562
|
+
exports.proxyAssign = proxyAssign;
|
|
3563
|
+
exports.random32 = random32;
|
|
3564
|
+
exports.randomValue = randomValue;
|
|
3565
|
+
exports.safeGetCookieMgr = safeGetCookieMgr;
|
|
3566
|
+
exports.safeGetLogger = safeGetLogger;
|
|
3567
|
+
exports.sanitizeProperty = sanitizeProperty;
|
|
3568
|
+
exports.setCookie = setCookie;
|
|
3569
|
+
exports.setEnableEnvMocks = setEnableEnvMocks;
|
|
3570
|
+
exports.setProcessTelemetryTimings = setProcessTelemetryTimings;
|
|
3571
|
+
exports.setValue = setValue;
|
|
3572
|
+
exports.strContains = strContains;
|
|
3573
|
+
exports.strEndsWith = strEndsWith;
|
|
3574
|
+
exports.strExtensionConfig = strExtensionConfig;
|
|
3575
|
+
exports.strFunction = strShimFunction;
|
|
3576
|
+
exports.strIKey = strIKey;
|
|
3577
|
+
exports.strObject = strShimObject;
|
|
3578
|
+
exports.strPrototype = strShimPrototype;
|
|
3579
|
+
exports.strStartsWith = strStartsWith;
|
|
3580
|
+
exports.strTrim = strTrim;
|
|
3581
|
+
exports.strUndefined = strShimUndefined;
|
|
3582
|
+
exports.throwError = throwError;
|
|
3583
|
+
exports.toISOString = toISOString;
|
|
3584
|
+
exports.useXDomainRequest = useXDomainRequest;
|
|
3585
|
+
|
|
3586
|
+
(function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
|
|
3587
|
+
|
|
3588
|
+
})(this.oneDS = this.oneDS || {});
|
|
3589
|
+
//# sourceMappingURL=ms.core-3.1.7.gbl.js.map
|