@microsoft/1ds-core-js 3.2.2 → 3.2.5
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/CODE_OF_CONDUCT.md +9 -0
- package/CONTRIBUTING.md +14 -0
- package/LICENSE.TXT +3 -3
- package/NOTICE +17 -0
- package/PRIVACY +3 -0
- package/README.md +15 -1
- package/SECURITY.md +41 -0
- package/SUPPORT.md +14 -0
- package/bundle/{ms.core-3.2.2.gbl.js → ms.core-3.2.5.gbl.js} +1728 -1431
- package/bundle/ms.core-3.2.5.gbl.js.map +1 -0
- package/bundle/ms.core-3.2.5.gbl.min.js +7 -0
- package/bundle/ms.core-3.2.5.gbl.min.js.map +1 -0
- package/bundle/ms.core-3.2.5.integrity.json +46 -0
- package/bundle/{ms.core-3.2.2.js → ms.core-3.2.5.js} +1728 -1431
- package/bundle/ms.core-3.2.5.js.map +1 -0
- package/bundle/ms.core-3.2.5.min.js +7 -0
- package/bundle/ms.core-3.2.5.min.js.map +1 -0
- package/bundle/ms.core.gbl.js +1727 -1430
- package/bundle/ms.core.gbl.js.map +1 -1
- package/bundle/ms.core.gbl.min.js +2 -2
- package/bundle/ms.core.gbl.min.js.map +1 -1
- package/bundle/ms.core.integrity.json +17 -17
- package/bundle/ms.core.js +1727 -1430
- package/bundle/ms.core.js.map +1 -1
- package/bundle/ms.core.min.js +2 -2
- package/bundle/ms.core.min.js.map +1 -1
- package/dist/ms.core.js +44 -35
- 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.d.ts +2 -7
- package/dist-esm/src/AppInsightsCore.js +27 -29
- package/dist-esm/src/AppInsightsCore.js.map +1 -1
- package/dist-esm/src/BaseCore.d.ts +2 -2
- package/dist-esm/src/BaseCore.js +18 -12
- package/dist-esm/src/BaseCore.js.map +1 -1
- package/dist-esm/src/DataModels.d.ts +5 -0
- package/dist-esm/src/DataModels.js +1 -1
- package/dist-esm/src/ESPromise.d.ts +5 -5
- package/dist-esm/src/ESPromise.js +15 -15
- package/dist-esm/src/ESPromise.js.map +1 -1
- package/dist-esm/src/ESPromiseScheduler.d.ts +4 -4
- package/dist-esm/src/ESPromiseScheduler.js +8 -8
- package/dist-esm/src/ESPromiseScheduler.js.map +1 -1
- package/dist-esm/src/Enums.d.ts +6 -5
- package/dist-esm/src/Enums.js +61 -61
- package/dist-esm/src/Enums.js.map +1 -1
- package/dist-esm/src/Index.d.ts +1 -2
- package/dist-esm/src/Index.js +3 -3
- package/dist-esm/src/Index.js.map +1 -1
- package/dist-esm/src/InternalConstants.d.ts +6 -0
- package/dist-esm/src/InternalConstants.js +19 -0
- package/dist-esm/src/InternalConstants.js.map +1 -0
- package/dist-esm/src/Utils.d.ts +9 -3
- package/dist-esm/src/Utils.js +40 -39
- package/dist-esm/src/Utils.js.map +1 -1
- package/dist-esm/src/ValueSanitizer.d.ts +1 -1
- package/dist-esm/src/ValueSanitizer.js +19 -18
- package/dist-esm/src/ValueSanitizer.js.map +1 -1
- package/package.json +4 -3
- package/src/AppInsightsCore.ts +29 -31
- package/src/BaseCore.ts +14 -11
- package/src/DataModels.ts +6 -0
- package/src/ESPromise.ts +6 -6
- package/src/ESPromiseScheduler.ts +8 -8
- package/src/Enums.ts +5 -5
- package/src/Index.ts +3 -3
- package/src/InternalConstants.ts +16 -0
- package/src/Utils.ts +24 -24
- package/src/ValueSanitizer.ts +5 -4
- package/bundle/ms.core-3.2.2.gbl.js.map +0 -1
- package/bundle/ms.core-3.2.2.gbl.min.js +0 -7
- package/bundle/ms.core-3.2.2.gbl.min.js.map +0 -1
- package/bundle/ms.core-3.2.2.integrity.json +0 -46
- package/bundle/ms.core-3.2.2.js.map +0 -1
- package/bundle/ms.core-3.2.2.min.js +0 -7
- package/bundle/ms.core-3.2.2.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* 1DS JS SDK Core, 3.2.
|
|
2
|
+
* 1DS JS SDK Core, 3.2.5
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
@@ -100,26 +100,79 @@
|
|
|
100
100
|
|
|
101
101
|
var MinChannelPriorty = 100;
|
|
102
102
|
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
var
|
|
106
|
-
var
|
|
107
|
-
var
|
|
108
|
-
var
|
|
109
|
-
var
|
|
110
|
-
var
|
|
111
|
-
var
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
var
|
|
122
|
-
var
|
|
103
|
+
var _DYN_INITIALIZE = "initialize";
|
|
104
|
+
var _DYN_NAME = "name";
|
|
105
|
+
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
106
|
+
var _DYN_IDENTIFIER = "identifier";
|
|
107
|
+
var _DYN_PUSH = "push";
|
|
108
|
+
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
109
|
+
var _DYN_CONFIG = "config";
|
|
110
|
+
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
111
|
+
var _DYN_LOGGER = "logger";
|
|
112
|
+
var _DYN_LENGTH = "length";
|
|
113
|
+
var _DYN_TIME = "time";
|
|
114
|
+
var _DYN_PROCESS_NEXT = "processNext";
|
|
115
|
+
var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
|
|
116
|
+
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
117
|
+
var _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener";
|
|
118
|
+
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
119
|
+
var _DYN_ON_COMPLETE = "onComplete";
|
|
120
|
+
var _DYN_GET_PLUGIN = "getPlugin";
|
|
121
|
+
var _DYN_FLUSH = "flush";
|
|
122
|
+
var _DYN__EXTENSIONS = "_extensions";
|
|
123
|
+
var _DYN_SPLICE = "splice";
|
|
124
|
+
var _DYN_TEARDOWN = "teardown";
|
|
125
|
+
var _DYN_MESSAGE_ID = "messageId";
|
|
126
|
+
var _DYN_MESSAGE = "message";
|
|
127
|
+
var _DYN_IS_ASYNC = "isAsync";
|
|
128
|
+
var _DYN__DO_TEARDOWN = "_doTeardown";
|
|
129
|
+
var _DYN_UPDATE = "update";
|
|
130
|
+
var _DYN_GET_NEXT = "getNext";
|
|
131
|
+
var _DYN_DIAG_LOG = "diagLog";
|
|
132
|
+
var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
|
|
133
|
+
var _DYN_CREATE_NEW = "createNew";
|
|
134
|
+
var _DYN_COOKIE_CFG = "cookieCfg";
|
|
135
|
+
var _DYN_INDEX_OF = "indexOf";
|
|
136
|
+
var _DYN_SUBSTRING = "substring";
|
|
137
|
+
var _DYN_USER_AGENT = "userAgent";
|
|
138
|
+
var _DYN_SPLIT = "split";
|
|
139
|
+
var _DYN_SET_ENABLED = "setEnabled";
|
|
140
|
+
var _DYN_SUBSTR = "substr";
|
|
141
|
+
var _DYN_NODE_TYPE = "nodeType";
|
|
142
|
+
var _DYN_APPLY = "apply";
|
|
143
|
+
var _DYN_REPLACE = "replace";
|
|
144
|
+
var _DYN_ENABLE_DEBUG_EXCEPTI4 = "enableDebugExceptions";
|
|
145
|
+
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
146
|
+
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
147
|
+
var _DYN_CALL = "call";
|
|
148
|
+
var _DYN_TYPE = "type";
|
|
149
|
+
var _DYN_HANDLER = "handler";
|
|
150
|
+
var _DYN_LISTENERS = "listeners";
|
|
151
|
+
var _DYN_IS_CHILD_EVT = "isChildEvt";
|
|
152
|
+
var _DYN_GET_CTX = "getCtx";
|
|
153
|
+
var _DYN_SET_CTX = "setCtx";
|
|
154
|
+
var _DYN_COMPLETE = "complete";
|
|
155
|
+
var _DYN_TRACE_ID = "traceId";
|
|
156
|
+
var _DYN_SPAN_ID = "spanId";
|
|
157
|
+
var _DYN_TRACE_FLAGS = "traceFlags";
|
|
158
|
+
var _DYN_VERSION = "version";
|
|
159
|
+
|
|
160
|
+
var STR_EMPTY$1 = "";
|
|
161
|
+
var STR_CHANNELS = "channels";
|
|
162
|
+
var STR_CORE = "core";
|
|
163
|
+
var STR_CREATE_PERF_MGR = "createPerfMgr";
|
|
164
|
+
var STR_DISABLED = "disabled";
|
|
165
|
+
var STR_EXTENSION_CONFIG = "extensionConfig";
|
|
166
|
+
var STR_EXTENSIONS = "extensions";
|
|
167
|
+
var STR_PROCESS_TELEMETRY = "processTelemetry";
|
|
168
|
+
var STR_PRIORITY = "priority";
|
|
169
|
+
var STR_EVENTS_SENT = "eventsSent";
|
|
170
|
+
var STR_EVENTS_DISCARDED = "eventsDiscarded";
|
|
171
|
+
var STR_EVENTS_SEND_REQUEST = "eventsSendRequest";
|
|
172
|
+
var STR_PERF_EVENT = "perfEvent";
|
|
173
|
+
var STR_ERROR_TO_CONSOLE = "errorToConsole";
|
|
174
|
+
var STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
175
|
+
var STR_GET_PERF_MGR = "getPerfMgr";
|
|
123
176
|
|
|
124
177
|
var strToISOString = "toISOString";
|
|
125
178
|
var cStrEndsWith = "endsWith";
|
|
@@ -144,7 +197,7 @@
|
|
|
144
197
|
var _isArray = Array.isArray;
|
|
145
198
|
var _objToString = ObjProto[strToString];
|
|
146
199
|
var _fnToString = ObjHasOwnProperty[strToString];
|
|
147
|
-
var _objFunctionString = _fnToString
|
|
200
|
+
var _objFunctionString = _fnToString[_DYN_CALL ](ObjClass);
|
|
148
201
|
var rCamelCase = /-([a-z])/g;
|
|
149
202
|
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
150
203
|
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
@@ -174,7 +227,7 @@
|
|
|
174
227
|
return !isNullOrUndefined(value);
|
|
175
228
|
}
|
|
176
229
|
function hasOwnProperty(obj, prop) {
|
|
177
|
-
return !!(obj && ObjHasOwnProperty
|
|
230
|
+
return !!(obj && ObjHasOwnProperty[_DYN_CALL ](obj, prop));
|
|
178
231
|
}
|
|
179
232
|
function isObject(value) {
|
|
180
233
|
return !!(value && typeof value === strShimObject);
|
|
@@ -185,11 +238,11 @@
|
|
|
185
238
|
function normalizeJsName(name) {
|
|
186
239
|
var value = name;
|
|
187
240
|
if (value && isString(value)) {
|
|
188
|
-
value = value
|
|
241
|
+
value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
|
|
189
242
|
return letter.toUpperCase();
|
|
190
243
|
});
|
|
191
|
-
value = value
|
|
192
|
-
value = value
|
|
244
|
+
value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
|
|
245
|
+
value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
|
|
193
246
|
return "_" + match;
|
|
194
247
|
});
|
|
195
248
|
}
|
|
@@ -198,8 +251,8 @@
|
|
|
198
251
|
function objForEachKey(target, callbackfn) {
|
|
199
252
|
if (target) {
|
|
200
253
|
for (var prop in target) {
|
|
201
|
-
if (ObjHasOwnProperty
|
|
202
|
-
callbackfn
|
|
254
|
+
if (ObjHasOwnProperty[_DYN_CALL ](target, prop)) {
|
|
255
|
+
callbackfn[_DYN_CALL ](target, prop, target[prop]);
|
|
203
256
|
}
|
|
204
257
|
}
|
|
205
258
|
}
|
|
@@ -213,8 +266,8 @@
|
|
|
213
266
|
}
|
|
214
267
|
function _strEndsWithPoly(value, search) {
|
|
215
268
|
var result = false;
|
|
216
|
-
var searchLen = search ? search
|
|
217
|
-
var valLen = value ? value
|
|
269
|
+
var searchLen = search ? search[_DYN_LENGTH ] : 0;
|
|
270
|
+
var valLen = value ? value[_DYN_LENGTH ] : 0;
|
|
218
271
|
if (searchLen && valLen && valLen >= searchLen && !(result = value === search)) {
|
|
219
272
|
var pos = valLen - 1;
|
|
220
273
|
for (var lp = searchLen - 1; lp >= 0; lp--) {
|
|
@@ -236,8 +289,8 @@
|
|
|
236
289
|
}
|
|
237
290
|
function _strStartsWithPoly(value, checkValue) {
|
|
238
291
|
var result = false;
|
|
239
|
-
var chkLen = checkValue ? checkValue
|
|
240
|
-
if (value && chkLen && value
|
|
292
|
+
var chkLen = checkValue ? checkValue[_DYN_LENGTH ] : 0;
|
|
293
|
+
if (value && chkLen && value[_DYN_LENGTH ] >= chkLen && !(result = value === checkValue)) {
|
|
241
294
|
for (var lp = 0; lp < chkLen; lp++) {
|
|
242
295
|
if (value[lp] !== checkValue[lp]) {
|
|
243
296
|
return false;
|
|
@@ -249,19 +302,19 @@
|
|
|
249
302
|
}
|
|
250
303
|
function strContains(value, search) {
|
|
251
304
|
if (value && search) {
|
|
252
|
-
return value
|
|
305
|
+
return value[_DYN_INDEX_OF ](search) !== -1;
|
|
253
306
|
}
|
|
254
307
|
return false;
|
|
255
308
|
}
|
|
256
309
|
function isDate(obj) {
|
|
257
|
-
return !!(obj && _objToString
|
|
310
|
+
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Date]");
|
|
258
311
|
}
|
|
259
312
|
var isArray = _isArray || _isArrayPoly;
|
|
260
313
|
function _isArrayPoly(obj) {
|
|
261
|
-
return !!(obj && _objToString
|
|
314
|
+
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Array]");
|
|
262
315
|
}
|
|
263
316
|
function isError(obj) {
|
|
264
|
-
return !!(obj && _objToString
|
|
317
|
+
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Error]");
|
|
265
318
|
}
|
|
266
319
|
function isString(value) {
|
|
267
320
|
return typeof value === "string";
|
|
@@ -280,10 +333,10 @@
|
|
|
280
333
|
result = true;
|
|
281
334
|
}
|
|
282
335
|
else {
|
|
283
|
-
if (proto[strConstructor] && ObjHasOwnProperty
|
|
336
|
+
if (proto[strConstructor] && ObjHasOwnProperty[_DYN_CALL ](proto, strConstructor)) {
|
|
284
337
|
proto = proto[strConstructor];
|
|
285
338
|
}
|
|
286
|
-
result = typeof proto === strShimFunction && _fnToString
|
|
339
|
+
result = typeof proto === strShimFunction && _fnToString[_DYN_CALL ](proto) === _objFunctionString;
|
|
287
340
|
}
|
|
288
341
|
}
|
|
289
342
|
return result;
|
|
@@ -297,7 +350,7 @@
|
|
|
297
350
|
if (date && date.getUTCFullYear) {
|
|
298
351
|
var pad = function (num) {
|
|
299
352
|
var r = String(num);
|
|
300
|
-
if (r
|
|
353
|
+
if (r[_DYN_LENGTH ] === 1) {
|
|
301
354
|
r = "0" + r;
|
|
302
355
|
}
|
|
303
356
|
return r;
|
|
@@ -313,11 +366,11 @@
|
|
|
313
366
|
}
|
|
314
367
|
}
|
|
315
368
|
function arrForEach(arr, callbackfn, thisArg) {
|
|
316
|
-
var len = arr
|
|
369
|
+
var len = arr[_DYN_LENGTH ];
|
|
317
370
|
try {
|
|
318
371
|
for (var idx = 0; idx < len; idx++) {
|
|
319
372
|
if (idx in arr) {
|
|
320
|
-
if (callbackfn
|
|
373
|
+
if (callbackfn[_DYN_CALL ](thisArg || arr, arr[idx], idx, arr) === -1) {
|
|
321
374
|
break;
|
|
322
375
|
}
|
|
323
376
|
}
|
|
@@ -331,7 +384,7 @@
|
|
|
331
384
|
if (arr[strIndexOf]) {
|
|
332
385
|
return arr[strIndexOf](searchElement, fromIndex);
|
|
333
386
|
}
|
|
334
|
-
var len = arr
|
|
387
|
+
var len = arr[_DYN_LENGTH ];
|
|
335
388
|
var from = fromIndex || 0;
|
|
336
389
|
try {
|
|
337
390
|
for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {
|
|
@@ -351,13 +404,13 @@
|
|
|
351
404
|
if (arr[strMap]) {
|
|
352
405
|
return arr[strMap](callbackfn, thisArg);
|
|
353
406
|
}
|
|
354
|
-
var len = arr
|
|
407
|
+
var len = arr[_DYN_LENGTH ];
|
|
355
408
|
var _this = thisArg || arr;
|
|
356
409
|
results = new Array(len);
|
|
357
410
|
try {
|
|
358
411
|
for (var lp = 0; lp < len; lp++) {
|
|
359
412
|
if (lp in arr) {
|
|
360
|
-
results[lp] = callbackfn
|
|
413
|
+
results[lp] = callbackfn[_DYN_CALL ](_this, arr[lp], arr);
|
|
361
414
|
}
|
|
362
415
|
}
|
|
363
416
|
}
|
|
@@ -372,9 +425,9 @@
|
|
|
372
425
|
if (arr[strReduce]) {
|
|
373
426
|
return arr[strReduce](callbackfn, initialValue);
|
|
374
427
|
}
|
|
375
|
-
var len = arr
|
|
428
|
+
var len = arr[_DYN_LENGTH ];
|
|
376
429
|
var lp = 0;
|
|
377
|
-
if (arguments
|
|
430
|
+
if (arguments[_DYN_LENGTH ] >= 3) {
|
|
378
431
|
value = arguments[2];
|
|
379
432
|
}
|
|
380
433
|
else {
|
|
@@ -394,7 +447,7 @@
|
|
|
394
447
|
}
|
|
395
448
|
function strTrim(str) {
|
|
396
449
|
if (str) {
|
|
397
|
-
str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str
|
|
450
|
+
str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str[_DYN_REPLACE ] ? str[_DYN_REPLACE ](/^\s+|\s+$/g, STR_EMPTY$1) : str);
|
|
398
451
|
}
|
|
399
452
|
return str;
|
|
400
453
|
}
|
|
@@ -418,15 +471,15 @@
|
|
|
418
471
|
}
|
|
419
472
|
var result = [];
|
|
420
473
|
for (var prop in obj) {
|
|
421
|
-
if (obj && ObjHasOwnProperty
|
|
422
|
-
result
|
|
474
|
+
if (obj && ObjHasOwnProperty[_DYN_CALL ](obj, prop)) {
|
|
475
|
+
result[_DYN_PUSH ](prop);
|
|
423
476
|
}
|
|
424
477
|
}
|
|
425
478
|
if (_objKeysHasDontEnumBug) {
|
|
426
|
-
var dontEnumsLength = _objKeysDontEnums
|
|
479
|
+
var dontEnumsLength = _objKeysDontEnums[_DYN_LENGTH ];
|
|
427
480
|
for (var lp = 0; lp < dontEnumsLength; lp++) {
|
|
428
|
-
if (obj && ObjHasOwnProperty
|
|
429
|
-
result
|
|
481
|
+
if (obj && ObjHasOwnProperty[_DYN_CALL ](obj, _objKeysDontEnums[lp])) {
|
|
482
|
+
result[_DYN_PUSH ](_objKeysDontEnums[lp]);
|
|
430
483
|
}
|
|
431
484
|
}
|
|
432
485
|
}
|
|
@@ -474,9 +527,9 @@
|
|
|
474
527
|
}
|
|
475
528
|
function getExceptionName(object) {
|
|
476
529
|
if (isError(object)) {
|
|
477
|
-
return object
|
|
530
|
+
return object[_DYN_NAME ];
|
|
478
531
|
}
|
|
479
|
-
return
|
|
532
|
+
return STR_EMPTY$1;
|
|
480
533
|
}
|
|
481
534
|
function setValue(target, field, value, valChk, srcChk) {
|
|
482
535
|
var theValue = value;
|
|
@@ -503,6 +556,9 @@
|
|
|
503
556
|
}
|
|
504
557
|
return theValue;
|
|
505
558
|
}
|
|
559
|
+
function getCfgValue(theValue, defaultValue) {
|
|
560
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
561
|
+
}
|
|
506
562
|
function isNotTruthy(value) {
|
|
507
563
|
return !value;
|
|
508
564
|
}
|
|
@@ -527,7 +583,7 @@
|
|
|
527
583
|
src = srcFunc();
|
|
528
584
|
}
|
|
529
585
|
if (src) {
|
|
530
|
-
return src[funcName]
|
|
586
|
+
return src[funcName][_DYN_APPLY ](src, originalArguments);
|
|
531
587
|
}
|
|
532
588
|
};
|
|
533
589
|
}
|
|
@@ -587,7 +643,7 @@
|
|
|
587
643
|
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
588
644
|
var theArgs = arguments;
|
|
589
645
|
var extended = theArgs[0] || {};
|
|
590
|
-
var argLen = theArgs
|
|
646
|
+
var argLen = theArgs[_DYN_LENGTH ];
|
|
591
647
|
var deep = false;
|
|
592
648
|
var idx = 1;
|
|
593
649
|
if (argLen > 0 && isBoolean(extended)) {
|
|
@@ -603,7 +659,7 @@
|
|
|
603
659
|
var isArgArray = isArray(arg);
|
|
604
660
|
var isArgObj = isObject(arg);
|
|
605
661
|
for (var prop in arg) {
|
|
606
|
-
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty
|
|
662
|
+
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty[_DYN_CALL ](arg, prop)));
|
|
607
663
|
if (!propOk) {
|
|
608
664
|
continue;
|
|
609
665
|
}
|
|
@@ -1034,9 +1090,9 @@
|
|
|
1034
1090
|
}
|
|
1035
1091
|
function isIE() {
|
|
1036
1092
|
var nav = getNavigator();
|
|
1037
|
-
if (nav && (nav
|
|
1038
|
-
_navUserAgentCheck = nav
|
|
1039
|
-
var userAgent = (_navUserAgentCheck ||
|
|
1093
|
+
if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
|
|
1094
|
+
_navUserAgentCheck = nav[_DYN_USER_AGENT ];
|
|
1095
|
+
var userAgent = (_navUserAgentCheck || STR_EMPTY$1)[_DYN_TO_LOWER_CASE ]();
|
|
1040
1096
|
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
1041
1097
|
}
|
|
1042
1098
|
return _isTrident;
|
|
@@ -1045,15 +1101,15 @@
|
|
|
1045
1101
|
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
1046
1102
|
if (!userAgentStr) {
|
|
1047
1103
|
var navigator_1 = getNavigator() || {};
|
|
1048
|
-
userAgentStr = navigator_1 ? (navigator_1
|
|
1104
|
+
userAgentStr = navigator_1 ? (navigator_1[_DYN_USER_AGENT ] || STR_EMPTY$1)[_DYN_TO_LOWER_CASE ]() : STR_EMPTY$1;
|
|
1049
1105
|
}
|
|
1050
|
-
var ua = (userAgentStr ||
|
|
1106
|
+
var ua = (userAgentStr || STR_EMPTY$1)[_DYN_TO_LOWER_CASE ]();
|
|
1051
1107
|
if (strContains(ua, strMsie)) {
|
|
1052
1108
|
var doc = getDocument() || {};
|
|
1053
|
-
return Math.max(parseInt(ua
|
|
1109
|
+
return Math.max(parseInt(ua[_DYN_SPLIT ](strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
1054
1110
|
}
|
|
1055
1111
|
else if (strContains(ua, strTrident)) {
|
|
1056
|
-
var tridentVer = parseInt(ua
|
|
1112
|
+
var tridentVer = parseInt(ua[_DYN_SPLIT ](strTrident)[1]);
|
|
1057
1113
|
if (tridentVer) {
|
|
1058
1114
|
return tridentVer + 4;
|
|
1059
1115
|
}
|
|
@@ -1061,10 +1117,10 @@
|
|
|
1061
1117
|
return null;
|
|
1062
1118
|
}
|
|
1063
1119
|
function dumpObj(object) {
|
|
1064
|
-
var objectTypeDump = Object[strShimPrototype].toString
|
|
1065
|
-
var propertyValueDump =
|
|
1120
|
+
var objectTypeDump = Object[strShimPrototype].toString[_DYN_CALL ](object);
|
|
1121
|
+
var propertyValueDump = STR_EMPTY$1;
|
|
1066
1122
|
if (objectTypeDump === "[object Error]") {
|
|
1067
|
-
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object
|
|
1123
|
+
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object[_DYN_NAME ] + "'";
|
|
1068
1124
|
}
|
|
1069
1125
|
else if (hasJSON()) {
|
|
1070
1126
|
propertyValueDump = getJSON().stringify(object);
|
|
@@ -1109,6 +1165,35 @@
|
|
|
1109
1165
|
}
|
|
1110
1166
|
return isSupported;
|
|
1111
1167
|
}
|
|
1168
|
+
function _getNamedValue(values, name) {
|
|
1169
|
+
if (values) {
|
|
1170
|
+
for (var i = 0; i < values[_DYN_LENGTH ]; i++) {
|
|
1171
|
+
var value = values[i];
|
|
1172
|
+
if (value[_DYN_NAME ]) {
|
|
1173
|
+
if (value[_DYN_NAME ] === name) {
|
|
1174
|
+
return value;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
return {};
|
|
1180
|
+
}
|
|
1181
|
+
function findMetaTag(name) {
|
|
1182
|
+
var doc = getDocument();
|
|
1183
|
+
if (doc && name) {
|
|
1184
|
+
return _getNamedValue(doc.querySelectorAll("meta"), name).content;
|
|
1185
|
+
}
|
|
1186
|
+
return null;
|
|
1187
|
+
}
|
|
1188
|
+
function findNamedServerTiming(name) {
|
|
1189
|
+
var value;
|
|
1190
|
+
var perf = getPerformance();
|
|
1191
|
+
if (perf) {
|
|
1192
|
+
var navPerf = perf.getEntriesByType("navigation") || [];
|
|
1193
|
+
value = _getNamedValue((navPerf[_DYN_LENGTH ] > 0 ? navPerf[0] : {}).serverTiming, name).description;
|
|
1194
|
+
}
|
|
1195
|
+
return value;
|
|
1196
|
+
}
|
|
1112
1197
|
|
|
1113
1198
|
var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"];
|
|
1114
1199
|
var _aiNamespace = null;
|
|
@@ -1120,7 +1205,7 @@
|
|
|
1120
1205
|
if (dbgExt) {
|
|
1121
1206
|
var listener = dbgExt.listener;
|
|
1122
1207
|
if (listener && listener[name]) {
|
|
1123
|
-
listener[name]
|
|
1208
|
+
listener[name][_DYN_APPLY ](listener, args);
|
|
1124
1209
|
}
|
|
1125
1210
|
}
|
|
1126
1211
|
};
|
|
@@ -1142,7 +1227,7 @@
|
|
|
1142
1227
|
function getDebugListener(config) {
|
|
1143
1228
|
if (!_debugListener) {
|
|
1144
1229
|
_debugListener = {};
|
|
1145
|
-
for (var lp = 0; lp < listenerFuncs
|
|
1230
|
+
for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH ]; lp++) {
|
|
1146
1231
|
_debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);
|
|
1147
1232
|
}
|
|
1148
1233
|
}
|
|
@@ -1152,13 +1237,11 @@
|
|
|
1152
1237
|
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
1153
1238
|
var AiUserActionablePrefix = "AI: ";
|
|
1154
1239
|
var AIInternalMessagePrefix = "AITR_";
|
|
1155
|
-
var strErrorToConsole = "errorToConsole";
|
|
1156
|
-
var strWarnToConsole = "warnToConsole";
|
|
1157
1240
|
function _sanitizeDiagnosticText(text) {
|
|
1158
1241
|
if (text) {
|
|
1159
|
-
return "\"" + text
|
|
1242
|
+
return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$1) + "\"";
|
|
1160
1243
|
}
|
|
1161
|
-
return
|
|
1244
|
+
return STR_EMPTY$1;
|
|
1162
1245
|
}
|
|
1163
1246
|
function _logToConsole(func, message) {
|
|
1164
1247
|
var theConsole = getConsole();
|
|
@@ -1176,23 +1259,23 @@
|
|
|
1176
1259
|
function _InternalLogMessage(msgId, msg, isUserAct, properties) {
|
|
1177
1260
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
1178
1261
|
var _self = this;
|
|
1179
|
-
_self
|
|
1180
|
-
_self
|
|
1262
|
+
_self[_DYN_MESSAGE_ID ] = msgId;
|
|
1263
|
+
_self[_DYN_MESSAGE ] =
|
|
1181
1264
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
1182
1265
|
msgId;
|
|
1183
|
-
var strProps =
|
|
1266
|
+
var strProps = STR_EMPTY$1;
|
|
1184
1267
|
if (hasJSON()) {
|
|
1185
1268
|
strProps = getJSON().stringify(properties);
|
|
1186
1269
|
}
|
|
1187
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) :
|
|
1188
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) :
|
|
1189
|
-
_self
|
|
1270
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$1) +
|
|
1271
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$1);
|
|
1272
|
+
_self[_DYN_MESSAGE ] += diagnosticText;
|
|
1190
1273
|
}
|
|
1191
1274
|
_InternalLogMessage.dataType = "MessageData";
|
|
1192
1275
|
return _InternalLogMessage;
|
|
1193
1276
|
}());
|
|
1194
1277
|
function safeGetLogger(core, config) {
|
|
1195
|
-
return (core || {})
|
|
1278
|
+
return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
|
|
1196
1279
|
}
|
|
1197
1280
|
var DiagnosticLogger = /** @class */ (function () {
|
|
1198
1281
|
function DiagnosticLogger(config) {
|
|
@@ -1200,48 +1283,49 @@
|
|
|
1200
1283
|
this.queue = [];
|
|
1201
1284
|
var _messageCount = 0;
|
|
1202
1285
|
var _messageLogged = {};
|
|
1286
|
+
var _loggingLevelConsole;
|
|
1287
|
+
var _loggingLevelTelemetry;
|
|
1288
|
+
var _maxInternalMessageLimit;
|
|
1289
|
+
var _enableDebugExceptions;
|
|
1203
1290
|
dynamicProto(DiagnosticLogger, this, function (_self) {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
}
|
|
1207
|
-
_self.
|
|
1208
|
-
_self
|
|
1209
|
-
_self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); };
|
|
1210
|
-
_self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); };
|
|
1291
|
+
_setDefaultsFromConfig(config || {});
|
|
1292
|
+
_self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
|
|
1293
|
+
_self.telemetryLoggingLevel = function () { return _loggingLevelTelemetry; };
|
|
1294
|
+
_self.maxInternalMessageLimit = function () { return _maxInternalMessageLimit; };
|
|
1295
|
+
_self[_DYN_ENABLE_DEBUG_EXCEPTI4 ] = function () { return _enableDebugExceptions; };
|
|
1211
1296
|
_self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {
|
|
1212
1297
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
1213
1298
|
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
1214
|
-
if (
|
|
1299
|
+
if (_enableDebugExceptions) {
|
|
1215
1300
|
throw dumpObj(message);
|
|
1216
1301
|
}
|
|
1217
1302
|
else {
|
|
1218
|
-
var logFunc = severity === 1 ?
|
|
1219
|
-
if (!isUndefined(message
|
|
1220
|
-
var logLevel = _self.consoleLoggingLevel();
|
|
1303
|
+
var logFunc = severity === 1 ? STR_ERROR_TO_CONSOLE : STR_WARN_TO_CONSOLE;
|
|
1304
|
+
if (!isUndefined(message[_DYN_MESSAGE ])) {
|
|
1221
1305
|
if (isUserAct) {
|
|
1222
|
-
var messageKey = +message
|
|
1223
|
-
if (!_messageLogged[messageKey] &&
|
|
1224
|
-
_self[logFunc](message
|
|
1306
|
+
var messageKey = +message[_DYN_MESSAGE_ID ];
|
|
1307
|
+
if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
|
|
1308
|
+
_self[logFunc](message[_DYN_MESSAGE ]);
|
|
1225
1309
|
_messageLogged[messageKey] = true;
|
|
1226
1310
|
}
|
|
1227
1311
|
}
|
|
1228
1312
|
else {
|
|
1229
|
-
if (
|
|
1230
|
-
_self[logFunc](message
|
|
1313
|
+
if (_loggingLevelConsole >= severity) {
|
|
1314
|
+
_self[logFunc](message[_DYN_MESSAGE ]);
|
|
1231
1315
|
}
|
|
1232
1316
|
}
|
|
1233
|
-
|
|
1317
|
+
_logInternalMessage(severity, message);
|
|
1234
1318
|
}
|
|
1235
1319
|
else {
|
|
1236
1320
|
_debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
|
|
1237
1321
|
}
|
|
1238
1322
|
}
|
|
1239
1323
|
};
|
|
1240
|
-
_self
|
|
1324
|
+
_self[STR_WARN_TO_CONSOLE ] = function (message) {
|
|
1241
1325
|
_logToConsole("warn", message);
|
|
1242
1326
|
_debugExtMsg("warning", message);
|
|
1243
1327
|
};
|
|
1244
|
-
_self
|
|
1328
|
+
_self[STR_ERROR_TO_CONSOLE ] = function (message) {
|
|
1245
1329
|
_logToConsole("error", message);
|
|
1246
1330
|
_debugExtMsg("error", message);
|
|
1247
1331
|
};
|
|
@@ -1249,12 +1333,13 @@
|
|
|
1249
1333
|
_messageCount = 0;
|
|
1250
1334
|
_messageLogged = {};
|
|
1251
1335
|
};
|
|
1252
|
-
_self
|
|
1336
|
+
_self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
|
|
1337
|
+
function _logInternalMessage(severity, message) {
|
|
1253
1338
|
if (_areInternalMessagesThrottled()) {
|
|
1254
1339
|
return;
|
|
1255
1340
|
}
|
|
1256
1341
|
var logMessage = true;
|
|
1257
|
-
var messageKey = AIInternalMessagePrefix + message
|
|
1342
|
+
var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
|
|
1258
1343
|
if (_messageLogged[messageKey]) {
|
|
1259
1344
|
logMessage = false;
|
|
1260
1345
|
}
|
|
@@ -1262,42 +1347,42 @@
|
|
|
1262
1347
|
_messageLogged[messageKey] = true;
|
|
1263
1348
|
}
|
|
1264
1349
|
if (logMessage) {
|
|
1265
|
-
if (severity <=
|
|
1266
|
-
_self.queue
|
|
1350
|
+
if (severity <= _loggingLevelTelemetry) {
|
|
1351
|
+
_self.queue[_DYN_PUSH ](message);
|
|
1267
1352
|
_messageCount++;
|
|
1268
1353
|
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
1269
1354
|
}
|
|
1270
|
-
if (_messageCount ===
|
|
1355
|
+
if (_messageCount === _maxInternalMessageLimit) {
|
|
1271
1356
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
1272
1357
|
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
1273
|
-
_self.queue
|
|
1358
|
+
_self.queue[_DYN_PUSH ](throttleMessage);
|
|
1274
1359
|
if (severity === 1 ) {
|
|
1275
|
-
_self
|
|
1360
|
+
_self[STR_ERROR_TO_CONSOLE ](throttleLimitMessage);
|
|
1276
1361
|
}
|
|
1277
1362
|
else {
|
|
1278
|
-
_self
|
|
1363
|
+
_self[STR_WARN_TO_CONSOLE ](throttleLimitMessage);
|
|
1279
1364
|
}
|
|
1280
1365
|
}
|
|
1281
1366
|
}
|
|
1282
|
-
}
|
|
1283
|
-
function
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
return defValue;
|
|
1367
|
+
}
|
|
1368
|
+
function _setDefaultsFromConfig(config) {
|
|
1369
|
+
_loggingLevelConsole = getCfgValue(config.loggingLevelConsole, 0);
|
|
1370
|
+
_loggingLevelTelemetry = getCfgValue(config.loggingLevelTelemetry, 1);
|
|
1371
|
+
_maxInternalMessageLimit = getCfgValue(config.maxMessageLimit, 25);
|
|
1372
|
+
_enableDebugExceptions = getCfgValue(config[_DYN_ENABLE_DEBUG_EXCEPTI4 ], false);
|
|
1289
1373
|
}
|
|
1290
1374
|
function _areInternalMessagesThrottled() {
|
|
1291
|
-
return _messageCount >=
|
|
1375
|
+
return _messageCount >= _maxInternalMessageLimit;
|
|
1292
1376
|
}
|
|
1293
1377
|
function _debugExtMsg(name, data) {
|
|
1294
|
-
var dbgExt = getDebugExt(config);
|
|
1295
|
-
if (dbgExt && dbgExt
|
|
1296
|
-
dbgExt
|
|
1378
|
+
var dbgExt = getDebugExt(config || {});
|
|
1379
|
+
if (dbgExt && dbgExt[_DYN_DIAG_LOG ]) {
|
|
1380
|
+
dbgExt[_DYN_DIAG_LOG ](name, data);
|
|
1297
1381
|
}
|
|
1298
1382
|
}
|
|
1299
1383
|
});
|
|
1300
1384
|
}
|
|
1385
|
+
DiagnosticLogger.__ieDyn=1;
|
|
1301
1386
|
return DiagnosticLogger;
|
|
1302
1387
|
}());
|
|
1303
1388
|
function _getLogger(logger) {
|
|
@@ -1305,22 +1390,27 @@
|
|
|
1305
1390
|
}
|
|
1306
1391
|
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
1307
1392
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
1308
|
-
(logger
|
|
1393
|
+
_getLogger(logger).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
1309
1394
|
}
|
|
1310
1395
|
function _warnToConsole(logger, message) {
|
|
1311
|
-
_getLogger(logger)
|
|
1396
|
+
_getLogger(logger)[STR_WARN_TO_CONSOLE ](message);
|
|
1397
|
+
}
|
|
1398
|
+
function _logInternalMessage(logger, severity, message) {
|
|
1399
|
+
_getLogger(logger)[_DYN_LOG_INTERNAL_MESSAGE ](severity, message);
|
|
1312
1400
|
}
|
|
1313
1401
|
|
|
1314
1402
|
var strExecutionContextKey = "ctx";
|
|
1403
|
+
var strParentContextKey = "ParentContextKey";
|
|
1404
|
+
var strChildrenContextKey = "ChildrenContextKey";
|
|
1315
1405
|
var _defaultPerfManager = null;
|
|
1316
1406
|
var PerfEvent = /** @class */ (function () {
|
|
1317
1407
|
function PerfEvent(name, payloadDetails, isAsync) {
|
|
1318
1408
|
var _self = this;
|
|
1319
1409
|
var accessorDefined = false;
|
|
1320
1410
|
_self.start = dateNow();
|
|
1321
|
-
_self
|
|
1322
|
-
_self
|
|
1323
|
-
_self
|
|
1411
|
+
_self[_DYN_NAME ] = name;
|
|
1412
|
+
_self[_DYN_IS_ASYNC ] = isAsync;
|
|
1413
|
+
_self[_DYN_IS_CHILD_EVT ] = function () { return false; };
|
|
1324
1414
|
if (isFunction(payloadDetails)) {
|
|
1325
1415
|
var theDetails_1;
|
|
1326
1416
|
accessorDefined = objDefineAccessors(_self, "payload", function () {
|
|
@@ -1331,24 +1421,24 @@
|
|
|
1331
1421
|
return theDetails_1;
|
|
1332
1422
|
});
|
|
1333
1423
|
}
|
|
1334
|
-
_self
|
|
1424
|
+
_self[_DYN_GET_CTX ] = function (key) {
|
|
1335
1425
|
if (key) {
|
|
1336
|
-
if (key === PerfEvent
|
|
1426
|
+
if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) {
|
|
1337
1427
|
return _self[key];
|
|
1338
1428
|
}
|
|
1339
1429
|
return (_self[strExecutionContextKey] || {})[key];
|
|
1340
1430
|
}
|
|
1341
1431
|
return null;
|
|
1342
1432
|
};
|
|
1343
|
-
_self
|
|
1433
|
+
_self[_DYN_SET_CTX ] = function (key, value) {
|
|
1344
1434
|
if (key) {
|
|
1345
|
-
if (key === PerfEvent
|
|
1435
|
+
if (key === PerfEvent[strParentContextKey]) {
|
|
1346
1436
|
if (!_self[key]) {
|
|
1347
|
-
_self
|
|
1437
|
+
_self[_DYN_IS_CHILD_EVT ] = function () { return true; };
|
|
1348
1438
|
}
|
|
1349
1439
|
_self[key] = value;
|
|
1350
1440
|
}
|
|
1351
|
-
else if (key === PerfEvent
|
|
1441
|
+
else if (key === PerfEvent[strChildrenContextKey]) {
|
|
1352
1442
|
_self[key] = value;
|
|
1353
1443
|
}
|
|
1354
1444
|
else {
|
|
@@ -1357,20 +1447,20 @@
|
|
|
1357
1447
|
}
|
|
1358
1448
|
}
|
|
1359
1449
|
};
|
|
1360
|
-
_self
|
|
1450
|
+
_self[_DYN_COMPLETE ] = function () {
|
|
1361
1451
|
var childTime = 0;
|
|
1362
|
-
var childEvts = _self
|
|
1452
|
+
var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
1363
1453
|
if (isArray(childEvts)) {
|
|
1364
|
-
for (var lp = 0; lp < childEvts
|
|
1454
|
+
for (var lp = 0; lp < childEvts[_DYN_LENGTH ]; lp++) {
|
|
1365
1455
|
var childEvt = childEvts[lp];
|
|
1366
1456
|
if (childEvt) {
|
|
1367
|
-
childTime += childEvt
|
|
1457
|
+
childTime += childEvt[_DYN_TIME ];
|
|
1368
1458
|
}
|
|
1369
1459
|
}
|
|
1370
1460
|
}
|
|
1371
|
-
_self
|
|
1372
|
-
_self.exTime = _self
|
|
1373
|
-
_self
|
|
1461
|
+
_self[_DYN_TIME ] = dateNow() - _self.start;
|
|
1462
|
+
_self.exTime = _self[_DYN_TIME ] - childTime;
|
|
1463
|
+
_self[_DYN_COMPLETE ] = function () { };
|
|
1374
1464
|
if (!accessorDefined && isFunction(payloadDetails)) {
|
|
1375
1465
|
_self.payload = payloadDetails();
|
|
1376
1466
|
}
|
|
@@ -1389,63 +1479,64 @@
|
|
|
1389
1479
|
};
|
|
1390
1480
|
_self.fire = function (perfEvent) {
|
|
1391
1481
|
if (perfEvent) {
|
|
1392
|
-
perfEvent
|
|
1393
|
-
if (manager && isFunction(manager
|
|
1394
|
-
manager
|
|
1482
|
+
perfEvent[_DYN_COMPLETE ]();
|
|
1483
|
+
if (manager && isFunction(manager[STR_PERF_EVENT ])) {
|
|
1484
|
+
manager[STR_PERF_EVENT ](perfEvent);
|
|
1395
1485
|
}
|
|
1396
1486
|
}
|
|
1397
1487
|
};
|
|
1398
|
-
_self
|
|
1488
|
+
_self[_DYN_SET_CTX ] = function (key, value) {
|
|
1399
1489
|
if (key) {
|
|
1400
1490
|
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
1401
1491
|
ctx[key] = value;
|
|
1402
1492
|
}
|
|
1403
1493
|
};
|
|
1404
|
-
_self
|
|
1494
|
+
_self[_DYN_GET_CTX ] = function (key) {
|
|
1405
1495
|
return (_self[strExecutionContextKey] || {})[key];
|
|
1406
1496
|
};
|
|
1407
1497
|
});
|
|
1408
1498
|
}
|
|
1499
|
+
PerfManager.__ieDyn=1;
|
|
1409
1500
|
return PerfManager;
|
|
1410
1501
|
}());
|
|
1411
1502
|
var doPerfActiveKey = "CoreUtils.doPerf";
|
|
1412
1503
|
function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
1413
1504
|
if (mgrSource) {
|
|
1414
1505
|
var perfMgr = mgrSource;
|
|
1415
|
-
if (
|
|
1416
|
-
perfMgr = perfMgr[
|
|
1506
|
+
if (perfMgr[STR_GET_PERF_MGR]) {
|
|
1507
|
+
perfMgr = perfMgr[STR_GET_PERF_MGR]();
|
|
1417
1508
|
}
|
|
1418
1509
|
if (perfMgr) {
|
|
1419
1510
|
var perfEvt = void 0;
|
|
1420
|
-
var currentActive = perfMgr
|
|
1511
|
+
var currentActive = perfMgr[_DYN_GET_CTX ](doPerfActiveKey);
|
|
1421
1512
|
try {
|
|
1422
1513
|
perfEvt = perfMgr.create(getSource(), details, isAsync);
|
|
1423
1514
|
if (perfEvt) {
|
|
1424
|
-
if (currentActive && perfEvt
|
|
1425
|
-
perfEvt
|
|
1426
|
-
if (currentActive
|
|
1427
|
-
var children = currentActive
|
|
1515
|
+
if (currentActive && perfEvt[_DYN_SET_CTX ]) {
|
|
1516
|
+
perfEvt[_DYN_SET_CTX ](PerfEvent[strParentContextKey], currentActive);
|
|
1517
|
+
if (currentActive[_DYN_GET_CTX ] && currentActive[_DYN_SET_CTX ]) {
|
|
1518
|
+
var children = currentActive[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
1428
1519
|
if (!children) {
|
|
1429
1520
|
children = [];
|
|
1430
|
-
currentActive
|
|
1521
|
+
currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children);
|
|
1431
1522
|
}
|
|
1432
|
-
children
|
|
1523
|
+
children[_DYN_PUSH ](perfEvt);
|
|
1433
1524
|
}
|
|
1434
1525
|
}
|
|
1435
|
-
perfMgr
|
|
1526
|
+
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt);
|
|
1436
1527
|
return func(perfEvt);
|
|
1437
1528
|
}
|
|
1438
1529
|
}
|
|
1439
1530
|
catch (ex) {
|
|
1440
|
-
if (perfEvt && perfEvt
|
|
1441
|
-
perfEvt
|
|
1531
|
+
if (perfEvt && perfEvt[_DYN_SET_CTX ]) {
|
|
1532
|
+
perfEvt[_DYN_SET_CTX ]("exception", ex);
|
|
1442
1533
|
}
|
|
1443
1534
|
}
|
|
1444
1535
|
finally {
|
|
1445
1536
|
if (perfEvt) {
|
|
1446
1537
|
perfMgr.fire(perfEvt);
|
|
1447
1538
|
}
|
|
1448
|
-
perfMgr
|
|
1539
|
+
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, currentActive);
|
|
1449
1540
|
}
|
|
1450
1541
|
}
|
|
1451
1542
|
}
|
|
@@ -1524,8 +1615,8 @@
|
|
|
1524
1615
|
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1525
1616
|
var number = random32() >>> 0;
|
|
1526
1617
|
var chars = 0;
|
|
1527
|
-
var result =
|
|
1528
|
-
while (result
|
|
1618
|
+
var result = STR_EMPTY$1;
|
|
1619
|
+
while (result[_DYN_LENGTH ] < maxLength) {
|
|
1529
1620
|
chars++;
|
|
1530
1621
|
result += base64chars.charAt(number & 0x3F);
|
|
1531
1622
|
number >>>= 6;
|
|
@@ -1538,7 +1629,7 @@
|
|
|
1538
1629
|
}
|
|
1539
1630
|
|
|
1540
1631
|
var _objDefineProperty = ObjDefineProperty;
|
|
1541
|
-
var version =
|
|
1632
|
+
var version = '2.8.6';
|
|
1542
1633
|
var instanceName = "." + newId(6);
|
|
1543
1634
|
var _dataUid = 0;
|
|
1544
1635
|
function _createAccessor(target, prop, value) {
|
|
@@ -1557,7 +1648,7 @@
|
|
|
1557
1648
|
return false;
|
|
1558
1649
|
}
|
|
1559
1650
|
function _canAcceptData(target) {
|
|
1560
|
-
return target
|
|
1651
|
+
return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]);
|
|
1561
1652
|
}
|
|
1562
1653
|
function _getCache(data, target) {
|
|
1563
1654
|
var theCache = target[data.id];
|
|
@@ -1577,11 +1668,11 @@
|
|
|
1577
1668
|
}
|
|
1578
1669
|
function createUniqueNamespace(name, includeVersion) {
|
|
1579
1670
|
if (includeVersion === void 0) { includeVersion = false; }
|
|
1580
|
-
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version :
|
|
1671
|
+
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY$1) + instanceName);
|
|
1581
1672
|
}
|
|
1582
1673
|
function createElmNodeData(name) {
|
|
1583
1674
|
var data = {
|
|
1584
|
-
id: createUniqueNamespace("_aiData-" + (name ||
|
|
1675
|
+
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY$1) + "." + version),
|
|
1585
1676
|
accept: function (target) {
|
|
1586
1677
|
return _canAcceptData(target);
|
|
1587
1678
|
},
|
|
@@ -1609,201 +1700,943 @@
|
|
|
1609
1700
|
return data;
|
|
1610
1701
|
}
|
|
1611
1702
|
|
|
1612
|
-
var
|
|
1613
|
-
|
|
1614
|
-
|
|
1703
|
+
var strToGMTString = "toGMTString";
|
|
1704
|
+
var strToUTCString = "toUTCString";
|
|
1705
|
+
var strCookie = "cookie";
|
|
1706
|
+
var strExpires = "expires";
|
|
1707
|
+
var strEnabled = "enabled";
|
|
1708
|
+
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
1709
|
+
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
1710
|
+
var strConfigCookieMgr = "_ckMgr";
|
|
1711
|
+
var _supportsCookies = null;
|
|
1712
|
+
var _allowUaSameSite = null;
|
|
1713
|
+
var _parsedCookieValue = null;
|
|
1714
|
+
var _doc = getDocument();
|
|
1715
|
+
var _cookieCache = {};
|
|
1716
|
+
var _globalCookieConfig = {};
|
|
1717
|
+
function _gblCookieMgr(config, logger) {
|
|
1718
|
+
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
1719
|
+
if (!inst) {
|
|
1720
|
+
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
1721
|
+
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
1722
|
+
}
|
|
1723
|
+
return inst;
|
|
1615
1724
|
}
|
|
1616
|
-
function
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
var proxy = processContext.getNext();
|
|
1620
|
-
var pluginState;
|
|
1621
|
-
while (proxy) {
|
|
1622
|
-
var thePlugin = proxy.getPlugin();
|
|
1623
|
-
if (thePlugin) {
|
|
1624
|
-
if (lastPlugin &&
|
|
1625
|
-
isFunction(lastPlugin[strSetNextPlugin]) &&
|
|
1626
|
-
isFunction(thePlugin[strProcessTelemetry])) {
|
|
1627
|
-
lastPlugin[strSetNextPlugin](thePlugin);
|
|
1628
|
-
}
|
|
1629
|
-
var isInitialized = false;
|
|
1630
|
-
if (isFunction(thePlugin[strIsInitialized])) {
|
|
1631
|
-
isInitialized = thePlugin[strIsInitialized]();
|
|
1632
|
-
}
|
|
1633
|
-
else {
|
|
1634
|
-
pluginState = _getPluginState(thePlugin);
|
|
1635
|
-
isInitialized = pluginState[strIsInitialized];
|
|
1636
|
-
}
|
|
1637
|
-
if (!isInitialized) {
|
|
1638
|
-
initPlugins.push(thePlugin);
|
|
1639
|
-
}
|
|
1640
|
-
lastPlugin = thePlugin;
|
|
1641
|
-
proxy = proxy.getNext();
|
|
1642
|
-
}
|
|
1725
|
+
function _isMgrEnabled(cookieMgr) {
|
|
1726
|
+
if (cookieMgr) {
|
|
1727
|
+
return cookieMgr.isEnabled();
|
|
1643
1728
|
}
|
|
1644
|
-
|
|
1645
|
-
var core = processContext.core();
|
|
1646
|
-
thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext());
|
|
1647
|
-
pluginState = _getPluginState(thePlugin);
|
|
1648
|
-
if (!thePlugin[strCore] && !pluginState[strCore]) {
|
|
1649
|
-
pluginState[strCore] = core;
|
|
1650
|
-
}
|
|
1651
|
-
pluginState[strIsInitialized] = true;
|
|
1652
|
-
delete pluginState[strTeardown];
|
|
1653
|
-
});
|
|
1729
|
+
return true;
|
|
1654
1730
|
}
|
|
1655
|
-
function
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
result = -1;
|
|
1731
|
+
function _createCookieMgrConfig(rootConfig) {
|
|
1732
|
+
var cookieMgrCfg = rootConfig[_DYN_COOKIE_CFG ] = rootConfig[_DYN_COOKIE_CFG ] || {};
|
|
1733
|
+
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
|
1734
|
+
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
|
1735
|
+
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
|
1736
|
+
var cookieEnabled = void 0;
|
|
1737
|
+
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
1738
|
+
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
1664
1739
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
1670
|
-
var strHasRunFlags = "_hasRun";
|
|
1671
|
-
var strGetTelCtx = "_getTelCtx";
|
|
1672
|
-
var _chainId = 0;
|
|
1673
|
-
function _getNextProxyStart(proxy, core, startAt) {
|
|
1674
|
-
while (proxy) {
|
|
1675
|
-
if (proxy.getPlugin() === startAt) {
|
|
1676
|
-
return proxy;
|
|
1740
|
+
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
1741
|
+
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
1677
1742
|
}
|
|
1678
|
-
|
|
1743
|
+
cookieMgrCfg[strEnabled] = cookieEnabled;
|
|
1679
1744
|
}
|
|
1680
|
-
return
|
|
1745
|
+
return cookieMgrCfg;
|
|
1681
1746
|
}
|
|
1682
|
-
function
|
|
1683
|
-
var
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
_nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain;
|
|
1747
|
+
function safeGetCookieMgr(core, config) {
|
|
1748
|
+
var cookieMgr;
|
|
1749
|
+
if (core) {
|
|
1750
|
+
cookieMgr = core.getCookieMgr();
|
|
1687
1751
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
return core;
|
|
1693
|
-
},
|
|
1694
|
-
diagLog: function () {
|
|
1695
|
-
return safeGetLogger(core, config);
|
|
1696
|
-
},
|
|
1697
|
-
getCfg: function () {
|
|
1698
|
-
return config;
|
|
1699
|
-
},
|
|
1700
|
-
getExtCfg: _getExtCfg,
|
|
1701
|
-
getConfig: _getConfig,
|
|
1702
|
-
hasNext: function () {
|
|
1703
|
-
return !!_nextProxy;
|
|
1704
|
-
},
|
|
1705
|
-
getNext: function () {
|
|
1706
|
-
return _nextProxy;
|
|
1707
|
-
},
|
|
1708
|
-
setNext: function (nextPlugin) {
|
|
1709
|
-
_nextProxy = nextPlugin;
|
|
1710
|
-
},
|
|
1711
|
-
iterate: _iterateChain,
|
|
1712
|
-
onComplete: _addOnComplete
|
|
1713
|
-
}
|
|
1714
|
-
};
|
|
1715
|
-
function _addOnComplete(onComplete, that) {
|
|
1716
|
-
var args = [];
|
|
1717
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1718
|
-
args[_i - 2] = arguments[_i];
|
|
1752
|
+
else if (config) {
|
|
1753
|
+
var cookieCfg = config[_DYN_COOKIE_CFG ];
|
|
1754
|
+
if (cookieCfg[strConfigCookieMgr]) {
|
|
1755
|
+
cookieMgr = cookieCfg[strConfigCookieMgr];
|
|
1719
1756
|
}
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
func: onComplete,
|
|
1723
|
-
self: !isUndefined(that) ? that : context.ctx,
|
|
1724
|
-
args: args
|
|
1725
|
-
});
|
|
1757
|
+
else {
|
|
1758
|
+
cookieMgr = createCookieMgr(config);
|
|
1726
1759
|
}
|
|
1727
1760
|
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
_nextProxy = nextProxy ? nextProxy.getNext() : null;
|
|
1731
|
-
if (!nextProxy) {
|
|
1732
|
-
var onComplete = _onComplete;
|
|
1733
|
-
if (onComplete && onComplete.length > 0) {
|
|
1734
|
-
arrForEach(onComplete, function (completeDetails) {
|
|
1735
|
-
try {
|
|
1736
|
-
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
1737
|
-
}
|
|
1738
|
-
catch (e) {
|
|
1739
|
-
_throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
1740
|
-
}
|
|
1741
|
-
});
|
|
1742
|
-
_onComplete = [];
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
return nextProxy;
|
|
1761
|
+
if (!cookieMgr) {
|
|
1762
|
+
cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER ]);
|
|
1746
1763
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1764
|
+
return cookieMgr;
|
|
1765
|
+
}
|
|
1766
|
+
function createCookieMgr(rootConfig, logger) {
|
|
1767
|
+
var _a;
|
|
1768
|
+
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
|
1769
|
+
var _path = cookieMgrConfig.path || "/";
|
|
1770
|
+
var _domain = cookieMgrConfig.domain;
|
|
1771
|
+
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
|
1772
|
+
var cookieMgr = (_a = {
|
|
1773
|
+
isEnabled: function () {
|
|
1774
|
+
var enabled = _enabled && areCookiesSupported(logger);
|
|
1775
|
+
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
1776
|
+
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
1777
|
+
enabled = _isMgrEnabled(gblManager);
|
|
1778
|
+
}
|
|
1779
|
+
return enabled;
|
|
1755
1780
|
}
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1781
|
+
},
|
|
1782
|
+
_a[_DYN_SET_ENABLED ] = function (value) {
|
|
1783
|
+
_enabled = value !== false;
|
|
1784
|
+
},
|
|
1785
|
+
_a.set = function (name, value, maxAgeSec, domain, path) {
|
|
1786
|
+
var result = false;
|
|
1787
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1788
|
+
var values = {};
|
|
1789
|
+
var theValue = strTrim(value || STR_EMPTY$1);
|
|
1790
|
+
var idx = theValue[_DYN_INDEX_OF ](";");
|
|
1791
|
+
if (idx !== -1) {
|
|
1792
|
+
theValue = strTrim(value[_DYN_SUBSTRING ](0, idx));
|
|
1793
|
+
values = _extractParts(value[_DYN_SUBSTRING ](idx + 1));
|
|
1794
|
+
}
|
|
1795
|
+
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
|
1796
|
+
if (!isNullOrUndefined(maxAgeSec)) {
|
|
1797
|
+
var _isIE = isIE();
|
|
1798
|
+
if (isUndefined(values[strExpires])) {
|
|
1799
|
+
var nowMs = dateNow();
|
|
1800
|
+
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
1801
|
+
if (expireMs > 0) {
|
|
1802
|
+
var expiry = new Date();
|
|
1803
|
+
expiry.setTime(expireMs);
|
|
1804
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY$1, isTruthy);
|
|
1770
1805
|
}
|
|
1771
|
-
}
|
|
1806
|
+
}
|
|
1807
|
+
if (!_isIE) {
|
|
1808
|
+
setValue(values, "max-age", STR_EMPTY$1 + maxAgeSec, null, isUndefined);
|
|
1809
|
+
}
|
|
1772
1810
|
}
|
|
1773
|
-
|
|
1811
|
+
var location_1 = getLocation();
|
|
1812
|
+
if (location_1 && location_1.protocol === "https:") {
|
|
1813
|
+
setValue(values, "secure", null, null, isUndefined);
|
|
1814
|
+
if (_allowUaSameSite === null) {
|
|
1815
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
|
|
1816
|
+
}
|
|
1817
|
+
if (_allowUaSameSite) {
|
|
1818
|
+
setValue(values, "SameSite", "None", null, isUndefined);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
setValue(values, "path", path || _path, null, isUndefined);
|
|
1822
|
+
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
1823
|
+
setCookieFn(name, _formatCookieValue(theValue, values));
|
|
1824
|
+
result = true;
|
|
1774
1825
|
}
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
var extConfig = _getExtCfg(identifier, null);
|
|
1782
|
-
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
1783
|
-
theValue = extConfig[field];
|
|
1784
|
-
}
|
|
1785
|
-
else if (config && !isNullOrUndefined(config[field])) {
|
|
1786
|
-
theValue = config[field];
|
|
1787
|
-
}
|
|
1788
|
-
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1789
|
-
}
|
|
1790
|
-
function _iterateChain(cb) {
|
|
1791
|
-
var nextPlugin;
|
|
1792
|
-
while (!!(nextPlugin = context._next())) {
|
|
1793
|
-
var plugin = nextPlugin.getPlugin();
|
|
1794
|
-
if (plugin) {
|
|
1795
|
-
cb(plugin);
|
|
1826
|
+
return result;
|
|
1827
|
+
},
|
|
1828
|
+
_a.get = function (name) {
|
|
1829
|
+
var value = STR_EMPTY$1;
|
|
1830
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1831
|
+
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1796
1832
|
}
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1833
|
+
return value;
|
|
1834
|
+
},
|
|
1835
|
+
_a.del = function (name, path) {
|
|
1836
|
+
var result = false;
|
|
1837
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1838
|
+
result = cookieMgr.purge(name, path);
|
|
1839
|
+
}
|
|
1840
|
+
return result;
|
|
1841
|
+
},
|
|
1842
|
+
_a.purge = function (name, path) {
|
|
1843
|
+
var _a;
|
|
1844
|
+
var result = false;
|
|
1845
|
+
if (areCookiesSupported(logger)) {
|
|
1846
|
+
var values = (_a = {},
|
|
1847
|
+
_a["path"] = path ? path : "/",
|
|
1848
|
+
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
1849
|
+
_a);
|
|
1850
|
+
if (!isIE()) {
|
|
1851
|
+
values["max-age"] = "0";
|
|
1852
|
+
}
|
|
1853
|
+
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1854
|
+
delCookie(name, _formatCookieValue(STR_EMPTY$1, values));
|
|
1855
|
+
result = true;
|
|
1856
|
+
}
|
|
1857
|
+
return result;
|
|
1858
|
+
},
|
|
1859
|
+
_a);
|
|
1860
|
+
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
1861
|
+
return cookieMgr;
|
|
1862
|
+
}
|
|
1863
|
+
function areCookiesSupported(logger) {
|
|
1864
|
+
if (_supportsCookies === null) {
|
|
1865
|
+
_supportsCookies = false;
|
|
1866
|
+
try {
|
|
1867
|
+
var doc = _doc || {};
|
|
1868
|
+
_supportsCookies = doc[strCookie] !== undefined;
|
|
1869
|
+
}
|
|
1870
|
+
catch (e) {
|
|
1871
|
+
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
return _supportsCookies;
|
|
1875
|
+
}
|
|
1876
|
+
function _extractParts(theValue) {
|
|
1877
|
+
var values = {};
|
|
1878
|
+
if (theValue && theValue[_DYN_LENGTH ]) {
|
|
1879
|
+
var parts = strTrim(theValue)[_DYN_SPLIT ](";");
|
|
1880
|
+
arrForEach(parts, function (thePart) {
|
|
1881
|
+
thePart = strTrim(thePart || STR_EMPTY$1);
|
|
1882
|
+
if (thePart) {
|
|
1883
|
+
var idx = thePart[_DYN_INDEX_OF ]("=");
|
|
1884
|
+
if (idx === -1) {
|
|
1885
|
+
values[thePart] = null;
|
|
1886
|
+
}
|
|
1887
|
+
else {
|
|
1888
|
+
values[strTrim(thePart[_DYN_SUBSTRING ](0, idx))] = strTrim(thePart[_DYN_SUBSTRING ](idx + 1));
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
return values;
|
|
1894
|
+
}
|
|
1895
|
+
function _formatDate(theDate, func) {
|
|
1896
|
+
if (isFunction(theDate[func])) {
|
|
1897
|
+
return theDate[func]();
|
|
1898
|
+
}
|
|
1899
|
+
return null;
|
|
1900
|
+
}
|
|
1901
|
+
function _formatCookieValue(value, values) {
|
|
1902
|
+
var cookieValue = value || STR_EMPTY$1;
|
|
1903
|
+
objForEachKey(values, function (name, theValue) {
|
|
1904
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY$1);
|
|
1905
|
+
});
|
|
1906
|
+
return cookieValue;
|
|
1907
|
+
}
|
|
1908
|
+
function _getCookieValue(name) {
|
|
1909
|
+
var cookieValue = STR_EMPTY$1;
|
|
1910
|
+
if (_doc) {
|
|
1911
|
+
var theCookie = _doc[strCookie] || STR_EMPTY$1;
|
|
1912
|
+
if (_parsedCookieValue !== theCookie) {
|
|
1913
|
+
_cookieCache = _extractParts(theCookie);
|
|
1914
|
+
_parsedCookieValue = theCookie;
|
|
1915
|
+
}
|
|
1916
|
+
cookieValue = strTrim(_cookieCache[name] || STR_EMPTY$1);
|
|
1917
|
+
}
|
|
1918
|
+
return cookieValue;
|
|
1919
|
+
}
|
|
1920
|
+
function _setCookieValue(name, cookieValue) {
|
|
1921
|
+
if (_doc) {
|
|
1922
|
+
_doc[strCookie] = name + "=" + cookieValue;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
function uaDisallowsSameSiteNone(userAgent) {
|
|
1926
|
+
if (!isString(userAgent)) {
|
|
1927
|
+
return false;
|
|
1928
|
+
}
|
|
1929
|
+
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
|
1930
|
+
return true;
|
|
1931
|
+
}
|
|
1932
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
1933
|
+
return true;
|
|
1934
|
+
}
|
|
1935
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
1936
|
+
return true;
|
|
1937
|
+
}
|
|
1938
|
+
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
1939
|
+
return true;
|
|
1940
|
+
}
|
|
1941
|
+
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
|
1942
|
+
return true;
|
|
1943
|
+
}
|
|
1944
|
+
if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) {
|
|
1945
|
+
return true;
|
|
1946
|
+
}
|
|
1947
|
+
return false;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
var strOnPrefix = "on";
|
|
1951
|
+
var strAttachEvent = "attachEvent";
|
|
1952
|
+
var strAddEventHelper = "addEventListener";
|
|
1953
|
+
var strDetachEvent = "detachEvent";
|
|
1954
|
+
var strRemoveEventListener = "removeEventListener";
|
|
1955
|
+
var strEvents = "events";
|
|
1956
|
+
var strVisibilityChangeEvt = "visibilitychange";
|
|
1957
|
+
var strPageHide = "pagehide";
|
|
1958
|
+
var strPageShow = "pageshow";
|
|
1959
|
+
var strUnload = "unload";
|
|
1960
|
+
var strBeforeUnload = "beforeunload";
|
|
1961
|
+
var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide");
|
|
1962
|
+
var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow");
|
|
1963
|
+
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
1964
|
+
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
1965
|
+
var _guid = 1;
|
|
1966
|
+
var elmNodeData = createElmNodeData("events");
|
|
1967
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
1968
|
+
function _normalizeNamespace(name) {
|
|
1969
|
+
if (name && name[_DYN_REPLACE ]) {
|
|
1970
|
+
return name.replace(/^\s*\.*|\.*\s*$/g, STR_EMPTY$1);
|
|
1971
|
+
}
|
|
1972
|
+
return name;
|
|
1973
|
+
}
|
|
1974
|
+
function _getEvtNamespace(eventName, evtNamespace) {
|
|
1975
|
+
var _a;
|
|
1976
|
+
if (evtNamespace) {
|
|
1977
|
+
var theNamespace_1 = STR_EMPTY$1;
|
|
1978
|
+
if (isArray(evtNamespace)) {
|
|
1979
|
+
theNamespace_1 = STR_EMPTY$1;
|
|
1980
|
+
arrForEach(evtNamespace, function (name) {
|
|
1981
|
+
name = _normalizeNamespace(name);
|
|
1982
|
+
if (name) {
|
|
1983
|
+
if (name[0] !== ".") {
|
|
1984
|
+
name = "." + name;
|
|
1985
|
+
}
|
|
1986
|
+
theNamespace_1 += name;
|
|
1987
|
+
}
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
else {
|
|
1991
|
+
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
1992
|
+
}
|
|
1993
|
+
if (theNamespace_1) {
|
|
1994
|
+
if (theNamespace_1[0] !== ".") {
|
|
1995
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
1996
|
+
}
|
|
1997
|
+
eventName = (eventName || STR_EMPTY$1) + theNamespace_1;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY$1) || []);
|
|
2001
|
+
return _a = {},
|
|
2002
|
+
_a[_DYN_TYPE ] = parsedEvent[1],
|
|
2003
|
+
_a.ns = ((parsedEvent[2] || STR_EMPTY$1).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY$1)[_DYN_SPLIT ](".").sort()).join("."),
|
|
2004
|
+
_a;
|
|
2005
|
+
}
|
|
2006
|
+
function __getRegisteredEvents(target, eventName, evtNamespace) {
|
|
2007
|
+
var theEvents = [];
|
|
2008
|
+
var eventCache = elmNodeData.get(target, strEvents, {}, false);
|
|
2009
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
2010
|
+
objForEachKey(eventCache, function (evtType, registeredEvents) {
|
|
2011
|
+
arrForEach(registeredEvents, function (value) {
|
|
2012
|
+
var _a;
|
|
2013
|
+
if (!evtName[_DYN_TYPE ] || evtName[_DYN_TYPE ] === value.evtName[_DYN_TYPE ]) {
|
|
2014
|
+
if (!evtName.ns || evtName.ns === evtName.ns) {
|
|
2015
|
+
theEvents[_DYN_PUSH ]((_a = {},
|
|
2016
|
+
_a[_DYN_NAME ] = value.evtName[_DYN_TYPE ] + (value.evtName.ns ? "." + value.evtName.ns : STR_EMPTY$1),
|
|
2017
|
+
_a.handler = value[_DYN_HANDLER ],
|
|
2018
|
+
_a));
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
});
|
|
2022
|
+
});
|
|
2023
|
+
return theEvents;
|
|
2024
|
+
}
|
|
2025
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
2026
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
2027
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
2028
|
+
var registeredEvents = aiEvts[evtName];
|
|
2029
|
+
if (!registeredEvents) {
|
|
2030
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
2031
|
+
}
|
|
2032
|
+
return registeredEvents;
|
|
2033
|
+
}
|
|
2034
|
+
function _doDetach(obj, evtName, handlerRef, useCapture) {
|
|
2035
|
+
if (obj && evtName && evtName[_DYN_TYPE ]) {
|
|
2036
|
+
if (obj[strRemoveEventListener]) {
|
|
2037
|
+
obj[strRemoveEventListener](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2038
|
+
}
|
|
2039
|
+
else if (obj[strDetachEvent]) {
|
|
2040
|
+
obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
2045
|
+
var result = false;
|
|
2046
|
+
if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) {
|
|
2047
|
+
if (obj[strAddEventHelper]) {
|
|
2048
|
+
obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2049
|
+
result = true;
|
|
2050
|
+
}
|
|
2051
|
+
else if (obj[strAttachEvent]) {
|
|
2052
|
+
obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2053
|
+
result = true;
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
return result;
|
|
2057
|
+
}
|
|
2058
|
+
function _doUnregister(target, events, evtName, unRegFn) {
|
|
2059
|
+
var idx = events[_DYN_LENGTH ];
|
|
2060
|
+
while (idx--) {
|
|
2061
|
+
var theEvent = events[idx];
|
|
2062
|
+
if (theEvent) {
|
|
2063
|
+
if (!evtName.ns || evtName.ns === theEvent.evtName.ns) {
|
|
2064
|
+
if (!unRegFn || unRegFn(theEvent)) {
|
|
2065
|
+
_doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture);
|
|
2066
|
+
events[_DYN_SPLICE ](idx, 1);
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
function _unregisterEvents(target, evtName, unRegFn) {
|
|
2073
|
+
if (evtName[_DYN_TYPE ]) {
|
|
2074
|
+
_doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn);
|
|
2075
|
+
}
|
|
2076
|
+
else {
|
|
2077
|
+
var eventCache = elmNodeData.get(target, strEvents, {});
|
|
2078
|
+
objForEachKey(eventCache, function (evtType, events) {
|
|
2079
|
+
_doUnregister(target, events, evtName, unRegFn);
|
|
2080
|
+
});
|
|
2081
|
+
if (objKeys(eventCache)[_DYN_LENGTH ] === 0) {
|
|
2082
|
+
elmNodeData.kill(target, strEvents);
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
function mergeEvtNamespace(theNamespace, namespaces) {
|
|
2087
|
+
var newNamespaces;
|
|
2088
|
+
if (namespaces) {
|
|
2089
|
+
if (isArray(namespaces)) {
|
|
2090
|
+
newNamespaces = [theNamespace].concat(namespaces);
|
|
2091
|
+
}
|
|
2092
|
+
else {
|
|
2093
|
+
newNamespaces = [theNamespace, namespaces];
|
|
2094
|
+
}
|
|
2095
|
+
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT ](".");
|
|
2096
|
+
}
|
|
2097
|
+
else {
|
|
2098
|
+
newNamespaces = theNamespace;
|
|
2099
|
+
}
|
|
2100
|
+
return newNamespaces;
|
|
2101
|
+
}
|
|
2102
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2103
|
+
var _a;
|
|
2104
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2105
|
+
var result = false;
|
|
2106
|
+
if (target) {
|
|
2107
|
+
try {
|
|
2108
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
2109
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
2110
|
+
if (result && elmNodeData.accept(target)) {
|
|
2111
|
+
var registeredEvent = (_a = {
|
|
2112
|
+
guid: _guid++,
|
|
2113
|
+
evtName: evtName
|
|
2114
|
+
},
|
|
2115
|
+
_a[_DYN_HANDLER ] = handlerRef,
|
|
2116
|
+
_a.capture = useCapture,
|
|
2117
|
+
_a);
|
|
2118
|
+
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH ](registeredEvent);
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
catch (e) {
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
return result;
|
|
2125
|
+
}
|
|
2126
|
+
function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2127
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2128
|
+
if (target) {
|
|
2129
|
+
try {
|
|
2130
|
+
var evtName_1 = _getEvtNamespace(eventName, evtNamespace);
|
|
2131
|
+
var found_1 = false;
|
|
2132
|
+
_unregisterEvents(target, evtName_1, function (regEvent) {
|
|
2133
|
+
if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) {
|
|
2134
|
+
found_1 = true;
|
|
2135
|
+
return true;
|
|
2136
|
+
}
|
|
2137
|
+
return false;
|
|
2138
|
+
});
|
|
2139
|
+
if (!found_1) {
|
|
2140
|
+
_doDetach(target, evtName_1, handlerRef, useCapture);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
catch (e) {
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
2148
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2149
|
+
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
2150
|
+
}
|
|
2151
|
+
function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
2152
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2153
|
+
eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
2154
|
+
}
|
|
2155
|
+
function addEventHandler(eventName, callback, evtNamespace) {
|
|
2156
|
+
var result = false;
|
|
2157
|
+
var w = getWindow();
|
|
2158
|
+
if (w) {
|
|
2159
|
+
result = eventOn(w, eventName, callback, evtNamespace);
|
|
2160
|
+
result = eventOn(w["body"], eventName, callback, evtNamespace) || result;
|
|
2161
|
+
}
|
|
2162
|
+
var doc = getDocument();
|
|
2163
|
+
if (doc) {
|
|
2164
|
+
result = eventOn(doc, eventName, callback, evtNamespace) || result;
|
|
2165
|
+
}
|
|
2166
|
+
return result;
|
|
2167
|
+
}
|
|
2168
|
+
function removeEventHandler(eventName, callback, evtNamespace) {
|
|
2169
|
+
var w = getWindow();
|
|
2170
|
+
if (w) {
|
|
2171
|
+
eventOff(w, eventName, callback, evtNamespace);
|
|
2172
|
+
eventOff(w["body"], eventName, callback, evtNamespace);
|
|
2173
|
+
}
|
|
2174
|
+
var doc = getDocument();
|
|
2175
|
+
if (doc) {
|
|
2176
|
+
eventOff(doc, eventName, callback, evtNamespace);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
function _addEventListeners(events, listener, excludeEvents, evtNamespace) {
|
|
2180
|
+
var added = false;
|
|
2181
|
+
if (listener && events && events[_DYN_LENGTH ] > 0) {
|
|
2182
|
+
arrForEach(events, function (name) {
|
|
2183
|
+
if (name) {
|
|
2184
|
+
if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {
|
|
2185
|
+
added = addEventHandler(name, listener, evtNamespace) || added;
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
return added;
|
|
2191
|
+
}
|
|
2192
|
+
function addEventListeners(events, listener, excludeEvents, evtNamespace) {
|
|
2193
|
+
var added = false;
|
|
2194
|
+
if (listener && events && isArray(events)) {
|
|
2195
|
+
added = _addEventListeners(events, listener, excludeEvents, evtNamespace);
|
|
2196
|
+
if (!added && excludeEvents && excludeEvents[_DYN_LENGTH ] > 0) {
|
|
2197
|
+
added = _addEventListeners(events, listener, null, evtNamespace);
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
return added;
|
|
2201
|
+
}
|
|
2202
|
+
function removeEventListeners(events, listener, evtNamespace) {
|
|
2203
|
+
if (events && isArray(events)) {
|
|
2204
|
+
arrForEach(events, function (name) {
|
|
2205
|
+
if (name) {
|
|
2206
|
+
removeEventHandler(name, listener, evtNamespace);
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) {
|
|
2212
|
+
return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace);
|
|
2213
|
+
}
|
|
2214
|
+
function removePageUnloadEventListener(listener, evtNamespace) {
|
|
2215
|
+
removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace);
|
|
2216
|
+
}
|
|
2217
|
+
function addPageHideEventListener(listener, excludeEvents, evtNamespace) {
|
|
2218
|
+
function _handlePageVisibility(evt) {
|
|
2219
|
+
var doc = getDocument();
|
|
2220
|
+
if (listener && doc && doc.visibilityState === "hidden") {
|
|
2221
|
+
listener(evt);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);
|
|
2225
|
+
var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces);
|
|
2226
|
+
if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {
|
|
2227
|
+
pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded;
|
|
2228
|
+
}
|
|
2229
|
+
if (!pageUnloadAdded && excludeEvents) {
|
|
2230
|
+
pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace);
|
|
2231
|
+
}
|
|
2232
|
+
return pageUnloadAdded;
|
|
2233
|
+
}
|
|
2234
|
+
function removePageHideEventListener(listener, evtNamespace) {
|
|
2235
|
+
var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);
|
|
2236
|
+
removeEventListeners([strPageHide], listener, newNamespaces);
|
|
2237
|
+
removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);
|
|
2238
|
+
}
|
|
2239
|
+
function addPageShowEventListener(listener, excludeEvents, evtNamespace) {
|
|
2240
|
+
function _handlePageVisibility(evt) {
|
|
2241
|
+
var doc = getDocument();
|
|
2242
|
+
if (listener && doc && doc.visibilityState === "visible") {
|
|
2243
|
+
listener(evt);
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);
|
|
2247
|
+
var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces);
|
|
2248
|
+
pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded;
|
|
2249
|
+
if (!pageShowAdded && excludeEvents) {
|
|
2250
|
+
pageShowAdded = addPageShowEventListener(listener, null, evtNamespace);
|
|
2251
|
+
}
|
|
2252
|
+
return pageShowAdded;
|
|
2253
|
+
}
|
|
2254
|
+
function removePageShowEventListener(listener, evtNamespace) {
|
|
2255
|
+
var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);
|
|
2256
|
+
removeEventListeners([strPageShow], listener, newNamespaces);
|
|
2257
|
+
removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
function newGuid() {
|
|
2261
|
+
var uuid = generateW3CId();
|
|
2262
|
+
return uuid[_DYN_SUBSTRING ](0, 8) + "-" + uuid[_DYN_SUBSTRING ](8, 12) + "-" + uuid[_DYN_SUBSTRING ](12, 16) + "-" + uuid[_DYN_SUBSTRING ](16, 20) + "-" + uuid[_DYN_SUBSTRING ](20);
|
|
2263
|
+
}
|
|
2264
|
+
function perfNow() {
|
|
2265
|
+
var perf = getPerformance();
|
|
2266
|
+
if (perf && perf.now) {
|
|
2267
|
+
return perf.now();
|
|
2268
|
+
}
|
|
2269
|
+
return dateNow();
|
|
2270
|
+
}
|
|
2271
|
+
function generateW3CId() {
|
|
2272
|
+
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
2273
|
+
var oct = STR_EMPTY$1, tmp;
|
|
2274
|
+
for (var a = 0; a < 4; a++) {
|
|
2275
|
+
tmp = random32();
|
|
2276
|
+
oct +=
|
|
2277
|
+
hexValues[tmp & 0xF] +
|
|
2278
|
+
hexValues[tmp >> 4 & 0xF] +
|
|
2279
|
+
hexValues[tmp >> 8 & 0xF] +
|
|
2280
|
+
hexValues[tmp >> 12 & 0xF] +
|
|
2281
|
+
hexValues[tmp >> 16 & 0xF] +
|
|
2282
|
+
hexValues[tmp >> 20 & 0xF] +
|
|
2283
|
+
hexValues[tmp >> 24 & 0xF] +
|
|
2284
|
+
hexValues[tmp >> 28 & 0xF];
|
|
2285
|
+
}
|
|
2286
|
+
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
|
2287
|
+
return oct[_DYN_SUBSTR ](0, 8) + oct[_DYN_SUBSTR ](9, 4) + "4" + oct[_DYN_SUBSTR ](13, 3) + clockSequenceHi + oct[_DYN_SUBSTR ](16, 3) + oct[_DYN_SUBSTR ](19, 12);
|
|
2288
|
+
}
|
|
2289
|
+
var EventHelper = {
|
|
2290
|
+
Attach: attachEvent,
|
|
2291
|
+
AttachEvent: attachEvent,
|
|
2292
|
+
Detach: detachEvent,
|
|
2293
|
+
DetachEvent: detachEvent
|
|
2294
|
+
};
|
|
2295
|
+
|
|
2296
|
+
var TRACE_PARENT_REGEX = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(-[^\s]*)?$/;
|
|
2297
|
+
var DEFAULT_VERSION = "00";
|
|
2298
|
+
var INVALID_VERSION = "ff";
|
|
2299
|
+
var INVALID_TRACE_ID = "00000000000000000000000000000000";
|
|
2300
|
+
var INVALID_SPAN_ID = "0000000000000000";
|
|
2301
|
+
var SAMPLED_FLAG = 0x01;
|
|
2302
|
+
function _isValid(value, len, invalidValue) {
|
|
2303
|
+
if (value && value[_DYN_LENGTH ] === len && value !== invalidValue) {
|
|
2304
|
+
return !!value.match(/^[\da-f]*$/);
|
|
2305
|
+
}
|
|
2306
|
+
return false;
|
|
2307
|
+
}
|
|
2308
|
+
function _formatValue(value, len, defValue) {
|
|
2309
|
+
if (_isValid(value, len)) {
|
|
2310
|
+
return value;
|
|
2311
|
+
}
|
|
2312
|
+
return defValue;
|
|
2313
|
+
}
|
|
2314
|
+
function _formatFlags(value) {
|
|
2315
|
+
if (isNaN(value) || value < 0 || value > 255) {
|
|
2316
|
+
value = 0x01;
|
|
2317
|
+
}
|
|
2318
|
+
var result = value.toString(16);
|
|
2319
|
+
while (result[_DYN_LENGTH ] < 2) {
|
|
2320
|
+
result = "0" + result;
|
|
2321
|
+
}
|
|
2322
|
+
return result;
|
|
2323
|
+
}
|
|
2324
|
+
function createTraceParent(traceId, spanId, flags, version) {
|
|
2325
|
+
var _a;
|
|
2326
|
+
return _a = {},
|
|
2327
|
+
_a[_DYN_VERSION ] = _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION,
|
|
2328
|
+
_a[_DYN_TRACE_ID ] = isValidTraceId(traceId) ? traceId : generateW3CId(),
|
|
2329
|
+
_a.spanId = isValidSpanId(spanId) ? spanId : generateW3CId()[_DYN_SUBSTR ](0, 16),
|
|
2330
|
+
_a.traceFlags = flags >= 0 && flags <= 0xFF ? flags : 1,
|
|
2331
|
+
_a;
|
|
2332
|
+
}
|
|
2333
|
+
function parseTraceParent(value) {
|
|
2334
|
+
var _a;
|
|
2335
|
+
if (!value) {
|
|
2336
|
+
return null;
|
|
2337
|
+
}
|
|
2338
|
+
if (isArray(value)) {
|
|
2339
|
+
value = value[0] || "";
|
|
2340
|
+
}
|
|
2341
|
+
if (!value || !isString(value) || value[_DYN_LENGTH ] > 8192) {
|
|
2342
|
+
return null;
|
|
2343
|
+
}
|
|
2344
|
+
var match = TRACE_PARENT_REGEX.exec(strTrim(value));
|
|
2345
|
+
if (!match ||
|
|
2346
|
+
match[1] === INVALID_VERSION ||
|
|
2347
|
+
match[2] === INVALID_TRACE_ID ||
|
|
2348
|
+
match[3] === INVALID_SPAN_ID) {
|
|
2349
|
+
return null;
|
|
2350
|
+
}
|
|
2351
|
+
return _a = {},
|
|
2352
|
+
_a[_DYN_VERSION ] = match[1],
|
|
2353
|
+
_a[_DYN_TRACE_ID ] = match[2],
|
|
2354
|
+
_a[_DYN_SPAN_ID ] = match[3],
|
|
2355
|
+
_a[_DYN_TRACE_FLAGS ] = parseInt(match[4], 16),
|
|
2356
|
+
_a;
|
|
2357
|
+
}
|
|
2358
|
+
function isValidTraceId(value) {
|
|
2359
|
+
return _isValid(value, 32, INVALID_TRACE_ID);
|
|
2360
|
+
}
|
|
2361
|
+
function isValidSpanId(value) {
|
|
2362
|
+
return _isValid(value, 16, INVALID_SPAN_ID);
|
|
2363
|
+
}
|
|
2364
|
+
function isValidTraceParent(value) {
|
|
2365
|
+
if (!value ||
|
|
2366
|
+
!_isValid(value[_DYN_VERSION ], 2, INVALID_VERSION) ||
|
|
2367
|
+
!_isValid(value[_DYN_TRACE_ID ], 32, INVALID_TRACE_ID) ||
|
|
2368
|
+
!_isValid(value[_DYN_SPAN_ID ], 16, INVALID_SPAN_ID) ||
|
|
2369
|
+
!_isValid(_formatFlags(value[_DYN_TRACE_FLAGS ]), 2)) {
|
|
2370
|
+
return false;
|
|
2371
|
+
}
|
|
2372
|
+
return true;
|
|
2373
|
+
}
|
|
2374
|
+
function isSampledFlag(value) {
|
|
2375
|
+
if (isValidTraceParent(value)) {
|
|
2376
|
+
return (value[_DYN_TRACE_FLAGS ] & SAMPLED_FLAG) === SAMPLED_FLAG;
|
|
2377
|
+
}
|
|
2378
|
+
return false;
|
|
2379
|
+
}
|
|
2380
|
+
function formatTraceParent(value) {
|
|
2381
|
+
if (value) {
|
|
2382
|
+
var flags = _formatFlags(value[_DYN_TRACE_FLAGS ]);
|
|
2383
|
+
if (!_isValid(flags, 2)) {
|
|
2384
|
+
flags = "01";
|
|
2385
|
+
}
|
|
2386
|
+
var version = value[_DYN_VERSION ] || DEFAULT_VERSION;
|
|
2387
|
+
if (version !== "00" && version !== "ff") {
|
|
2388
|
+
version = DEFAULT_VERSION;
|
|
2389
|
+
}
|
|
2390
|
+
return "".concat(version, "-").concat(_formatValue(value.traceId, 32, INVALID_TRACE_ID), "-").concat(_formatValue(value.spanId, 16, INVALID_SPAN_ID), "-").concat(flags);
|
|
2391
|
+
}
|
|
2392
|
+
return "";
|
|
2393
|
+
}
|
|
2394
|
+
function findW3cTraceParent() {
|
|
2395
|
+
var name = "traceparent";
|
|
2396
|
+
var traceParent = parseTraceParent(findMetaTag(name));
|
|
2397
|
+
if (!traceParent) {
|
|
2398
|
+
traceParent = parseTraceParent(findNamedServerTiming(name));
|
|
2399
|
+
}
|
|
2400
|
+
return traceParent;
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
var pluginStateData = createElmNodeData("plugin");
|
|
2404
|
+
function _getPluginState(plugin) {
|
|
2405
|
+
return pluginStateData.get(plugin, "state", {}, true);
|
|
2406
|
+
}
|
|
2407
|
+
function initializePlugins(processContext, extensions) {
|
|
2408
|
+
var initPlugins = [];
|
|
2409
|
+
var lastPlugin = null;
|
|
2410
|
+
var proxy = processContext[_DYN_GET_NEXT ]();
|
|
2411
|
+
var pluginState;
|
|
2412
|
+
while (proxy) {
|
|
2413
|
+
var thePlugin = proxy[_DYN_GET_PLUGIN ]();
|
|
2414
|
+
if (thePlugin) {
|
|
2415
|
+
if (lastPlugin &&
|
|
2416
|
+
isFunction(lastPlugin[_DYN_SET_NEXT_PLUGIN ]) &&
|
|
2417
|
+
isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) {
|
|
2418
|
+
lastPlugin[_DYN_SET_NEXT_PLUGIN ](thePlugin);
|
|
2419
|
+
}
|
|
2420
|
+
var isInitialized = false;
|
|
2421
|
+
if (isFunction(thePlugin[_DYN_IS_INITIALIZED ])) {
|
|
2422
|
+
isInitialized = thePlugin[_DYN_IS_INITIALIZED ]();
|
|
2423
|
+
}
|
|
2424
|
+
else {
|
|
2425
|
+
pluginState = _getPluginState(thePlugin);
|
|
2426
|
+
isInitialized = pluginState[_DYN_IS_INITIALIZED ];
|
|
2427
|
+
}
|
|
2428
|
+
if (!isInitialized) {
|
|
2429
|
+
initPlugins[_DYN_PUSH ](thePlugin);
|
|
2430
|
+
}
|
|
2431
|
+
lastPlugin = thePlugin;
|
|
2432
|
+
proxy = proxy[_DYN_GET_NEXT ]();
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
arrForEach(initPlugins, function (thePlugin) {
|
|
2436
|
+
var core = processContext[STR_CORE]();
|
|
2437
|
+
thePlugin[_DYN_INITIALIZE ](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT ]());
|
|
2438
|
+
pluginState = _getPluginState(thePlugin);
|
|
2439
|
+
if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) {
|
|
2440
|
+
pluginState[STR_CORE] = core;
|
|
2441
|
+
}
|
|
2442
|
+
pluginState[_DYN_IS_INITIALIZED ] = true;
|
|
2443
|
+
delete pluginState[_DYN_TEARDOWN ];
|
|
2444
|
+
});
|
|
2445
|
+
}
|
|
2446
|
+
function sortPlugins(plugins) {
|
|
2447
|
+
return plugins.sort(function (extA, extB) {
|
|
2448
|
+
var result = 0;
|
|
2449
|
+
if (extB) {
|
|
2450
|
+
var bHasProcess = isFunction(extB[STR_PROCESS_TELEMETRY]);
|
|
2451
|
+
if (isFunction(extA[STR_PROCESS_TELEMETRY])) {
|
|
2452
|
+
result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1;
|
|
2453
|
+
}
|
|
2454
|
+
else if (bHasProcess) {
|
|
2455
|
+
result = -1;
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
else {
|
|
2459
|
+
result = extA ? 1 : -1;
|
|
2460
|
+
}
|
|
2461
|
+
return result;
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
function createDistributedTraceContext(parentCtx) {
|
|
2465
|
+
var trace = {};
|
|
2466
|
+
return {
|
|
2467
|
+
getName: function () {
|
|
2468
|
+
return trace[_DYN_NAME ];
|
|
2469
|
+
},
|
|
2470
|
+
setName: function (newValue) {
|
|
2471
|
+
parentCtx && parentCtx.setName(newValue);
|
|
2472
|
+
trace[_DYN_NAME ] = newValue;
|
|
2473
|
+
},
|
|
2474
|
+
getTraceId: function () {
|
|
2475
|
+
return trace[_DYN_TRACE_ID ];
|
|
2476
|
+
},
|
|
2477
|
+
setTraceId: function (newValue) {
|
|
2478
|
+
parentCtx && parentCtx.setTraceId(newValue);
|
|
2479
|
+
if (isValidTraceId(newValue)) {
|
|
2480
|
+
trace[_DYN_TRACE_ID ] = newValue;
|
|
2481
|
+
}
|
|
2482
|
+
},
|
|
2483
|
+
getSpanId: function () {
|
|
2484
|
+
return trace[_DYN_SPAN_ID ];
|
|
2485
|
+
},
|
|
2486
|
+
setSpanId: function (newValue) {
|
|
2487
|
+
parentCtx && parentCtx.setSpanId(newValue);
|
|
2488
|
+
if (isValidSpanId(newValue)) {
|
|
2489
|
+
trace[_DYN_SPAN_ID ] = newValue;
|
|
2490
|
+
}
|
|
2491
|
+
},
|
|
2492
|
+
getTraceFlags: function () {
|
|
2493
|
+
return trace[_DYN_TRACE_FLAGS ];
|
|
2494
|
+
},
|
|
2495
|
+
setTraceFlags: function (newTraceFlags) {
|
|
2496
|
+
parentCtx && parentCtx.setTraceFlags(newTraceFlags);
|
|
2497
|
+
trace[_DYN_TRACE_FLAGS ] = newTraceFlags;
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
2503
|
+
var strHasRunFlags = "_hasRun";
|
|
2504
|
+
var strGetTelCtx = "_getTelCtx";
|
|
2505
|
+
var _chainId = 0;
|
|
2506
|
+
function _getNextProxyStart(proxy, core, startAt) {
|
|
2507
|
+
while (proxy) {
|
|
2508
|
+
if (proxy[_DYN_GET_PLUGIN ]() === startAt) {
|
|
2509
|
+
return proxy;
|
|
2510
|
+
}
|
|
2511
|
+
proxy = proxy[_DYN_GET_NEXT ]();
|
|
2512
|
+
}
|
|
2513
|
+
return createTelemetryProxyChain([startAt], core[_DYN_CONFIG ] || {}, core);
|
|
2514
|
+
}
|
|
2515
|
+
function _createInternalContext(telemetryChain, config, core, startAt) {
|
|
2516
|
+
var _nextProxy = null;
|
|
2517
|
+
var _onComplete = [];
|
|
2518
|
+
if (startAt !== null) {
|
|
2519
|
+
_nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain;
|
|
2520
|
+
}
|
|
2521
|
+
var context = {
|
|
2522
|
+
_next: _moveNext,
|
|
2523
|
+
ctx: {
|
|
2524
|
+
core: function () {
|
|
2525
|
+
return core;
|
|
2526
|
+
},
|
|
2527
|
+
diagLog: function () {
|
|
2528
|
+
return safeGetLogger(core, config);
|
|
2529
|
+
},
|
|
2530
|
+
getCfg: function () {
|
|
2531
|
+
return config;
|
|
2532
|
+
},
|
|
2533
|
+
getExtCfg: _getExtCfg,
|
|
2534
|
+
getConfig: _getConfig,
|
|
2535
|
+
hasNext: function () {
|
|
2536
|
+
return !!_nextProxy;
|
|
2537
|
+
},
|
|
2538
|
+
getNext: function () {
|
|
2539
|
+
return _nextProxy;
|
|
2540
|
+
},
|
|
2541
|
+
setNext: function (nextPlugin) {
|
|
2542
|
+
_nextProxy = nextPlugin;
|
|
2543
|
+
},
|
|
2544
|
+
iterate: _iterateChain,
|
|
2545
|
+
onComplete: _addOnComplete
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
function _addOnComplete(onComplete, that) {
|
|
2549
|
+
var args = [];
|
|
2550
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2551
|
+
args[_i - 2] = arguments[_i];
|
|
2552
|
+
}
|
|
2553
|
+
if (onComplete) {
|
|
2554
|
+
_onComplete[_DYN_PUSH ]({
|
|
2555
|
+
func: onComplete,
|
|
2556
|
+
self: !isUndefined(that) ? that : context.ctx,
|
|
2557
|
+
args: args
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
function _moveNext() {
|
|
2562
|
+
var nextProxy = _nextProxy;
|
|
2563
|
+
_nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null;
|
|
2564
|
+
if (!nextProxy) {
|
|
2565
|
+
var onComplete = _onComplete;
|
|
2566
|
+
if (onComplete && onComplete[_DYN_LENGTH ] > 0) {
|
|
2567
|
+
arrForEach(onComplete, function (completeDetails) {
|
|
2568
|
+
try {
|
|
2569
|
+
completeDetails.func[_DYN_CALL ](completeDetails.self, completeDetails.args);
|
|
2570
|
+
}
|
|
2571
|
+
catch (e) {
|
|
2572
|
+
_throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
2573
|
+
}
|
|
2574
|
+
});
|
|
2575
|
+
_onComplete = [];
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
return nextProxy;
|
|
2579
|
+
}
|
|
2580
|
+
function _getExtCfg(identifier, defaultValue, mergeDefault) {
|
|
2581
|
+
if (defaultValue === void 0) { defaultValue = {}; }
|
|
2582
|
+
if (mergeDefault === void 0) { mergeDefault = 0 ; }
|
|
2583
|
+
var theConfig;
|
|
2584
|
+
if (config) {
|
|
2585
|
+
var extConfig = config[STR_EXTENSION_CONFIG ];
|
|
2586
|
+
if (extConfig && identifier) {
|
|
2587
|
+
theConfig = extConfig[identifier];
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
if (!theConfig) {
|
|
2591
|
+
theConfig = defaultValue;
|
|
2592
|
+
}
|
|
2593
|
+
else if (isObject(defaultValue)) {
|
|
2594
|
+
if (mergeDefault !== 0 ) {
|
|
2595
|
+
var newConfig_1 = objExtend(true, defaultValue, theConfig);
|
|
2596
|
+
if (config && mergeDefault === 2 ) {
|
|
2597
|
+
objForEachKey(defaultValue, function (field) {
|
|
2598
|
+
if (isNullOrUndefined(newConfig_1[field])) {
|
|
2599
|
+
var cfgValue = config[field];
|
|
2600
|
+
if (!isNullOrUndefined(cfgValue)) {
|
|
2601
|
+
newConfig_1[field] = cfgValue;
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
});
|
|
2605
|
+
}
|
|
2606
|
+
theConfig = newConfig_1;
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
return theConfig;
|
|
2610
|
+
}
|
|
2611
|
+
function _getConfig(identifier, field, defaultValue) {
|
|
2612
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
2613
|
+
var theValue;
|
|
2614
|
+
var extConfig = _getExtCfg(identifier, null);
|
|
2615
|
+
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
2616
|
+
theValue = extConfig[field];
|
|
2617
|
+
}
|
|
2618
|
+
else if (config && !isNullOrUndefined(config[field])) {
|
|
2619
|
+
theValue = config[field];
|
|
2620
|
+
}
|
|
2621
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
2622
|
+
}
|
|
2623
|
+
function _iterateChain(cb) {
|
|
2624
|
+
var nextPlugin;
|
|
2625
|
+
while (!!(nextPlugin = context._next())) {
|
|
2626
|
+
var plugin = nextPlugin[_DYN_GET_PLUGIN ]();
|
|
2627
|
+
if (plugin) {
|
|
2628
|
+
cb(plugin);
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
return context;
|
|
1800
2633
|
}
|
|
1801
2634
|
function createProcessTelemetryContext(telemetryChain, config, core, startAt) {
|
|
1802
2635
|
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1803
2636
|
var context = internalContext.ctx;
|
|
1804
2637
|
function _processNext(env) {
|
|
1805
2638
|
var nextPlugin = internalContext._next();
|
|
1806
|
-
nextPlugin && nextPlugin
|
|
2639
|
+
nextPlugin && nextPlugin[STR_PROCESS_TELEMETRY ](env, context);
|
|
1807
2640
|
return !nextPlugin;
|
|
1808
2641
|
}
|
|
1809
2642
|
function _createNew(plugins, startAt) {
|
|
@@ -1811,14 +2644,14 @@
|
|
|
1811
2644
|
if (isArray(plugins)) {
|
|
1812
2645
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1813
2646
|
}
|
|
1814
|
-
return createProcessTelemetryContext(plugins || context
|
|
2647
|
+
return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT ](), config, core, startAt);
|
|
1815
2648
|
}
|
|
1816
|
-
context
|
|
1817
|
-
context
|
|
2649
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
2650
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
1818
2651
|
return context;
|
|
1819
2652
|
}
|
|
1820
2653
|
function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {
|
|
1821
|
-
var config = core
|
|
2654
|
+
var config = core[_DYN_CONFIG ] || {};
|
|
1822
2655
|
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1823
2656
|
var context = internalContext.ctx;
|
|
1824
2657
|
function _processNext(unloadState) {
|
|
@@ -1831,20 +2664,20 @@
|
|
|
1831
2664
|
if (isArray(plugins)) {
|
|
1832
2665
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1833
2666
|
}
|
|
1834
|
-
return createProcessTelemetryUnloadContext(plugins || context
|
|
2667
|
+
return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT ](), core, startAt);
|
|
1835
2668
|
}
|
|
1836
|
-
context
|
|
1837
|
-
context
|
|
2669
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
2670
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
1838
2671
|
return context;
|
|
1839
2672
|
}
|
|
1840
2673
|
function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {
|
|
1841
|
-
var config = core
|
|
2674
|
+
var config = core[_DYN_CONFIG ] || {};
|
|
1842
2675
|
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1843
2676
|
var context = internalContext.ctx;
|
|
1844
2677
|
function _processNext(updateState) {
|
|
1845
2678
|
return context.iterate(function (plugin) {
|
|
1846
|
-
if (isFunction(plugin
|
|
1847
|
-
plugin
|
|
2679
|
+
if (isFunction(plugin[_DYN_UPDATE ])) {
|
|
2680
|
+
plugin[_DYN_UPDATE ](context, updateState);
|
|
1848
2681
|
}
|
|
1849
2682
|
});
|
|
1850
2683
|
}
|
|
@@ -1853,22 +2686,22 @@
|
|
|
1853
2686
|
if (isArray(plugins)) {
|
|
1854
2687
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1855
2688
|
}
|
|
1856
|
-
return createProcessTelemetryUpdateContext(plugins || context
|
|
2689
|
+
return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT ](), core, startAt);
|
|
1857
2690
|
}
|
|
1858
|
-
context
|
|
1859
|
-
context
|
|
2691
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
2692
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
1860
2693
|
return context;
|
|
1861
2694
|
}
|
|
1862
2695
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
1863
2696
|
var firstProxy = null;
|
|
1864
2697
|
var add = startAt ? false : true;
|
|
1865
|
-
if (isArray(plugins) && plugins
|
|
2698
|
+
if (isArray(plugins) && plugins[_DYN_LENGTH ] > 0) {
|
|
1866
2699
|
var lastProxy_1 = null;
|
|
1867
2700
|
arrForEach(plugins, function (thePlugin) {
|
|
1868
2701
|
if (!add && startAt === thePlugin) {
|
|
1869
2702
|
add = true;
|
|
1870
2703
|
}
|
|
1871
|
-
if (add && thePlugin && isFunction(thePlugin
|
|
2704
|
+
if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) {
|
|
1872
2705
|
var newProxy = createTelemetryPluginProxy(thePlugin, config, core);
|
|
1873
2706
|
if (!firstProxy) {
|
|
1874
2707
|
firstProxy = newProxy;
|
|
@@ -1887,11 +2720,11 @@
|
|
|
1887
2720
|
}
|
|
1888
2721
|
function createTelemetryPluginProxy(plugin, config, core) {
|
|
1889
2722
|
var nextProxy = null;
|
|
1890
|
-
var hasProcessTelemetry = isFunction(plugin
|
|
1891
|
-
var hasSetNext = isFunction(plugin
|
|
2723
|
+
var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]);
|
|
2724
|
+
var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
|
|
1892
2725
|
var chainId;
|
|
1893
2726
|
if (plugin) {
|
|
1894
|
-
chainId = plugin
|
|
2727
|
+
chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
1895
2728
|
}
|
|
1896
2729
|
else {
|
|
1897
2730
|
chainId = "Unknown-0-" + _chainId++;
|
|
@@ -1923,17 +2756,17 @@
|
|
|
1923
2756
|
}
|
|
1924
2757
|
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
1925
2758
|
var hasRun = false;
|
|
1926
|
-
var identifier = plugin ? plugin
|
|
2759
|
+
var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain;
|
|
1927
2760
|
var hasRunContext = itemCtx[strHasRunFlags];
|
|
1928
2761
|
if (!hasRunContext) {
|
|
1929
2762
|
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
1930
2763
|
}
|
|
1931
2764
|
itemCtx.setNext(nextProxy);
|
|
1932
2765
|
if (plugin) {
|
|
1933
|
-
doPerf(itemCtx[
|
|
2766
|
+
doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () {
|
|
1934
2767
|
hasRunContext[chainId] = true;
|
|
1935
2768
|
try {
|
|
1936
|
-
var nextId = nextProxy ? nextProxy._id :
|
|
2769
|
+
var nextId = nextProxy ? nextProxy._id : STR_EMPTY$1;
|
|
1937
2770
|
if (nextId) {
|
|
1938
2771
|
hasRunContext[nextId] = false;
|
|
1939
2772
|
}
|
|
@@ -1945,7 +2778,7 @@
|
|
|
1945
2778
|
hasRun = true;
|
|
1946
2779
|
}
|
|
1947
2780
|
if (!nextProxy || !hasNextRun) {
|
|
1948
|
-
_throwInternal(itemCtx
|
|
2781
|
+
_throwInternal(itemCtx[_DYN_DIAG_LOG ](), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1949
2782
|
}
|
|
1950
2783
|
}
|
|
1951
2784
|
}, details, isAsync);
|
|
@@ -1959,17 +2792,17 @@
|
|
|
1959
2792
|
return false;
|
|
1960
2793
|
}
|
|
1961
2794
|
var pluginState = _getPluginState(plugin);
|
|
1962
|
-
if (pluginState
|
|
2795
|
+
if (pluginState[_DYN_TEARDOWN ] || pluginState[STR_DISABLED]) {
|
|
1963
2796
|
return false;
|
|
1964
2797
|
}
|
|
1965
2798
|
if (hasSetNext) {
|
|
1966
|
-
plugin
|
|
2799
|
+
plugin[_DYN_SET_NEXT_PLUGIN ](nextProxy);
|
|
1967
2800
|
}
|
|
1968
|
-
plugin
|
|
2801
|
+
plugin[STR_PROCESS_TELEMETRY ](env, itemCtx);
|
|
1969
2802
|
return true;
|
|
1970
2803
|
}
|
|
1971
2804
|
if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) {
|
|
1972
|
-
itemCtx
|
|
2805
|
+
itemCtx[_DYN_PROCESS_NEXT ](env);
|
|
1973
2806
|
}
|
|
1974
2807
|
}
|
|
1975
2808
|
function _unloadPlugin(unloadCtx, unloadState) {
|
|
@@ -1977,20 +2810,20 @@
|
|
|
1977
2810
|
var hasRun = false;
|
|
1978
2811
|
if (plugin) {
|
|
1979
2812
|
var pluginState = _getPluginState(plugin);
|
|
1980
|
-
var pluginCore = plugin[
|
|
1981
|
-
if (plugin && (!pluginCore || pluginCore === unloadCtx
|
|
1982
|
-
pluginState[
|
|
1983
|
-
pluginState[
|
|
1984
|
-
pluginState[
|
|
1985
|
-
if (plugin[
|
|
2813
|
+
var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ];
|
|
2814
|
+
if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN ]) {
|
|
2815
|
+
pluginState[STR_CORE ] = null;
|
|
2816
|
+
pluginState[_DYN_TEARDOWN ] = true;
|
|
2817
|
+
pluginState[_DYN_IS_INITIALIZED ] = false;
|
|
2818
|
+
if (plugin[_DYN_TEARDOWN ] && plugin[_DYN_TEARDOWN ](unloadCtx, unloadState) === true) {
|
|
1986
2819
|
hasRun = true;
|
|
1987
2820
|
}
|
|
1988
2821
|
}
|
|
1989
2822
|
}
|
|
1990
2823
|
return hasRun;
|
|
1991
2824
|
}
|
|
1992
|
-
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState
|
|
1993
|
-
unloadCtx
|
|
2825
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState[_DYN_IS_ASYNC ])) {
|
|
2826
|
+
unloadCtx[_DYN_PROCESS_NEXT ](unloadState);
|
|
1994
2827
|
}
|
|
1995
2828
|
}
|
|
1996
2829
|
function _updatePlugin(updateCtx, updateState) {
|
|
@@ -1998,9 +2831,9 @@
|
|
|
1998
2831
|
var hasRun = false;
|
|
1999
2832
|
if (plugin) {
|
|
2000
2833
|
var pluginState = _getPluginState(plugin);
|
|
2001
|
-
var pluginCore = plugin[
|
|
2002
|
-
if (plugin && (!pluginCore || pluginCore === updateCtx
|
|
2003
|
-
if (plugin[
|
|
2834
|
+
var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ];
|
|
2835
|
+
if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN ]) {
|
|
2836
|
+
if (plugin[_DYN_UPDATE ] && plugin[_DYN_UPDATE ](updateCtx, updateState) === true) {
|
|
2004
2837
|
hasRun = true;
|
|
2005
2838
|
}
|
|
2006
2839
|
}
|
|
@@ -2008,7 +2841,7 @@
|
|
|
2008
2841
|
return hasRun;
|
|
2009
2842
|
}
|
|
2010
2843
|
if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
|
|
2011
|
-
updateCtx
|
|
2844
|
+
updateCtx[_DYN_PROCESS_NEXT ](updateState);
|
|
2012
2845
|
}
|
|
2013
2846
|
}
|
|
2014
2847
|
return objFreeze(proxyChain);
|
|
@@ -2022,279 +2855,30 @@
|
|
|
2022
2855
|
return ProcessTelemetryContext;
|
|
2023
2856
|
}());
|
|
2024
2857
|
|
|
2025
|
-
var strToGMTString = "toGMTString";
|
|
2026
|
-
var strToUTCString = "toUTCString";
|
|
2027
|
-
var strCookie = "cookie";
|
|
2028
|
-
var strExpires = "expires";
|
|
2029
|
-
var strEnabled = "enabled";
|
|
2030
|
-
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
2031
|
-
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
2032
|
-
var strConfigCookieMgr = "_ckMgr";
|
|
2033
|
-
var _supportsCookies = null;
|
|
2034
|
-
var _allowUaSameSite = null;
|
|
2035
|
-
var _parsedCookieValue = null;
|
|
2036
|
-
var _doc = getDocument();
|
|
2037
|
-
var _cookieCache = {};
|
|
2038
|
-
var _globalCookieConfig = {};
|
|
2039
|
-
function _gblCookieMgr(config, logger) {
|
|
2040
|
-
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
2041
|
-
if (!inst) {
|
|
2042
|
-
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
2043
|
-
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
2044
|
-
}
|
|
2045
|
-
return inst;
|
|
2046
|
-
}
|
|
2047
|
-
function _isMgrEnabled(cookieMgr) {
|
|
2048
|
-
if (cookieMgr) {
|
|
2049
|
-
return cookieMgr.isEnabled();
|
|
2050
|
-
}
|
|
2051
|
-
return true;
|
|
2052
|
-
}
|
|
2053
|
-
function _createCookieMgrConfig(rootConfig) {
|
|
2054
|
-
var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {};
|
|
2055
|
-
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
|
2056
|
-
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
|
2057
|
-
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
|
2058
|
-
var cookieEnabled = void 0;
|
|
2059
|
-
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
2060
|
-
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
2061
|
-
}
|
|
2062
|
-
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
2063
|
-
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
2064
|
-
}
|
|
2065
|
-
cookieMgrCfg[strEnabled] = cookieEnabled;
|
|
2066
|
-
}
|
|
2067
|
-
return cookieMgrCfg;
|
|
2068
|
-
}
|
|
2069
|
-
function safeGetCookieMgr(core, config) {
|
|
2070
|
-
var cookieMgr;
|
|
2071
|
-
if (core) {
|
|
2072
|
-
cookieMgr = core.getCookieMgr();
|
|
2073
|
-
}
|
|
2074
|
-
else if (config) {
|
|
2075
|
-
var cookieCfg = config.cookieCfg;
|
|
2076
|
-
if (cookieCfg[strConfigCookieMgr]) {
|
|
2077
|
-
cookieMgr = cookieCfg[strConfigCookieMgr];
|
|
2078
|
-
}
|
|
2079
|
-
else {
|
|
2080
|
-
cookieMgr = createCookieMgr(config);
|
|
2081
|
-
}
|
|
2082
|
-
}
|
|
2083
|
-
if (!cookieMgr) {
|
|
2084
|
-
cookieMgr = _gblCookieMgr(config, (core || {}).logger);
|
|
2085
|
-
}
|
|
2086
|
-
return cookieMgr;
|
|
2087
|
-
}
|
|
2088
|
-
function createCookieMgr(rootConfig, logger) {
|
|
2089
|
-
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
|
2090
|
-
var _path = cookieMgrConfig.path || "/";
|
|
2091
|
-
var _domain = cookieMgrConfig.domain;
|
|
2092
|
-
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
|
2093
|
-
var cookieMgr = {
|
|
2094
|
-
isEnabled: function () {
|
|
2095
|
-
var enabled = _enabled && areCookiesSupported(logger);
|
|
2096
|
-
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
2097
|
-
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
2098
|
-
enabled = _isMgrEnabled(gblManager);
|
|
2099
|
-
}
|
|
2100
|
-
return enabled;
|
|
2101
|
-
},
|
|
2102
|
-
setEnabled: function (value) {
|
|
2103
|
-
_enabled = value !== false;
|
|
2104
|
-
},
|
|
2105
|
-
set: function (name, value, maxAgeSec, domain, path) {
|
|
2106
|
-
var result = false;
|
|
2107
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
2108
|
-
var values = {};
|
|
2109
|
-
var theValue = strTrim(value || strEmpty);
|
|
2110
|
-
var idx = theValue.indexOf(";");
|
|
2111
|
-
if (idx !== -1) {
|
|
2112
|
-
theValue = strTrim(value.substring(0, idx));
|
|
2113
|
-
values = _extractParts(value.substring(idx + 1));
|
|
2114
|
-
}
|
|
2115
|
-
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
|
2116
|
-
if (!isNullOrUndefined(maxAgeSec)) {
|
|
2117
|
-
var _isIE = isIE();
|
|
2118
|
-
if (isUndefined(values[strExpires])) {
|
|
2119
|
-
var nowMs = dateNow();
|
|
2120
|
-
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
2121
|
-
if (expireMs > 0) {
|
|
2122
|
-
var expiry = new Date();
|
|
2123
|
-
expiry.setTime(expireMs);
|
|
2124
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy);
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
if (!_isIE) {
|
|
2128
|
-
setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined);
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
var location_1 = getLocation();
|
|
2132
|
-
if (location_1 && location_1.protocol === "https:") {
|
|
2133
|
-
setValue(values, "secure", null, null, isUndefined);
|
|
2134
|
-
if (_allowUaSameSite === null) {
|
|
2135
|
-
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent);
|
|
2136
|
-
}
|
|
2137
|
-
if (_allowUaSameSite) {
|
|
2138
|
-
setValue(values, "SameSite", "None", null, isUndefined);
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
setValue(values, "path", path || _path, null, isUndefined);
|
|
2142
|
-
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
2143
|
-
setCookieFn(name, _formatCookieValue(theValue, values));
|
|
2144
|
-
result = true;
|
|
2145
|
-
}
|
|
2146
|
-
return result;
|
|
2147
|
-
},
|
|
2148
|
-
get: function (name) {
|
|
2149
|
-
var value = strEmpty;
|
|
2150
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
2151
|
-
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
2152
|
-
}
|
|
2153
|
-
return value;
|
|
2154
|
-
},
|
|
2155
|
-
del: function (name, path) {
|
|
2156
|
-
var result = false;
|
|
2157
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
2158
|
-
result = cookieMgr.purge(name, path);
|
|
2159
|
-
}
|
|
2160
|
-
return result;
|
|
2161
|
-
},
|
|
2162
|
-
purge: function (name, path) {
|
|
2163
|
-
var _a;
|
|
2164
|
-
var result = false;
|
|
2165
|
-
if (areCookiesSupported(logger)) {
|
|
2166
|
-
var values = (_a = {},
|
|
2167
|
-
_a["path"] = path ? path : "/",
|
|
2168
|
-
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
2169
|
-
_a);
|
|
2170
|
-
if (!isIE()) {
|
|
2171
|
-
values["max-age"] = "0";
|
|
2172
|
-
}
|
|
2173
|
-
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
2174
|
-
delCookie(name, _formatCookieValue(strEmpty, values));
|
|
2175
|
-
result = true;
|
|
2176
|
-
}
|
|
2177
|
-
return result;
|
|
2178
|
-
}
|
|
2179
|
-
};
|
|
2180
|
-
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
2181
|
-
return cookieMgr;
|
|
2182
|
-
}
|
|
2183
|
-
function areCookiesSupported(logger) {
|
|
2184
|
-
if (_supportsCookies === null) {
|
|
2185
|
-
_supportsCookies = false;
|
|
2186
|
-
try {
|
|
2187
|
-
var doc = _doc || {};
|
|
2188
|
-
_supportsCookies = doc[strCookie] !== undefined;
|
|
2189
|
-
}
|
|
2190
|
-
catch (e) {
|
|
2191
|
-
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
return _supportsCookies;
|
|
2195
|
-
}
|
|
2196
|
-
function _extractParts(theValue) {
|
|
2197
|
-
var values = {};
|
|
2198
|
-
if (theValue && theValue.length) {
|
|
2199
|
-
var parts = strTrim(theValue).split(";");
|
|
2200
|
-
arrForEach(parts, function (thePart) {
|
|
2201
|
-
thePart = strTrim(thePart || strEmpty);
|
|
2202
|
-
if (thePart) {
|
|
2203
|
-
var idx = thePart.indexOf("=");
|
|
2204
|
-
if (idx === -1) {
|
|
2205
|
-
values[thePart] = null;
|
|
2206
|
-
}
|
|
2207
|
-
else {
|
|
2208
|
-
values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1));
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
});
|
|
2212
|
-
}
|
|
2213
|
-
return values;
|
|
2214
|
-
}
|
|
2215
|
-
function _formatDate(theDate, func) {
|
|
2216
|
-
if (isFunction(theDate[func])) {
|
|
2217
|
-
return theDate[func]();
|
|
2218
|
-
}
|
|
2219
|
-
return null;
|
|
2220
|
-
}
|
|
2221
|
-
function _formatCookieValue(value, values) {
|
|
2222
|
-
var cookieValue = value || strEmpty;
|
|
2223
|
-
objForEachKey(values, function (name, theValue) {
|
|
2224
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty);
|
|
2225
|
-
});
|
|
2226
|
-
return cookieValue;
|
|
2227
|
-
}
|
|
2228
|
-
function _getCookieValue(name) {
|
|
2229
|
-
var cookieValue = strEmpty;
|
|
2230
|
-
if (_doc) {
|
|
2231
|
-
var theCookie = _doc[strCookie] || strEmpty;
|
|
2232
|
-
if (_parsedCookieValue !== theCookie) {
|
|
2233
|
-
_cookieCache = _extractParts(theCookie);
|
|
2234
|
-
_parsedCookieValue = theCookie;
|
|
2235
|
-
}
|
|
2236
|
-
cookieValue = strTrim(_cookieCache[name] || strEmpty);
|
|
2237
|
-
}
|
|
2238
|
-
return cookieValue;
|
|
2239
|
-
}
|
|
2240
|
-
function _setCookieValue(name, cookieValue) {
|
|
2241
|
-
if (_doc) {
|
|
2242
|
-
_doc[strCookie] = name + "=" + cookieValue;
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
function uaDisallowsSameSiteNone(userAgent) {
|
|
2246
|
-
if (!isString(userAgent)) {
|
|
2247
|
-
return false;
|
|
2248
|
-
}
|
|
2249
|
-
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
|
2250
|
-
return true;
|
|
2251
|
-
}
|
|
2252
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
2253
|
-
return true;
|
|
2254
|
-
}
|
|
2255
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
2256
|
-
return true;
|
|
2257
|
-
}
|
|
2258
|
-
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
2259
|
-
return true;
|
|
2260
|
-
}
|
|
2261
|
-
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
|
2262
|
-
return true;
|
|
2263
|
-
}
|
|
2264
|
-
if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) {
|
|
2265
|
-
return true;
|
|
2266
|
-
}
|
|
2267
|
-
return false;
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
var strIKey = "iKey";
|
|
2271
|
-
var strExtensionConfig = "extensionConfig";
|
|
2272
|
-
|
|
2273
2858
|
var ChannelControllerPriority = 500;
|
|
2274
2859
|
var ChannelValidationMessage = "Channel has invalid priority - ";
|
|
2275
|
-
function _addChannelQueue(channelQueue, queue,
|
|
2276
|
-
if (queue && isArray(queue) && queue
|
|
2860
|
+
function _addChannelQueue(channelQueue, queue, core) {
|
|
2861
|
+
if (queue && isArray(queue) && queue[_DYN_LENGTH ] > 0) {
|
|
2277
2862
|
queue = queue.sort(function (a, b) {
|
|
2278
|
-
return a
|
|
2863
|
+
return a[STR_PRIORITY ] - b[STR_PRIORITY ];
|
|
2279
2864
|
});
|
|
2280
2865
|
arrForEach(queue, function (queueItem) {
|
|
2281
|
-
if (queueItem
|
|
2282
|
-
throwError(ChannelValidationMessage + queueItem
|
|
2866
|
+
if (queueItem[STR_PRIORITY ] < ChannelControllerPriority) {
|
|
2867
|
+
throwError(ChannelValidationMessage + queueItem[_DYN_IDENTIFIER ]);
|
|
2283
2868
|
}
|
|
2284
2869
|
});
|
|
2285
|
-
channelQueue
|
|
2870
|
+
channelQueue[_DYN_PUSH ]({
|
|
2286
2871
|
queue: objFreeze(queue),
|
|
2287
|
-
chain: createTelemetryProxyChain(queue,
|
|
2872
|
+
chain: createTelemetryProxyChain(queue, core[_DYN_CONFIG ], core)
|
|
2288
2873
|
});
|
|
2289
2874
|
}
|
|
2290
2875
|
}
|
|
2291
2876
|
function createChannelControllerPlugin(channelQueue, core) {
|
|
2292
|
-
var _a;
|
|
2293
2877
|
function _getTelCtx() {
|
|
2294
|
-
return createProcessTelemetryContext(null, core
|
|
2878
|
+
return createProcessTelemetryContext(null, core[_DYN_CONFIG ], core, null);
|
|
2295
2879
|
}
|
|
2296
2880
|
function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) {
|
|
2297
|
-
var waiting = theChannels ? (theChannels
|
|
2881
|
+
var waiting = theChannels ? (theChannels[_DYN_LENGTH ] + 1) : 1;
|
|
2298
2882
|
function _runChainOnComplete() {
|
|
2299
2883
|
waiting--;
|
|
2300
2884
|
if (waiting === 0) {
|
|
@@ -2304,10 +2888,10 @@
|
|
|
2304
2888
|
}
|
|
2305
2889
|
if (waiting > 0) {
|
|
2306
2890
|
arrForEach(theChannels, function (channels) {
|
|
2307
|
-
if (channels && channels.queue
|
|
2891
|
+
if (channels && channels.queue[_DYN_LENGTH ] > 0) {
|
|
2308
2892
|
var channelChain = channels.chain;
|
|
2309
|
-
var chainCtx = itemCtx
|
|
2310
|
-
chainCtx
|
|
2893
|
+
var chainCtx = itemCtx[_DYN_CREATE_NEW ](channelChain);
|
|
2894
|
+
chainCtx[_DYN_ON_COMPLETE ](_runChainOnComplete);
|
|
2311
2895
|
processFn(chainCtx);
|
|
2312
2896
|
}
|
|
2313
2897
|
else {
|
|
@@ -2322,9 +2906,9 @@
|
|
|
2322
2906
|
reason: 0
|
|
2323
2907
|
};
|
|
2324
2908
|
_processChannelQueue(channelQueue, updateCtx, function (chainCtx) {
|
|
2325
|
-
chainCtx[
|
|
2909
|
+
chainCtx[_DYN_PROCESS_NEXT ](theUpdateState);
|
|
2326
2910
|
}, function () {
|
|
2327
|
-
updateCtx[
|
|
2911
|
+
updateCtx[_DYN_PROCESS_NEXT ](theUpdateState);
|
|
2328
2912
|
});
|
|
2329
2913
|
return true;
|
|
2330
2914
|
}
|
|
@@ -2334,20 +2918,20 @@
|
|
|
2334
2918
|
isAsync: false
|
|
2335
2919
|
};
|
|
2336
2920
|
_processChannelQueue(channelQueue, unloadCtx, function (chainCtx) {
|
|
2337
|
-
chainCtx[
|
|
2921
|
+
chainCtx[_DYN_PROCESS_NEXT ](theUnloadState);
|
|
2338
2922
|
}, function () {
|
|
2339
|
-
unloadCtx[
|
|
2923
|
+
unloadCtx[_DYN_PROCESS_NEXT ](theUnloadState);
|
|
2340
2924
|
isInitialized = false;
|
|
2341
2925
|
});
|
|
2342
2926
|
return true;
|
|
2343
2927
|
}
|
|
2344
2928
|
function _getChannel(pluginIdentifier) {
|
|
2345
2929
|
var thePlugin = null;
|
|
2346
|
-
if (channelQueue && channelQueue
|
|
2930
|
+
if (channelQueue && channelQueue[_DYN_LENGTH ] > 0) {
|
|
2347
2931
|
arrForEach(channelQueue, function (channels) {
|
|
2348
|
-
if (channels && channels.queue
|
|
2932
|
+
if (channels && channels.queue[_DYN_LENGTH ] > 0) {
|
|
2349
2933
|
arrForEach(channels.queue, function (ext) {
|
|
2350
|
-
if (ext
|
|
2934
|
+
if (ext[_DYN_IDENTIFIER ] === pluginIdentifier) {
|
|
2351
2935
|
thePlugin = ext;
|
|
2352
2936
|
return -1;
|
|
2353
2937
|
}
|
|
@@ -2361,46 +2945,45 @@
|
|
|
2361
2945
|
return thePlugin;
|
|
2362
2946
|
}
|
|
2363
2947
|
var isInitialized = false;
|
|
2364
|
-
var channelController =
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
},
|
|
2378
|
-
processTelemetry: function (item, itemCtx) {
|
|
2379
|
-
_processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) {
|
|
2380
|
-
chainCtx[strProcessNext](item);
|
|
2381
|
-
}, function () {
|
|
2382
|
-
itemCtx[strProcessNext](item);
|
|
2383
|
-
});
|
|
2384
|
-
},
|
|
2385
|
-
update: _doUpdate
|
|
2948
|
+
var channelController = {
|
|
2949
|
+
identifier: "ChannelControllerPlugin",
|
|
2950
|
+
priority: ChannelControllerPriority,
|
|
2951
|
+
initialize: function (config, core, extensions, pluginChain) {
|
|
2952
|
+
isInitialized = true;
|
|
2953
|
+
arrForEach(channelQueue, function (channels) {
|
|
2954
|
+
if (channels && channels.queue[_DYN_LENGTH ] > 0) {
|
|
2955
|
+
initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions);
|
|
2956
|
+
}
|
|
2957
|
+
});
|
|
2958
|
+
},
|
|
2959
|
+
isInitialized: function () {
|
|
2960
|
+
return isInitialized;
|
|
2386
2961
|
},
|
|
2387
|
-
|
|
2962
|
+
processTelemetry: function (item, itemCtx) {
|
|
2963
|
+
_processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) {
|
|
2964
|
+
chainCtx[_DYN_PROCESS_NEXT ](item);
|
|
2965
|
+
}, function () {
|
|
2966
|
+
itemCtx[_DYN_PROCESS_NEXT ](item);
|
|
2967
|
+
});
|
|
2968
|
+
},
|
|
2969
|
+
update: _doUpdate,
|
|
2970
|
+
pause: function () {
|
|
2388
2971
|
_processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) {
|
|
2389
2972
|
chainCtx.iterate(function (plugin) {
|
|
2390
|
-
plugin
|
|
2973
|
+
plugin.pause && plugin.pause();
|
|
2391
2974
|
});
|
|
2392
2975
|
}, null);
|
|
2393
2976
|
},
|
|
2394
|
-
|
|
2977
|
+
resume: function () {
|
|
2395
2978
|
_processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) {
|
|
2396
2979
|
chainCtx.iterate(function (plugin) {
|
|
2397
|
-
plugin
|
|
2980
|
+
plugin.resume && plugin.resume();
|
|
2398
2981
|
});
|
|
2399
2982
|
}, null);
|
|
2400
2983
|
},
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2984
|
+
teardown: _doTeardown,
|
|
2985
|
+
getChannel: _getChannel,
|
|
2986
|
+
flush: function (isAsync, callBack, sendReason, cbTimeout) {
|
|
2404
2987
|
var waiting = 1;
|
|
2405
2988
|
var doneIterating = false;
|
|
2406
2989
|
var cbTimer = null;
|
|
@@ -2418,10 +3001,10 @@
|
|
|
2418
3001
|
}
|
|
2419
3002
|
_processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) {
|
|
2420
3003
|
chainCtx.iterate(function (plugin) {
|
|
2421
|
-
if (plugin
|
|
3004
|
+
if (plugin[_DYN_FLUSH ]) {
|
|
2422
3005
|
waiting++;
|
|
2423
3006
|
var handled_1 = false;
|
|
2424
|
-
if (!plugin
|
|
3007
|
+
if (!plugin[_DYN_FLUSH ](isAsync, function () {
|
|
2425
3008
|
handled_1 = true;
|
|
2426
3009
|
doCallback();
|
|
2427
3010
|
}, sendReason)) {
|
|
@@ -2445,25 +3028,25 @@
|
|
|
2445
3028
|
});
|
|
2446
3029
|
return true;
|
|
2447
3030
|
},
|
|
2448
|
-
|
|
3031
|
+
_setQueue: function (queue) {
|
|
2449
3032
|
channelQueue = queue;
|
|
2450
|
-
}
|
|
2451
|
-
|
|
3033
|
+
}
|
|
3034
|
+
};
|
|
2452
3035
|
return channelController;
|
|
2453
3036
|
}
|
|
2454
|
-
function createChannelQueues(channels, extensions,
|
|
3037
|
+
function createChannelQueues(channels, extensions, core) {
|
|
2455
3038
|
var channelQueue = [];
|
|
2456
3039
|
if (channels) {
|
|
2457
|
-
arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue,
|
|
3040
|
+
arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, core); });
|
|
2458
3041
|
}
|
|
2459
3042
|
if (extensions) {
|
|
2460
3043
|
var extensionQueue_1 = [];
|
|
2461
3044
|
arrForEach(extensions, function (plugin) {
|
|
2462
|
-
if (plugin
|
|
2463
|
-
extensionQueue_1
|
|
3045
|
+
if (plugin[STR_PRIORITY ] > ChannelControllerPriority) {
|
|
3046
|
+
extensionQueue_1[_DYN_PUSH ](plugin);
|
|
2464
3047
|
}
|
|
2465
3048
|
});
|
|
2466
|
-
_addChannelQueue(channelQueue, extensionQueue_1,
|
|
3049
|
+
_addChannelQueue(channelQueue, extensionQueue_1, core);
|
|
2467
3050
|
}
|
|
2468
3051
|
return channelQueue;
|
|
2469
3052
|
}
|
|
@@ -2472,7 +3055,7 @@
|
|
|
2472
3055
|
var handlers = [];
|
|
2473
3056
|
function _addHandler(handler) {
|
|
2474
3057
|
if (handler) {
|
|
2475
|
-
handlers
|
|
3058
|
+
handlers[_DYN_PUSH ](handler);
|
|
2476
3059
|
}
|
|
2477
3060
|
}
|
|
2478
3061
|
function _runHandlers(unloadCtx, unloadState) {
|
|
@@ -2481,7 +3064,7 @@
|
|
|
2481
3064
|
handler(unloadCtx, unloadState);
|
|
2482
3065
|
}
|
|
2483
3066
|
catch (e) {
|
|
2484
|
-
_throwInternal(unloadCtx
|
|
3067
|
+
_throwInternal(unloadCtx[_DYN_DIAG_LOG ](), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
|
|
2485
3068
|
}
|
|
2486
3069
|
});
|
|
2487
3070
|
handlers = [];
|
|
@@ -2503,37 +3086,40 @@
|
|
|
2503
3086
|
var _hooks;
|
|
2504
3087
|
_initDefaults();
|
|
2505
3088
|
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
|
2506
|
-
_self
|
|
3089
|
+
_self[_DYN_INITIALIZE ] = function (config, core, extensions, pluginChain) {
|
|
2507
3090
|
_setDefaults(config, core, pluginChain);
|
|
2508
3091
|
_isinitialized = true;
|
|
2509
3092
|
};
|
|
2510
|
-
_self
|
|
2511
|
-
var
|
|
2512
|
-
|
|
3093
|
+
_self[_DYN_TEARDOWN ] = function (unloadCtx, unloadState) {
|
|
3094
|
+
var _a;
|
|
3095
|
+
var core = _self[STR_CORE ];
|
|
3096
|
+
if (!core || (unloadCtx && core !== unloadCtx[STR_CORE ]())) {
|
|
2513
3097
|
return;
|
|
2514
3098
|
}
|
|
2515
3099
|
var result;
|
|
2516
3100
|
var unloadDone = false;
|
|
2517
3101
|
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
2518
|
-
var theUnloadState = unloadState || {
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
3102
|
+
var theUnloadState = unloadState || (_a = {
|
|
3103
|
+
reason: 0
|
|
3104
|
+
},
|
|
3105
|
+
_a[_DYN_IS_ASYNC ] = false,
|
|
3106
|
+
_a);
|
|
2522
3107
|
function _unloadCallback() {
|
|
2523
3108
|
if (!unloadDone) {
|
|
2524
3109
|
unloadDone = true;
|
|
2525
3110
|
_unloadHandlerContainer.run(theUnloadCtx, unloadState);
|
|
2526
|
-
|
|
3111
|
+
var oldHooks = _hooks;
|
|
3112
|
+
_hooks = [];
|
|
3113
|
+
arrForEach(oldHooks, function (fn) {
|
|
2527
3114
|
fn.rm();
|
|
2528
3115
|
});
|
|
2529
|
-
_hooks = [];
|
|
2530
3116
|
if (result === true) {
|
|
2531
|
-
theUnloadCtx
|
|
3117
|
+
theUnloadCtx[_DYN_PROCESS_NEXT ](theUnloadState);
|
|
2532
3118
|
}
|
|
2533
3119
|
_initDefaults();
|
|
2534
3120
|
}
|
|
2535
3121
|
}
|
|
2536
|
-
if (!_self[
|
|
3122
|
+
if (!_self[_DYN__DO_TEARDOWN ] || _self[_DYN__DO_TEARDOWN ](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
|
2537
3123
|
_unloadCallback();
|
|
2538
3124
|
}
|
|
2539
3125
|
else {
|
|
@@ -2541,9 +3127,9 @@
|
|
|
2541
3127
|
}
|
|
2542
3128
|
return result;
|
|
2543
3129
|
};
|
|
2544
|
-
_self
|
|
2545
|
-
var core = _self
|
|
2546
|
-
if (!core || (updateCtx && core !== updateCtx
|
|
3130
|
+
_self[_DYN_UPDATE ] = function (updateCtx, updateState) {
|
|
3131
|
+
var core = _self[STR_CORE ];
|
|
3132
|
+
if (!core || (updateCtx && core !== updateCtx[STR_CORE ]())) {
|
|
2547
3133
|
return;
|
|
2548
3134
|
}
|
|
2549
3135
|
var result;
|
|
@@ -2555,7 +3141,7 @@
|
|
|
2555
3141
|
function _updateCallback() {
|
|
2556
3142
|
if (!updateDone) {
|
|
2557
3143
|
updateDone = true;
|
|
2558
|
-
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx
|
|
3144
|
+
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT ]());
|
|
2559
3145
|
}
|
|
2560
3146
|
}
|
|
2561
3147
|
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
|
@@ -2572,30 +3158,30 @@
|
|
|
2572
3158
|
_hooks = _hooks.concat(hooks);
|
|
2573
3159
|
}
|
|
2574
3160
|
else {
|
|
2575
|
-
_hooks
|
|
3161
|
+
_hooks[_DYN_PUSH ](hooks);
|
|
2576
3162
|
}
|
|
2577
3163
|
}
|
|
2578
3164
|
};
|
|
2579
3165
|
proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add");
|
|
2580
3166
|
});
|
|
2581
|
-
_self
|
|
2582
|
-
return _getTelCtx(itemCtx)
|
|
3167
|
+
_self[_DYN_DIAG_LOG ] = function (itemCtx) {
|
|
3168
|
+
return _getTelCtx(itemCtx)[_DYN_DIAG_LOG ]();
|
|
2583
3169
|
};
|
|
2584
|
-
_self[
|
|
3170
|
+
_self[_DYN_IS_INITIALIZED ] = function () {
|
|
2585
3171
|
return _isinitialized;
|
|
2586
3172
|
};
|
|
2587
3173
|
_self.setInitialized = function (isInitialized) {
|
|
2588
3174
|
_isinitialized = isInitialized;
|
|
2589
3175
|
};
|
|
2590
|
-
_self[
|
|
3176
|
+
_self[_DYN_SET_NEXT_PLUGIN ] = function (next) {
|
|
2591
3177
|
_nextPlugin = next;
|
|
2592
3178
|
};
|
|
2593
|
-
_self
|
|
3179
|
+
_self[_DYN_PROCESS_NEXT ] = function (env, itemCtx) {
|
|
2594
3180
|
if (itemCtx) {
|
|
2595
|
-
itemCtx
|
|
3181
|
+
itemCtx[_DYN_PROCESS_NEXT ](env);
|
|
2596
3182
|
}
|
|
2597
|
-
else if (_nextPlugin && isFunction(_nextPlugin
|
|
2598
|
-
_nextPlugin
|
|
3183
|
+
else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY ])) {
|
|
3184
|
+
_nextPlugin[STR_PROCESS_TELEMETRY ](env, null);
|
|
2599
3185
|
}
|
|
2600
3186
|
};
|
|
2601
3187
|
_self._getTelCtx = _getTelCtx;
|
|
@@ -2603,39 +3189,40 @@
|
|
|
2603
3189
|
if (currentCtx === void 0) { currentCtx = null; }
|
|
2604
3190
|
var itemCtx = currentCtx;
|
|
2605
3191
|
if (!itemCtx) {
|
|
2606
|
-
var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self
|
|
3192
|
+
var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE ]);
|
|
2607
3193
|
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
2608
|
-
itemCtx = rootCtx
|
|
3194
|
+
itemCtx = rootCtx[_DYN_CREATE_NEW ](null, _nextPlugin[strGetPlugin]);
|
|
2609
3195
|
}
|
|
2610
3196
|
else {
|
|
2611
|
-
itemCtx = rootCtx
|
|
3197
|
+
itemCtx = rootCtx[_DYN_CREATE_NEW ](null, _nextPlugin);
|
|
2612
3198
|
}
|
|
2613
3199
|
}
|
|
2614
3200
|
return itemCtx;
|
|
2615
3201
|
}
|
|
2616
3202
|
function _setDefaults(config, core, pluginChain) {
|
|
2617
3203
|
if (config) {
|
|
2618
|
-
setValue(config,
|
|
3204
|
+
setValue(config, STR_EXTENSION_CONFIG, [], null, isNullOrUndefined);
|
|
2619
3205
|
}
|
|
2620
3206
|
if (!pluginChain && core) {
|
|
2621
|
-
pluginChain = core
|
|
3207
|
+
pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ]();
|
|
2622
3208
|
}
|
|
2623
3209
|
var nextPlugin = _nextPlugin;
|
|
2624
3210
|
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
2625
3211
|
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
2626
3212
|
}
|
|
2627
|
-
_self
|
|
3213
|
+
_self[STR_CORE ] = core;
|
|
2628
3214
|
_rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
2629
3215
|
}
|
|
2630
3216
|
function _initDefaults() {
|
|
2631
3217
|
_isinitialized = false;
|
|
2632
|
-
_self
|
|
3218
|
+
_self[STR_CORE ] = null;
|
|
2633
3219
|
_rootCtx = null;
|
|
2634
3220
|
_nextPlugin = null;
|
|
2635
3221
|
_hooks = [];
|
|
2636
3222
|
_unloadHandlerContainer = createUnloadHandlerContainer();
|
|
2637
3223
|
}
|
|
2638
3224
|
}
|
|
3225
|
+
BaseTelemetryPlugin.__ieDyn=1;
|
|
2639
3226
|
return BaseTelemetryPlugin;
|
|
2640
3227
|
}());
|
|
2641
3228
|
|
|
@@ -2654,12 +3241,12 @@
|
|
|
2654
3241
|
id: _id++,
|
|
2655
3242
|
fn: telemetryInitializer
|
|
2656
3243
|
};
|
|
2657
|
-
_initializers
|
|
3244
|
+
_initializers[_DYN_PUSH ](theInitializer);
|
|
2658
3245
|
var handler = {
|
|
2659
3246
|
remove: function () {
|
|
2660
3247
|
arrForEach(_initializers, function (initializer, idx) {
|
|
2661
3248
|
if (initializer.id === theInitializer.id) {
|
|
2662
|
-
_initializers
|
|
3249
|
+
_initializers[_DYN_SPLICE ](idx, 1);
|
|
2663
3250
|
return -1;
|
|
2664
3251
|
}
|
|
2665
3252
|
});
|
|
@@ -2667,28 +3254,28 @@
|
|
|
2667
3254
|
};
|
|
2668
3255
|
return handler;
|
|
2669
3256
|
};
|
|
2670
|
-
_self
|
|
3257
|
+
_self[STR_PROCESS_TELEMETRY ] = function (item, itemCtx) {
|
|
2671
3258
|
var doNotSendItem = false;
|
|
2672
|
-
var telemetryInitializersCount = _initializers
|
|
3259
|
+
var telemetryInitializersCount = _initializers[_DYN_LENGTH ];
|
|
2673
3260
|
for (var i = 0; i < telemetryInitializersCount; ++i) {
|
|
2674
3261
|
var telemetryInitializer = _initializers[i];
|
|
2675
3262
|
if (telemetryInitializer) {
|
|
2676
3263
|
try {
|
|
2677
|
-
if (telemetryInitializer.fn
|
|
3264
|
+
if (telemetryInitializer.fn[_DYN_APPLY ](null, [item]) === false) {
|
|
2678
3265
|
doNotSendItem = true;
|
|
2679
3266
|
break;
|
|
2680
3267
|
}
|
|
2681
3268
|
}
|
|
2682
3269
|
catch (e) {
|
|
2683
|
-
_throwInternal(itemCtx
|
|
3270
|
+
_throwInternal(itemCtx[_DYN_DIAG_LOG ](), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true);
|
|
2684
3271
|
}
|
|
2685
3272
|
}
|
|
2686
3273
|
}
|
|
2687
3274
|
if (!doNotSendItem) {
|
|
2688
|
-
_self
|
|
3275
|
+
_self[_DYN_PROCESS_NEXT ](item, itemCtx);
|
|
2689
3276
|
}
|
|
2690
3277
|
};
|
|
2691
|
-
_self[
|
|
3278
|
+
_self[_DYN__DO_TEARDOWN ] = function () {
|
|
2692
3279
|
_initDefaults();
|
|
2693
3280
|
};
|
|
2694
3281
|
});
|
|
@@ -2698,6 +3285,7 @@
|
|
|
2698
3285
|
}
|
|
2699
3286
|
return _this;
|
|
2700
3287
|
}
|
|
3288
|
+
TelemetryInitializerPlugin.__ieDyn=1;
|
|
2701
3289
|
return TelemetryInitializerPlugin;
|
|
2702
3290
|
}(BaseTelemetryPlugin));
|
|
2703
3291
|
|
|
@@ -2712,14 +3300,15 @@
|
|
|
2712
3300
|
return new PerfManager(notificationMgr);
|
|
2713
3301
|
}
|
|
2714
3302
|
function _validateExtensions(logger, channelPriority, allExtensions) {
|
|
3303
|
+
var _a;
|
|
2715
3304
|
var coreExtensions = [];
|
|
2716
3305
|
var extPriorities = {};
|
|
2717
3306
|
arrForEach(allExtensions, function (ext) {
|
|
2718
|
-
if (isNullOrUndefined(ext) || isNullOrUndefined(ext
|
|
3307
|
+
if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE ])) {
|
|
2719
3308
|
throwError(strValidationError);
|
|
2720
3309
|
}
|
|
2721
|
-
var extPriority = ext
|
|
2722
|
-
var identifier = ext
|
|
3310
|
+
var extPriority = ext[STR_PRIORITY ];
|
|
3311
|
+
var identifier = ext[_DYN_IDENTIFIER ];
|
|
2723
3312
|
if (ext && extPriority) {
|
|
2724
3313
|
if (!isNullOrUndefined(extPriorities[extPriority])) {
|
|
2725
3314
|
_warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier);
|
|
@@ -2729,13 +3318,14 @@
|
|
|
2729
3318
|
}
|
|
2730
3319
|
}
|
|
2731
3320
|
if (!extPriority || extPriority < channelPriority) {
|
|
2732
|
-
coreExtensions
|
|
3321
|
+
coreExtensions[_DYN_PUSH ](ext);
|
|
2733
3322
|
}
|
|
2734
3323
|
});
|
|
2735
|
-
return {
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
3324
|
+
return _a = {
|
|
3325
|
+
all: allExtensions
|
|
3326
|
+
},
|
|
3327
|
+
_a[STR_CORE ] = coreExtensions,
|
|
3328
|
+
_a;
|
|
2739
3329
|
}
|
|
2740
3330
|
function _isPluginPresent(thePlugin, plugins) {
|
|
2741
3331
|
var exists = false;
|
|
@@ -2750,15 +3340,16 @@
|
|
|
2750
3340
|
function _createDummyNotificationManager() {
|
|
2751
3341
|
var _a;
|
|
2752
3342
|
return objCreateFn((_a = {},
|
|
2753
|
-
_a[
|
|
2754
|
-
_a[
|
|
2755
|
-
_a[
|
|
2756
|
-
_a[
|
|
2757
|
-
_a[
|
|
3343
|
+
_a[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) { },
|
|
3344
|
+
_a[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) { },
|
|
3345
|
+
_a[STR_EVENTS_SENT ] = function (events) { },
|
|
3346
|
+
_a[STR_EVENTS_DISCARDED ] = function (events, reason) { },
|
|
3347
|
+
_a[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) { },
|
|
2758
3348
|
_a));
|
|
2759
3349
|
}
|
|
2760
3350
|
var BaseCore$2 = /** @class */ (function () {
|
|
2761
3351
|
function BaseCore() {
|
|
3352
|
+
var _config;
|
|
2762
3353
|
var _isInitialized;
|
|
2763
3354
|
var _eventQueue;
|
|
2764
3355
|
var _notificationManager;
|
|
@@ -2777,36 +3368,38 @@
|
|
|
2777
3368
|
var _evtNamespace;
|
|
2778
3369
|
var _unloadHandlers;
|
|
2779
3370
|
var _debugListener;
|
|
3371
|
+
var _traceCtx;
|
|
2780
3372
|
var _internalLogPoller = 0;
|
|
2781
3373
|
dynamicProto(BaseCore, this, function (_self) {
|
|
2782
3374
|
_initDefaults();
|
|
2783
|
-
_self
|
|
2784
|
-
_self
|
|
3375
|
+
_self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; };
|
|
3376
|
+
_self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) {
|
|
2785
3377
|
if (_isUnloading) {
|
|
2786
3378
|
throwError(strSdkUnloadingError);
|
|
2787
3379
|
}
|
|
2788
|
-
if (_self
|
|
3380
|
+
if (_self[_DYN_IS_INITIALIZED ]()) {
|
|
2789
3381
|
throwError("Core should not be initialized more than once");
|
|
2790
3382
|
}
|
|
2791
|
-
|
|
3383
|
+
_config = config || {};
|
|
3384
|
+
_self[_DYN_CONFIG ] = _config;
|
|
3385
|
+
if (isNullOrUndefined(config[_DYN_INSTRUMENTATION_KEY ])) {
|
|
2792
3386
|
throwError("Please provide instrumentation key");
|
|
2793
3387
|
}
|
|
2794
3388
|
_notificationManager = notificationManager;
|
|
2795
3389
|
_self[strNotificationManager] = notificationManager;
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions;
|
|
2800
|
-
_initExtConfig(config);
|
|
3390
|
+
_initDebugListener();
|
|
3391
|
+
_initPerfManager();
|
|
3392
|
+
_initExtConfig();
|
|
2801
3393
|
if (logger) {
|
|
2802
|
-
_self
|
|
3394
|
+
_self[_DYN_LOGGER ] = logger;
|
|
2803
3395
|
}
|
|
3396
|
+
var cfgExtensions = getSetValue(_config, STR_EXTENSIONS, []);
|
|
2804
3397
|
_configExtensions = [];
|
|
2805
|
-
_configExtensions.
|
|
2806
|
-
_channelConfig = (
|
|
2807
|
-
_initPluginChain(
|
|
2808
|
-
if (!_channelQueue || _channelQueue
|
|
2809
|
-
throwError("No
|
|
3398
|
+
_configExtensions[_DYN_PUSH ].apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), cfgExtensions));
|
|
3399
|
+
_channelConfig = getSetValue(_config, STR_CHANNELS, []);
|
|
3400
|
+
_initPluginChain(null);
|
|
3401
|
+
if (!_channelQueue || _channelQueue[_DYN_LENGTH ] === 0) {
|
|
3402
|
+
throwError("No " + STR_CHANNELS + " available");
|
|
2810
3403
|
}
|
|
2811
3404
|
_isInitialized = true;
|
|
2812
3405
|
_self.releaseQueue();
|
|
@@ -2815,53 +3408,56 @@
|
|
|
2815
3408
|
var controls = [];
|
|
2816
3409
|
if (_channelQueue) {
|
|
2817
3410
|
arrForEach(_channelQueue, function (channels) {
|
|
2818
|
-
controls
|
|
3411
|
+
controls[_DYN_PUSH ](channels.queue);
|
|
2819
3412
|
});
|
|
2820
3413
|
}
|
|
2821
3414
|
return objFreeze(controls);
|
|
2822
3415
|
};
|
|
2823
3416
|
_self.track = function (telemetryItem) {
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
if (!_isUnloading && _self
|
|
2828
|
-
_createTelCtx()
|
|
3417
|
+
telemetryItem.iKey = telemetryItem.iKey || _config[_DYN_INSTRUMENTATION_KEY ];
|
|
3418
|
+
telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date());
|
|
3419
|
+
telemetryItem.ver = telemetryItem.ver || "4.0";
|
|
3420
|
+
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) {
|
|
3421
|
+
_createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem);
|
|
2829
3422
|
}
|
|
2830
3423
|
else {
|
|
2831
|
-
_eventQueue
|
|
3424
|
+
_eventQueue[_DYN_PUSH ](telemetryItem);
|
|
2832
3425
|
}
|
|
2833
3426
|
};
|
|
2834
|
-
_self
|
|
2835
|
-
_self
|
|
3427
|
+
_self[_DYN_GET_PROCESS_TEL_CONT0 ] = _createTelCtx;
|
|
3428
|
+
_self[_DYN_GET_NOTIFY_MGR ] = function () {
|
|
2836
3429
|
if (!_notificationManager) {
|
|
2837
3430
|
_notificationManager = _createDummyNotificationManager();
|
|
2838
3431
|
_self[strNotificationManager] = _notificationManager;
|
|
2839
3432
|
}
|
|
2840
3433
|
return _notificationManager;
|
|
2841
3434
|
};
|
|
2842
|
-
_self[
|
|
3435
|
+
_self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
|
|
2843
3436
|
if (_notificationManager) {
|
|
2844
|
-
_notificationManager[
|
|
3437
|
+
_notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](listener);
|
|
2845
3438
|
}
|
|
2846
3439
|
};
|
|
2847
|
-
_self[
|
|
3440
|
+
_self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) {
|
|
2848
3441
|
if (_notificationManager) {
|
|
2849
|
-
_notificationManager[
|
|
3442
|
+
_notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](listener);
|
|
2850
3443
|
}
|
|
2851
3444
|
};
|
|
2852
3445
|
_self.getCookieMgr = function () {
|
|
2853
3446
|
if (!_cookieManager) {
|
|
2854
|
-
_cookieManager = createCookieMgr(
|
|
3447
|
+
_cookieManager = createCookieMgr(_config, _self[_DYN_LOGGER ]);
|
|
2855
3448
|
}
|
|
2856
3449
|
return _cookieManager;
|
|
2857
3450
|
};
|
|
2858
3451
|
_self.setCookieMgr = function (cookieMgr) {
|
|
2859
3452
|
_cookieManager = cookieMgr;
|
|
2860
3453
|
};
|
|
2861
|
-
_self
|
|
3454
|
+
_self[STR_GET_PERF_MGR ] = function () {
|
|
2862
3455
|
if (!_perfManager && !_cfgPerfManager) {
|
|
2863
|
-
if (
|
|
2864
|
-
|
|
3456
|
+
if (getCfgValue(_config.enablePerfMgr)) {
|
|
3457
|
+
var createPerfMgr = getCfgValue(_config[STR_CREATE_PERF_MGR ]);
|
|
3458
|
+
if (isFunction(createPerfMgr)) {
|
|
3459
|
+
_cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]());
|
|
3460
|
+
}
|
|
2865
3461
|
}
|
|
2866
3462
|
}
|
|
2867
3463
|
return _perfManager || _cfgPerfManager || getGblPerfMgr();
|
|
@@ -2870,20 +3466,20 @@
|
|
|
2870
3466
|
_perfManager = perfMgr;
|
|
2871
3467
|
};
|
|
2872
3468
|
_self.eventCnt = function () {
|
|
2873
|
-
return _eventQueue
|
|
3469
|
+
return _eventQueue[_DYN_LENGTH ];
|
|
2874
3470
|
};
|
|
2875
3471
|
_self.releaseQueue = function () {
|
|
2876
|
-
if (_isInitialized && _eventQueue
|
|
3472
|
+
if (_isInitialized && _eventQueue[_DYN_LENGTH ] > 0) {
|
|
2877
3473
|
var eventQueue = _eventQueue;
|
|
2878
3474
|
_eventQueue = [];
|
|
2879
3475
|
arrForEach(eventQueue, function (event) {
|
|
2880
|
-
_createTelCtx()
|
|
3476
|
+
_createTelCtx()[_DYN_PROCESS_NEXT ](event);
|
|
2881
3477
|
});
|
|
2882
3478
|
}
|
|
2883
3479
|
};
|
|
2884
3480
|
_self.pollInternalLogs = function (eventName) {
|
|
2885
3481
|
_internalLogsEventName = eventName || null;
|
|
2886
|
-
var interval =
|
|
3482
|
+
var interval = getCfgValue(_config.diagnosticLogInterval);
|
|
2887
3483
|
if (!interval || !(interval > 0)) {
|
|
2888
3484
|
interval = 10000;
|
|
2889
3485
|
}
|
|
@@ -2895,7 +3491,7 @@
|
|
|
2895
3491
|
}, interval);
|
|
2896
3492
|
return _internalLogPoller;
|
|
2897
3493
|
};
|
|
2898
|
-
_self
|
|
3494
|
+
_self[_DYN_STOP_POLLING_INTERNA3 ] = function () {
|
|
2899
3495
|
if (_internalLogPoller) {
|
|
2900
3496
|
clearInterval(_internalLogPoller);
|
|
2901
3497
|
_internalLogPoller = 0;
|
|
@@ -2904,6 +3500,7 @@
|
|
|
2904
3500
|
};
|
|
2905
3501
|
proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]);
|
|
2906
3502
|
_self.unload = function (isAsync, unloadComplete, cbTimeout) {
|
|
3503
|
+
var _a;
|
|
2907
3504
|
if (isAsync === void 0) { isAsync = true; }
|
|
2908
3505
|
if (!_isInitialized) {
|
|
2909
3506
|
throwError(strSdkNotInitialized);
|
|
@@ -2911,13 +3508,14 @@
|
|
|
2911
3508
|
if (_isUnloading) {
|
|
2912
3509
|
throwError(strSdkUnloadingError);
|
|
2913
3510
|
}
|
|
2914
|
-
var unloadState = {
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
3511
|
+
var unloadState = (_a = {
|
|
3512
|
+
reason: 50
|
|
3513
|
+
},
|
|
3514
|
+
_a[_DYN_IS_ASYNC ] = isAsync,
|
|
3515
|
+
_a.flushComplete = false,
|
|
3516
|
+
_a);
|
|
2919
3517
|
var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self);
|
|
2920
|
-
processUnloadCtx
|
|
3518
|
+
processUnloadCtx[_DYN_ON_COMPLETE ](function () {
|
|
2921
3519
|
_initDefaults();
|
|
2922
3520
|
unloadComplete && unloadComplete(unloadState);
|
|
2923
3521
|
}, _self);
|
|
@@ -2925,33 +3523,33 @@
|
|
|
2925
3523
|
unloadState.flushComplete = flushComplete;
|
|
2926
3524
|
_isUnloading = true;
|
|
2927
3525
|
_unloadHandlers.run(processUnloadCtx, unloadState);
|
|
2928
|
-
_self
|
|
2929
|
-
processUnloadCtx
|
|
3526
|
+
_self[_DYN_STOP_POLLING_INTERNA3 ]();
|
|
3527
|
+
processUnloadCtx[_DYN_PROCESS_NEXT ](unloadState);
|
|
2930
3528
|
}
|
|
2931
3529
|
if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) {
|
|
2932
3530
|
_doUnload(false);
|
|
2933
3531
|
}
|
|
2934
3532
|
};
|
|
2935
|
-
_self
|
|
3533
|
+
_self[_DYN_GET_PLUGIN ] = _getPlugin;
|
|
2936
3534
|
_self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) {
|
|
2937
3535
|
if (!plugin) {
|
|
2938
3536
|
addCb && addCb(false);
|
|
2939
3537
|
_logOrThrowError(strValidationError);
|
|
2940
3538
|
return;
|
|
2941
3539
|
}
|
|
2942
|
-
var existingPlugin = _getPlugin(plugin
|
|
3540
|
+
var existingPlugin = _getPlugin(plugin[_DYN_IDENTIFIER ]);
|
|
2943
3541
|
if (existingPlugin && !replaceExisting) {
|
|
2944
3542
|
addCb && addCb(false);
|
|
2945
|
-
_logOrThrowError("Plugin [" + plugin
|
|
3543
|
+
_logOrThrowError("Plugin [" + plugin[_DYN_IDENTIFIER ] + "] is already loaded!");
|
|
2946
3544
|
return;
|
|
2947
3545
|
}
|
|
2948
3546
|
var updateState = {
|
|
2949
3547
|
reason: 16
|
|
2950
3548
|
};
|
|
2951
3549
|
function _addPlugin(removed) {
|
|
2952
|
-
_configExtensions
|
|
3550
|
+
_configExtensions[_DYN_PUSH ](plugin);
|
|
2953
3551
|
updateState.added = [plugin];
|
|
2954
|
-
_initPluginChain(
|
|
3552
|
+
_initPluginChain(updateState);
|
|
2955
3553
|
addCb && addCb(true);
|
|
2956
3554
|
}
|
|
2957
3555
|
if (existingPlugin) {
|
|
@@ -2978,13 +3576,23 @@
|
|
|
2978
3576
|
_self.evtNamespace = function () {
|
|
2979
3577
|
return _evtNamespace;
|
|
2980
3578
|
};
|
|
2981
|
-
_self
|
|
3579
|
+
_self[_DYN_FLUSH ] = _flushChannels;
|
|
3580
|
+
_self.getTraceCtx = function (createNew) {
|
|
3581
|
+
if (!_traceCtx) {
|
|
3582
|
+
_traceCtx = createDistributedTraceContext();
|
|
3583
|
+
}
|
|
3584
|
+
return _traceCtx;
|
|
3585
|
+
};
|
|
3586
|
+
_self.setTraceCtx = function (traceCtx) {
|
|
3587
|
+
_traceCtx = traceCtx || null;
|
|
3588
|
+
};
|
|
2982
3589
|
proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add");
|
|
2983
3590
|
function _initDefaults() {
|
|
2984
3591
|
_isInitialized = false;
|
|
2985
|
-
|
|
2986
|
-
_self
|
|
2987
|
-
_self
|
|
3592
|
+
_config = objExtend(true, {}, defaultInitConfig);
|
|
3593
|
+
_self[_DYN_CONFIG ] = _config;
|
|
3594
|
+
_self[_DYN_LOGGER ] = new DiagnosticLogger(_config);
|
|
3595
|
+
_self[_DYN__EXTENSIONS ] = [];
|
|
2988
3596
|
_telemetryInitializerPlugin = new TelemetryInitializerPlugin();
|
|
2989
3597
|
_eventQueue = [];
|
|
2990
3598
|
_notificationManager = null;
|
|
@@ -3001,45 +3609,47 @@
|
|
|
3001
3609
|
_internalLogsEventName = null;
|
|
3002
3610
|
_evtNamespace = createUniqueNamespace("AIBaseCore", true);
|
|
3003
3611
|
_unloadHandlers = createUnloadHandlerContainer();
|
|
3612
|
+
_traceCtx = null;
|
|
3004
3613
|
}
|
|
3005
3614
|
function _createTelCtx() {
|
|
3006
|
-
return createProcessTelemetryContext(_getPluginChain(),
|
|
3615
|
+
return createProcessTelemetryContext(_getPluginChain(), _config, _self);
|
|
3007
3616
|
}
|
|
3008
|
-
function _initPluginChain(
|
|
3009
|
-
var theExtensions = _validateExtensions(_self
|
|
3010
|
-
_coreExtensions = theExtensions
|
|
3617
|
+
function _initPluginChain(updateState) {
|
|
3618
|
+
var theExtensions = _validateExtensions(_self[_DYN_LOGGER ], ChannelControllerPriority, _configExtensions);
|
|
3619
|
+
_coreExtensions = theExtensions[STR_CORE ];
|
|
3011
3620
|
_pluginChain = null;
|
|
3012
3621
|
var allExtensions = theExtensions.all;
|
|
3013
|
-
_channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions,
|
|
3622
|
+
_channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, _self));
|
|
3014
3623
|
if (_channelControl) {
|
|
3015
3624
|
var idx = arrIndexOf(allExtensions, _channelControl);
|
|
3016
3625
|
if (idx !== -1) {
|
|
3017
|
-
allExtensions
|
|
3626
|
+
allExtensions[_DYN_SPLICE ](idx, 1);
|
|
3018
3627
|
}
|
|
3019
3628
|
idx = arrIndexOf(_coreExtensions, _channelControl);
|
|
3020
3629
|
if (idx !== -1) {
|
|
3021
|
-
_coreExtensions
|
|
3630
|
+
_coreExtensions[_DYN_SPLICE ](idx, 1);
|
|
3022
3631
|
}
|
|
3023
3632
|
_channelControl._setQueue(_channelQueue);
|
|
3024
3633
|
}
|
|
3025
3634
|
else {
|
|
3026
3635
|
_channelControl = createChannelControllerPlugin(_channelQueue, _self);
|
|
3027
3636
|
}
|
|
3028
|
-
allExtensions
|
|
3029
|
-
_coreExtensions
|
|
3030
|
-
_self
|
|
3031
|
-
_channelControl
|
|
3637
|
+
allExtensions[_DYN_PUSH ](_channelControl);
|
|
3638
|
+
_coreExtensions[_DYN_PUSH ](_channelControl);
|
|
3639
|
+
_self[_DYN__EXTENSIONS ] = sortPlugins(allExtensions);
|
|
3640
|
+
_channelControl[_DYN_INITIALIZE ](_config, _self, allExtensions);
|
|
3032
3641
|
initializePlugins(_createTelCtx(), allExtensions);
|
|
3033
|
-
_self
|
|
3642
|
+
_self[_DYN__EXTENSIONS ] = objFreeze(sortPlugins(_coreExtensions || [])).slice();
|
|
3034
3643
|
if (updateState) {
|
|
3035
3644
|
_doUpdate(updateState);
|
|
3036
3645
|
}
|
|
3037
3646
|
}
|
|
3038
3647
|
function _getPlugin(pluginIdentifier) {
|
|
3648
|
+
var _a;
|
|
3039
3649
|
var theExt = null;
|
|
3040
3650
|
var thePlugin = null;
|
|
3041
|
-
arrForEach(_self
|
|
3042
|
-
if (ext
|
|
3651
|
+
arrForEach(_self[_DYN__EXTENSIONS ], function (ext) {
|
|
3652
|
+
if (ext[_DYN_IDENTIFIER ] === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) {
|
|
3043
3653
|
thePlugin = ext;
|
|
3044
3654
|
return -1;
|
|
3045
3655
|
}
|
|
@@ -3048,33 +3658,36 @@
|
|
|
3048
3658
|
thePlugin = _channelControl.getChannel(pluginIdentifier);
|
|
3049
3659
|
}
|
|
3050
3660
|
if (thePlugin) {
|
|
3051
|
-
theExt = {
|
|
3052
|
-
|
|
3053
|
-
setEnabled: function (enabled) {
|
|
3054
|
-
_getPluginState(thePlugin)[strDisabled] = !enabled;
|
|
3661
|
+
theExt = (_a = {
|
|
3662
|
+
plugin: thePlugin
|
|
3055
3663
|
},
|
|
3056
|
-
|
|
3664
|
+
_a[_DYN_SET_ENABLED ] = function (enabled) {
|
|
3665
|
+
_getPluginState(thePlugin)[STR_DISABLED] = !enabled;
|
|
3666
|
+
},
|
|
3667
|
+
_a.isEnabled = function () {
|
|
3057
3668
|
var pluginState = _getPluginState(thePlugin);
|
|
3058
|
-
return !pluginState[
|
|
3669
|
+
return !pluginState[_DYN_TEARDOWN ] && !pluginState[STR_DISABLED];
|
|
3059
3670
|
},
|
|
3060
|
-
remove
|
|
3671
|
+
_a.remove = function (isAsync, removeCb) {
|
|
3672
|
+
var _a;
|
|
3061
3673
|
if (isAsync === void 0) { isAsync = true; }
|
|
3062
3674
|
var pluginsToRemove = [thePlugin];
|
|
3063
|
-
var unloadState = {
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3675
|
+
var unloadState = (_a = {
|
|
3676
|
+
reason: 1
|
|
3677
|
+
},
|
|
3678
|
+
_a[_DYN_IS_ASYNC ] = isAsync,
|
|
3679
|
+
_a);
|
|
3067
3680
|
_removePlugins(pluginsToRemove, unloadState, function (removed) {
|
|
3068
3681
|
if (removed) {
|
|
3069
|
-
_initPluginChain(
|
|
3682
|
+
_initPluginChain({
|
|
3070
3683
|
reason: 32 ,
|
|
3071
3684
|
removed: pluginsToRemove
|
|
3072
3685
|
});
|
|
3073
3686
|
}
|
|
3074
3687
|
removeCb && removeCb(removed);
|
|
3075
3688
|
});
|
|
3076
|
-
}
|
|
3077
|
-
|
|
3689
|
+
},
|
|
3690
|
+
_a);
|
|
3078
3691
|
}
|
|
3079
3692
|
return theExt;
|
|
3080
3693
|
}
|
|
@@ -3082,22 +3695,22 @@
|
|
|
3082
3695
|
if (!_pluginChain) {
|
|
3083
3696
|
var extensions = (_coreExtensions || []).slice();
|
|
3084
3697
|
if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {
|
|
3085
|
-
extensions
|
|
3698
|
+
extensions[_DYN_PUSH ](_telemetryInitializerPlugin);
|
|
3086
3699
|
}
|
|
3087
|
-
_pluginChain = createTelemetryProxyChain(sortPlugins(extensions),
|
|
3700
|
+
_pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _config, _self);
|
|
3088
3701
|
}
|
|
3089
3702
|
return _pluginChain;
|
|
3090
3703
|
}
|
|
3091
3704
|
function _removePlugins(thePlugins, unloadState, removeComplete) {
|
|
3092
|
-
if (thePlugins && thePlugins
|
|
3093
|
-
var unloadChain = createTelemetryProxyChain(thePlugins,
|
|
3705
|
+
if (thePlugins && thePlugins[_DYN_LENGTH ] > 0) {
|
|
3706
|
+
var unloadChain = createTelemetryProxyChain(thePlugins, _config, _self);
|
|
3094
3707
|
var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self);
|
|
3095
|
-
unloadCtx
|
|
3708
|
+
unloadCtx[_DYN_ON_COMPLETE ](function () {
|
|
3096
3709
|
var removed = false;
|
|
3097
3710
|
var newConfigExtensions = [];
|
|
3098
3711
|
arrForEach(_configExtensions, function (plugin, idx) {
|
|
3099
3712
|
if (!_isPluginPresent(plugin, thePlugins)) {
|
|
3100
|
-
newConfigExtensions
|
|
3713
|
+
newConfigExtensions[_DYN_PUSH ](plugin);
|
|
3101
3714
|
}
|
|
3102
3715
|
else {
|
|
3103
3716
|
removed = true;
|
|
@@ -3110,626 +3723,301 @@
|
|
|
3110
3723
|
var newQueue = [];
|
|
3111
3724
|
arrForEach(queue, function (channel) {
|
|
3112
3725
|
if (!_isPluginPresent(channel, thePlugins)) {
|
|
3113
|
-
newQueue
|
|
3726
|
+
newQueue[_DYN_PUSH ](channel);
|
|
3114
3727
|
}
|
|
3115
3728
|
else {
|
|
3116
3729
|
removed = true;
|
|
3117
3730
|
}
|
|
3118
3731
|
});
|
|
3119
|
-
newChannelConfig
|
|
3732
|
+
newChannelConfig[_DYN_PUSH ](newQueue);
|
|
3120
3733
|
});
|
|
3121
3734
|
_channelConfig = newChannelConfig;
|
|
3122
3735
|
}
|
|
3123
3736
|
removeComplete && removeComplete(removed);
|
|
3124
3737
|
});
|
|
3125
|
-
unloadCtx
|
|
3738
|
+
unloadCtx[_DYN_PROCESS_NEXT ](unloadState);
|
|
3126
3739
|
}
|
|
3127
3740
|
else {
|
|
3128
3741
|
removeComplete(false);
|
|
3129
3742
|
}
|
|
3130
3743
|
}
|
|
3131
3744
|
function _flushInternalLogs() {
|
|
3132
|
-
var queue = _self
|
|
3745
|
+
var queue = _self[_DYN_LOGGER ] ? _self[_DYN_LOGGER ].queue : [];
|
|
3133
3746
|
if (queue) {
|
|
3134
3747
|
arrForEach(queue, function (logMessage) {
|
|
3135
|
-
var
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3748
|
+
var _a;
|
|
3749
|
+
var item = (_a = {},
|
|
3750
|
+
_a[_DYN_NAME ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ],
|
|
3751
|
+
_a.iKey = getCfgValue(_config[_DYN_INSTRUMENTATION_KEY ]),
|
|
3752
|
+
_a.time = toISOString(new Date()),
|
|
3753
|
+
_a.baseType = _InternalLogMessage.dataType,
|
|
3754
|
+
_a.baseData = { message: logMessage[_DYN_MESSAGE ] },
|
|
3755
|
+
_a);
|
|
3142
3756
|
_self.track(item);
|
|
3143
3757
|
});
|
|
3144
|
-
queue
|
|
3758
|
+
queue[_DYN_LENGTH ] = 0;
|
|
3145
3759
|
}
|
|
3146
3760
|
}
|
|
3147
3761
|
function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {
|
|
3148
3762
|
if (_channelControl) {
|
|
3149
|
-
return _channelControl
|
|
3150
|
-
}
|
|
3151
|
-
callBack && callBack(false);
|
|
3152
|
-
return true;
|
|
3153
|
-
}
|
|
3154
|
-
function _initDebugListener(config) {
|
|
3155
|
-
if (config.disableDbgExt === true && _debugListener) {
|
|
3156
|
-
_notificationManager[strRemoveNotificationListener](_debugListener);
|
|
3157
|
-
_debugListener = null;
|
|
3158
|
-
}
|
|
3159
|
-
if (_notificationManager && !_debugListener && config.disableDbgExt !== true) {
|
|
3160
|
-
_debugListener = getDebugListener(config);
|
|
3161
|
-
_notificationManager[strAddNotificationListener](_debugListener);
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
function _initPerfManager(config) {
|
|
3165
|
-
if (!config.enablePerfMgr && _cfgPerfManager) {
|
|
3166
|
-
_cfgPerfManager = null;
|
|
3167
|
-
}
|
|
3168
|
-
if (config.enablePerfMgr) {
|
|
3169
|
-
setValue(_self.config, "createPerfMgr", _createPerfManager);
|
|
3170
|
-
}
|
|
3171
|
-
}
|
|
3172
|
-
function _initExtConfig(config) {
|
|
3173
|
-
var extConfig = getSetValue(config, strExtensionConfig);
|
|
3174
|
-
extConfig.NotificationManager = _notificationManager;
|
|
3175
|
-
}
|
|
3176
|
-
function _doUpdate(updateState) {
|
|
3177
|
-
var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self);
|
|
3178
|
-
if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) {
|
|
3179
|
-
updateCtx.processNext(updateState);
|
|
3180
|
-
}
|
|
3181
|
-
}
|
|
3182
|
-
function _logOrThrowError(message) {
|
|
3183
|
-
var logger = _self.logger;
|
|
3184
|
-
if (logger) {
|
|
3185
|
-
_throwInternal(logger, 2 , 73 , message);
|
|
3186
|
-
}
|
|
3187
|
-
else {
|
|
3188
|
-
throwError(message);
|
|
3189
|
-
}
|
|
3190
|
-
}
|
|
3191
|
-
});
|
|
3192
|
-
}
|
|
3193
|
-
return BaseCore;
|
|
3194
|
-
}());
|
|
3195
|
-
|
|
3196
|
-
function _runListeners(listeners, name, isAsync, callback) {
|
|
3197
|
-
arrForEach(listeners, function (listener) {
|
|
3198
|
-
if (listener && listener[name]) {
|
|
3199
|
-
if (isAsync) {
|
|
3200
|
-
setTimeout(function () { return callback(listener); }, 0);
|
|
3201
|
-
}
|
|
3202
|
-
else {
|
|
3203
|
-
try {
|
|
3204
|
-
callback(listener);
|
|
3205
|
-
}
|
|
3206
|
-
catch (e) {
|
|
3207
|
-
}
|
|
3208
|
-
}
|
|
3209
|
-
}
|
|
3210
|
-
});
|
|
3211
|
-
}
|
|
3212
|
-
var NotificationManager = /** @class */ (function () {
|
|
3213
|
-
function NotificationManager(config) {
|
|
3214
|
-
this.listeners = [];
|
|
3215
|
-
var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll;
|
|
3216
|
-
dynamicProto(NotificationManager, this, function (_self) {
|
|
3217
|
-
_self[strAddNotificationListener] = function (listener) {
|
|
3218
|
-
_self.listeners.push(listener);
|
|
3219
|
-
};
|
|
3220
|
-
_self[strRemoveNotificationListener] = function (listener) {
|
|
3221
|
-
var index = arrIndexOf(_self.listeners, listener);
|
|
3222
|
-
while (index > -1) {
|
|
3223
|
-
_self.listeners.splice(index, 1);
|
|
3224
|
-
index = arrIndexOf(_self.listeners, listener);
|
|
3225
|
-
}
|
|
3226
|
-
};
|
|
3227
|
-
_self[strEventsSent] = function (events) {
|
|
3228
|
-
_runListeners(_self.listeners, strEventsSent, true, function (listener) {
|
|
3229
|
-
listener[strEventsSent](events);
|
|
3230
|
-
});
|
|
3231
|
-
};
|
|
3232
|
-
_self[strEventsDiscarded] = function (events, reason) {
|
|
3233
|
-
_runListeners(_self.listeners, strEventsDiscarded, true, function (listener) {
|
|
3234
|
-
listener[strEventsDiscarded](events, reason);
|
|
3235
|
-
});
|
|
3236
|
-
};
|
|
3237
|
-
_self[strEventsSendRequest] = function (sendReason, isAsync) {
|
|
3238
|
-
_runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) {
|
|
3239
|
-
listener[strEventsSendRequest](sendReason, isAsync);
|
|
3240
|
-
});
|
|
3241
|
-
};
|
|
3242
|
-
_self[strPerfEvent] = function (perfEvent) {
|
|
3243
|
-
if (perfEvent) {
|
|
3244
|
-
if (perfEvtsSendAll || !perfEvent.isChildEvt()) {
|
|
3245
|
-
_runListeners(_self.listeners, strPerfEvent, false, function (listener) {
|
|
3246
|
-
if (perfEvent.isAsync) {
|
|
3247
|
-
setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0);
|
|
3248
|
-
}
|
|
3249
|
-
else {
|
|
3250
|
-
listener[strPerfEvent](perfEvent);
|
|
3251
|
-
}
|
|
3252
|
-
});
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
};
|
|
3256
|
-
});
|
|
3257
|
-
}
|
|
3258
|
-
return NotificationManager;
|
|
3259
|
-
}());
|
|
3260
|
-
|
|
3261
|
-
var AppInsightsCore$2 = /** @class */ (function (_super) {
|
|
3262
|
-
__extendsFn(AppInsightsCore, _super);
|
|
3263
|
-
function AppInsightsCore() {
|
|
3264
|
-
var _this = _super.call(this) || this;
|
|
3265
|
-
dynamicProto(AppInsightsCore, _this, function (_self, _base) {
|
|
3266
|
-
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
3267
|
-
_base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config));
|
|
3268
|
-
};
|
|
3269
|
-
_self.track = function (telemetryItem) {
|
|
3270
|
-
doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () {
|
|
3271
|
-
if (telemetryItem === null) {
|
|
3272
|
-
_notifyInvalidEvent(telemetryItem);
|
|
3273
|
-
throwError("Invalid telemetry item");
|
|
3274
|
-
}
|
|
3275
|
-
_validateTelemetryItem(telemetryItem);
|
|
3276
|
-
_base.track(telemetryItem);
|
|
3277
|
-
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
3278
|
-
};
|
|
3279
|
-
function _validateTelemetryItem(telemetryItem) {
|
|
3280
|
-
if (isNullOrUndefined(telemetryItem.name)) {
|
|
3281
|
-
_notifyInvalidEvent(telemetryItem);
|
|
3282
|
-
throwError("telemetry name required");
|
|
3283
|
-
}
|
|
3284
|
-
}
|
|
3285
|
-
function _notifyInvalidEvent(telemetryItem) {
|
|
3286
|
-
var manager = _self.getNotifyMgr();
|
|
3287
|
-
if (manager) {
|
|
3288
|
-
manager.eventsDiscarded([telemetryItem], 2 );
|
|
3289
|
-
}
|
|
3290
|
-
}
|
|
3291
|
-
});
|
|
3292
|
-
return _this;
|
|
3293
|
-
}
|
|
3294
|
-
return AppInsightsCore;
|
|
3295
|
-
}(BaseCore$2));
|
|
3296
|
-
|
|
3297
|
-
var strOnPrefix = "on";
|
|
3298
|
-
var strAttachEvent = "attachEvent";
|
|
3299
|
-
var strAddEventHelper = "addEventListener";
|
|
3300
|
-
var strDetachEvent = "detachEvent";
|
|
3301
|
-
var strRemoveEventListener = "removeEventListener";
|
|
3302
|
-
var strEvents = "events";
|
|
3303
|
-
var strVisibilityChangeEvt = "visibilitychange";
|
|
3304
|
-
var strPageHide = "pagehide";
|
|
3305
|
-
var strPageShow = "pageshow";
|
|
3306
|
-
var strUnload = "unload";
|
|
3307
|
-
var strBeforeUnload = "beforeunload";
|
|
3308
|
-
var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide");
|
|
3309
|
-
var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow");
|
|
3310
|
-
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
3311
|
-
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
3312
|
-
var _guid = 1;
|
|
3313
|
-
var elmNodeData = createElmNodeData("events");
|
|
3314
|
-
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
3315
|
-
function _normalizeNamespace(name) {
|
|
3316
|
-
if (name && name.replace) {
|
|
3317
|
-
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
3318
|
-
}
|
|
3319
|
-
return name;
|
|
3320
|
-
}
|
|
3321
|
-
function _getEvtNamespace(eventName, evtNamespace) {
|
|
3322
|
-
if (evtNamespace) {
|
|
3323
|
-
var theNamespace_1 = "";
|
|
3324
|
-
if (isArray(evtNamespace)) {
|
|
3325
|
-
theNamespace_1 = "";
|
|
3326
|
-
arrForEach(evtNamespace, function (name) {
|
|
3327
|
-
name = _normalizeNamespace(name);
|
|
3328
|
-
if (name) {
|
|
3329
|
-
if (name[0] !== ".") {
|
|
3330
|
-
name = "." + name;
|
|
3331
|
-
}
|
|
3332
|
-
theNamespace_1 += name;
|
|
3333
|
-
}
|
|
3334
|
-
});
|
|
3335
|
-
}
|
|
3336
|
-
else {
|
|
3337
|
-
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
3338
|
-
}
|
|
3339
|
-
if (theNamespace_1) {
|
|
3340
|
-
if (theNamespace_1[0] !== ".") {
|
|
3341
|
-
theNamespace_1 = "." + theNamespace_1;
|
|
3342
|
-
}
|
|
3343
|
-
eventName = (eventName || "") + theNamespace_1;
|
|
3344
|
-
}
|
|
3345
|
-
}
|
|
3346
|
-
var parsedEvent = (eventNamespace.exec(eventName || "") || []);
|
|
3347
|
-
return {
|
|
3348
|
-
type: parsedEvent[1],
|
|
3349
|
-
ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
|
|
3350
|
-
};
|
|
3351
|
-
}
|
|
3352
|
-
function __getRegisteredEvents(target, eventName, evtNamespace) {
|
|
3353
|
-
var theEvents = [];
|
|
3354
|
-
var eventCache = elmNodeData.get(target, strEvents, {}, false);
|
|
3355
|
-
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
3356
|
-
objForEachKey(eventCache, function (evtType, registeredEvents) {
|
|
3357
|
-
arrForEach(registeredEvents, function (value) {
|
|
3358
|
-
if (!evtName.type || evtName.type === value.evtName.type) {
|
|
3359
|
-
if (!evtName.ns || evtName.ns === evtName.ns) {
|
|
3360
|
-
theEvents.push({
|
|
3361
|
-
name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""),
|
|
3362
|
-
handler: value.handler
|
|
3363
|
-
});
|
|
3364
|
-
}
|
|
3365
|
-
}
|
|
3366
|
-
});
|
|
3367
|
-
});
|
|
3368
|
-
return theEvents;
|
|
3369
|
-
}
|
|
3370
|
-
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
3371
|
-
if (addDefault === void 0) { addDefault = true; }
|
|
3372
|
-
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
3373
|
-
var registeredEvents = aiEvts[evtName];
|
|
3374
|
-
if (!registeredEvents) {
|
|
3375
|
-
registeredEvents = aiEvts[evtName] = [];
|
|
3376
|
-
}
|
|
3377
|
-
return registeredEvents;
|
|
3378
|
-
}
|
|
3379
|
-
function _doDetach(obj, evtName, handlerRef, useCapture) {
|
|
3380
|
-
if (obj && evtName && evtName.type) {
|
|
3381
|
-
if (obj[strRemoveEventListener]) {
|
|
3382
|
-
obj[strRemoveEventListener](evtName.type, handlerRef, useCapture);
|
|
3383
|
-
}
|
|
3384
|
-
else if (obj[strDetachEvent]) {
|
|
3385
|
-
obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef);
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
}
|
|
3389
|
-
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
3390
|
-
var result = false;
|
|
3391
|
-
if (obj && evtName && evtName.type && handlerRef) {
|
|
3392
|
-
if (obj[strAddEventHelper]) {
|
|
3393
|
-
obj[strAddEventHelper](evtName.type, handlerRef, useCapture);
|
|
3394
|
-
result = true;
|
|
3395
|
-
}
|
|
3396
|
-
else if (obj[strAttachEvent]) {
|
|
3397
|
-
obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef);
|
|
3398
|
-
result = true;
|
|
3399
|
-
}
|
|
3400
|
-
}
|
|
3401
|
-
return result;
|
|
3402
|
-
}
|
|
3403
|
-
function _doUnregister(target, events, evtName, unRegFn) {
|
|
3404
|
-
var idx = events.length;
|
|
3405
|
-
while (idx--) {
|
|
3406
|
-
var theEvent = events[idx];
|
|
3407
|
-
if (theEvent) {
|
|
3408
|
-
if (!evtName.ns || evtName.ns === theEvent.evtName.ns) {
|
|
3409
|
-
if (!unRegFn || unRegFn(theEvent)) {
|
|
3410
|
-
_doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture);
|
|
3411
|
-
events.splice(idx, 1);
|
|
3763
|
+
return _channelControl[_DYN_FLUSH ](isAsync, callBack, sendReason || 6 , cbTimeout);
|
|
3412
3764
|
}
|
|
3765
|
+
callBack && callBack(false);
|
|
3766
|
+
return true;
|
|
3413
3767
|
}
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
objForEachKey(eventCache, function (evtType, events) {
|
|
3424
|
-
_doUnregister(target, events, evtName, unRegFn);
|
|
3425
|
-
});
|
|
3426
|
-
if (objKeys(eventCache).length === 0) {
|
|
3427
|
-
elmNodeData.kill(target, strEvents);
|
|
3428
|
-
}
|
|
3429
|
-
}
|
|
3430
|
-
}
|
|
3431
|
-
function mergeEvtNamespace(theNamespace, namespaces) {
|
|
3432
|
-
var newNamespaces;
|
|
3433
|
-
if (namespaces) {
|
|
3434
|
-
if (isArray(namespaces)) {
|
|
3435
|
-
newNamespaces = [theNamespace].concat(namespaces);
|
|
3436
|
-
}
|
|
3437
|
-
else {
|
|
3438
|
-
newNamespaces = [theNamespace, namespaces];
|
|
3439
|
-
}
|
|
3440
|
-
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split(".");
|
|
3441
|
-
}
|
|
3442
|
-
else {
|
|
3443
|
-
newNamespaces = theNamespace;
|
|
3444
|
-
}
|
|
3445
|
-
return newNamespaces;
|
|
3446
|
-
}
|
|
3447
|
-
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
3448
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
3449
|
-
var result = false;
|
|
3450
|
-
if (target) {
|
|
3451
|
-
try {
|
|
3452
|
-
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
3453
|
-
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
3454
|
-
if (result && elmNodeData.accept(target)) {
|
|
3455
|
-
var registeredEvent = {
|
|
3456
|
-
guid: _guid++,
|
|
3457
|
-
evtName: evtName,
|
|
3458
|
-
handler: handlerRef,
|
|
3459
|
-
capture: useCapture
|
|
3460
|
-
};
|
|
3461
|
-
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
3462
|
-
}
|
|
3463
|
-
}
|
|
3464
|
-
catch (e) {
|
|
3465
|
-
}
|
|
3466
|
-
}
|
|
3467
|
-
return result;
|
|
3468
|
-
}
|
|
3469
|
-
function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
3470
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
3471
|
-
if (target) {
|
|
3472
|
-
try {
|
|
3473
|
-
var evtName_1 = _getEvtNamespace(eventName, evtNamespace);
|
|
3474
|
-
var found_1 = false;
|
|
3475
|
-
_unregisterEvents(target, evtName_1, function (regEvent) {
|
|
3476
|
-
if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) {
|
|
3477
|
-
found_1 = true;
|
|
3478
|
-
return true;
|
|
3768
|
+
function _initDebugListener() {
|
|
3769
|
+
var disableDbgExt = getCfgValue(_config.disableDbgExt);
|
|
3770
|
+
if (disableDbgExt === true && _debugListener) {
|
|
3771
|
+
_notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](_debugListener);
|
|
3772
|
+
_debugListener = null;
|
|
3773
|
+
}
|
|
3774
|
+
if (_notificationManager && !_debugListener && disableDbgExt !== true) {
|
|
3775
|
+
_debugListener = getDebugListener(_config);
|
|
3776
|
+
_notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](_debugListener);
|
|
3479
3777
|
}
|
|
3480
|
-
return false;
|
|
3481
|
-
});
|
|
3482
|
-
if (!found_1) {
|
|
3483
|
-
_doDetach(target, evtName_1, handlerRef, useCapture);
|
|
3484
3778
|
}
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
3493
|
-
}
|
|
3494
|
-
function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
3495
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
3496
|
-
eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
3497
|
-
}
|
|
3498
|
-
function addEventHandler(eventName, callback, evtNamespace) {
|
|
3499
|
-
var result = false;
|
|
3500
|
-
var w = getWindow();
|
|
3501
|
-
if (w) {
|
|
3502
|
-
result = eventOn(w, eventName, callback, evtNamespace);
|
|
3503
|
-
result = eventOn(w["body"], eventName, callback, evtNamespace) || result;
|
|
3504
|
-
}
|
|
3505
|
-
var doc = getDocument();
|
|
3506
|
-
if (doc) {
|
|
3507
|
-
result = eventOn(doc, eventName, callback, evtNamespace) || result;
|
|
3508
|
-
}
|
|
3509
|
-
return result;
|
|
3510
|
-
}
|
|
3511
|
-
function removeEventHandler(eventName, callback, evtNamespace) {
|
|
3512
|
-
var w = getWindow();
|
|
3513
|
-
if (w) {
|
|
3514
|
-
eventOff(w, eventName, callback, evtNamespace);
|
|
3515
|
-
eventOff(w["body"], eventName, callback, evtNamespace);
|
|
3516
|
-
}
|
|
3517
|
-
var doc = getDocument();
|
|
3518
|
-
if (doc) {
|
|
3519
|
-
eventOff(doc, eventName, callback, evtNamespace);
|
|
3520
|
-
}
|
|
3521
|
-
}
|
|
3522
|
-
function _addEventListeners(events, listener, excludeEvents, evtNamespace) {
|
|
3523
|
-
var added = false;
|
|
3524
|
-
if (listener && events && events.length > 0) {
|
|
3525
|
-
arrForEach(events, function (name) {
|
|
3526
|
-
if (name) {
|
|
3527
|
-
if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {
|
|
3528
|
-
added = addEventHandler(name, listener, evtNamespace) || added;
|
|
3779
|
+
function _initPerfManager() {
|
|
3780
|
+
var enablePerfMgr = getCfgValue(_config.enablePerfMgr);
|
|
3781
|
+
if (!enablePerfMgr && _cfgPerfManager) {
|
|
3782
|
+
_cfgPerfManager = null;
|
|
3783
|
+
}
|
|
3784
|
+
if (enablePerfMgr) {
|
|
3785
|
+
getSetValue(_config, STR_CREATE_PERF_MGR, _createPerfManager);
|
|
3529
3786
|
}
|
|
3530
3787
|
}
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
removeEventHandler(name, listener, evtNamespace);
|
|
3788
|
+
function _initExtConfig() {
|
|
3789
|
+
var extConfig = getSetValue(_config, STR_EXTENSION_CONFIG, {});
|
|
3790
|
+
extConfig.NotificationManager = _notificationManager;
|
|
3791
|
+
}
|
|
3792
|
+
function _doUpdate(updateState) {
|
|
3793
|
+
var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self);
|
|
3794
|
+
if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) {
|
|
3795
|
+
updateCtx[_DYN_PROCESS_NEXT ](updateState);
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3798
|
+
function _logOrThrowError(message) {
|
|
3799
|
+
var logger = _self[_DYN_LOGGER ];
|
|
3800
|
+
if (logger) {
|
|
3801
|
+
_throwInternal(logger, 2 , 73 , message);
|
|
3802
|
+
}
|
|
3803
|
+
else {
|
|
3804
|
+
throwError(message);
|
|
3805
|
+
}
|
|
3550
3806
|
}
|
|
3551
3807
|
});
|
|
3552
3808
|
}
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
}
|
|
3557
|
-
function removePageUnloadEventListener(listener, evtNamespace) {
|
|
3558
|
-
removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace);
|
|
3559
|
-
}
|
|
3560
|
-
function addPageHideEventListener(listener, excludeEvents, evtNamespace) {
|
|
3561
|
-
function _handlePageVisibility(evt) {
|
|
3562
|
-
var doc = getDocument();
|
|
3563
|
-
if (listener && doc && doc.visibilityState === "hidden") {
|
|
3564
|
-
listener(evt);
|
|
3565
|
-
}
|
|
3566
|
-
}
|
|
3567
|
-
var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);
|
|
3568
|
-
var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces);
|
|
3569
|
-
if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) {
|
|
3570
|
-
pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded;
|
|
3571
|
-
}
|
|
3572
|
-
if (!pageUnloadAdded && excludeEvents) {
|
|
3573
|
-
pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace);
|
|
3574
|
-
}
|
|
3575
|
-
return pageUnloadAdded;
|
|
3576
|
-
}
|
|
3577
|
-
function removePageHideEventListener(listener, evtNamespace) {
|
|
3578
|
-
var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace);
|
|
3579
|
-
removeEventListeners([strPageHide], listener, newNamespaces);
|
|
3580
|
-
removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);
|
|
3581
|
-
}
|
|
3582
|
-
function addPageShowEventListener(listener, excludeEvents, evtNamespace) {
|
|
3583
|
-
function _handlePageVisibility(evt) {
|
|
3584
|
-
var doc = getDocument();
|
|
3585
|
-
if (listener && doc && doc.visibilityState === "visible") {
|
|
3586
|
-
listener(evt);
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);
|
|
3590
|
-
var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces);
|
|
3591
|
-
pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded;
|
|
3592
|
-
if (!pageShowAdded && excludeEvents) {
|
|
3593
|
-
pageShowAdded = addPageShowEventListener(listener, null, evtNamespace);
|
|
3594
|
-
}
|
|
3595
|
-
return pageShowAdded;
|
|
3596
|
-
}
|
|
3597
|
-
function removePageShowEventListener(listener, evtNamespace) {
|
|
3598
|
-
var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);
|
|
3599
|
-
removeEventListeners([strPageShow], listener, newNamespaces);
|
|
3600
|
-
removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);
|
|
3601
|
-
}
|
|
3809
|
+
BaseCore.__ieDyn=1;
|
|
3810
|
+
return BaseCore;
|
|
3811
|
+
}());
|
|
3602
3812
|
|
|
3603
|
-
function
|
|
3604
|
-
function
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3813
|
+
function _runListeners(listeners, name, isAsync, callback) {
|
|
3814
|
+
arrForEach(listeners, function (listener) {
|
|
3815
|
+
if (listener && listener[name]) {
|
|
3816
|
+
if (isAsync) {
|
|
3817
|
+
setTimeout(function () { return callback(listener); }, 0);
|
|
3818
|
+
}
|
|
3819
|
+
else {
|
|
3820
|
+
try {
|
|
3821
|
+
callback(listener);
|
|
3822
|
+
}
|
|
3823
|
+
catch (e) {
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3610
3827
|
});
|
|
3611
3828
|
}
|
|
3612
|
-
function
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3829
|
+
var NotificationManager = /** @class */ (function () {
|
|
3830
|
+
function NotificationManager(config) {
|
|
3831
|
+
this.listeners = [];
|
|
3832
|
+
var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll;
|
|
3833
|
+
dynamicProto(NotificationManager, this, function (_self) {
|
|
3834
|
+
_self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
|
|
3835
|
+
_self.listeners[_DYN_PUSH ](listener);
|
|
3836
|
+
};
|
|
3837
|
+
_self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) {
|
|
3838
|
+
var index = arrIndexOf(_self[_DYN_LISTENERS ], listener);
|
|
3839
|
+
while (index > -1) {
|
|
3840
|
+
_self.listeners[_DYN_SPLICE ](index, 1);
|
|
3841
|
+
index = arrIndexOf(_self[_DYN_LISTENERS ], listener);
|
|
3842
|
+
}
|
|
3843
|
+
};
|
|
3844
|
+
_self[STR_EVENTS_SENT ] = function (events) {
|
|
3845
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_SENT, true, function (listener) {
|
|
3846
|
+
listener[STR_EVENTS_SENT ](events);
|
|
3847
|
+
});
|
|
3848
|
+
};
|
|
3849
|
+
_self[STR_EVENTS_DISCARDED ] = function (events, reason) {
|
|
3850
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_DISCARDED, true, function (listener) {
|
|
3851
|
+
listener[STR_EVENTS_DISCARDED ](events, reason);
|
|
3852
|
+
});
|
|
3853
|
+
};
|
|
3854
|
+
_self[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) {
|
|
3855
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_SEND_REQUEST, isAsync, function (listener) {
|
|
3856
|
+
listener[STR_EVENTS_SEND_REQUEST ](sendReason, isAsync);
|
|
3857
|
+
});
|
|
3858
|
+
};
|
|
3859
|
+
_self[STR_PERF_EVENT ] = function (perfEvent) {
|
|
3860
|
+
if (perfEvent) {
|
|
3861
|
+
if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) {
|
|
3862
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_PERF_EVENT, false, function (listener) {
|
|
3863
|
+
if (perfEvent[_DYN_IS_ASYNC ]) {
|
|
3864
|
+
setTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0);
|
|
3865
|
+
}
|
|
3866
|
+
else {
|
|
3867
|
+
listener[STR_PERF_EVENT ](perfEvent);
|
|
3868
|
+
}
|
|
3869
|
+
});
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
};
|
|
3873
|
+
});
|
|
3616
3874
|
}
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3875
|
+
NotificationManager.__ieDyn=1;
|
|
3876
|
+
return NotificationManager;
|
|
3877
|
+
}());
|
|
3878
|
+
|
|
3879
|
+
var AppInsightsCore$2 = /** @class */ (function (_super) {
|
|
3880
|
+
__extendsFn(AppInsightsCore, _super);
|
|
3881
|
+
function AppInsightsCore() {
|
|
3882
|
+
var _this = _super.call(this) || this;
|
|
3883
|
+
dynamicProto(AppInsightsCore, _this, function (_self, _base) {
|
|
3884
|
+
_self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) {
|
|
3885
|
+
_base[_DYN_INITIALIZE ](config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config));
|
|
3886
|
+
};
|
|
3887
|
+
_self.track = function (telemetryItem) {
|
|
3888
|
+
doPerf(_self[STR_GET_PERF_MGR ](), function () { return "AppInsightsCore:track"; }, function () {
|
|
3889
|
+
if (telemetryItem === null) {
|
|
3890
|
+
_notifyInvalidEvent(telemetryItem);
|
|
3891
|
+
throwError("Invalid telemetry item");
|
|
3892
|
+
}
|
|
3893
|
+
_validateTelemetryItem(telemetryItem);
|
|
3894
|
+
_base.track(telemetryItem);
|
|
3895
|
+
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
3896
|
+
};
|
|
3897
|
+
function _validateTelemetryItem(telemetryItem) {
|
|
3898
|
+
if (isNullOrUndefined(telemetryItem[_DYN_NAME ])) {
|
|
3899
|
+
_notifyInvalidEvent(telemetryItem);
|
|
3900
|
+
throwError("telemetry name required");
|
|
3901
|
+
}
|
|
3902
|
+
}
|
|
3903
|
+
function _notifyInvalidEvent(telemetryItem) {
|
|
3904
|
+
var manager = _self[_DYN_GET_NOTIFY_MGR ]();
|
|
3905
|
+
if (manager) {
|
|
3906
|
+
manager[STR_EVENTS_DISCARDED ]([telemetryItem], 2 );
|
|
3907
|
+
}
|
|
3908
|
+
}
|
|
3909
|
+
});
|
|
3910
|
+
return _this;
|
|
3633
3911
|
}
|
|
3634
|
-
|
|
3635
|
-
return
|
|
3636
|
-
}
|
|
3637
|
-
var GuidRegex = /[xy]/g;
|
|
3638
|
-
var EventHelper = {
|
|
3639
|
-
Attach: attachEvent,
|
|
3640
|
-
AttachEvent: attachEvent,
|
|
3641
|
-
Detach: detachEvent,
|
|
3642
|
-
DetachEvent: detachEvent
|
|
3643
|
-
};
|
|
3912
|
+
AppInsightsCore.__ieDyn=1;
|
|
3913
|
+
return AppInsightsCore;
|
|
3914
|
+
}(BaseCore$2));
|
|
3644
3915
|
|
|
3916
|
+
var _a$1;
|
|
3917
|
+
var FAILED = "Failed";
|
|
3918
|
+
var FAILED_MONITOR_AJAX = FAILED + "MonitorAjax";
|
|
3919
|
+
var TRACK = "Track";
|
|
3920
|
+
var START = "Start";
|
|
3921
|
+
var STOP = "Stop";
|
|
3922
|
+
var EVENT = "Event";
|
|
3923
|
+
var AUTH_CONTEXT = "AuthContext";
|
|
3924
|
+
var EXCEPTION = "Exception";
|
|
3925
|
+
var LOCAL = "Local";
|
|
3926
|
+
var SESSION = "Session";
|
|
3927
|
+
var STORAGE = "Storage";
|
|
3928
|
+
var BROWSER = "Browser";
|
|
3929
|
+
var CANNOT = "Cannot";
|
|
3930
|
+
var BUFFER = "Buffer";
|
|
3931
|
+
var INSTRUMENTATION_KEY = "InstrumentationKey";
|
|
3645
3932
|
var LoggingSeverity = createEnumStyle({
|
|
3646
3933
|
CRITICAL: 1 ,
|
|
3647
3934
|
WARNING: 2
|
|
3648
3935
|
});
|
|
3649
|
-
var _InternalMessageId = createEnumStyle({
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
ClientPerformanceMathError
|
|
3659
|
-
|
|
3660
|
-
ErrorPVCalc
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
MessageLimitPerPVExceeded
|
|
3674
|
-
MissingRequiredFieldSpecification
|
|
3675
|
-
NavigationTimingNotSupported
|
|
3676
|
-
OnError
|
|
3677
|
-
|
|
3678
|
-
SenderNotInitialized
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
TelemetrySampledAndNotSent
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
InvalidBackendResponse
|
|
3694
|
-
|
|
3695
|
-
InvalidDurationValue
|
|
3696
|
-
TelemetryEnvelopeInvalid
|
|
3697
|
-
CreateEnvelopeError
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
CircularReferenceDetected
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
IllegalCharsInName
|
|
3704
|
-
ItemNotInArray
|
|
3705
|
-
MaxAjaxPerPVExceeded
|
|
3706
|
-
MessageTruncated
|
|
3707
|
-
NameTooLong
|
|
3708
|
-
SampleRateOutOfRange
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
StringValueTooLong
|
|
3712
|
-
StartCalledMoreThanOnce
|
|
3713
|
-
StopCalledWithoutStart
|
|
3714
|
-
|
|
3715
|
-
TrackArgumentsNotSpecified
|
|
3716
|
-
UrlTooLong
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
IdTooLong
|
|
3720
|
-
InvalidEvent
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
SnippetScriptLoadFailure
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
InvalidContentBlob
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3936
|
+
var _InternalMessageId = createEnumStyle((_a$1 = {},
|
|
3937
|
+
_a$1[BROWSER + "DoesNotSupport" + LOCAL + STORAGE] = 0 ,
|
|
3938
|
+
_a$1[BROWSER + CANNOT + "Read" + LOCAL + STORAGE] = 1 ,
|
|
3939
|
+
_a$1[BROWSER + CANNOT + "Read" + SESSION + STORAGE] = 2 ,
|
|
3940
|
+
_a$1[BROWSER + CANNOT + "Write" + LOCAL + STORAGE] = 3 ,
|
|
3941
|
+
_a$1[BROWSER + CANNOT + "Write" + SESSION + STORAGE] = 4 ,
|
|
3942
|
+
_a$1[BROWSER + FAILED + "RemovalFrom" + LOCAL + STORAGE] = 5 ,
|
|
3943
|
+
_a$1[BROWSER + FAILED + "RemovalFrom" + SESSION + STORAGE] = 6 ,
|
|
3944
|
+
_a$1[CANNOT + "SendEmptyTelemetry"] = 7 ,
|
|
3945
|
+
_a$1.ClientPerformanceMathError = 8 ,
|
|
3946
|
+
_a$1["ErrorParsingAI" + SESSION + "Cookie"] = 9 ,
|
|
3947
|
+
_a$1.ErrorPVCalc = 10 ,
|
|
3948
|
+
_a$1[EXCEPTION + "WhileLoggingError"] = 11 ,
|
|
3949
|
+
_a$1[FAILED + "AddingTelemetryTo" + BUFFER] = 12 ,
|
|
3950
|
+
_a$1[FAILED_MONITOR_AJAX + "Abort"] = 13 ,
|
|
3951
|
+
_a$1[FAILED_MONITOR_AJAX + "Dur"] = 14 ,
|
|
3952
|
+
_a$1[FAILED_MONITOR_AJAX + "Open"] = 15 ,
|
|
3953
|
+
_a$1[FAILED_MONITOR_AJAX + "RSC"] = 16 ,
|
|
3954
|
+
_a$1[FAILED_MONITOR_AJAX + "Send"] = 17 ,
|
|
3955
|
+
_a$1[FAILED_MONITOR_AJAX + "GetCorrelationHeader"] = 18 ,
|
|
3956
|
+
_a$1[FAILED + "ToAddHandlerForOnBeforeUnload"] = 19 ,
|
|
3957
|
+
_a$1[FAILED + "ToSendQueuedTelemetry"] = 20 ,
|
|
3958
|
+
_a$1[FAILED + "ToReportDataLoss"] = 21 ,
|
|
3959
|
+
_a$1["Flush" + FAILED] = 22 ,
|
|
3960
|
+
_a$1.MessageLimitPerPVExceeded = 23 ,
|
|
3961
|
+
_a$1.MissingRequiredFieldSpecification = 24 ,
|
|
3962
|
+
_a$1.NavigationTimingNotSupported = 25 ,
|
|
3963
|
+
_a$1.OnError = 26 ,
|
|
3964
|
+
_a$1[SESSION + "RenewalDateIsZero"] = 27 ,
|
|
3965
|
+
_a$1.SenderNotInitialized = 28 ,
|
|
3966
|
+
_a$1[START + TRACK + EVENT + FAILED] = 29 ,
|
|
3967
|
+
_a$1[STOP + TRACK + EVENT + FAILED] = 30 ,
|
|
3968
|
+
_a$1[START + TRACK + FAILED] = 31 ,
|
|
3969
|
+
_a$1[STOP + TRACK + FAILED] = 32 ,
|
|
3970
|
+
_a$1.TelemetrySampledAndNotSent = 33 ,
|
|
3971
|
+
_a$1[TRACK + EVENT + FAILED] = 34 ,
|
|
3972
|
+
_a$1[TRACK + EXCEPTION + FAILED] = 35 ,
|
|
3973
|
+
_a$1[TRACK + "Metric" + FAILED] = 36 ,
|
|
3974
|
+
_a$1[TRACK + "PV" + FAILED] = 37 ,
|
|
3975
|
+
_a$1[TRACK + "PV" + FAILED + "Calc"] = 38 ,
|
|
3976
|
+
_a$1[TRACK + "Trace" + FAILED] = 39 ,
|
|
3977
|
+
_a$1["Transmission" + FAILED] = 40 ,
|
|
3978
|
+
_a$1[FAILED + "ToSet" + STORAGE + BUFFER] = 41 ,
|
|
3979
|
+
_a$1[FAILED + "ToRestore" + STORAGE + BUFFER] = 42 ,
|
|
3980
|
+
_a$1.InvalidBackendResponse = 43 ,
|
|
3981
|
+
_a$1[FAILED + "ToFixDepricatedValues"] = 44 ,
|
|
3982
|
+
_a$1.InvalidDurationValue = 45 ,
|
|
3983
|
+
_a$1.TelemetryEnvelopeInvalid = 46 ,
|
|
3984
|
+
_a$1.CreateEnvelopeError = 47 ,
|
|
3985
|
+
_a$1[CANNOT + "SerializeObject"] = 48 ,
|
|
3986
|
+
_a$1[CANNOT + "SerializeObjectNonSerializable"] = 49 ,
|
|
3987
|
+
_a$1.CircularReferenceDetected = 50 ,
|
|
3988
|
+
_a$1["Clear" + AUTH_CONTEXT + FAILED] = 51 ,
|
|
3989
|
+
_a$1[EXCEPTION + "Truncated"] = 52 ,
|
|
3990
|
+
_a$1.IllegalCharsInName = 53 ,
|
|
3991
|
+
_a$1.ItemNotInArray = 54 ,
|
|
3992
|
+
_a$1.MaxAjaxPerPVExceeded = 55 ,
|
|
3993
|
+
_a$1.MessageTruncated = 56 ,
|
|
3994
|
+
_a$1.NameTooLong = 57 ,
|
|
3995
|
+
_a$1.SampleRateOutOfRange = 58 ,
|
|
3996
|
+
_a$1["Set" + AUTH_CONTEXT + FAILED] = 59 ,
|
|
3997
|
+
_a$1["Set" + AUTH_CONTEXT + FAILED + "AccountName"] = 60 ,
|
|
3998
|
+
_a$1.StringValueTooLong = 61 ,
|
|
3999
|
+
_a$1.StartCalledMoreThanOnce = 62 ,
|
|
4000
|
+
_a$1.StopCalledWithoutStart = 63 ,
|
|
4001
|
+
_a$1["TelemetryInitializer" + FAILED] = 64 ,
|
|
4002
|
+
_a$1.TrackArgumentsNotSpecified = 65 ,
|
|
4003
|
+
_a$1.UrlTooLong = 66 ,
|
|
4004
|
+
_a$1[SESSION + STORAGE + BUFFER + "Full"] = 67 ,
|
|
4005
|
+
_a$1[CANNOT + "AccessCookie"] = 68 ,
|
|
4006
|
+
_a$1.IdTooLong = 69 ,
|
|
4007
|
+
_a$1.InvalidEvent = 70 ,
|
|
4008
|
+
_a$1[FAILED_MONITOR_AJAX + "SetRequestHeader"] = 71 ,
|
|
4009
|
+
_a$1["Send" + BROWSER + "InfoOnUserInit"] = 72 ,
|
|
4010
|
+
_a$1["Plugin" + EXCEPTION] = 73 ,
|
|
4011
|
+
_a$1["Notification" + EXCEPTION] = 74 ,
|
|
4012
|
+
_a$1.SnippetScriptLoadFailure = 99 ,
|
|
4013
|
+
_a$1["Invalid" + INSTRUMENTATION_KEY] = 100 ,
|
|
4014
|
+
_a$1[CANNOT + "ParseAiBlobValue"] = 101 ,
|
|
4015
|
+
_a$1.InvalidContentBlob = 102 ,
|
|
4016
|
+
_a$1[TRACK + "PageAction" + EVENT + FAILED] = 103 ,
|
|
4017
|
+
_a$1[FAILED + "AddingCustomDefinedRequestContext"] = 104 ,
|
|
4018
|
+
_a$1["InMemory" + STORAGE + BUFFER + "Full"] = 105 ,
|
|
4019
|
+
_a$1[INSTRUMENTATION_KEY + "Deprecation"] = 106 ,
|
|
4020
|
+
_a$1));
|
|
3733
4021
|
|
|
3734
4022
|
var ValueKind = createEnumStyle({
|
|
3735
4023
|
NotSet: 0 ,
|
|
@@ -3799,8 +4087,13 @@
|
|
|
3799
4087
|
SDKNotInitialized: 520
|
|
3800
4088
|
})));
|
|
3801
4089
|
|
|
4090
|
+
var STR_EMPTY = "";
|
|
4091
|
+
var STR_DEFAULT_ENDPOINT_URL = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
|
|
4092
|
+
var STR_VERSION = "version";
|
|
4093
|
+
var STR_PROPERTIES = "properties";
|
|
4094
|
+
|
|
3802
4095
|
var _a;
|
|
3803
|
-
var Version = '3.2.
|
|
4096
|
+
var Version = '3.2.5';
|
|
3804
4097
|
var FullVersionString = "1DS-Web-JS-" + Version;
|
|
3805
4098
|
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
3806
4099
|
var strWithCredentials = "withCredentials";
|
|
@@ -3818,7 +4111,7 @@
|
|
|
3818
4111
|
var isDocumentObjectAvailable = Boolean(getDocument());
|
|
3819
4112
|
var isWindowObjectAvailable = Boolean(getWindow());
|
|
3820
4113
|
function isValueAssigned(value) {
|
|
3821
|
-
return !(value ===
|
|
4114
|
+
return !(value === STR_EMPTY || isNullOrUndefined(value));
|
|
3822
4115
|
}
|
|
3823
4116
|
function getTenantId(apiKey) {
|
|
3824
4117
|
if (apiKey) {
|
|
@@ -3827,7 +4120,7 @@
|
|
|
3827
4120
|
return apiKey.substring(0, indexTenantId);
|
|
3828
4121
|
}
|
|
3829
4122
|
}
|
|
3830
|
-
return
|
|
4123
|
+
return STR_EMPTY;
|
|
3831
4124
|
}
|
|
3832
4125
|
function isUint8ArrayAvailable() {
|
|
3833
4126
|
if (uInt8ArraySupported === null) {
|
|
@@ -3849,11 +4142,11 @@
|
|
|
3849
4142
|
if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) {
|
|
3850
4143
|
property = { value: property };
|
|
3851
4144
|
}
|
|
3852
|
-
else if (propType === "object" && !
|
|
4145
|
+
else if (propType === "object" && !ObjHasOwnProperty.call(property, "value")) {
|
|
3853
4146
|
property = { value: stringifyObjects ? JSON.stringify(property) : property };
|
|
3854
4147
|
}
|
|
3855
4148
|
else if (isNullOrUndefined(property.value)
|
|
3856
|
-
|| property.value ===
|
|
4149
|
+
|| property.value === STR_EMPTY || (!isString(property.value)
|
|
3857
4150
|
&& !isNumber(property.value) && !isBoolean(property.value)
|
|
3858
4151
|
&& !isArray(property.value))) {
|
|
3859
4152
|
return null;
|
|
@@ -3916,7 +4209,7 @@
|
|
|
3916
4209
|
if (areCookiesSupported(null)) {
|
|
3917
4210
|
return getCookieValue(safeGetCookieMgr(null), name);
|
|
3918
4211
|
}
|
|
3919
|
-
return
|
|
4212
|
+
return STR_EMPTY;
|
|
3920
4213
|
}
|
|
3921
4214
|
function getCookieValue(cookieMgr, name, decode) {
|
|
3922
4215
|
if (decode === void 0) { decode = true; }
|
|
@@ -3927,7 +4220,7 @@
|
|
|
3927
4220
|
cookieValue = decodeURIComponent(cookieValue);
|
|
3928
4221
|
}
|
|
3929
4222
|
}
|
|
3930
|
-
return cookieValue ||
|
|
4223
|
+
return cookieValue || STR_EMPTY;
|
|
3931
4224
|
}
|
|
3932
4225
|
function createGuid(style) {
|
|
3933
4226
|
if (style === void 0) { style = "D" ; }
|
|
@@ -3939,7 +4232,7 @@
|
|
|
3939
4232
|
theGuid = "(" + theGuid + ")";
|
|
3940
4233
|
}
|
|
3941
4234
|
else if (style === "N" ) {
|
|
3942
|
-
theGuid = theGuid.replace(/-/g,
|
|
4235
|
+
theGuid = theGuid.replace(/-/g, STR_EMPTY);
|
|
3943
4236
|
}
|
|
3944
4237
|
return theGuid;
|
|
3945
4238
|
}
|
|
@@ -4033,7 +4326,7 @@
|
|
|
4033
4326
|
theType |= getFieldValueType(value[0]);
|
|
4034
4327
|
}
|
|
4035
4328
|
}
|
|
4036
|
-
else if (
|
|
4329
|
+
else if (ObjHasOwnProperty.call(value, "value")) {
|
|
4037
4330
|
theType = 8192 | getFieldValueType(value.value);
|
|
4038
4331
|
}
|
|
4039
4332
|
}
|
|
@@ -4155,27 +4448,25 @@
|
|
|
4155
4448
|
return xhr;
|
|
4156
4449
|
}
|
|
4157
4450
|
|
|
4158
|
-
var PropVersion = "version";
|
|
4159
|
-
var properties = "properties";
|
|
4160
4451
|
var AppInsightsCore = /** @class */ (function (_super) {
|
|
4161
4452
|
__extendsFn(AppInsightsCore, _super);
|
|
4162
4453
|
function AppInsightsCore() {
|
|
4163
4454
|
var _this = _super.call(this) || this;
|
|
4164
4455
|
_this.pluginVersionStringArr = [];
|
|
4165
|
-
_this.pluginVersionString = "";
|
|
4166
4456
|
dynamicProto(AppInsightsCore, _this, function (_self, _base) {
|
|
4167
4457
|
if (!_self.logger || !_self.logger.queue) {
|
|
4168
4458
|
_self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 });
|
|
4169
4459
|
}
|
|
4170
4460
|
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
4171
4461
|
doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () {
|
|
4462
|
+
var _pluginVersionStringArr = _self.pluginVersionStringArr;
|
|
4172
4463
|
if (config) {
|
|
4173
4464
|
if (!config.endpointUrl) {
|
|
4174
|
-
config.endpointUrl =
|
|
4465
|
+
config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
|
|
4175
4466
|
}
|
|
4176
4467
|
var propertyStorageOverride = config.propertyStorageOverride;
|
|
4177
4468
|
if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {
|
|
4178
|
-
|
|
4469
|
+
throwError("Invalid property storage override passed.");
|
|
4179
4470
|
}
|
|
4180
4471
|
if (config.channels) {
|
|
4181
4472
|
arrForEach(config.channels, function (channels) {
|
|
@@ -4183,7 +4474,7 @@
|
|
|
4183
4474
|
arrForEach(channels, function (channel) {
|
|
4184
4475
|
if (channel.identifier && channel.version) {
|
|
4185
4476
|
var ver = channel.identifier + "=" + channel.version;
|
|
4186
|
-
|
|
4477
|
+
_pluginVersionStringArr.push(ver);
|
|
4187
4478
|
}
|
|
4188
4479
|
});
|
|
4189
4480
|
}
|
|
@@ -4191,17 +4482,18 @@
|
|
|
4191
4482
|
}
|
|
4192
4483
|
}
|
|
4193
4484
|
_self.getWParam = function () {
|
|
4194
|
-
return typeof document !== "undefined" ? 0 : -1;
|
|
4485
|
+
return (typeof document !== "undefined" || !!config.enableWParam) ? 0 : -1;
|
|
4195
4486
|
};
|
|
4196
4487
|
if (extensions) {
|
|
4197
4488
|
arrForEach(extensions, function (ext) {
|
|
4198
4489
|
if (ext && ext.identifier && ext.version) {
|
|
4199
4490
|
var ver = ext.identifier + "=" + ext.version;
|
|
4200
|
-
|
|
4491
|
+
_pluginVersionStringArr.push(ver);
|
|
4201
4492
|
}
|
|
4202
4493
|
});
|
|
4203
4494
|
}
|
|
4204
|
-
_self.pluginVersionString =
|
|
4495
|
+
_self.pluginVersionString = _pluginVersionStringArr.join(";");
|
|
4496
|
+
_self.pluginVersionStringArr = _pluginVersionStringArr;
|
|
4205
4497
|
try {
|
|
4206
4498
|
_base.initialize(config, extensions, logger, notificationManager);
|
|
4207
4499
|
_self.pollInternalLogs("InternalLog");
|
|
@@ -4212,7 +4504,7 @@
|
|
|
4212
4504
|
if (message.indexOf("channels") !== -1) {
|
|
4213
4505
|
message += "\n - Channels must be provided through config.channels only!";
|
|
4214
4506
|
}
|
|
4215
|
-
logger_1
|
|
4507
|
+
_throwInternal(logger_1, 1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message);
|
|
4216
4508
|
}
|
|
4217
4509
|
}, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });
|
|
4218
4510
|
};
|
|
@@ -4229,16 +4521,9 @@
|
|
|
4229
4521
|
itemExt.sdk = itemExt.sdk || {};
|
|
4230
4522
|
itemExt.sdk.ver = FullVersionString;
|
|
4231
4523
|
var baseData = telemetryItem.baseData = telemetryItem.baseData || {};
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
var itemProperties = baseData[properties];
|
|
4236
|
-
if (!itemProperties[PropVersion]) {
|
|
4237
|
-
itemProperties[PropVersion] = "";
|
|
4238
|
-
}
|
|
4239
|
-
if (_self.pluginVersionString !== "") {
|
|
4240
|
-
itemProperties[PropVersion] = _self.pluginVersionString;
|
|
4241
|
-
}
|
|
4524
|
+
baseData[STR_PROPERTIES] = baseData[STR_PROPERTIES] || {};
|
|
4525
|
+
var itemProperties = baseData[STR_PROPERTIES];
|
|
4526
|
+
itemProperties[STR_VERSION] = itemProperties[STR_VERSION] || _self.pluginVersionString || STR_EMPTY;
|
|
4242
4527
|
}
|
|
4243
4528
|
_base.track(telemetryItem);
|
|
4244
4529
|
}, function () { return ({ item: item }); }, !(item.sync));
|
|
@@ -4246,6 +4531,7 @@
|
|
|
4246
4531
|
});
|
|
4247
4532
|
return _this;
|
|
4248
4533
|
}
|
|
4534
|
+
AppInsightsCore.__ieDyn=1;
|
|
4249
4535
|
return AppInsightsCore;
|
|
4250
4536
|
}(AppInsightsCore$2));
|
|
4251
4537
|
var AppInsightsCore$1 = AppInsightsCore;
|
|
@@ -4257,10 +4543,10 @@
|
|
|
4257
4543
|
dynamicProto(BaseCore, _this, function (_self, _base) {
|
|
4258
4544
|
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
4259
4545
|
if (config && !config.endpointUrl) {
|
|
4260
|
-
config.endpointUrl =
|
|
4546
|
+
config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
|
|
4261
4547
|
}
|
|
4262
4548
|
_self.getWParam = function () {
|
|
4263
|
-
return isDocumentObjectAvailable ? 0 : -1;
|
|
4549
|
+
return (isDocumentObjectAvailable || !!config.enableWParam) ? 0 : -1;
|
|
4264
4550
|
};
|
|
4265
4551
|
try {
|
|
4266
4552
|
_base.initialize(config, extensions, logger, notificationManager);
|
|
@@ -4281,6 +4567,7 @@
|
|
|
4281
4567
|
});
|
|
4282
4568
|
return _this;
|
|
4283
4569
|
}
|
|
4570
|
+
BaseCore.__ieDyn=1;
|
|
4284
4571
|
return BaseCore;
|
|
4285
4572
|
}(BaseCore$2));
|
|
4286
4573
|
var BaseCore$1 = BaseCore;
|
|
@@ -4662,7 +4949,7 @@
|
|
|
4662
4949
|
}
|
|
4663
4950
|
}
|
|
4664
4951
|
function _warnLog(message) {
|
|
4665
|
-
diagLog
|
|
4952
|
+
_warnToConsole(diagLog, "ESPromiseScheduler[" + _scheduledName + "] " + message);
|
|
4666
4953
|
}
|
|
4667
4954
|
}
|
|
4668
4955
|
ESPromiseScheduler.incomplete = function () {
|
|
@@ -4754,7 +5041,7 @@
|
|
|
4754
5041
|
if (mapValue.handler) {
|
|
4755
5042
|
return mapValue.handler.value(path, name, value, stringifyObjects);
|
|
4756
5043
|
}
|
|
4757
|
-
if (!isString(name) || isNullOrUndefined(value) || value ===
|
|
5044
|
+
if (!isString(name) || isNullOrUndefined(value) || value === STR_EMPTY) {
|
|
4758
5045
|
return null;
|
|
4759
5046
|
}
|
|
4760
5047
|
var property = null;
|
|
@@ -4886,7 +5173,9 @@
|
|
|
4886
5173
|
exports._InternalLogMessage = _InternalLogMessage;
|
|
4887
5174
|
exports._InternalMessageId = _InternalMessageId;
|
|
4888
5175
|
exports.__getRegisteredEvents = __getRegisteredEvents;
|
|
5176
|
+
exports._logInternalMessage = _logInternalMessage;
|
|
4889
5177
|
exports._throwInternal = _throwInternal;
|
|
5178
|
+
exports._warnToConsole = _warnToConsole;
|
|
4890
5179
|
exports.addEventHandler = addEventHandler;
|
|
4891
5180
|
exports.addEventListeners = addEventListeners;
|
|
4892
5181
|
exports.addPageHideEventListener = addPageHideEventListener;
|
|
@@ -4903,6 +5192,7 @@
|
|
|
4903
5192
|
exports.createEnumStyle = createEnumStyle;
|
|
4904
5193
|
exports.createGuid = createGuid;
|
|
4905
5194
|
exports.createProcessTelemetryContext = createProcessTelemetryContext;
|
|
5195
|
+
exports.createTraceParent = createTraceParent;
|
|
4906
5196
|
exports.createUniqueNamespace = createUniqueNamespace;
|
|
4907
5197
|
exports.createUnloadHandlerContainer = createUnloadHandlerContainer;
|
|
4908
5198
|
exports.dateNow = dateNow;
|
|
@@ -4915,6 +5205,8 @@
|
|
|
4915
5205
|
exports.eventOff = eventOff;
|
|
4916
5206
|
exports.eventOn = eventOn;
|
|
4917
5207
|
exports.extend = extend;
|
|
5208
|
+
exports.findW3cTraceParent = findW3cTraceParent;
|
|
5209
|
+
exports.formatTraceParent = formatTraceParent;
|
|
4918
5210
|
exports.generateW3CId = generateW3CId;
|
|
4919
5211
|
exports.getCommonSchemaMetaData = getCommonSchemaMetaData;
|
|
4920
5212
|
exports.getConsole = getConsole;
|
|
@@ -4961,11 +5253,15 @@
|
|
|
4961
5253
|
exports.isNumber = isNumber;
|
|
4962
5254
|
exports.isObject = isObject;
|
|
4963
5255
|
exports.isReactNative = isReactNative;
|
|
5256
|
+
exports.isSampledFlag = isSampledFlag;
|
|
4964
5257
|
exports.isString = isString;
|
|
4965
5258
|
exports.isTruthy = isTruthy;
|
|
4966
5259
|
exports.isTypeof = isTypeof;
|
|
4967
5260
|
exports.isUint8ArrayAvailable = isUint8ArrayAvailable;
|
|
4968
5261
|
exports.isUndefined = isUndefined;
|
|
5262
|
+
exports.isValidSpanId = isValidSpanId;
|
|
5263
|
+
exports.isValidTraceId = isValidTraceId;
|
|
5264
|
+
exports.isValidTraceParent = isValidTraceParent;
|
|
4969
5265
|
exports.isValueAssigned = isValueAssigned;
|
|
4970
5266
|
exports.isValueKind = isValueKind;
|
|
4971
5267
|
exports.isWindowObjectAvailable = isWindowObjectAvailable;
|
|
@@ -4982,6 +5278,7 @@
|
|
|
4982
5278
|
exports.objSeal = objSeal;
|
|
4983
5279
|
exports.openXhr = openXhr;
|
|
4984
5280
|
exports.optimizeObject = optimizeObject;
|
|
5281
|
+
exports.parseTraceParent = parseTraceParent;
|
|
4985
5282
|
exports.perfNow = perfNow;
|
|
4986
5283
|
exports.proxyAssign = proxyAssign;
|
|
4987
5284
|
exports.proxyFunctionAs = proxyFunctionAs;
|
|
@@ -5015,4 +5312,4 @@
|
|
|
5015
5312
|
(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 });
|
|
5016
5313
|
|
|
5017
5314
|
})(this.oneDS = this.oneDS || {});
|
|
5018
|
-
//# sourceMappingURL=ms.core-3.2.
|
|
5315
|
+
//# sourceMappingURL=ms.core-3.2.5.gbl.js.map
|