@microsoft/applicationinsights-clickanalytics-js 2.8.0-beta.2202-06 → 2.8.0-beta.2203-02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{ai.clck.2.8.0-beta.2202-06.cjs.js → ai.clck.2.8.0-beta.2203-02.cjs.js} +607 -214
- package/browser/ai.clck.2.8.0-beta.2203-02.cjs.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.cjs.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.cjs.min.js.map +1 -0
- package/browser/{ai.clck.2.8.0-beta.2202-06.gbl.js → ai.clck.2.8.0-beta.2203-02.gbl.js} +607 -214
- package/browser/ai.clck.2.8.0-beta.2203-02.gbl.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.gbl.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.gbl.min.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.integrity.json +66 -0
- package/browser/{ai.clck.2.8.0-beta.2202-06.js → ai.clck.2.8.0-beta.2203-02.js} +607 -214
- package/browser/ai.clck.2.8.0-beta.2203-02.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.min.js.map +1 -0
- package/browser/ai.clck.2.cjs.js +606 -213
- package/browser/ai.clck.2.cjs.js.map +1 -1
- package/browser/ai.clck.2.cjs.min.js +2 -2
- package/browser/ai.clck.2.cjs.min.js.map +1 -1
- package/browser/ai.clck.2.gbl.js +606 -213
- package/browser/ai.clck.2.gbl.js.map +1 -1
- package/browser/ai.clck.2.gbl.min.js +2 -2
- package/browser/ai.clck.2.gbl.min.js.map +1 -1
- package/browser/ai.clck.2.js +606 -213
- package/browser/ai.clck.2.js.map +1 -1
- package/browser/ai.clck.2.min.js +2 -2
- package/browser/ai.clck.2.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.d.ts +1 -1
- package/dist/applicationinsights-clickanalytics-js.js +606 -213
- package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +1 -1
- package/dist-esm/Behaviours.js +1 -1
- package/dist-esm/ClickAnalyticsPlugin.js +2 -2
- package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-esm/DataCollector.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/Interfaces/Datamodel.js +1 -1
- package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-esm/common/Utils.js +1 -1
- package/dist-esm/events/PageAction.js +1 -1
- package/dist-esm/events/WebEvent.js +1 -1
- package/dist-esm/handlers/AutoCaptureHandler.js +1 -1
- package/dist-esm/handlers/DomContentHandler.js +1 -1
- package/package.json +4 -4
- package/src/ClickAnalyticsPlugin.ts +1 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.cjs.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.cjs.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2202-06.cjs.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.gbl.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.gbl.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2202-06.gbl.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.integrity.json +0 -66
- package/browser/ai.clck.2.8.0-beta.2202-06.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2202-06.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.2203-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -335,108 +335,26 @@
|
|
|
335
335
|
};
|
|
336
336
|
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
337
337
|
|
|
338
|
-
var
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
var
|
|
344
|
-
|
|
345
|
-
BrowserCannotReadLocalStorage: 1,
|
|
346
|
-
BrowserCannotReadSessionStorage: 2,
|
|
347
|
-
BrowserCannotWriteLocalStorage: 3,
|
|
348
|
-
BrowserCannotWriteSessionStorage: 4,
|
|
349
|
-
BrowserFailedRemovalFromLocalStorage: 5,
|
|
350
|
-
BrowserFailedRemovalFromSessionStorage: 6,
|
|
351
|
-
CannotSendEmptyTelemetry: 7,
|
|
352
|
-
ClientPerformanceMathError: 8,
|
|
353
|
-
ErrorParsingAISessionCookie: 9,
|
|
354
|
-
ErrorPVCalc: 10,
|
|
355
|
-
ExceptionWhileLoggingError: 11,
|
|
356
|
-
FailedAddingTelemetryToBuffer: 12,
|
|
357
|
-
FailedMonitorAjaxAbort: 13,
|
|
358
|
-
FailedMonitorAjaxDur: 14,
|
|
359
|
-
FailedMonitorAjaxOpen: 15,
|
|
360
|
-
FailedMonitorAjaxRSC: 16,
|
|
361
|
-
FailedMonitorAjaxSend: 17,
|
|
362
|
-
FailedMonitorAjaxGetCorrelationHeader: 18,
|
|
363
|
-
FailedToAddHandlerForOnBeforeUnload: 19,
|
|
364
|
-
FailedToSendQueuedTelemetry: 20,
|
|
365
|
-
FailedToReportDataLoss: 21,
|
|
366
|
-
FlushFailed: 22,
|
|
367
|
-
MessageLimitPerPVExceeded: 23,
|
|
368
|
-
MissingRequiredFieldSpecification: 24,
|
|
369
|
-
NavigationTimingNotSupported: 25,
|
|
370
|
-
OnError: 26,
|
|
371
|
-
SessionRenewalDateIsZero: 27,
|
|
372
|
-
SenderNotInitialized: 28,
|
|
373
|
-
StartTrackEventFailed: 29,
|
|
374
|
-
StopTrackEventFailed: 30,
|
|
375
|
-
StartTrackFailed: 31,
|
|
376
|
-
StopTrackFailed: 32,
|
|
377
|
-
TelemetrySampledAndNotSent: 33,
|
|
378
|
-
TrackEventFailed: 34,
|
|
379
|
-
TrackExceptionFailed: 35,
|
|
380
|
-
TrackMetricFailed: 36,
|
|
381
|
-
TrackPVFailed: 37,
|
|
382
|
-
TrackPVFailedCalc: 38,
|
|
383
|
-
TrackTraceFailed: 39,
|
|
384
|
-
TransmissionFailed: 40,
|
|
385
|
-
FailedToSetStorageBuffer: 41,
|
|
386
|
-
FailedToRestoreStorageBuffer: 42,
|
|
387
|
-
InvalidBackendResponse: 43,
|
|
388
|
-
FailedToFixDepricatedValues: 44,
|
|
389
|
-
InvalidDurationValue: 45,
|
|
390
|
-
TelemetryEnvelopeInvalid: 46,
|
|
391
|
-
CreateEnvelopeError: 47,
|
|
392
|
-
CannotSerializeObject: 48,
|
|
393
|
-
CannotSerializeObjectNonSerializable: 49,
|
|
394
|
-
CircularReferenceDetected: 50,
|
|
395
|
-
ClearAuthContextFailed: 51,
|
|
396
|
-
ExceptionTruncated: 52,
|
|
397
|
-
IllegalCharsInName: 53,
|
|
398
|
-
ItemNotInArray: 54,
|
|
399
|
-
MaxAjaxPerPVExceeded: 55,
|
|
400
|
-
MessageTruncated: 56,
|
|
401
|
-
NameTooLong: 57,
|
|
402
|
-
SampleRateOutOfRange: 58,
|
|
403
|
-
SetAuthContextFailed: 59,
|
|
404
|
-
SetAuthContextFailedAccountName: 60,
|
|
405
|
-
StringValueTooLong: 61,
|
|
406
|
-
StartCalledMoreThanOnce: 62,
|
|
407
|
-
StopCalledWithoutStart: 63,
|
|
408
|
-
TelemetryInitializerFailed: 64,
|
|
409
|
-
TrackArgumentsNotSpecified: 65,
|
|
410
|
-
UrlTooLong: 66,
|
|
411
|
-
SessionStorageBufferFull: 67,
|
|
412
|
-
CannotAccessCookie: 68,
|
|
413
|
-
IdTooLong: 69,
|
|
414
|
-
InvalidEvent: 70,
|
|
415
|
-
FailedMonitorAjaxSetRequestHeader: 71,
|
|
416
|
-
SendBrowserInfoOnUserInit: 72,
|
|
417
|
-
PluginException: 73,
|
|
418
|
-
NotificationException: 74,
|
|
419
|
-
SnippetScriptLoadFailure: 99,
|
|
420
|
-
InvalidInstrumentationKey: 100,
|
|
421
|
-
CannotParseAiBlobValue: 101,
|
|
422
|
-
InvalidContentBlob: 102,
|
|
423
|
-
TrackPageActionEventFailed: 103,
|
|
424
|
-
FailedAddingCustomDefinedRequestContext: 104,
|
|
425
|
-
InMemoryStorageBufferFull: 105
|
|
426
|
-
};
|
|
338
|
+
var strEmpty = "";
|
|
339
|
+
var strSetNextPlugin = "setNextPlugin";
|
|
340
|
+
var strIsInitialized = "isInitialized";
|
|
341
|
+
var strTeardown = "teardown";
|
|
342
|
+
var strCore = "core";
|
|
343
|
+
var strDisabled = "disabled";
|
|
344
|
+
var strDoTeardown = "_doTeardown";
|
|
427
345
|
|
|
428
|
-
var strOnPrefix = "on";
|
|
429
|
-
var strAttachEvent = "attachEvent";
|
|
430
|
-
var strAddEventHelper = "addEventListener";
|
|
431
346
|
var strToString = "toString";
|
|
432
347
|
var str__Proto = "__proto__";
|
|
433
348
|
var strConstructor = "constructor";
|
|
434
|
-
var _objDefineProperty = ObjDefineProperty;
|
|
349
|
+
var _objDefineProperty$1 = ObjDefineProperty;
|
|
435
350
|
var _objFreeze = ObjClass.freeze;
|
|
436
351
|
var _isArray = Array.isArray;
|
|
437
352
|
var _objToString = ObjProto[strToString];
|
|
438
353
|
var _fnToString = ObjHasOwnProperty[strToString];
|
|
439
354
|
var _objFunctionString = _fnToString.call(ObjClass);
|
|
355
|
+
var rCamelCase = /-([a-z])/g;
|
|
356
|
+
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
357
|
+
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
440
358
|
var _objGetPrototypeOf = Object["getPrototypeOf"];
|
|
441
359
|
function _getObjProto(target) {
|
|
442
360
|
if (target) {
|
|
@@ -465,24 +383,18 @@
|
|
|
465
383
|
function isFunction(value) {
|
|
466
384
|
return !!(value && typeof value === strShimFunction);
|
|
467
385
|
}
|
|
468
|
-
function
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
479
|
-
result = true;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
catch (e) {
|
|
483
|
-
}
|
|
386
|
+
function normalizeJsName(name) {
|
|
387
|
+
var value = name;
|
|
388
|
+
if (value && isString(value)) {
|
|
389
|
+
value = value.replace(rCamelCase, function (_all, letter) {
|
|
390
|
+
return letter.toUpperCase();
|
|
391
|
+
});
|
|
392
|
+
value = value.replace(rNormalizeInvalid, "_");
|
|
393
|
+
value = value.replace(rLeadingNumeric, function (_all, match) {
|
|
394
|
+
return "_" + match;
|
|
395
|
+
});
|
|
484
396
|
}
|
|
485
|
-
return
|
|
397
|
+
return value;
|
|
486
398
|
}
|
|
487
399
|
function objForEachKey(target, callbackfn) {
|
|
488
400
|
if (target) {
|
|
@@ -493,6 +405,12 @@
|
|
|
493
405
|
}
|
|
494
406
|
}
|
|
495
407
|
}
|
|
408
|
+
function strContains(value, search) {
|
|
409
|
+
if (value && search) {
|
|
410
|
+
return value.indexOf(search) !== -1;
|
|
411
|
+
}
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
496
414
|
var isArray = _isArray || _isArrayPoly;
|
|
497
415
|
function _isArrayPoly(obj) {
|
|
498
416
|
return !!(obj && _objToString.call(obj) === "[object Array]");
|
|
@@ -500,6 +418,9 @@
|
|
|
500
418
|
function isError(obj) {
|
|
501
419
|
return !!(obj && _objToString.call(obj) === "[object Error]");
|
|
502
420
|
}
|
|
421
|
+
function isString(value) {
|
|
422
|
+
return typeof value === "string";
|
|
423
|
+
}
|
|
503
424
|
function isBoolean(value) {
|
|
504
425
|
return typeof value === "boolean";
|
|
505
426
|
}
|
|
@@ -534,7 +455,7 @@
|
|
|
534
455
|
}
|
|
535
456
|
}
|
|
536
457
|
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
537
|
-
if (_objDefineProperty) {
|
|
458
|
+
if (_objDefineProperty$1) {
|
|
538
459
|
try {
|
|
539
460
|
var descriptor = {
|
|
540
461
|
enumerable: true,
|
|
@@ -546,7 +467,7 @@
|
|
|
546
467
|
if (setProp) {
|
|
547
468
|
descriptor.set = setProp;
|
|
548
469
|
}
|
|
549
|
-
_objDefineProperty(target, prop, descriptor);
|
|
470
|
+
_objDefineProperty$1(target, prop, descriptor);
|
|
550
471
|
return true;
|
|
551
472
|
}
|
|
552
473
|
catch (e) {
|
|
@@ -566,7 +487,7 @@
|
|
|
566
487
|
if (isError(object)) {
|
|
567
488
|
return object.name;
|
|
568
489
|
}
|
|
569
|
-
return
|
|
490
|
+
return strEmpty;
|
|
570
491
|
}
|
|
571
492
|
function setValue(target, field, value, valChk, srcChk) {
|
|
572
493
|
var theValue = value;
|
|
@@ -579,6 +500,20 @@
|
|
|
579
500
|
}
|
|
580
501
|
return theValue;
|
|
581
502
|
}
|
|
503
|
+
function throwError(message) {
|
|
504
|
+
throw new Error(message);
|
|
505
|
+
}
|
|
506
|
+
function createEnumStyle(values) {
|
|
507
|
+
var enumClass = {};
|
|
508
|
+
objForEachKey(values, function (field, value) {
|
|
509
|
+
enumClass[field] = value;
|
|
510
|
+
if (!isUndefined(enumClass[value])) {
|
|
511
|
+
throwError("Value: [" + value + "] already exists for " + field);
|
|
512
|
+
}
|
|
513
|
+
enumClass[value] = field;
|
|
514
|
+
});
|
|
515
|
+
return objFreeze(enumClass);
|
|
516
|
+
}
|
|
582
517
|
function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
|
|
583
518
|
var theArgs = arguments;
|
|
584
519
|
var extended = theArgs[0] || {};
|
|
@@ -626,10 +561,17 @@
|
|
|
626
561
|
|
|
627
562
|
var strWindow = "window";
|
|
628
563
|
var strDocument = "document";
|
|
564
|
+
var strNavigator = "navigator";
|
|
629
565
|
var strLocation = "location";
|
|
630
566
|
var strConsole = "console";
|
|
631
567
|
var strPerformance = "performance";
|
|
632
568
|
var strJSON = "JSON";
|
|
569
|
+
var strCrypto = "crypto";
|
|
570
|
+
var strMsCrypto = "msCrypto";
|
|
571
|
+
var strMsie = "msie";
|
|
572
|
+
var strTrident = "trident/";
|
|
573
|
+
var _isTrident = null;
|
|
574
|
+
var _navUserAgentCheck = null;
|
|
633
575
|
var _enableMocks = false;
|
|
634
576
|
function getGlobalInst(name) {
|
|
635
577
|
var gbl = getGlobal();
|
|
@@ -659,6 +601,15 @@
|
|
|
659
601
|
}
|
|
660
602
|
return getGlobalInst(strDocument);
|
|
661
603
|
}
|
|
604
|
+
function hasNavigator() {
|
|
605
|
+
return Boolean(typeof navigator === strShimObject && navigator);
|
|
606
|
+
}
|
|
607
|
+
function getNavigator() {
|
|
608
|
+
if (hasNavigator()) {
|
|
609
|
+
return navigator;
|
|
610
|
+
}
|
|
611
|
+
return getGlobalInst(strNavigator);
|
|
612
|
+
}
|
|
662
613
|
function getLocation(checkForMock) {
|
|
663
614
|
if (checkForMock && _enableMocks) {
|
|
664
615
|
var mockLocation = getGlobalInst("__mockLocation");
|
|
@@ -689,9 +640,24 @@
|
|
|
689
640
|
}
|
|
690
641
|
return null;
|
|
691
642
|
}
|
|
643
|
+
function getCrypto() {
|
|
644
|
+
return getGlobalInst(strCrypto);
|
|
645
|
+
}
|
|
646
|
+
function getMsCrypto() {
|
|
647
|
+
return getGlobalInst(strMsCrypto);
|
|
648
|
+
}
|
|
649
|
+
function isIE() {
|
|
650
|
+
var nav = getNavigator();
|
|
651
|
+
if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
|
|
652
|
+
_navUserAgentCheck = nav.userAgent;
|
|
653
|
+
var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase();
|
|
654
|
+
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
655
|
+
}
|
|
656
|
+
return _isTrident;
|
|
657
|
+
}
|
|
692
658
|
function dumpObj(object) {
|
|
693
659
|
var objectTypeDump = Object[strShimPrototype].toString.call(object);
|
|
694
|
-
var propertyValueDump =
|
|
660
|
+
var propertyValueDump = strEmpty;
|
|
695
661
|
if (objectTypeDump === "[object Error]") {
|
|
696
662
|
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
697
663
|
}
|
|
@@ -724,9 +690,9 @@
|
|
|
724
690
|
var strWarnToConsole = "warnToConsole";
|
|
725
691
|
function _sanitizeDiagnosticText(text) {
|
|
726
692
|
if (text) {
|
|
727
|
-
return "\"" + text.replace(/\"/g,
|
|
693
|
+
return "\"" + text.replace(/\"/g, strEmpty) + "\"";
|
|
728
694
|
}
|
|
729
|
-
return
|
|
695
|
+
return strEmpty;
|
|
730
696
|
}
|
|
731
697
|
function _logToConsole(func, message) {
|
|
732
698
|
var theConsole = getConsole();
|
|
@@ -748,12 +714,12 @@
|
|
|
748
714
|
_self.message =
|
|
749
715
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
750
716
|
msgId;
|
|
751
|
-
var strProps =
|
|
717
|
+
var strProps = strEmpty;
|
|
752
718
|
if (hasJSON()) {
|
|
753
719
|
strProps = getJSON().stringify(properties);
|
|
754
720
|
}
|
|
755
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) :
|
|
756
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) :
|
|
721
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) +
|
|
722
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty);
|
|
757
723
|
_self.message += diagnosticText;
|
|
758
724
|
}
|
|
759
725
|
_InternalLogMessage.dataType = "MessageData";
|
|
@@ -783,7 +749,7 @@
|
|
|
783
749
|
throw message;
|
|
784
750
|
}
|
|
785
751
|
else {
|
|
786
|
-
var logFunc = severity ===
|
|
752
|
+
var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole;
|
|
787
753
|
if (!isUndefined(message.message)) {
|
|
788
754
|
var logLevel = _self.consoleLoggingLevel();
|
|
789
755
|
if (isUserAct) {
|
|
@@ -801,7 +767,7 @@
|
|
|
801
767
|
_self.logInternalMessage(severity, message);
|
|
802
768
|
}
|
|
803
769
|
else {
|
|
804
|
-
_debugExtMsg("throw" + (severity ===
|
|
770
|
+
_debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
|
|
805
771
|
}
|
|
806
772
|
}
|
|
807
773
|
};
|
|
@@ -833,13 +799,13 @@
|
|
|
833
799
|
if (severity <= _self.telemetryLoggingLevel()) {
|
|
834
800
|
_self.queue.push(message);
|
|
835
801
|
_messageCount++;
|
|
836
|
-
_debugExtMsg((severity ===
|
|
802
|
+
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
837
803
|
}
|
|
838
804
|
if (_messageCount === _self.maxInternalMessageLimit()) {
|
|
839
805
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
840
|
-
var throttleMessage = new _InternalLogMessage(
|
|
806
|
+
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
841
807
|
_self.queue.push(throttleMessage);
|
|
842
|
-
if (severity ===
|
|
808
|
+
if (severity === 1 ) {
|
|
843
809
|
_self.errorToConsole(throttleLimitMessage);
|
|
844
810
|
}
|
|
845
811
|
else {
|
|
@@ -981,6 +947,151 @@
|
|
|
981
947
|
return func();
|
|
982
948
|
}
|
|
983
949
|
|
|
950
|
+
var UInt32Mask = 0x100000000;
|
|
951
|
+
var MaxUInt32 = 0xffffffff;
|
|
952
|
+
var _mwcSeeded = false;
|
|
953
|
+
var _mwcW = 123456789;
|
|
954
|
+
var _mwcZ = 987654321;
|
|
955
|
+
function _mwcSeed(seedValue) {
|
|
956
|
+
if (seedValue < 0) {
|
|
957
|
+
seedValue >>>= 0;
|
|
958
|
+
}
|
|
959
|
+
_mwcW = (123456789 + seedValue) & MaxUInt32;
|
|
960
|
+
_mwcZ = (987654321 - seedValue) & MaxUInt32;
|
|
961
|
+
_mwcSeeded = true;
|
|
962
|
+
}
|
|
963
|
+
function _autoSeedMwc() {
|
|
964
|
+
try {
|
|
965
|
+
var now = dateNow() & 0x7fffffff;
|
|
966
|
+
_mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
|
|
967
|
+
}
|
|
968
|
+
catch (e) {
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
function random32(signed) {
|
|
972
|
+
var value = 0;
|
|
973
|
+
var c = getCrypto() || getMsCrypto();
|
|
974
|
+
if (c && c.getRandomValues) {
|
|
975
|
+
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
976
|
+
}
|
|
977
|
+
if (value === 0 && isIE()) {
|
|
978
|
+
if (!_mwcSeeded) {
|
|
979
|
+
_autoSeedMwc();
|
|
980
|
+
}
|
|
981
|
+
value = mwcRandom32() & MaxUInt32;
|
|
982
|
+
}
|
|
983
|
+
if (value === 0) {
|
|
984
|
+
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
985
|
+
}
|
|
986
|
+
if (!signed) {
|
|
987
|
+
value >>>= 0;
|
|
988
|
+
}
|
|
989
|
+
return value;
|
|
990
|
+
}
|
|
991
|
+
function mwcRandom32(signed) {
|
|
992
|
+
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
993
|
+
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
994
|
+
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
995
|
+
if (!signed) {
|
|
996
|
+
value >>>= 0;
|
|
997
|
+
}
|
|
998
|
+
return value;
|
|
999
|
+
}
|
|
1000
|
+
function newId(maxLength) {
|
|
1001
|
+
if (maxLength === void 0) { maxLength = 22; }
|
|
1002
|
+
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1003
|
+
var number = random32() >>> 0;
|
|
1004
|
+
var chars = 0;
|
|
1005
|
+
var result = strEmpty;
|
|
1006
|
+
while (result.length < maxLength) {
|
|
1007
|
+
chars++;
|
|
1008
|
+
result += base64chars.charAt(number & 0x3F);
|
|
1009
|
+
number >>>= 6;
|
|
1010
|
+
if (chars === 5) {
|
|
1011
|
+
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1012
|
+
chars = 0;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
return result;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
var _objDefineProperty = ObjDefineProperty;
|
|
1019
|
+
var version = "2.7.3";
|
|
1020
|
+
var instanceName = "." + newId(6);
|
|
1021
|
+
var _dataUid = 0;
|
|
1022
|
+
function _createAccessor(target, prop, value) {
|
|
1023
|
+
if (_objDefineProperty) {
|
|
1024
|
+
try {
|
|
1025
|
+
_objDefineProperty(target, prop, {
|
|
1026
|
+
value: value,
|
|
1027
|
+
enumerable: false,
|
|
1028
|
+
configurable: true
|
|
1029
|
+
});
|
|
1030
|
+
return true;
|
|
1031
|
+
}
|
|
1032
|
+
catch (e) {
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
return false;
|
|
1036
|
+
}
|
|
1037
|
+
function _canAcceptData(target) {
|
|
1038
|
+
return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);
|
|
1039
|
+
}
|
|
1040
|
+
function _getCache(data, target) {
|
|
1041
|
+
var theCache = target[data.id];
|
|
1042
|
+
if (!theCache) {
|
|
1043
|
+
theCache = {};
|
|
1044
|
+
try {
|
|
1045
|
+
if (_canAcceptData(target)) {
|
|
1046
|
+
if (!_createAccessor(target, data.id, theCache)) {
|
|
1047
|
+
target[data.id] = theCache;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
catch (e) {
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return theCache;
|
|
1055
|
+
}
|
|
1056
|
+
function createUniqueNamespace(name, includeVersion) {
|
|
1057
|
+
if (includeVersion === void 0) { includeVersion = false; }
|
|
1058
|
+
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName);
|
|
1059
|
+
}
|
|
1060
|
+
function createElmNodeData(name) {
|
|
1061
|
+
var data = {
|
|
1062
|
+
id: createUniqueNamespace("_aiData-" + (name || "") + "." + version),
|
|
1063
|
+
accept: function (target) {
|
|
1064
|
+
return _canAcceptData(target);
|
|
1065
|
+
},
|
|
1066
|
+
get: function (target, name, defValue, addDefault) {
|
|
1067
|
+
var theCache = target[data.id];
|
|
1068
|
+
if (!theCache) {
|
|
1069
|
+
if (addDefault) {
|
|
1070
|
+
theCache = _getCache(data, target);
|
|
1071
|
+
theCache[normalizeJsName(name)] = defValue;
|
|
1072
|
+
}
|
|
1073
|
+
return defValue;
|
|
1074
|
+
}
|
|
1075
|
+
return theCache[normalizeJsName(name)];
|
|
1076
|
+
},
|
|
1077
|
+
kill: function (target, name) {
|
|
1078
|
+
if (target && target[name]) {
|
|
1079
|
+
try {
|
|
1080
|
+
delete target[name];
|
|
1081
|
+
}
|
|
1082
|
+
catch (e) {
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
return data;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
var pluginStateData = createElmNodeData("plugin");
|
|
1091
|
+
function _getPluginState(plugin) {
|
|
1092
|
+
return pluginStateData.get(plugin, "state", {}, true);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
984
1095
|
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
985
1096
|
var strHasRunFlags = "_hasRun";
|
|
986
1097
|
var strGetTelCtx = "_getTelCtx";
|
|
@@ -994,53 +1105,66 @@
|
|
|
994
1105
|
}
|
|
995
1106
|
return createTelemetryProxyChain([startAt], config, core);
|
|
996
1107
|
}
|
|
997
|
-
function
|
|
998
|
-
var _nextProxy =
|
|
999
|
-
var _onComplete =
|
|
1000
|
-
if (startAt) {
|
|
1001
|
-
_nextProxy = _getNextProxyStart(telemetryChain, config, core, startAt);
|
|
1002
|
-
}
|
|
1003
|
-
else {
|
|
1004
|
-
_nextProxy = telemetryChain;
|
|
1005
|
-
}
|
|
1108
|
+
function _createInternalContext(telemetryChain, config, core, startAt) {
|
|
1109
|
+
var _nextProxy = startAt ? _getNextProxyStart(telemetryChain, config, core, startAt) : telemetryChain;
|
|
1110
|
+
var _onComplete = [];
|
|
1006
1111
|
var context = {
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1112
|
+
_next: _moveNext,
|
|
1113
|
+
ctx: {
|
|
1114
|
+
core: function () { return core; },
|
|
1115
|
+
diagLog: function () {
|
|
1116
|
+
return safeGetLogger(core, config);
|
|
1117
|
+
},
|
|
1118
|
+
getCfg: function () {
|
|
1119
|
+
return config;
|
|
1120
|
+
},
|
|
1121
|
+
getExtCfg: _getExtCfg,
|
|
1122
|
+
getConfig: _getConfig,
|
|
1123
|
+
hasNext: function () {
|
|
1124
|
+
return !!_nextProxy;
|
|
1125
|
+
},
|
|
1126
|
+
getNext: function () {
|
|
1127
|
+
return _nextProxy;
|
|
1128
|
+
},
|
|
1129
|
+
setNext: function (nextPlugin) {
|
|
1130
|
+
_nextProxy = nextPlugin;
|
|
1131
|
+
},
|
|
1132
|
+
iterate: _iterateChain,
|
|
1133
|
+
onComplete: _addOnComplete
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
function _addOnComplete(onComplete, that) {
|
|
1137
|
+
var args = [];
|
|
1138
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1139
|
+
args[_i - 2] = arguments[_i];
|
|
1140
|
+
}
|
|
1141
|
+
if (onComplete) {
|
|
1142
|
+
_onComplete.push({
|
|
1143
|
+
func: onComplete,
|
|
1144
|
+
self: !isUndefined(that) ? that : context.ctx,
|
|
1145
|
+
args: args
|
|
1030
1146
|
});
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
function _moveNext() {
|
|
1150
|
+
var nextProxy = _nextProxy;
|
|
1151
|
+
_nextProxy = nextProxy ? nextProxy.getNext() : null;
|
|
1152
|
+
if (!nextProxy) {
|
|
1153
|
+
var onComplete = _onComplete;
|
|
1154
|
+
if (onComplete && onComplete.length > 0) {
|
|
1155
|
+
arrForEach(onComplete, function (completeDetails) {
|
|
1156
|
+
try {
|
|
1157
|
+
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
1158
|
+
}
|
|
1159
|
+
catch (e) {
|
|
1160
|
+
core.logger.throwInternal(2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
_onComplete = [];
|
|
1037
1164
|
}
|
|
1038
|
-
return createProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
|
|
1039
|
-
},
|
|
1040
|
-
onComplete: function (onComplete) {
|
|
1041
|
-
_onComplete = onComplete;
|
|
1042
1165
|
}
|
|
1043
|
-
|
|
1166
|
+
return nextProxy;
|
|
1167
|
+
}
|
|
1044
1168
|
function _getExtCfg(identifier, defaultValue, mergeDefault) {
|
|
1045
1169
|
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1046
1170
|
if (mergeDefault === void 0) { mergeDefault = 0 ; }
|
|
@@ -1083,29 +1207,53 @@
|
|
|
1083
1207
|
}
|
|
1084
1208
|
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1085
1209
|
}
|
|
1086
|
-
function
|
|
1087
|
-
var nextPlugin
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
else {
|
|
1093
|
-
if (_onComplete) {
|
|
1094
|
-
_onComplete();
|
|
1095
|
-
_onComplete = null;
|
|
1210
|
+
function _iterateChain(cb) {
|
|
1211
|
+
var nextPlugin;
|
|
1212
|
+
while (!!(nextPlugin = context._next())) {
|
|
1213
|
+
var plugin = nextPlugin.getPlugin();
|
|
1214
|
+
if (plugin) {
|
|
1215
|
+
cb(plugin);
|
|
1096
1216
|
}
|
|
1097
1217
|
}
|
|
1098
1218
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1219
|
+
return context;
|
|
1220
|
+
}
|
|
1221
|
+
function createProcessTelemetryContext(telemetryChain, config, core, startAt) {
|
|
1222
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1223
|
+
var context = internalContext.ctx;
|
|
1224
|
+
function _processNext(env) {
|
|
1225
|
+
var nextPlugin = internalContext._next();
|
|
1226
|
+
nextPlugin && nextPlugin.processTelemetry(env, context);
|
|
1227
|
+
return !nextPlugin;
|
|
1228
|
+
}
|
|
1229
|
+
function _createNew(plugins, startAt) {
|
|
1230
|
+
if (plugins === void 0) { plugins = null; }
|
|
1231
|
+
if (isArray(plugins)) {
|
|
1232
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1233
|
+
}
|
|
1234
|
+
return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt);
|
|
1235
|
+
}
|
|
1236
|
+
context.processNext = _processNext;
|
|
1237
|
+
context.createNew = _createNew;
|
|
1238
|
+
return context;
|
|
1239
|
+
}
|
|
1240
|
+
function createProcessTelemetryUnloadContext(telemetryChain, config, core, startAt) {
|
|
1241
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1242
|
+
var context = internalContext.ctx;
|
|
1243
|
+
function _processNext(unloadState) {
|
|
1244
|
+
var nextPlugin = internalContext._next();
|
|
1245
|
+
nextPlugin && nextPlugin.unload(context, unloadState);
|
|
1246
|
+
return !nextPlugin;
|
|
1247
|
+
}
|
|
1248
|
+
function _createNew(plugins, startAt) {
|
|
1249
|
+
if (plugins === void 0) { plugins = null; }
|
|
1250
|
+
if (isArray(plugins)) {
|
|
1251
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1107
1252
|
}
|
|
1253
|
+
return createProcessTelemetryUnloadContext(plugins || context.getNext(), config, core, startAt);
|
|
1108
1254
|
}
|
|
1255
|
+
context.processNext = _processNext;
|
|
1256
|
+
context.createNew = _createNew;
|
|
1109
1257
|
return context;
|
|
1110
1258
|
}
|
|
1111
1259
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
@@ -1153,32 +1301,35 @@
|
|
|
1153
1301
|
return nextProxy;
|
|
1154
1302
|
},
|
|
1155
1303
|
processTelemetry: _processTelemetry,
|
|
1304
|
+
unload: _unloadPlugin,
|
|
1156
1305
|
_id: chainId,
|
|
1157
1306
|
_setNext: function (nextPlugin) {
|
|
1158
1307
|
nextProxy = nextPlugin;
|
|
1159
1308
|
}
|
|
1160
1309
|
};
|
|
1161
|
-
function
|
|
1310
|
+
function _getTelCtx() {
|
|
1311
|
+
var itemCtx;
|
|
1312
|
+
if (plugin && isFunction(plugin[strGetTelCtx])) {
|
|
1313
|
+
itemCtx = plugin[strGetTelCtx]();
|
|
1314
|
+
}
|
|
1162
1315
|
if (!itemCtx) {
|
|
1163
|
-
|
|
1164
|
-
itemCtx = plugin[strGetTelCtx]();
|
|
1165
|
-
}
|
|
1166
|
-
if (!itemCtx) {
|
|
1167
|
-
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
1168
|
-
}
|
|
1316
|
+
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
1169
1317
|
}
|
|
1318
|
+
return itemCtx;
|
|
1319
|
+
}
|
|
1320
|
+
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
1321
|
+
var hasRun = false;
|
|
1170
1322
|
var identifier = plugin ? plugin.identifier : strTelemetryPluginChain;
|
|
1171
1323
|
var hasRunContext = itemCtx[strHasRunFlags];
|
|
1172
1324
|
if (!hasRunContext) {
|
|
1173
1325
|
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
1174
1326
|
}
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
if (plugin) {
|
|
1327
|
+
itemCtx.setNext(nextProxy);
|
|
1328
|
+
if (plugin) {
|
|
1329
|
+
doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () {
|
|
1330
|
+
hasRunContext[chainId] = true;
|
|
1180
1331
|
try {
|
|
1181
|
-
var nextId = nextProxy ? nextProxy._id :
|
|
1332
|
+
var nextId = nextProxy ? nextProxy._id : strEmpty;
|
|
1182
1333
|
if (nextId) {
|
|
1183
1334
|
hasRunContext[nextId] = false;
|
|
1184
1335
|
}
|
|
@@ -1190,18 +1341,21 @@
|
|
|
1190
1341
|
hasRun = true;
|
|
1191
1342
|
}
|
|
1192
1343
|
if (!nextProxy || !hasNextRun) {
|
|
1193
|
-
itemCtx.diagLog().throwInternal(
|
|
1344
|
+
itemCtx.diagLog().throwInternal(1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1194
1345
|
}
|
|
1195
1346
|
}
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
}
|
|
1200
|
-
}, details, isAsync);
|
|
1347
|
+
}, details, isAsync);
|
|
1348
|
+
}
|
|
1349
|
+
return hasRun;
|
|
1201
1350
|
}
|
|
1202
1351
|
function _processTelemetry(env, itemCtx) {
|
|
1203
|
-
|
|
1204
|
-
|
|
1352
|
+
itemCtx = itemCtx || _getTelCtx();
|
|
1353
|
+
function _callProcessTelemetry(itemCtx) {
|
|
1354
|
+
if (!plugin || !hasProcessTelemetry) {
|
|
1355
|
+
return false;
|
|
1356
|
+
}
|
|
1357
|
+
var pluginState = _getPluginState(plugin);
|
|
1358
|
+
if (pluginState[strTeardown] || pluginState[strDisabled]) {
|
|
1205
1359
|
return false;
|
|
1206
1360
|
}
|
|
1207
1361
|
if (hasSetNext) {
|
|
@@ -1209,9 +1363,31 @@
|
|
|
1209
1363
|
}
|
|
1210
1364
|
plugin.processTelemetry(env, itemCtx);
|
|
1211
1365
|
return true;
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
|
|
1366
|
+
}
|
|
1367
|
+
if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) {
|
|
1368
|
+
itemCtx.processNext(env);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
function _unloadPlugin(unloadCtx, unloadState) {
|
|
1372
|
+
function _callTeardown() {
|
|
1373
|
+
var hasRun = false;
|
|
1374
|
+
if (plugin) {
|
|
1375
|
+
var pluginState = _getPluginState(plugin);
|
|
1376
|
+
var pluginCore = plugin[strCore] || pluginState.core;
|
|
1377
|
+
if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) {
|
|
1378
|
+
pluginState[strCore] = null;
|
|
1379
|
+
pluginState[strTeardown] = true;
|
|
1380
|
+
pluginState[strIsInitialized] = false;
|
|
1381
|
+
if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) {
|
|
1382
|
+
hasRun = true;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return hasRun;
|
|
1387
|
+
}
|
|
1388
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) {
|
|
1389
|
+
unloadCtx.processNext(unloadState);
|
|
1390
|
+
}
|
|
1215
1391
|
}
|
|
1216
1392
|
return objFreeze(proxyChain);
|
|
1217
1393
|
}
|
|
@@ -1232,6 +1408,38 @@
|
|
|
1232
1408
|
_setDefaults(config, core, pluginChain);
|
|
1233
1409
|
_isinitialized = true;
|
|
1234
1410
|
};
|
|
1411
|
+
_self.teardown = function (unloadCtx, unloadState) {
|
|
1412
|
+
if (!_self.core || (unloadCtx && _self.core !== unloadCtx.core())) {
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
var result;
|
|
1416
|
+
var unloadDone = false;
|
|
1417
|
+
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1418
|
+
var theUnloadState = unloadState || {
|
|
1419
|
+
reason: 0 ,
|
|
1420
|
+
isAsync: false
|
|
1421
|
+
};
|
|
1422
|
+
function _unloadCallback() {
|
|
1423
|
+
if (!unloadDone) {
|
|
1424
|
+
unloadDone = true;
|
|
1425
|
+
arrForEach(_hooks, function (fn) {
|
|
1426
|
+
fn.rm();
|
|
1427
|
+
});
|
|
1428
|
+
_hooks = [];
|
|
1429
|
+
if (result === true) {
|
|
1430
|
+
theUnloadCtx.processNext(theUnloadState);
|
|
1431
|
+
}
|
|
1432
|
+
_initDefaults();
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
|
1436
|
+
_unloadCallback();
|
|
1437
|
+
}
|
|
1438
|
+
else {
|
|
1439
|
+
result = true;
|
|
1440
|
+
}
|
|
1441
|
+
return result;
|
|
1442
|
+
};
|
|
1235
1443
|
_self._addHook = function (hooks) {
|
|
1236
1444
|
if (hooks) {
|
|
1237
1445
|
if (isArray(hooks)) {
|
|
@@ -1246,13 +1454,13 @@
|
|
|
1246
1454
|
_self.diagLog = function (itemCtx) {
|
|
1247
1455
|
return _getTelCtx(itemCtx).diagLog();
|
|
1248
1456
|
};
|
|
1249
|
-
_self
|
|
1457
|
+
_self[strIsInitialized] = function () {
|
|
1250
1458
|
return _isinitialized;
|
|
1251
1459
|
};
|
|
1252
1460
|
_self.setInitialized = function (isInitialized) {
|
|
1253
1461
|
_isinitialized = isInitialized;
|
|
1254
1462
|
};
|
|
1255
|
-
_self
|
|
1463
|
+
_self[strSetNextPlugin] = function (next) {
|
|
1256
1464
|
_nextPlugin = next;
|
|
1257
1465
|
};
|
|
1258
1466
|
_self.processNext = function (env, itemCtx) {
|
|
@@ -1303,6 +1511,191 @@
|
|
|
1303
1511
|
return BaseTelemetryPlugin;
|
|
1304
1512
|
}());
|
|
1305
1513
|
|
|
1514
|
+
var strOnPrefix = "on";
|
|
1515
|
+
var strAttachEvent = "attachEvent";
|
|
1516
|
+
var strAddEventHelper = "addEventListener";
|
|
1517
|
+
var strEvents = "events";
|
|
1518
|
+
createUniqueNamespace("aiEvtPageHide");
|
|
1519
|
+
createUniqueNamespace("aiEvtPageShow");
|
|
1520
|
+
var _guid = 1;
|
|
1521
|
+
var elmNodeData = createElmNodeData("events");
|
|
1522
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
1523
|
+
function _normalizeNamespace(name) {
|
|
1524
|
+
if (name && name.replace) {
|
|
1525
|
+
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
1526
|
+
}
|
|
1527
|
+
return name;
|
|
1528
|
+
}
|
|
1529
|
+
function _getEvtNamespace(eventName, namespaces) {
|
|
1530
|
+
if (namespaces) {
|
|
1531
|
+
var theNamespace_1 = "";
|
|
1532
|
+
if (isArray(namespaces)) {
|
|
1533
|
+
theNamespace_1 = "";
|
|
1534
|
+
arrForEach(namespaces, function (name) {
|
|
1535
|
+
name = _normalizeNamespace(name);
|
|
1536
|
+
if (name) {
|
|
1537
|
+
if (name[0] !== ".") {
|
|
1538
|
+
name = "." + name;
|
|
1539
|
+
}
|
|
1540
|
+
theNamespace_1 += name;
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
else {
|
|
1545
|
+
theNamespace_1 = _normalizeNamespace(namespaces);
|
|
1546
|
+
}
|
|
1547
|
+
if (theNamespace_1) {
|
|
1548
|
+
if (theNamespace_1[0] !== ".") {
|
|
1549
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
1550
|
+
}
|
|
1551
|
+
eventName = (eventName || "") + theNamespace_1;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
var parsedEvent = (eventNamespace.exec(eventName) || []);
|
|
1555
|
+
return {
|
|
1556
|
+
type: parsedEvent[1],
|
|
1557
|
+
ns: ((parsedEvent[2] || "").split(".").sort()).join(".")
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
1561
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
1562
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
1563
|
+
var registeredEvents = aiEvts[evtName];
|
|
1564
|
+
if (!registeredEvents) {
|
|
1565
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
1566
|
+
}
|
|
1567
|
+
return registeredEvents;
|
|
1568
|
+
}
|
|
1569
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
1570
|
+
var result = false;
|
|
1571
|
+
if (obj && evtName && evtName.type && handlerRef) {
|
|
1572
|
+
if (obj[strAddEventHelper]) {
|
|
1573
|
+
obj[strAddEventHelper](evtName.type, handlerRef, useCapture);
|
|
1574
|
+
result = true;
|
|
1575
|
+
}
|
|
1576
|
+
else if (obj[strAttachEvent]) {
|
|
1577
|
+
obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef);
|
|
1578
|
+
result = true;
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
return result;
|
|
1582
|
+
}
|
|
1583
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
1584
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1585
|
+
var result = false;
|
|
1586
|
+
if (target) {
|
|
1587
|
+
try {
|
|
1588
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
1589
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
1590
|
+
if (result && elmNodeData.accept(target)) {
|
|
1591
|
+
var registeredEvent = {
|
|
1592
|
+
guid: _guid++,
|
|
1593
|
+
evtName: evtName,
|
|
1594
|
+
handler: handlerRef,
|
|
1595
|
+
capture: useCapture
|
|
1596
|
+
};
|
|
1597
|
+
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
catch (e) {
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
return result;
|
|
1604
|
+
}
|
|
1605
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
1606
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1607
|
+
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
var LoggingSeverity = createEnumStyle({
|
|
1611
|
+
CRITICAL: 1 ,
|
|
1612
|
+
WARNING: 2
|
|
1613
|
+
});
|
|
1614
|
+
var _InternalMessageId = createEnumStyle({
|
|
1615
|
+
BrowserDoesNotSupportLocalStorage: 0 ,
|
|
1616
|
+
BrowserCannotReadLocalStorage: 1 ,
|
|
1617
|
+
BrowserCannotReadSessionStorage: 2 ,
|
|
1618
|
+
BrowserCannotWriteLocalStorage: 3 ,
|
|
1619
|
+
BrowserCannotWriteSessionStorage: 4 ,
|
|
1620
|
+
BrowserFailedRemovalFromLocalStorage: 5 ,
|
|
1621
|
+
BrowserFailedRemovalFromSessionStorage: 6 ,
|
|
1622
|
+
CannotSendEmptyTelemetry: 7 ,
|
|
1623
|
+
ClientPerformanceMathError: 8 ,
|
|
1624
|
+
ErrorParsingAISessionCookie: 9 ,
|
|
1625
|
+
ErrorPVCalc: 10 ,
|
|
1626
|
+
ExceptionWhileLoggingError: 11 ,
|
|
1627
|
+
FailedAddingTelemetryToBuffer: 12 ,
|
|
1628
|
+
FailedMonitorAjaxAbort: 13 ,
|
|
1629
|
+
FailedMonitorAjaxDur: 14 ,
|
|
1630
|
+
FailedMonitorAjaxOpen: 15 ,
|
|
1631
|
+
FailedMonitorAjaxRSC: 16 ,
|
|
1632
|
+
FailedMonitorAjaxSend: 17 ,
|
|
1633
|
+
FailedMonitorAjaxGetCorrelationHeader: 18 ,
|
|
1634
|
+
FailedToAddHandlerForOnBeforeUnload: 19 ,
|
|
1635
|
+
FailedToSendQueuedTelemetry: 20 ,
|
|
1636
|
+
FailedToReportDataLoss: 21 ,
|
|
1637
|
+
FlushFailed: 22 ,
|
|
1638
|
+
MessageLimitPerPVExceeded: 23 ,
|
|
1639
|
+
MissingRequiredFieldSpecification: 24 ,
|
|
1640
|
+
NavigationTimingNotSupported: 25 ,
|
|
1641
|
+
OnError: 26 ,
|
|
1642
|
+
SessionRenewalDateIsZero: 27 ,
|
|
1643
|
+
SenderNotInitialized: 28 ,
|
|
1644
|
+
StartTrackEventFailed: 29 ,
|
|
1645
|
+
StopTrackEventFailed: 30 ,
|
|
1646
|
+
StartTrackFailed: 31 ,
|
|
1647
|
+
StopTrackFailed: 32 ,
|
|
1648
|
+
TelemetrySampledAndNotSent: 33 ,
|
|
1649
|
+
TrackEventFailed: 34 ,
|
|
1650
|
+
TrackExceptionFailed: 35 ,
|
|
1651
|
+
TrackMetricFailed: 36 ,
|
|
1652
|
+
TrackPVFailed: 37 ,
|
|
1653
|
+
TrackPVFailedCalc: 38 ,
|
|
1654
|
+
TrackTraceFailed: 39 ,
|
|
1655
|
+
TransmissionFailed: 40 ,
|
|
1656
|
+
FailedToSetStorageBuffer: 41 ,
|
|
1657
|
+
FailedToRestoreStorageBuffer: 42 ,
|
|
1658
|
+
InvalidBackendResponse: 43 ,
|
|
1659
|
+
FailedToFixDepricatedValues: 44 ,
|
|
1660
|
+
InvalidDurationValue: 45 ,
|
|
1661
|
+
TelemetryEnvelopeInvalid: 46 ,
|
|
1662
|
+
CreateEnvelopeError: 47 ,
|
|
1663
|
+
CannotSerializeObject: 48 ,
|
|
1664
|
+
CannotSerializeObjectNonSerializable: 49 ,
|
|
1665
|
+
CircularReferenceDetected: 50 ,
|
|
1666
|
+
ClearAuthContextFailed: 51 ,
|
|
1667
|
+
ExceptionTruncated: 52 ,
|
|
1668
|
+
IllegalCharsInName: 53 ,
|
|
1669
|
+
ItemNotInArray: 54 ,
|
|
1670
|
+
MaxAjaxPerPVExceeded: 55 ,
|
|
1671
|
+
MessageTruncated: 56 ,
|
|
1672
|
+
NameTooLong: 57 ,
|
|
1673
|
+
SampleRateOutOfRange: 58 ,
|
|
1674
|
+
SetAuthContextFailed: 59 ,
|
|
1675
|
+
SetAuthContextFailedAccountName: 60 ,
|
|
1676
|
+
StringValueTooLong: 61 ,
|
|
1677
|
+
StartCalledMoreThanOnce: 62 ,
|
|
1678
|
+
StopCalledWithoutStart: 63 ,
|
|
1679
|
+
TelemetryInitializerFailed: 64 ,
|
|
1680
|
+
TrackArgumentsNotSpecified: 65 ,
|
|
1681
|
+
UrlTooLong: 66 ,
|
|
1682
|
+
SessionStorageBufferFull: 67 ,
|
|
1683
|
+
CannotAccessCookie: 68 ,
|
|
1684
|
+
IdTooLong: 69 ,
|
|
1685
|
+
InvalidEvent: 70 ,
|
|
1686
|
+
FailedMonitorAjaxSetRequestHeader: 71 ,
|
|
1687
|
+
SendBrowserInfoOnUserInit: 72 ,
|
|
1688
|
+
PluginException: 73 ,
|
|
1689
|
+
NotificationException: 74 ,
|
|
1690
|
+
SnippetScriptLoadFailure: 99 ,
|
|
1691
|
+
InvalidInstrumentationKey: 100 ,
|
|
1692
|
+
CannotParseAiBlobValue: 101 ,
|
|
1693
|
+
InvalidContentBlob: 102 ,
|
|
1694
|
+
TrackPageActionEventFailed: 103 ,
|
|
1695
|
+
FailedAddingCustomDefinedRequestContext: 104 ,
|
|
1696
|
+
InMemoryStorageBufferFull: 105
|
|
1697
|
+
});
|
|
1698
|
+
|
|
1306
1699
|
var strNotSpecified = "not_specified";
|
|
1307
1700
|
|
|
1308
1701
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
@@ -2158,7 +2551,7 @@
|
|
|
2158
2551
|
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.TrackPageActionEventFailed, "trackPageAction failed, page action event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2159
2552
|
}
|
|
2160
2553
|
};
|
|
2161
|
-
ClickAnalyticsPlugin.Version = "2.8.0-beta.
|
|
2554
|
+
ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-02";
|
|
2162
2555
|
return ClickAnalyticsPlugin;
|
|
2163
2556
|
}(BaseTelemetryPlugin));
|
|
2164
2557
|
|