@microsoft/applicationinsights-web-basic 3.0.0-beta.2211-03 → 3.0.0-beta.2212-03
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/aib.2.js +1072 -1222
- package/browser/aib.2.js.map +1 -1
- package/browser/aib.2.min.js +2 -2
- package/browser/aib.2.min.js.map +1 -1
- package/browser/aib.3.0.0-beta.2212-03.integrity.json +26 -0
- package/browser/{aib.3.0.0-beta.2211-03.js → aib.3.0.0-beta.2212-03.js} +1073 -1223
- package/browser/aib.3.0.0-beta.2212-03.js.map +1 -0
- package/browser/aib.3.0.0-beta.2212-03.min.js +6 -0
- package/browser/aib.3.0.0-beta.2212-03.min.js.map +1 -0
- package/dist/applicationinsights-web-basic.api.json +113 -81
- package/dist/applicationinsights-web-basic.api.md +7 -8
- package/dist/applicationinsights-web-basic.d.ts +14 -8
- package/dist/applicationinsights-web-basic.js +1072 -1222
- package/dist/applicationinsights-web-basic.js.map +1 -1
- package/dist/applicationinsights-web-basic.min.js +2 -2
- package/dist/applicationinsights-web-basic.min.js.map +1 -1
- package/dist/applicationinsights-web-basic.rollup.d.ts +14 -8
- package/dist-esm/__DynamicConstants.js +3 -2
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/index.js +27 -17
- package/dist-esm/index.js.map +1 -1
- package/package.json +5 -5
- package/src/__DynamicConstants.ts +2 -1
- package/src/index.ts +43 -26
- package/types/__DynamicConstants.d.ts +2 -1
- package/types/index.d.ts +8 -2
- package/browser/aib.3.0.0-beta.2211-03.integrity.json +0 -26
- package/browser/aib.3.0.0-beta.2211-03.js.map +0 -1
- package/browser/aib.3.0.0-beta.2211-03.min.js +0 -6
- package/browser/aib.3.0.0-beta.2211-03.min.js.map +0 -1
package/browser/aib.2.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.
|
|
2
|
+
* Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2212-03
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -582,114 +582,39 @@
|
|
|
582
582
|
return registry.k[key];
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
this.constructor = d;
|
|
602
|
-
}
|
|
603
|
-
__[PROTOTYPE] = b[PROTOTYPE];
|
|
604
|
-
__[PROTOTYPE].name = name;
|
|
605
|
-
d[PROTOTYPE] = new __();
|
|
606
|
-
return d;
|
|
607
|
-
}
|
|
608
|
-
function createCustomError(name, constructCb) {
|
|
609
|
-
var baseClass = Error;
|
|
610
|
-
var customError = _createCustomError(name, function () {
|
|
611
|
-
var _this = this;
|
|
612
|
-
_this = baseClass.apply(_this, arguments) || _this;
|
|
613
|
-
constructCb && constructCb(_this, arguments);
|
|
614
|
-
return _this;
|
|
615
|
-
}, baseClass);
|
|
616
|
-
return customError;
|
|
617
|
-
}
|
|
618
|
-
var _unsupportedError;
|
|
619
|
-
function throwUnsupported(message) {
|
|
620
|
-
if (!_unsupportedError) {
|
|
621
|
-
_unsupportedError = createCustomError("UnsupportedError");
|
|
622
|
-
}
|
|
623
|
-
throw new _unsupportedError(message);
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
function dumpObj(object, format) {
|
|
627
|
-
var objectTypeDump = objToString(object);
|
|
628
|
-
var propertyValueDump = "";
|
|
629
|
-
if (objectTypeDump === "[object Error]") {
|
|
630
|
-
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
631
|
-
}
|
|
632
|
-
else {
|
|
633
|
-
try {
|
|
634
|
-
if (format) {
|
|
635
|
-
if (isNumber(format)) {
|
|
636
|
-
propertyValueDump = JSON.stringify(object, null, format);
|
|
637
|
-
}
|
|
638
|
-
else {
|
|
639
|
-
propertyValueDump = JSON.stringify(object, null, 4);
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
propertyValueDump = JSON.stringify(object);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
catch (e) {
|
|
647
|
-
propertyValueDump = objToString(object) + " - " + dumpObj(e, format);
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
return objectTypeDump + ": " + propertyValueDump;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
var _objDefineProperty$1 = ObjClass["defineProperty"];
|
|
654
|
-
function objDefineProp(target, key, descriptor) {
|
|
655
|
-
if (_objDefineProperty$1) {
|
|
656
|
-
_objDefineProperty$1(target, key, descriptor);
|
|
657
|
-
return target;
|
|
658
|
-
}
|
|
659
|
-
throwUnsupported("Unable to define property [" + objToString(key) + "] on " + dumpObj(target));
|
|
585
|
+
var propMap = {
|
|
586
|
+
e: "enumerable",
|
|
587
|
+
c: "configurable",
|
|
588
|
+
v: VALUE,
|
|
589
|
+
w: "writable",
|
|
590
|
+
g: "get",
|
|
591
|
+
s: "set"
|
|
592
|
+
};
|
|
593
|
+
function _createProp(value) {
|
|
594
|
+
var prop = {};
|
|
595
|
+
prop[propMap["c"]] = true;
|
|
596
|
+
prop[propMap["e"]] = true;
|
|
597
|
+
objForEachKey(value, function (key, value) {
|
|
598
|
+
prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
|
|
599
|
+
});
|
|
600
|
+
return prop;
|
|
660
601
|
}
|
|
661
|
-
|
|
602
|
+
var objDefineProp = ObjClass.defineProperty;
|
|
603
|
+
function objDefineAccessors(target, prop, getProp, setProp, configurable, enumerable) {
|
|
662
604
|
var desc = {
|
|
663
|
-
|
|
664
|
-
|
|
605
|
+
e: enumerable,
|
|
606
|
+
c: configurable
|
|
665
607
|
};
|
|
666
|
-
if (
|
|
667
|
-
desc.
|
|
608
|
+
if (getProp) {
|
|
609
|
+
desc.g = getProp;
|
|
668
610
|
}
|
|
669
|
-
|
|
670
|
-
desc
|
|
611
|
+
if (setProp) {
|
|
612
|
+
desc.s = setProp;
|
|
671
613
|
}
|
|
672
|
-
return objDefineProp(target,
|
|
614
|
+
return objDefineProp(target, prop, _createProp(desc));
|
|
673
615
|
}
|
|
674
|
-
function
|
|
675
|
-
|
|
676
|
-
try {
|
|
677
|
-
var descriptor = {
|
|
678
|
-
enumerable: true,
|
|
679
|
-
configurable: isUndefined(configurable) ? true : configurable
|
|
680
|
-
};
|
|
681
|
-
if (getProp) {
|
|
682
|
-
descriptor.get = getProp;
|
|
683
|
-
}
|
|
684
|
-
if (setProp) {
|
|
685
|
-
descriptor.set = setProp;
|
|
686
|
-
}
|
|
687
|
-
return objDefineProp(target, prop, descriptor);
|
|
688
|
-
}
|
|
689
|
-
catch (e) {
|
|
690
|
-
throwUnsupported("Unable to define accessors for [" + objToString(prop) + "] on " + dumpObj(target));
|
|
691
|
-
}
|
|
692
|
-
}
|
|
616
|
+
function objDefine(target, key, propDesc) {
|
|
617
|
+
return objDefineProp(target, key, _createProp(propDesc));
|
|
693
618
|
}
|
|
694
619
|
|
|
695
620
|
var _globalLazyTestHooks;
|
|
@@ -701,24 +626,21 @@
|
|
|
701
626
|
var lazyValue = {};
|
|
702
627
|
_fetchLazyTestHooks && _fetchLazyTestHooks();
|
|
703
628
|
lazyValue.b = _globalLazyTestHooks.lzy;
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
});
|
|
713
|
-
if (lazyValue.b) {
|
|
714
|
-
delete lazyValue.b;
|
|
629
|
+
objDefine(lazyValue, "v", {
|
|
630
|
+
g: function () {
|
|
631
|
+
var result = cb();
|
|
632
|
+
if (!_globalLazyTestHooks.lzy) {
|
|
633
|
+
objDefine(lazyValue, "v", { v: result });
|
|
634
|
+
if (lazyValue.b) {
|
|
635
|
+
delete lazyValue.b;
|
|
636
|
+
}
|
|
715
637
|
}
|
|
638
|
+
if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) {
|
|
639
|
+
lazyValue.b = _globalLazyTestHooks.lzy;
|
|
640
|
+
}
|
|
641
|
+
return result;
|
|
716
642
|
}
|
|
717
|
-
|
|
718
|
-
lazyValue.b = _globalLazyTestHooks.lzy;
|
|
719
|
-
}
|
|
720
|
-
return result;
|
|
721
|
-
}, true);
|
|
643
|
+
});
|
|
722
644
|
return lazyValue;
|
|
723
645
|
}
|
|
724
646
|
|
|
@@ -824,6 +746,33 @@
|
|
|
824
746
|
}
|
|
825
747
|
}
|
|
826
748
|
|
|
749
|
+
function dumpObj(object, format) {
|
|
750
|
+
var objectTypeDump = objToString(object);
|
|
751
|
+
var propertyValueDump = "";
|
|
752
|
+
if (objectTypeDump === "[object Error]") {
|
|
753
|
+
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
try {
|
|
757
|
+
if (format) {
|
|
758
|
+
if (isNumber(format)) {
|
|
759
|
+
propertyValueDump = JSON.stringify(object, null, format);
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
propertyValueDump = JSON.stringify(object, null, 4);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
else {
|
|
766
|
+
propertyValueDump = JSON.stringify(object);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
catch (e) {
|
|
770
|
+
propertyValueDump = objToString(object) + " - " + dumpObj(e, format);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return objectTypeDump + ": " + propertyValueDump;
|
|
774
|
+
}
|
|
775
|
+
|
|
827
776
|
function _unwrapFunction(funcName) {
|
|
828
777
|
return function (thisArg) {
|
|
829
778
|
var args = [];
|
|
@@ -841,6 +790,42 @@
|
|
|
841
790
|
|
|
842
791
|
var arrMap = _unwrapFunction("map");
|
|
843
792
|
|
|
793
|
+
var arrReduce = _unwrapFunction("reduce");
|
|
794
|
+
|
|
795
|
+
function objSetPrototypeOf(obj, proto) {
|
|
796
|
+
var fn = ObjClass["setPrototypeOf"] ||
|
|
797
|
+
({ __proto__: [] } instanceof Array && function (d, b) {
|
|
798
|
+
d.__proto__ = b;
|
|
799
|
+
}) ||
|
|
800
|
+
function (d, b) {
|
|
801
|
+
objForEachKey(b, function (key, value) {
|
|
802
|
+
d[key] = value;
|
|
803
|
+
});
|
|
804
|
+
};
|
|
805
|
+
return fn(obj, proto);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
function _createCustomError(name, d, b) {
|
|
809
|
+
objSetPrototypeOf(d, b);
|
|
810
|
+
function __() {
|
|
811
|
+
this.constructor = d;
|
|
812
|
+
}
|
|
813
|
+
__[PROTOTYPE] = b[PROTOTYPE];
|
|
814
|
+
__[PROTOTYPE].name = name;
|
|
815
|
+
d[PROTOTYPE] = new __();
|
|
816
|
+
return d;
|
|
817
|
+
}
|
|
818
|
+
function createCustomError(name, constructCb) {
|
|
819
|
+
var baseClass = Error;
|
|
820
|
+
var customError = _createCustomError(name, function () {
|
|
821
|
+
var _this = this;
|
|
822
|
+
_this = baseClass.apply(_this, arguments) || _this;
|
|
823
|
+
constructCb && constructCb(_this, arguments);
|
|
824
|
+
return _this;
|
|
825
|
+
}, baseClass);
|
|
826
|
+
return customError;
|
|
827
|
+
}
|
|
828
|
+
|
|
844
829
|
function utcNow() {
|
|
845
830
|
return (Date.now || polyUtcNow)();
|
|
846
831
|
}
|
|
@@ -930,11 +915,14 @@
|
|
|
930
915
|
};
|
|
931
916
|
if (!details.isPrim) {
|
|
932
917
|
return _getSetVisited(visitMap, value, newPath, function (newEntry) {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
918
|
+
objDefine(details, "result", {
|
|
919
|
+
g: function () {
|
|
920
|
+
return newEntry.v;
|
|
921
|
+
},
|
|
922
|
+
s: function (newValue) {
|
|
923
|
+
newEntry.v = newValue;
|
|
924
|
+
}
|
|
925
|
+
});
|
|
938
926
|
var idx = 0;
|
|
939
927
|
var handler = userHandler;
|
|
940
928
|
while (!(handler || (idx < defaultDeepCopyHandlers.length ? defaultDeepCopyHandlers[idx++] : _defaultDeepCopyHandler)).call(ctx, details)) {
|
|
@@ -1114,6 +1102,7 @@
|
|
|
1114
1102
|
var _DYN_INITIALIZE = "initialize";
|
|
1115
1103
|
var _DYN_IDENTIFIER = "identifier";
|
|
1116
1104
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1105
|
+
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1117
1106
|
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1118
1107
|
var _DYN_NAME$2 = "name";
|
|
1119
1108
|
var _DYN_TIME = "time";
|
|
@@ -1125,10 +1114,9 @@
|
|
|
1125
1114
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1126
1115
|
var _DYN_ON_COMPLETE = "onComplete";
|
|
1127
1116
|
var _DYN_CALL = "call";
|
|
1128
|
-
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1129
|
-
var _DYN_FLUSH = "flush";
|
|
1130
1117
|
var _DYN_VERSION = "version";
|
|
1131
1118
|
var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
|
|
1119
|
+
var _DYN_CREATE_NEW = "createNew";
|
|
1132
1120
|
var _DYN_TEARDOWN = "teardown";
|
|
1133
1121
|
var _DYN_MESSAGE_ID = "messageId";
|
|
1134
1122
|
var _DYN_MESSAGE$1 = "message";
|
|
@@ -1138,8 +1126,6 @@
|
|
|
1138
1126
|
var _DYN_UPDATE = "update";
|
|
1139
1127
|
var _DYN_GET_NEXT = "getNext";
|
|
1140
1128
|
var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
|
|
1141
|
-
var _DYN_CREATE_NEW = "createNew";
|
|
1142
|
-
var _DYN_CONFIG = "config";
|
|
1143
1129
|
var _DYN_USER_AGENT = "userAgent";
|
|
1144
1130
|
var _DYN_SPLIT$1 = "split";
|
|
1145
1131
|
var _DYN_NODE_TYPE = "nodeType";
|
|
@@ -1565,7 +1551,7 @@
|
|
|
1565
1551
|
}
|
|
1566
1552
|
|
|
1567
1553
|
var _objDefineProperty = ObjDefineProperty;
|
|
1568
|
-
var version = "3.0.0-beta.
|
|
1554
|
+
var version = "3.0.0-beta.2212-03";
|
|
1569
1555
|
var instanceName = "." + newId(6);
|
|
1570
1556
|
var _dataUid = 0;
|
|
1571
1557
|
function _createAccessor(target, prop, value) {
|
|
@@ -2059,6 +2045,8 @@
|
|
|
2059
2045
|
createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
|
|
2060
2046
|
}
|
|
2061
2047
|
|
|
2048
|
+
var ChannelControllerPriority = 500;
|
|
2049
|
+
|
|
2062
2050
|
var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];
|
|
2063
2051
|
var _aiNamespace = null;
|
|
2064
2052
|
var _debugListener;
|
|
@@ -2272,1138 +2260,941 @@
|
|
|
2272
2260
|
_getLogger(logger)[STR_WARN_TO_CONSOLE ](message);
|
|
2273
2261
|
}
|
|
2274
2262
|
|
|
2275
|
-
var
|
|
2276
|
-
var
|
|
2277
|
-
var
|
|
2278
|
-
var
|
|
2279
|
-
var
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2263
|
+
var _a$3, _b$1;
|
|
2264
|
+
var strToGMTString = "toGMTString";
|
|
2265
|
+
var strToUTCString = "toUTCString";
|
|
2266
|
+
var strCookie = "cookie";
|
|
2267
|
+
var strExpires = "expires";
|
|
2268
|
+
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
2269
|
+
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
2270
|
+
var strConfigCookieMgr = "_ckMgr";
|
|
2271
|
+
var _supportsCookies = null;
|
|
2272
|
+
var _allowUaSameSite = null;
|
|
2273
|
+
var _parsedCookieValue = null;
|
|
2274
|
+
var _doc = getDocument();
|
|
2275
|
+
var _cookieCache = {};
|
|
2276
|
+
var _globalCookieConfig = {};
|
|
2277
|
+
var defaultConfig$1 = objDeepFreeze((_a$3 = {},
|
|
2278
|
+
_a$3[STR_DOMAIN] = { fb: "cookieDomain", dfVal: isNotNullOrUndefined },
|
|
2279
|
+
_a$3.path = { fb: "cookiePath", dfVal: isNotNullOrUndefined },
|
|
2280
|
+
_a$3.enabled = UNDEFINED_VALUE$1,
|
|
2281
|
+
_a$3));
|
|
2282
|
+
var rootDefaultConfig = (_b$1 = {
|
|
2283
|
+
cookieCfg: {},
|
|
2284
|
+
cookieDomain: UNDEFINED_VALUE$1,
|
|
2285
|
+
cookiePath: UNDEFINED_VALUE$1
|
|
2286
|
+
},
|
|
2287
|
+
_b$1[strDisableCookiesUsage] = UNDEFINED_VALUE$1,
|
|
2288
|
+
_b$1);
|
|
2289
|
+
function _isMgrEnabled(cookieMgr) {
|
|
2290
|
+
if (cookieMgr) {
|
|
2291
|
+
return cookieMgr.isEnabled();
|
|
2292
|
+
}
|
|
2293
|
+
return true;
|
|
2294
|
+
}
|
|
2295
|
+
function _isIgnoredCookie(cookieMgrCfg, name) {
|
|
2296
|
+
if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) {
|
|
2297
|
+
return arrIndexOf(cookieMgrCfg.ignoreCookies, name) !== -1;
|
|
2298
|
+
}
|
|
2299
|
+
return false;
|
|
2300
|
+
}
|
|
2301
|
+
function _isBlockedCookie(cookieMgrCfg, name) {
|
|
2302
|
+
if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {
|
|
2303
|
+
if (arrIndexOf(cookieMgrCfg.blockedCookies, name) !== -1) {
|
|
2304
|
+
return true;
|
|
2295
2305
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2306
|
+
}
|
|
2307
|
+
return _isIgnoredCookie(cookieMgrCfg, name);
|
|
2308
|
+
}
|
|
2309
|
+
function createCookieMgr(rootConfig, logger) {
|
|
2310
|
+
var cookieMgrConfig;
|
|
2311
|
+
var _path;
|
|
2312
|
+
var _domain;
|
|
2313
|
+
var _enabled;
|
|
2314
|
+
var _getCookieFn;
|
|
2315
|
+
var _setCookieFn;
|
|
2316
|
+
var _delCookieFn;
|
|
2317
|
+
rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;
|
|
2318
|
+
onConfigChange(rootConfig, function (details) {
|
|
2319
|
+
details[_DYN_SET_DF ](details.cfg, rootDefaultConfig);
|
|
2320
|
+
cookieMgrConfig = details[_DYN_SET_DF ](details.cfg.cookieCfg, defaultConfig$1);
|
|
2321
|
+
var isEnabled = cookieMgrConfig.enabled;
|
|
2322
|
+
if (isNullOrUndefined(isEnabled)) {
|
|
2323
|
+
var cookieEnabled = void 0;
|
|
2324
|
+
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
2325
|
+
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
2302
2326
|
}
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
_self[_DYN_SET_CTX ] = function (key, value) {
|
|
2306
|
-
if (key) {
|
|
2307
|
-
if (key === PerfEvent[strParentContextKey]) {
|
|
2308
|
-
if (!_self[key]) {
|
|
2309
|
-
_self[_DYN_IS_CHILD_EVT ] = function () { return true; };
|
|
2310
|
-
}
|
|
2311
|
-
_self[key] = value;
|
|
2312
|
-
}
|
|
2313
|
-
else if (key === PerfEvent[strChildrenContextKey]) {
|
|
2314
|
-
_self[key] = value;
|
|
2315
|
-
}
|
|
2316
|
-
else {
|
|
2317
|
-
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
2318
|
-
ctx[key] = value;
|
|
2319
|
-
}
|
|
2327
|
+
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
2328
|
+
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
2320
2329
|
}
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2330
|
+
isEnabled = cookieEnabled;
|
|
2331
|
+
}
|
|
2332
|
+
_path = cookieMgrConfig[STR_PATH ] || "/";
|
|
2333
|
+
_domain = cookieMgrConfig[STR_DOMAIN ];
|
|
2334
|
+
_enabled = isEnabled !== false;
|
|
2335
|
+
_getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;
|
|
2336
|
+
_setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
2337
|
+
_delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;
|
|
2338
|
+
}, logger);
|
|
2339
|
+
var cookieMgr = {
|
|
2340
|
+
isEnabled: function () {
|
|
2341
|
+
var enabled = _enabled && areCookiesSupported(logger);
|
|
2342
|
+
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
2343
|
+
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
2344
|
+
enabled = _isMgrEnabled(gblManager);
|
|
2332
2345
|
}
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
return new PerfEvent(src, payloadDetails, isAsync);
|
|
2348
|
-
};
|
|
2349
|
-
_self.fire = function (perfEvent) {
|
|
2350
|
-
if (perfEvent) {
|
|
2351
|
-
perfEvent[_DYN_COMPLETE ]();
|
|
2352
|
-
if (manager && isFunction(manager[STR_PERF_EVENT ])) {
|
|
2353
|
-
manager[STR_PERF_EVENT ](perfEvent);
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
};
|
|
2357
|
-
_self[_DYN_SET_CTX ] = function (key, value) {
|
|
2358
|
-
if (key) {
|
|
2359
|
-
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
2360
|
-
ctx[key] = value;
|
|
2346
|
+
return enabled;
|
|
2347
|
+
},
|
|
2348
|
+
setEnabled: function (value) {
|
|
2349
|
+
_enabled = value !== false;
|
|
2350
|
+
},
|
|
2351
|
+
set: function (name, value, maxAgeSec, domain, path) {
|
|
2352
|
+
var result = false;
|
|
2353
|
+
if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {
|
|
2354
|
+
var values = {};
|
|
2355
|
+
var theValue = strTrim(value || STR_EMPTY);
|
|
2356
|
+
var idx = strIndexOf(theValue, ";");
|
|
2357
|
+
if (idx !== -1) {
|
|
2358
|
+
theValue = strTrim(strLeft(value, idx));
|
|
2359
|
+
values = _extractParts(strSubstring(value, idx + 1));
|
|
2361
2360
|
}
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
2373
|
-
if (mgrSource) {
|
|
2374
|
-
var perfMgr = mgrSource;
|
|
2375
|
-
if (perfMgr[STR_GET_PERF_MGR]) {
|
|
2376
|
-
perfMgr = perfMgr[STR_GET_PERF_MGR]();
|
|
2377
|
-
}
|
|
2378
|
-
if (perfMgr) {
|
|
2379
|
-
var perfEvt = void 0;
|
|
2380
|
-
var currentActive = perfMgr[_DYN_GET_CTX ](doPerfActiveKey);
|
|
2381
|
-
try {
|
|
2382
|
-
perfEvt = perfMgr.create(getSource(), details, isAsync);
|
|
2383
|
-
if (perfEvt) {
|
|
2384
|
-
if (currentActive && perfEvt[_DYN_SET_CTX ]) {
|
|
2385
|
-
perfEvt[_DYN_SET_CTX ](PerfEvent[strParentContextKey], currentActive);
|
|
2386
|
-
if (currentActive[_DYN_GET_CTX ] && currentActive[_DYN_SET_CTX ]) {
|
|
2387
|
-
var children = currentActive[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
2388
|
-
if (!children) {
|
|
2389
|
-
children = [];
|
|
2390
|
-
currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children);
|
|
2391
|
-
}
|
|
2392
|
-
children[_DYN_PUSH$1 ](perfEvt);
|
|
2361
|
+
setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
|
|
2362
|
+
if (!isNullOrUndefined(maxAgeSec)) {
|
|
2363
|
+
var _isIE = isIE();
|
|
2364
|
+
if (isUndefined(values[strExpires])) {
|
|
2365
|
+
var nowMs = utcNow();
|
|
2366
|
+
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
2367
|
+
if (expireMs > 0) {
|
|
2368
|
+
var expiry = new Date();
|
|
2369
|
+
expiry.setTime(expireMs);
|
|
2370
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
2393
2371
|
}
|
|
2394
2372
|
}
|
|
2395
|
-
|
|
2396
|
-
|
|
2373
|
+
if (!_isIE) {
|
|
2374
|
+
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
2375
|
+
}
|
|
2397
2376
|
}
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2377
|
+
var location_1 = getLocation();
|
|
2378
|
+
if (location_1 && location_1.protocol === "https:") {
|
|
2379
|
+
setValue(values, "secure", null, null, isUndefined);
|
|
2380
|
+
if (_allowUaSameSite === null) {
|
|
2381
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
|
|
2382
|
+
}
|
|
2383
|
+
if (_allowUaSameSite) {
|
|
2384
|
+
setValue(values, "SameSite", "None", null, isUndefined);
|
|
2385
|
+
}
|
|
2402
2386
|
}
|
|
2387
|
+
setValue(values, STR_PATH, path || _path, null, isUndefined);
|
|
2388
|
+
_setCookieFn(name, _formatCookieValue(theValue, values));
|
|
2389
|
+
result = true;
|
|
2403
2390
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2391
|
+
return result;
|
|
2392
|
+
},
|
|
2393
|
+
get: function (name) {
|
|
2394
|
+
var value = STR_EMPTY;
|
|
2395
|
+
if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {
|
|
2396
|
+
value = _getCookieFn(name);
|
|
2397
|
+
}
|
|
2398
|
+
return value;
|
|
2399
|
+
},
|
|
2400
|
+
del: function (name, path) {
|
|
2401
|
+
var result = false;
|
|
2402
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
2403
|
+
result = cookieMgr.purge(name, path);
|
|
2404
|
+
}
|
|
2405
|
+
return result;
|
|
2406
|
+
},
|
|
2407
|
+
purge: function (name, path) {
|
|
2408
|
+
var _a;
|
|
2409
|
+
var result = false;
|
|
2410
|
+
if (areCookiesSupported(logger)) {
|
|
2411
|
+
var values = (_a = {},
|
|
2412
|
+
_a[STR_PATH] = path ? path : "/",
|
|
2413
|
+
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
2414
|
+
_a);
|
|
2415
|
+
if (!isIE()) {
|
|
2416
|
+
values["max-age"] = "0";
|
|
2407
2417
|
}
|
|
2408
|
-
|
|
2418
|
+
_delCookieFn(name, _formatCookieValue(STR_EMPTY, values));
|
|
2419
|
+
result = true;
|
|
2409
2420
|
}
|
|
2421
|
+
return result;
|
|
2422
|
+
}
|
|
2423
|
+
};
|
|
2424
|
+
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
2425
|
+
return cookieMgr;
|
|
2426
|
+
}
|
|
2427
|
+
function areCookiesSupported(logger) {
|
|
2428
|
+
if (_supportsCookies === null) {
|
|
2429
|
+
_supportsCookies = false;
|
|
2430
|
+
try {
|
|
2431
|
+
var doc = _doc || {};
|
|
2432
|
+
_supportsCookies = doc[strCookie] !== undefined;
|
|
2433
|
+
}
|
|
2434
|
+
catch (e) {
|
|
2435
|
+
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2410
2436
|
}
|
|
2411
2437
|
}
|
|
2412
|
-
return
|
|
2438
|
+
return _supportsCookies;
|
|
2413
2439
|
}
|
|
2414
|
-
function
|
|
2415
|
-
|
|
2440
|
+
function _extractParts(theValue) {
|
|
2441
|
+
var values = {};
|
|
2442
|
+
if (theValue && theValue[_DYN_LENGTH$2 ]) {
|
|
2443
|
+
var parts = strTrim(theValue)[_DYN_SPLIT$1 ](";");
|
|
2444
|
+
arrForEach(parts, function (thePart) {
|
|
2445
|
+
thePart = strTrim(thePart || STR_EMPTY);
|
|
2446
|
+
if (thePart) {
|
|
2447
|
+
var idx = strIndexOf(thePart, "=");
|
|
2448
|
+
if (idx === -1) {
|
|
2449
|
+
values[thePart] = null;
|
|
2450
|
+
}
|
|
2451
|
+
else {
|
|
2452
|
+
values[strTrim(strLeft(thePart, idx))] = strTrim(strSubstring(thePart, idx + 1));
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
return values;
|
|
2416
2458
|
}
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
function _isValid(value, len, invalidValue) {
|
|
2421
|
-
if (value && value[_DYN_LENGTH$2 ] === len && value !== invalidValue) {
|
|
2422
|
-
return !!value.match(/^[\da-f]*$/i);
|
|
2459
|
+
function _formatDate(theDate, func) {
|
|
2460
|
+
if (isFunction(theDate[func])) {
|
|
2461
|
+
return theDate[func]();
|
|
2423
2462
|
}
|
|
2424
|
-
return
|
|
2463
|
+
return null;
|
|
2425
2464
|
}
|
|
2426
|
-
function
|
|
2427
|
-
|
|
2465
|
+
function _formatCookieValue(value, values) {
|
|
2466
|
+
var cookieValue = value || STR_EMPTY;
|
|
2467
|
+
objForEachKey(values, function (name, theValue) {
|
|
2468
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY);
|
|
2469
|
+
});
|
|
2470
|
+
return cookieValue;
|
|
2428
2471
|
}
|
|
2429
|
-
function
|
|
2430
|
-
|
|
2472
|
+
function _getCookieValue(name) {
|
|
2473
|
+
var cookieValue = STR_EMPTY;
|
|
2474
|
+
if (_doc) {
|
|
2475
|
+
var theCookie = _doc[strCookie] || STR_EMPTY;
|
|
2476
|
+
if (_parsedCookieValue !== theCookie) {
|
|
2477
|
+
_cookieCache = _extractParts(theCookie);
|
|
2478
|
+
_parsedCookieValue = theCookie;
|
|
2479
|
+
}
|
|
2480
|
+
cookieValue = strTrim(_cookieCache[name] || STR_EMPTY);
|
|
2481
|
+
}
|
|
2482
|
+
return cookieValue;
|
|
2431
2483
|
}
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2484
|
+
function _setCookieValue(name, cookieValue) {
|
|
2485
|
+
if (_doc) {
|
|
2486
|
+
_doc[strCookie] = name + "=" + cookieValue;
|
|
2487
|
+
}
|
|
2436
2488
|
}
|
|
2437
|
-
function
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
var proxy = processContext[_DYN_GET_NEXT ]();
|
|
2441
|
-
var pluginState;
|
|
2442
|
-
while (proxy) {
|
|
2443
|
-
var thePlugin = proxy[_DYN_GET_PLUGIN ]();
|
|
2444
|
-
if (thePlugin) {
|
|
2445
|
-
if (lastPlugin && lastPlugin[_DYN_SET_NEXT_PLUGIN ] && thePlugin[STR_PROCESS_TELEMETRY ]) {
|
|
2446
|
-
lastPlugin[_DYN_SET_NEXT_PLUGIN ](thePlugin);
|
|
2447
|
-
}
|
|
2448
|
-
var isInitialized = false;
|
|
2449
|
-
if (isFunction(thePlugin[_DYN_IS_INITIALIZED ])) {
|
|
2450
|
-
isInitialized = thePlugin[_DYN_IS_INITIALIZED ]();
|
|
2451
|
-
}
|
|
2452
|
-
else {
|
|
2453
|
-
pluginState = _getPluginState(thePlugin);
|
|
2454
|
-
isInitialized = pluginState[_DYN_IS_INITIALIZED ];
|
|
2455
|
-
}
|
|
2456
|
-
if (!isInitialized) {
|
|
2457
|
-
initPlugins[_DYN_PUSH$1 ](thePlugin);
|
|
2458
|
-
}
|
|
2459
|
-
lastPlugin = thePlugin;
|
|
2460
|
-
proxy = proxy[_DYN_GET_NEXT ]();
|
|
2461
|
-
}
|
|
2489
|
+
function uaDisallowsSameSiteNone(userAgent) {
|
|
2490
|
+
if (!isString(userAgent)) {
|
|
2491
|
+
return false;
|
|
2462
2492
|
}
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
thePlugin[_DYN_INITIALIZE ](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT ]());
|
|
2466
|
-
pluginState = _getPluginState(thePlugin);
|
|
2467
|
-
if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) {
|
|
2468
|
-
pluginState[STR_CORE] = core;
|
|
2469
|
-
}
|
|
2470
|
-
pluginState[_DYN_IS_INITIALIZED ] = true;
|
|
2471
|
-
delete pluginState[_DYN_TEARDOWN ];
|
|
2472
|
-
});
|
|
2473
|
-
}
|
|
2474
|
-
function sortPlugins(plugins) {
|
|
2475
|
-
return plugins.sort(function (extA, extB) {
|
|
2476
|
-
var result = 0;
|
|
2477
|
-
if (extB) {
|
|
2478
|
-
var bHasProcess = extB[STR_PROCESS_TELEMETRY];
|
|
2479
|
-
if (extA[STR_PROCESS_TELEMETRY]) {
|
|
2480
|
-
result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1;
|
|
2481
|
-
}
|
|
2482
|
-
else if (bHasProcess) {
|
|
2483
|
-
result = -1;
|
|
2484
|
-
}
|
|
2485
|
-
}
|
|
2486
|
-
else {
|
|
2487
|
-
result = extA ? 1 : -1;
|
|
2488
|
-
}
|
|
2489
|
-
return result;
|
|
2490
|
-
});
|
|
2491
|
-
}
|
|
2492
|
-
function createDistributedTraceContext(parentCtx) {
|
|
2493
|
-
var trace = {};
|
|
2494
|
-
return {
|
|
2495
|
-
getName: function () {
|
|
2496
|
-
return trace[_DYN_NAME$2 ];
|
|
2497
|
-
},
|
|
2498
|
-
setName: function (newValue) {
|
|
2499
|
-
parentCtx && parentCtx.setName(newValue);
|
|
2500
|
-
trace[_DYN_NAME$2 ] = newValue;
|
|
2501
|
-
},
|
|
2502
|
-
getTraceId: function () {
|
|
2503
|
-
return trace[_DYN_TRACE_ID$1 ];
|
|
2504
|
-
},
|
|
2505
|
-
setTraceId: function (newValue) {
|
|
2506
|
-
parentCtx && parentCtx.setTraceId(newValue);
|
|
2507
|
-
if (isValidTraceId(newValue)) {
|
|
2508
|
-
trace[_DYN_TRACE_ID$1 ] = newValue;
|
|
2509
|
-
}
|
|
2510
|
-
},
|
|
2511
|
-
getSpanId: function () {
|
|
2512
|
-
return trace[_DYN_SPAN_ID ];
|
|
2513
|
-
},
|
|
2514
|
-
setSpanId: function (newValue) {
|
|
2515
|
-
parentCtx && parentCtx.setSpanId(newValue);
|
|
2516
|
-
if (isValidSpanId(newValue)) {
|
|
2517
|
-
trace[_DYN_SPAN_ID ] = newValue;
|
|
2518
|
-
}
|
|
2519
|
-
},
|
|
2520
|
-
getTraceFlags: function () {
|
|
2521
|
-
return trace[_DYN_TRACE_FLAGS ];
|
|
2522
|
-
},
|
|
2523
|
-
setTraceFlags: function (newTraceFlags) {
|
|
2524
|
-
parentCtx && parentCtx.setTraceFlags(newTraceFlags);
|
|
2525
|
-
trace[_DYN_TRACE_FLAGS ] = newTraceFlags;
|
|
2526
|
-
}
|
|
2527
|
-
};
|
|
2528
|
-
}
|
|
2529
|
-
|
|
2530
|
-
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
2531
|
-
var strHasRunFlags = "_hasRun";
|
|
2532
|
-
var strGetTelCtx = "_getTelCtx";
|
|
2533
|
-
var _chainId = 0;
|
|
2534
|
-
function _getNextProxyStart(proxy, core, startAt) {
|
|
2535
|
-
while (proxy) {
|
|
2536
|
-
if (proxy[_DYN_GET_PLUGIN ]() === startAt) {
|
|
2537
|
-
return proxy;
|
|
2538
|
-
}
|
|
2539
|
-
proxy = proxy[_DYN_GET_NEXT ]();
|
|
2493
|
+
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
|
2494
|
+
return true;
|
|
2540
2495
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
2544
|
-
var _nextProxy = null;
|
|
2545
|
-
var _onComplete = [];
|
|
2546
|
-
if (!dynamicHandler) {
|
|
2547
|
-
dynamicHandler = createDynamicConfig({}, null, core[_DYN_LOGGER ]);
|
|
2496
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
2497
|
+
return true;
|
|
2548
2498
|
}
|
|
2549
|
-
if (
|
|
2550
|
-
|
|
2499
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
2500
|
+
return true;
|
|
2551
2501
|
}
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
ctx: {
|
|
2555
|
-
core: function () {
|
|
2556
|
-
return core;
|
|
2557
|
-
},
|
|
2558
|
-
diagLog: function () {
|
|
2559
|
-
return safeGetLogger(core, dynamicHandler.cfg);
|
|
2560
|
-
},
|
|
2561
|
-
getCfg: function () {
|
|
2562
|
-
return dynamicHandler.cfg;
|
|
2563
|
-
},
|
|
2564
|
-
getExtCfg: _resolveExtCfg,
|
|
2565
|
-
getConfig: _getConfig,
|
|
2566
|
-
hasNext: function () {
|
|
2567
|
-
return !!_nextProxy;
|
|
2568
|
-
},
|
|
2569
|
-
getNext: function () {
|
|
2570
|
-
return _nextProxy;
|
|
2571
|
-
},
|
|
2572
|
-
setNext: function (nextPlugin) {
|
|
2573
|
-
_nextProxy = nextPlugin;
|
|
2574
|
-
},
|
|
2575
|
-
iterate: _iterateChain,
|
|
2576
|
-
onComplete: _addOnComplete
|
|
2577
|
-
}
|
|
2578
|
-
};
|
|
2579
|
-
function _addOnComplete(onComplete, that) {
|
|
2580
|
-
var args = [];
|
|
2581
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2582
|
-
args[_i - 2] = arguments[_i];
|
|
2583
|
-
}
|
|
2584
|
-
if (onComplete) {
|
|
2585
|
-
_onComplete[_DYN_PUSH$1 ]({
|
|
2586
|
-
func: onComplete,
|
|
2587
|
-
self: !isUndefined(that) ? that : context.ctx,
|
|
2588
|
-
args: args
|
|
2589
|
-
});
|
|
2590
|
-
}
|
|
2502
|
+
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
2503
|
+
return true;
|
|
2591
2504
|
}
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
_nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null;
|
|
2595
|
-
if (!nextProxy) {
|
|
2596
|
-
var onComplete = _onComplete;
|
|
2597
|
-
if (onComplete && onComplete[_DYN_LENGTH$2 ] > 0) {
|
|
2598
|
-
arrForEach(onComplete, function (completeDetails) {
|
|
2599
|
-
try {
|
|
2600
|
-
completeDetails.func[_DYN_CALL ](completeDetails.self, completeDetails.args);
|
|
2601
|
-
}
|
|
2602
|
-
catch (e) {
|
|
2603
|
-
_throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
2604
|
-
}
|
|
2605
|
-
});
|
|
2606
|
-
_onComplete = [];
|
|
2607
|
-
}
|
|
2608
|
-
}
|
|
2609
|
-
return nextProxy;
|
|
2505
|
+
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
|
2506
|
+
return true;
|
|
2610
2507
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2508
|
+
if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) {
|
|
2509
|
+
return true;
|
|
2510
|
+
}
|
|
2511
|
+
return false;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
var defaultValues$1 = {
|
|
2515
|
+
perfEvtsSendAll: false
|
|
2516
|
+
};
|
|
2517
|
+
function _runListeners(listeners, name, isAsync, callback) {
|
|
2518
|
+
arrForEach(listeners, function (listener) {
|
|
2519
|
+
if (listener && listener[name]) {
|
|
2520
|
+
if (isAsync) {
|
|
2521
|
+
scheduleTimeout(function () { return callback(listener); }, 0);
|
|
2618
2522
|
}
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
idCfg = extCfg[identifier];
|
|
2623
|
-
if (!idCfg && createIfMissing) {
|
|
2624
|
-
idCfg = {};
|
|
2523
|
+
else {
|
|
2524
|
+
try {
|
|
2525
|
+
callback(listener);
|
|
2625
2526
|
}
|
|
2626
|
-
|
|
2627
|
-
idCfg = extCfg[identifier];
|
|
2628
|
-
}
|
|
2629
|
-
}
|
|
2630
|
-
return idCfg;
|
|
2631
|
-
}
|
|
2632
|
-
function _resolveExtCfg(identifier, defaultValues) {
|
|
2633
|
-
var newConfig = _getExtCfg(identifier, true);
|
|
2634
|
-
if (defaultValues) {
|
|
2635
|
-
objForEachKey(defaultValues, function (field, defaultValue) {
|
|
2636
|
-
if (isNullOrUndefined(newConfig[field])) {
|
|
2637
|
-
var cfgValue = dynamicHandler.cfg[field];
|
|
2638
|
-
if (cfgValue || !isNullOrUndefined(cfgValue)) {
|
|
2639
|
-
newConfig[field] = cfgValue;
|
|
2640
|
-
}
|
|
2527
|
+
catch (e) {
|
|
2641
2528
|
}
|
|
2642
|
-
_applyDefaultValue(dynamicHandler, newConfig, field, defaultValue);
|
|
2643
|
-
});
|
|
2644
|
-
}
|
|
2645
|
-
return dynamicHandler[_DYN_SET_DF ](newConfig, defaultValues);
|
|
2646
|
-
}
|
|
2647
|
-
function _getConfig(identifier, field, defaultValue) {
|
|
2648
|
-
if (defaultValue === void 0) { defaultValue = false; }
|
|
2649
|
-
var theValue;
|
|
2650
|
-
var extConfig = _getExtCfg(identifier, false);
|
|
2651
|
-
var rootConfig = dynamicHandler.cfg;
|
|
2652
|
-
if (extConfig && (extConfig[field] || !isNullOrUndefined(extConfig[field]))) {
|
|
2653
|
-
theValue = extConfig[field];
|
|
2654
|
-
}
|
|
2655
|
-
else if (rootConfig[field] || !isNullOrUndefined(rootConfig[field])) {
|
|
2656
|
-
theValue = rootConfig[field];
|
|
2657
|
-
}
|
|
2658
|
-
return (theValue || !isNullOrUndefined(theValue)) ? theValue : defaultValue;
|
|
2659
|
-
}
|
|
2660
|
-
function _iterateChain(cb) {
|
|
2661
|
-
var nextPlugin;
|
|
2662
|
-
while (!!(nextPlugin = context._next())) {
|
|
2663
|
-
var plugin = nextPlugin[_DYN_GET_PLUGIN ]();
|
|
2664
|
-
if (plugin) {
|
|
2665
|
-
cb(plugin);
|
|
2666
2529
|
}
|
|
2667
2530
|
}
|
|
2668
|
-
}
|
|
2669
|
-
return context;
|
|
2670
|
-
}
|
|
2671
|
-
function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) {
|
|
2672
|
-
var config = createDynamicConfig(cfg);
|
|
2673
|
-
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
2674
|
-
var context = internalContext.ctx;
|
|
2675
|
-
function _processNext(env) {
|
|
2676
|
-
var nextPlugin = internalContext._next();
|
|
2677
|
-
if (nextPlugin) {
|
|
2678
|
-
nextPlugin[STR_PROCESS_TELEMETRY ](env, context);
|
|
2679
|
-
}
|
|
2680
|
-
return !nextPlugin;
|
|
2681
|
-
}
|
|
2682
|
-
function _createNew(plugins, startAt) {
|
|
2683
|
-
if (plugins === void 0) { plugins = null; }
|
|
2684
|
-
if (isArray(plugins)) {
|
|
2685
|
-
plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);
|
|
2686
|
-
}
|
|
2687
|
-
return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT ](), config.cfg, core, startAt);
|
|
2688
|
-
}
|
|
2689
|
-
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
2690
|
-
context[_DYN_CREATE_NEW ] = _createNew;
|
|
2691
|
-
return context;
|
|
2692
|
-
}
|
|
2693
|
-
function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {
|
|
2694
|
-
var config = createDynamicConfig(core[_DYN_CONFIG ]);
|
|
2695
|
-
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
2696
|
-
var context = internalContext.ctx;
|
|
2697
|
-
function _processNext(unloadState) {
|
|
2698
|
-
var nextPlugin = internalContext._next();
|
|
2699
|
-
nextPlugin && nextPlugin.unload(context, unloadState);
|
|
2700
|
-
return !nextPlugin;
|
|
2701
|
-
}
|
|
2702
|
-
function _createNew(plugins, startAt) {
|
|
2703
|
-
if (plugins === void 0) { plugins = null; }
|
|
2704
|
-
if (isArray(plugins)) {
|
|
2705
|
-
plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);
|
|
2706
|
-
}
|
|
2707
|
-
return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT ](), core, startAt);
|
|
2708
|
-
}
|
|
2709
|
-
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
2710
|
-
context[_DYN_CREATE_NEW ] = _createNew;
|
|
2711
|
-
return context;
|
|
2531
|
+
});
|
|
2712
2532
|
}
|
|
2713
|
-
function
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2533
|
+
var NotificationManager = /** @class */ (function () {
|
|
2534
|
+
function NotificationManager(config) {
|
|
2535
|
+
this.listeners = [];
|
|
2536
|
+
var perfEvtsSendAll;
|
|
2537
|
+
var cfgHandler = createDynamicConfig(config, defaultValues$1);
|
|
2538
|
+
cfgHandler[_DYN_WATCH ](function (details) {
|
|
2539
|
+
perfEvtsSendAll = !!details.cfg.perfEvtsSendAll;
|
|
2540
|
+
});
|
|
2541
|
+
dynamicProto(NotificationManager, this, function (_self) {
|
|
2542
|
+
_self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
|
|
2543
|
+
_self.listeners[_DYN_PUSH$1 ](listener);
|
|
2544
|
+
};
|
|
2545
|
+
_self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) {
|
|
2546
|
+
var index = arrIndexOf(_self[_DYN_LISTENERS ], listener);
|
|
2547
|
+
while (index > -1) {
|
|
2548
|
+
_self.listeners[_DYN_SPLICE ](index, 1);
|
|
2549
|
+
index = arrIndexOf(_self[_DYN_LISTENERS ], listener);
|
|
2550
|
+
}
|
|
2551
|
+
};
|
|
2552
|
+
_self[STR_EVENTS_SENT ] = function (events) {
|
|
2553
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_SENT, true, function (listener) {
|
|
2554
|
+
listener[STR_EVENTS_SENT ](events);
|
|
2555
|
+
});
|
|
2556
|
+
};
|
|
2557
|
+
_self[STR_EVENTS_DISCARDED ] = function (events, reason) {
|
|
2558
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_DISCARDED, true, function (listener) {
|
|
2559
|
+
listener[STR_EVENTS_DISCARDED ](events, reason);
|
|
2560
|
+
});
|
|
2561
|
+
};
|
|
2562
|
+
_self[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) {
|
|
2563
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_EVENTS_SEND_REQUEST, isAsync, function (listener) {
|
|
2564
|
+
listener[STR_EVENTS_SEND_REQUEST ](sendReason, isAsync);
|
|
2565
|
+
});
|
|
2566
|
+
};
|
|
2567
|
+
_self[STR_PERF_EVENT ] = function (perfEvent) {
|
|
2568
|
+
if (perfEvent) {
|
|
2569
|
+
if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) {
|
|
2570
|
+
_runListeners(_self[_DYN_LISTENERS ], STR_PERF_EVENT, false, function (listener) {
|
|
2571
|
+
if (perfEvent[_DYN_IS_ASYNC ]) {
|
|
2572
|
+
scheduleTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0);
|
|
2573
|
+
}
|
|
2574
|
+
else {
|
|
2575
|
+
listener[STR_PERF_EVENT ](perfEvent);
|
|
2576
|
+
}
|
|
2577
|
+
});
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
};
|
|
2722
2581
|
});
|
|
2723
2582
|
}
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
var newProxy = createTelemetryPluginProxy(thePlugin, config, core);
|
|
2746
|
-
if (!firstProxy) {
|
|
2747
|
-
firstProxy = newProxy;
|
|
2583
|
+
NotificationManager.__ieDyn=1;
|
|
2584
|
+
return NotificationManager;
|
|
2585
|
+
}());
|
|
2586
|
+
|
|
2587
|
+
var strExecutionContextKey = "ctx";
|
|
2588
|
+
var strParentContextKey = "ParentContextKey";
|
|
2589
|
+
var strChildrenContextKey = "ChildrenContextKey";
|
|
2590
|
+
var _defaultPerfManager = null;
|
|
2591
|
+
var PerfEvent = /** @class */ (function () {
|
|
2592
|
+
function PerfEvent(name, payloadDetails, isAsync) {
|
|
2593
|
+
var _self = this;
|
|
2594
|
+
_self.start = utcNow();
|
|
2595
|
+
_self[_DYN_NAME$2 ] = name;
|
|
2596
|
+
_self[_DYN_IS_ASYNC ] = isAsync;
|
|
2597
|
+
_self[_DYN_IS_CHILD_EVT ] = function () { return false; };
|
|
2598
|
+
if (isFunction(payloadDetails)) {
|
|
2599
|
+
var theDetails_1;
|
|
2600
|
+
objDefineAccessors(_self, "payload", function () {
|
|
2601
|
+
if (!theDetails_1 && isFunction(payloadDetails)) {
|
|
2602
|
+
theDetails_1 = payloadDetails();
|
|
2603
|
+
payloadDetails = null;
|
|
2748
2604
|
}
|
|
2749
|
-
|
|
2750
|
-
|
|
2605
|
+
return theDetails_1;
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
_self[_DYN_GET_CTX ] = function (key) {
|
|
2609
|
+
if (key) {
|
|
2610
|
+
if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) {
|
|
2611
|
+
return _self[key];
|
|
2751
2612
|
}
|
|
2752
|
-
|
|
2613
|
+
return (_self[strExecutionContextKey] || {})[key];
|
|
2753
2614
|
}
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
function createTelemetryPluginProxy(plugin, config, core) {
|
|
2762
|
-
var nextProxy = null;
|
|
2763
|
-
var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]);
|
|
2764
|
-
var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
|
|
2765
|
-
var chainId;
|
|
2766
|
-
if (plugin) {
|
|
2767
|
-
chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
2768
|
-
}
|
|
2769
|
-
else {
|
|
2770
|
-
chainId = "Unknown-0-" + _chainId++;
|
|
2771
|
-
}
|
|
2772
|
-
var proxyChain = {
|
|
2773
|
-
getPlugin: function () {
|
|
2774
|
-
return plugin;
|
|
2775
|
-
},
|
|
2776
|
-
getNext: function () {
|
|
2777
|
-
return nextProxy;
|
|
2778
|
-
},
|
|
2779
|
-
processTelemetry: _processTelemetry,
|
|
2780
|
-
unload: _unloadPlugin,
|
|
2781
|
-
update: _updatePlugin,
|
|
2782
|
-
_id: chainId,
|
|
2783
|
-
_setNext: function (nextPlugin) {
|
|
2784
|
-
nextProxy = nextPlugin;
|
|
2785
|
-
}
|
|
2786
|
-
};
|
|
2787
|
-
function _getTelCtx() {
|
|
2788
|
-
var itemCtx;
|
|
2789
|
-
if (plugin && isFunction(plugin[strGetTelCtx])) {
|
|
2790
|
-
itemCtx = plugin[strGetTelCtx]();
|
|
2791
|
-
}
|
|
2792
|
-
if (!itemCtx) {
|
|
2793
|
-
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
2794
|
-
}
|
|
2795
|
-
return itemCtx;
|
|
2796
|
-
}
|
|
2797
|
-
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
2798
|
-
var hasRun = false;
|
|
2799
|
-
var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain;
|
|
2800
|
-
var hasRunContext = itemCtx[strHasRunFlags];
|
|
2801
|
-
if (!hasRunContext) {
|
|
2802
|
-
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
2803
|
-
}
|
|
2804
|
-
itemCtx.setNext(nextProxy);
|
|
2805
|
-
if (plugin) {
|
|
2806
|
-
doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () {
|
|
2807
|
-
hasRunContext[chainId] = true;
|
|
2808
|
-
try {
|
|
2809
|
-
var nextId = nextProxy ? nextProxy._id : STR_EMPTY;
|
|
2810
|
-
if (nextId) {
|
|
2811
|
-
hasRunContext[nextId] = false;
|
|
2615
|
+
return null;
|
|
2616
|
+
};
|
|
2617
|
+
_self[_DYN_SET_CTX ] = function (key, value) {
|
|
2618
|
+
if (key) {
|
|
2619
|
+
if (key === PerfEvent[strParentContextKey]) {
|
|
2620
|
+
if (!_self[key]) {
|
|
2621
|
+
_self[_DYN_IS_CHILD_EVT ] = function () { return true; };
|
|
2812
2622
|
}
|
|
2813
|
-
|
|
2623
|
+
_self[key] = value;
|
|
2814
2624
|
}
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2625
|
+
else if (key === PerfEvent[strChildrenContextKey]) {
|
|
2626
|
+
_self[key] = value;
|
|
2627
|
+
}
|
|
2628
|
+
else {
|
|
2629
|
+
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
2630
|
+
ctx[key] = value;
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
_self[_DYN_COMPLETE ] = function () {
|
|
2635
|
+
var childTime = 0;
|
|
2636
|
+
var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
2637
|
+
if (isArray(childEvts)) {
|
|
2638
|
+
for (var lp = 0; lp < childEvts[_DYN_LENGTH$2 ]; lp++) {
|
|
2639
|
+
var childEvt = childEvts[lp];
|
|
2640
|
+
if (childEvt) {
|
|
2641
|
+
childTime += childEvt[_DYN_TIME ];
|
|
2819
2642
|
}
|
|
2820
|
-
|
|
2821
|
-
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
_self[_DYN_TIME ] = utcNow() - _self.start;
|
|
2646
|
+
_self.exTime = _self[_DYN_TIME ] - childTime;
|
|
2647
|
+
_self[_DYN_COMPLETE ] = function () { };
|
|
2648
|
+
};
|
|
2649
|
+
}
|
|
2650
|
+
PerfEvent.ParentContextKey = "parent";
|
|
2651
|
+
PerfEvent.ChildrenContextKey = "childEvts";
|
|
2652
|
+
return PerfEvent;
|
|
2653
|
+
}());
|
|
2654
|
+
var PerfManager = /** @class */ (function () {
|
|
2655
|
+
function PerfManager(manager) {
|
|
2656
|
+
this.ctx = {};
|
|
2657
|
+
dynamicProto(PerfManager, this, function (_self) {
|
|
2658
|
+
_self.create = function (src, payloadDetails, isAsync) {
|
|
2659
|
+
return new PerfEvent(src, payloadDetails, isAsync);
|
|
2660
|
+
};
|
|
2661
|
+
_self.fire = function (perfEvent) {
|
|
2662
|
+
if (perfEvent) {
|
|
2663
|
+
perfEvent[_DYN_COMPLETE ]();
|
|
2664
|
+
if (manager && isFunction(manager[STR_PERF_EVENT ])) {
|
|
2665
|
+
manager[STR_PERF_EVENT ](perfEvent);
|
|
2822
2666
|
}
|
|
2823
2667
|
}
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
|
-
|
|
2668
|
+
};
|
|
2669
|
+
_self[_DYN_SET_CTX ] = function (key, value) {
|
|
2670
|
+
if (key) {
|
|
2671
|
+
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
2672
|
+
ctx[key] = value;
|
|
2673
|
+
}
|
|
2674
|
+
};
|
|
2675
|
+
_self[_DYN_GET_CTX ] = function (key) {
|
|
2676
|
+
return (_self[strExecutionContextKey] || {})[key];
|
|
2677
|
+
};
|
|
2678
|
+
});
|
|
2827
2679
|
}
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
}
|
|
2838
|
-
if (hasSetNext) {
|
|
2839
|
-
plugin[_DYN_SET_NEXT_PLUGIN ](nextProxy);
|
|
2840
|
-
}
|
|
2841
|
-
plugin[STR_PROCESS_TELEMETRY ](env, itemCtx);
|
|
2842
|
-
return true;
|
|
2843
|
-
}
|
|
2844
|
-
if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) {
|
|
2845
|
-
itemCtx[_DYN_PROCESS_NEXT ](env);
|
|
2680
|
+
PerfManager.__ieDyn=1;
|
|
2681
|
+
return PerfManager;
|
|
2682
|
+
}());
|
|
2683
|
+
var doPerfActiveKey = "CoreUtils.doPerf";
|
|
2684
|
+
function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
2685
|
+
if (mgrSource) {
|
|
2686
|
+
var perfMgr = mgrSource;
|
|
2687
|
+
if (perfMgr[STR_GET_PERF_MGR]) {
|
|
2688
|
+
perfMgr = perfMgr[STR_GET_PERF_MGR]();
|
|
2846
2689
|
}
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2690
|
+
if (perfMgr) {
|
|
2691
|
+
var perfEvt = void 0;
|
|
2692
|
+
var currentActive = perfMgr[_DYN_GET_CTX ](doPerfActiveKey);
|
|
2693
|
+
try {
|
|
2694
|
+
perfEvt = perfMgr.create(getSource(), details, isAsync);
|
|
2695
|
+
if (perfEvt) {
|
|
2696
|
+
if (currentActive && perfEvt[_DYN_SET_CTX ]) {
|
|
2697
|
+
perfEvt[_DYN_SET_CTX ](PerfEvent[strParentContextKey], currentActive);
|
|
2698
|
+
if (currentActive[_DYN_GET_CTX ] && currentActive[_DYN_SET_CTX ]) {
|
|
2699
|
+
var children = currentActive[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
2700
|
+
if (!children) {
|
|
2701
|
+
children = [];
|
|
2702
|
+
currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children);
|
|
2703
|
+
}
|
|
2704
|
+
children[_DYN_PUSH$1 ](perfEvt);
|
|
2705
|
+
}
|
|
2860
2706
|
}
|
|
2707
|
+
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt);
|
|
2708
|
+
return func(perfEvt);
|
|
2861
2709
|
}
|
|
2862
2710
|
}
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2711
|
+
catch (ex) {
|
|
2712
|
+
if (perfEvt && perfEvt[_DYN_SET_CTX ]) {
|
|
2713
|
+
perfEvt[_DYN_SET_CTX ]("exception", ex);
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
finally {
|
|
2717
|
+
if (perfEvt) {
|
|
2718
|
+
perfMgr.fire(perfEvt);
|
|
2719
|
+
}
|
|
2720
|
+
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, currentActive);
|
|
2721
|
+
}
|
|
2867
2722
|
}
|
|
2868
2723
|
}
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2724
|
+
return func();
|
|
2725
|
+
}
|
|
2726
|
+
function getGblPerfMgr() {
|
|
2727
|
+
return _defaultPerfManager;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
var INVALID_TRACE_ID = "00000000000000000000000000000000";
|
|
2731
|
+
var INVALID_SPAN_ID = "0000000000000000";
|
|
2732
|
+
function _isValid(value, len, invalidValue) {
|
|
2733
|
+
if (value && value[_DYN_LENGTH$2 ] === len && value !== invalidValue) {
|
|
2734
|
+
return !!value.match(/^[\da-f]*$/i);
|
|
2735
|
+
}
|
|
2736
|
+
return false;
|
|
2737
|
+
}
|
|
2738
|
+
function isValidTraceId(value) {
|
|
2739
|
+
return _isValid(value, 32, INVALID_TRACE_ID);
|
|
2740
|
+
}
|
|
2741
|
+
function isValidSpanId(value) {
|
|
2742
|
+
return _isValid(value, 16, INVALID_SPAN_ID);
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
var pluginStateData = createElmNodeData("plugin");
|
|
2746
|
+
function _getPluginState(plugin) {
|
|
2747
|
+
return pluginStateData.get(plugin, "state", {}, true);
|
|
2748
|
+
}
|
|
2749
|
+
function initializePlugins(processContext, extensions) {
|
|
2750
|
+
var initPlugins = [];
|
|
2751
|
+
var lastPlugin = null;
|
|
2752
|
+
var proxy = processContext[_DYN_GET_NEXT ]();
|
|
2753
|
+
var pluginState;
|
|
2754
|
+
while (proxy) {
|
|
2755
|
+
var thePlugin = proxy[_DYN_GET_PLUGIN ]();
|
|
2756
|
+
if (thePlugin) {
|
|
2757
|
+
if (lastPlugin && lastPlugin[_DYN_SET_NEXT_PLUGIN ] && thePlugin[STR_PROCESS_TELEMETRY ]) {
|
|
2758
|
+
lastPlugin[_DYN_SET_NEXT_PLUGIN ](thePlugin);
|
|
2880
2759
|
}
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2760
|
+
pluginState = _getPluginState(thePlugin);
|
|
2761
|
+
var isInitialized = !!pluginState[_DYN_IS_INITIALIZED ];
|
|
2762
|
+
if (thePlugin[_DYN_IS_INITIALIZED ]) {
|
|
2763
|
+
isInitialized = thePlugin[_DYN_IS_INITIALIZED ]();
|
|
2764
|
+
}
|
|
2765
|
+
if (!isInitialized) {
|
|
2766
|
+
initPlugins[_DYN_PUSH$1 ](thePlugin);
|
|
2767
|
+
}
|
|
2768
|
+
lastPlugin = thePlugin;
|
|
2769
|
+
proxy = proxy[_DYN_GET_NEXT ]();
|
|
2885
2770
|
}
|
|
2886
2771
|
}
|
|
2887
|
-
|
|
2772
|
+
arrForEach(initPlugins, function (thePlugin) {
|
|
2773
|
+
var core = processContext[STR_CORE ]();
|
|
2774
|
+
thePlugin[_DYN_INITIALIZE ](processContext.getCfg(), core, extensions, processContext[_DYN_GET_NEXT ]());
|
|
2775
|
+
pluginState = _getPluginState(thePlugin);
|
|
2776
|
+
if (!thePlugin[STR_CORE] && !pluginState[STR_CORE]) {
|
|
2777
|
+
pluginState[STR_CORE] = core;
|
|
2778
|
+
}
|
|
2779
|
+
pluginState[_DYN_IS_INITIALIZED ] = true;
|
|
2780
|
+
delete pluginState[_DYN_TEARDOWN ];
|
|
2781
|
+
});
|
|
2888
2782
|
}
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
});
|
|
2897
|
-
arrForEach(queue, function (queueItem) {
|
|
2898
|
-
if (queueItem[STR_PRIORITY ] < ChannelControllerPriority) {
|
|
2899
|
-
throwError(ChannelValidationMessage + queueItem[_DYN_IDENTIFIER ]);
|
|
2783
|
+
function sortPlugins(plugins) {
|
|
2784
|
+
return plugins.sort(function (extA, extB) {
|
|
2785
|
+
var result = 0;
|
|
2786
|
+
if (extB) {
|
|
2787
|
+
var bHasProcess = extB[STR_PROCESS_TELEMETRY];
|
|
2788
|
+
if (extA[STR_PROCESS_TELEMETRY]) {
|
|
2789
|
+
result = bHasProcess ? extA[STR_PRIORITY] - extB[STR_PRIORITY] : 1;
|
|
2900
2790
|
}
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
queue: objFreeze(queue),
|
|
2904
|
-
chain: createTelemetryProxyChain(queue, core[_DYN_CONFIG ], core)
|
|
2905
|
-
});
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
function createChannelControllerPlugin(channelQueue, core) {
|
|
2909
|
-
function _getTelCtx() {
|
|
2910
|
-
return createProcessTelemetryContext(null, core[_DYN_CONFIG ], core, null);
|
|
2911
|
-
}
|
|
2912
|
-
function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) {
|
|
2913
|
-
var waiting = theChannels ? (theChannels[_DYN_LENGTH$2 ] + 1) : 1;
|
|
2914
|
-
function _runChainOnComplete() {
|
|
2915
|
-
waiting--;
|
|
2916
|
-
if (waiting === 0) {
|
|
2917
|
-
onComplete && onComplete();
|
|
2918
|
-
onComplete = null;
|
|
2791
|
+
else if (bHasProcess) {
|
|
2792
|
+
result = -1;
|
|
2919
2793
|
}
|
|
2920
2794
|
}
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
if (channels && channels.queue[_DYN_LENGTH$2 ] > 0) {
|
|
2924
|
-
var channelChain = channels.chain;
|
|
2925
|
-
var chainCtx = itemCtx[_DYN_CREATE_NEW ](channelChain);
|
|
2926
|
-
chainCtx[_DYN_ON_COMPLETE ](_runChainOnComplete);
|
|
2927
|
-
processFn(chainCtx);
|
|
2928
|
-
}
|
|
2929
|
-
else {
|
|
2930
|
-
waiting--;
|
|
2931
|
-
}
|
|
2932
|
-
});
|
|
2933
|
-
}
|
|
2934
|
-
_runChainOnComplete();
|
|
2935
|
-
}
|
|
2936
|
-
function _doUpdate(updateCtx, updateState) {
|
|
2937
|
-
var theUpdateState = updateState || {
|
|
2938
|
-
reason: 0
|
|
2939
|
-
};
|
|
2940
|
-
_processChannelQueue(channelQueue, updateCtx, function (chainCtx) {
|
|
2941
|
-
chainCtx[_DYN_PROCESS_NEXT ](theUpdateState);
|
|
2942
|
-
}, function () {
|
|
2943
|
-
updateCtx[_DYN_PROCESS_NEXT ](theUpdateState);
|
|
2944
|
-
});
|
|
2945
|
-
return true;
|
|
2946
|
-
}
|
|
2947
|
-
function _doTeardown(unloadCtx, unloadState) {
|
|
2948
|
-
var theUnloadState = unloadState || {
|
|
2949
|
-
reason: 0 ,
|
|
2950
|
-
isAsync: false
|
|
2951
|
-
};
|
|
2952
|
-
_processChannelQueue(channelQueue, unloadCtx, function (chainCtx) {
|
|
2953
|
-
chainCtx[_DYN_PROCESS_NEXT ](theUnloadState);
|
|
2954
|
-
}, function () {
|
|
2955
|
-
unloadCtx[_DYN_PROCESS_NEXT ](theUnloadState);
|
|
2956
|
-
isInitialized = false;
|
|
2957
|
-
});
|
|
2958
|
-
return true;
|
|
2959
|
-
}
|
|
2960
|
-
function _getChannel(pluginIdentifier) {
|
|
2961
|
-
var thePlugin = null;
|
|
2962
|
-
if (channelQueue && channelQueue[_DYN_LENGTH$2 ] > 0) {
|
|
2963
|
-
arrForEach(channelQueue, function (channels) {
|
|
2964
|
-
if (channels && channels.queue[_DYN_LENGTH$2 ] > 0) {
|
|
2965
|
-
arrForEach(channels.queue, function (ext) {
|
|
2966
|
-
if (ext[_DYN_IDENTIFIER ] === pluginIdentifier) {
|
|
2967
|
-
thePlugin = ext;
|
|
2968
|
-
return -1;
|
|
2969
|
-
}
|
|
2970
|
-
});
|
|
2971
|
-
if (thePlugin) {
|
|
2972
|
-
return -1;
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
});
|
|
2795
|
+
else {
|
|
2796
|
+
result = extA ? 1 : -1;
|
|
2976
2797
|
}
|
|
2977
|
-
return
|
|
2978
|
-
}
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
arrForEach(channelQueue, function (channels) {
|
|
2986
|
-
if (channels && channels.queue[_DYN_LENGTH$2 ] > 0) {
|
|
2987
|
-
initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions);
|
|
2988
|
-
}
|
|
2989
|
-
});
|
|
2798
|
+
return result;
|
|
2799
|
+
});
|
|
2800
|
+
}
|
|
2801
|
+
function createDistributedTraceContext(parentCtx) {
|
|
2802
|
+
var trace = {};
|
|
2803
|
+
return {
|
|
2804
|
+
getName: function () {
|
|
2805
|
+
return trace[_DYN_NAME$2 ];
|
|
2990
2806
|
},
|
|
2991
|
-
|
|
2992
|
-
|
|
2807
|
+
setName: function (newValue) {
|
|
2808
|
+
parentCtx && parentCtx.setName(newValue);
|
|
2809
|
+
trace[_DYN_NAME$2 ] = newValue;
|
|
2993
2810
|
},
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
chainCtx[_DYN_PROCESS_NEXT ](item);
|
|
2997
|
-
}, function () {
|
|
2998
|
-
itemCtx[_DYN_PROCESS_NEXT ](item);
|
|
2999
|
-
});
|
|
2811
|
+
getTraceId: function () {
|
|
2812
|
+
return trace[_DYN_TRACE_ID$1 ];
|
|
3000
2813
|
},
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
});
|
|
3007
|
-
}, null);
|
|
2814
|
+
setTraceId: function (newValue) {
|
|
2815
|
+
parentCtx && parentCtx.setTraceId(newValue);
|
|
2816
|
+
if (isValidTraceId(newValue)) {
|
|
2817
|
+
trace[_DYN_TRACE_ID$1 ] = newValue;
|
|
2818
|
+
}
|
|
3008
2819
|
},
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
chainCtx.iterate(function (plugin) {
|
|
3012
|
-
plugin.resume && plugin.resume();
|
|
3013
|
-
});
|
|
3014
|
-
}, null);
|
|
2820
|
+
getSpanId: function () {
|
|
2821
|
+
return trace[_DYN_SPAN_ID ];
|
|
3015
2822
|
},
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
waiting--;
|
|
3025
|
-
if (doneIterating && waiting === 0) {
|
|
3026
|
-
cbTimer && cbTimer[_DYN_CANCEL ]();
|
|
3027
|
-
cbTimer = null;
|
|
3028
|
-
callBack && callBack(doneIterating);
|
|
3029
|
-
callBack = null;
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
_processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) {
|
|
3033
|
-
chainCtx.iterate(function (plugin) {
|
|
3034
|
-
if (plugin[_DYN_FLUSH ]) {
|
|
3035
|
-
waiting++;
|
|
3036
|
-
var handled_1 = false;
|
|
3037
|
-
if (!plugin[_DYN_FLUSH ](isAsync, function () {
|
|
3038
|
-
handled_1 = true;
|
|
3039
|
-
doCallback();
|
|
3040
|
-
}, sendReason)) {
|
|
3041
|
-
if (!handled_1) {
|
|
3042
|
-
if (isAsync && cbTimer == null) {
|
|
3043
|
-
cbTimer = scheduleTimeout(function () {
|
|
3044
|
-
cbTimer = null;
|
|
3045
|
-
doCallback();
|
|
3046
|
-
}, cbTimeout);
|
|
3047
|
-
}
|
|
3048
|
-
else {
|
|
3049
|
-
doCallback();
|
|
3050
|
-
}
|
|
3051
|
-
}
|
|
3052
|
-
}
|
|
3053
|
-
}
|
|
3054
|
-
});
|
|
3055
|
-
}, function () {
|
|
3056
|
-
doneIterating = true;
|
|
3057
|
-
doCallback();
|
|
3058
|
-
});
|
|
3059
|
-
return true;
|
|
2823
|
+
setSpanId: function (newValue) {
|
|
2824
|
+
parentCtx && parentCtx.setSpanId(newValue);
|
|
2825
|
+
if (isValidSpanId(newValue)) {
|
|
2826
|
+
trace[_DYN_SPAN_ID ] = newValue;
|
|
2827
|
+
}
|
|
2828
|
+
},
|
|
2829
|
+
getTraceFlags: function () {
|
|
2830
|
+
return trace[_DYN_TRACE_FLAGS ];
|
|
3060
2831
|
},
|
|
3061
|
-
|
|
3062
|
-
|
|
2832
|
+
setTraceFlags: function (newTraceFlags) {
|
|
2833
|
+
parentCtx && parentCtx.setTraceFlags(newTraceFlags);
|
|
2834
|
+
trace[_DYN_TRACE_FLAGS ] = newTraceFlags;
|
|
3063
2835
|
}
|
|
3064
2836
|
};
|
|
3065
|
-
return channelController;
|
|
3066
|
-
}
|
|
3067
|
-
function createChannelQueues(channels, extensions, core) {
|
|
3068
|
-
var channelQueue = [];
|
|
3069
|
-
if (channels) {
|
|
3070
|
-
arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, core); });
|
|
3071
|
-
}
|
|
3072
|
-
if (extensions) {
|
|
3073
|
-
var extensionQueue_1 = [];
|
|
3074
|
-
arrForEach(extensions, function (plugin) {
|
|
3075
|
-
if (plugin[STR_PRIORITY ] > ChannelControllerPriority) {
|
|
3076
|
-
extensionQueue_1[_DYN_PUSH$1 ](plugin);
|
|
3077
|
-
}
|
|
3078
|
-
});
|
|
3079
|
-
_addChannelQueue(channelQueue, extensionQueue_1, core);
|
|
3080
|
-
}
|
|
3081
|
-
return channelQueue;
|
|
3082
2837
|
}
|
|
3083
2838
|
|
|
3084
|
-
var
|
|
3085
|
-
var
|
|
3086
|
-
var
|
|
3087
|
-
var
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
var _parsedCookieValue = null;
|
|
3095
|
-
var _doc = getDocument();
|
|
3096
|
-
var _cookieCache = {};
|
|
3097
|
-
var _globalCookieConfig = {};
|
|
3098
|
-
var defaultConfig$1 = objDeepFreeze((_a$3 = {},
|
|
3099
|
-
_a$3[STR_DOMAIN] = { fb: "cookieDomain", dfVal: isNotNullOrUndefined },
|
|
3100
|
-
_a$3.path = { fb: "cookiePath", dfVal: isNotNullOrUndefined },
|
|
3101
|
-
_a$3.enabled = UNDEFINED_VALUE$1,
|
|
3102
|
-
_a$3));
|
|
3103
|
-
var rootDefaultConfig = (_b$1 = {
|
|
3104
|
-
cookieCfg: {},
|
|
3105
|
-
cookieDomain: UNDEFINED_VALUE$1,
|
|
3106
|
-
cookiePath: UNDEFINED_VALUE$1
|
|
3107
|
-
},
|
|
3108
|
-
_b$1[strDisableCookiesUsage] = UNDEFINED_VALUE$1,
|
|
3109
|
-
_b$1);
|
|
3110
|
-
function _isMgrEnabled(cookieMgr) {
|
|
3111
|
-
if (cookieMgr) {
|
|
3112
|
-
return cookieMgr.isEnabled();
|
|
2839
|
+
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
2840
|
+
var strHasRunFlags = "_hasRun";
|
|
2841
|
+
var strGetTelCtx = "_getTelCtx";
|
|
2842
|
+
var _chainId = 0;
|
|
2843
|
+
function _getNextProxyStart(proxy, core, startAt) {
|
|
2844
|
+
while (proxy) {
|
|
2845
|
+
if (proxy[_DYN_GET_PLUGIN ]() === startAt) {
|
|
2846
|
+
return proxy;
|
|
2847
|
+
}
|
|
2848
|
+
proxy = proxy[_DYN_GET_NEXT ]();
|
|
3113
2849
|
}
|
|
3114
|
-
return
|
|
2850
|
+
return createTelemetryProxyChain([startAt], core.config || {}, core);
|
|
3115
2851
|
}
|
|
3116
|
-
function
|
|
3117
|
-
|
|
3118
|
-
|
|
2852
|
+
function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
2853
|
+
var _nextProxy = null;
|
|
2854
|
+
var _onComplete = [];
|
|
2855
|
+
if (!dynamicHandler) {
|
|
2856
|
+
dynamicHandler = createDynamicConfig({}, null, core[_DYN_LOGGER ]);
|
|
3119
2857
|
}
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
function _isBlockedCookie(cookieMgrCfg, name) {
|
|
3123
|
-
if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {
|
|
3124
|
-
if (arrIndexOf(cookieMgrCfg.blockedCookies, name) !== -1) {
|
|
3125
|
-
return true;
|
|
3126
|
-
}
|
|
2858
|
+
if (startAt !== null) {
|
|
2859
|
+
_nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain;
|
|
3127
2860
|
}
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
}
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
}
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
var idx = strIndexOf(theValue, ";");
|
|
3178
|
-
if (idx !== -1) {
|
|
3179
|
-
theValue = strTrim(strLeft(value, idx));
|
|
3180
|
-
values = _extractParts(strSubstring(value, idx + 1));
|
|
3181
|
-
}
|
|
3182
|
-
setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
|
|
3183
|
-
if (!isNullOrUndefined(maxAgeSec)) {
|
|
3184
|
-
var _isIE = isIE();
|
|
3185
|
-
if (isUndefined(values[strExpires])) {
|
|
3186
|
-
var nowMs = utcNow();
|
|
3187
|
-
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
3188
|
-
if (expireMs > 0) {
|
|
3189
|
-
var expiry = new Date();
|
|
3190
|
-
expiry.setTime(expireMs);
|
|
3191
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
3192
|
-
}
|
|
3193
|
-
}
|
|
3194
|
-
if (!_isIE) {
|
|
3195
|
-
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
3196
|
-
}
|
|
3197
|
-
}
|
|
3198
|
-
var location_1 = getLocation();
|
|
3199
|
-
if (location_1 && location_1.protocol === "https:") {
|
|
3200
|
-
setValue(values, "secure", null, null, isUndefined);
|
|
3201
|
-
if (_allowUaSameSite === null) {
|
|
3202
|
-
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
|
|
2861
|
+
var context = {
|
|
2862
|
+
_next: _moveNext,
|
|
2863
|
+
ctx: {
|
|
2864
|
+
core: function () {
|
|
2865
|
+
return core;
|
|
2866
|
+
},
|
|
2867
|
+
diagLog: function () {
|
|
2868
|
+
return safeGetLogger(core, dynamicHandler.cfg);
|
|
2869
|
+
},
|
|
2870
|
+
getCfg: function () {
|
|
2871
|
+
return dynamicHandler.cfg;
|
|
2872
|
+
},
|
|
2873
|
+
getExtCfg: _resolveExtCfg,
|
|
2874
|
+
getConfig: _getConfig,
|
|
2875
|
+
hasNext: function () {
|
|
2876
|
+
return !!_nextProxy;
|
|
2877
|
+
},
|
|
2878
|
+
getNext: function () {
|
|
2879
|
+
return _nextProxy;
|
|
2880
|
+
},
|
|
2881
|
+
setNext: function (nextPlugin) {
|
|
2882
|
+
_nextProxy = nextPlugin;
|
|
2883
|
+
},
|
|
2884
|
+
iterate: _iterateChain,
|
|
2885
|
+
onComplete: _addOnComplete
|
|
2886
|
+
}
|
|
2887
|
+
};
|
|
2888
|
+
function _addOnComplete(onComplete, that) {
|
|
2889
|
+
var args = [];
|
|
2890
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2891
|
+
args[_i - 2] = arguments[_i];
|
|
2892
|
+
}
|
|
2893
|
+
if (onComplete) {
|
|
2894
|
+
_onComplete[_DYN_PUSH$1 ]({
|
|
2895
|
+
func: onComplete,
|
|
2896
|
+
self: !isUndefined(that) ? that : context.ctx,
|
|
2897
|
+
args: args
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
function _moveNext() {
|
|
2902
|
+
var nextProxy = _nextProxy;
|
|
2903
|
+
_nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null;
|
|
2904
|
+
if (!nextProxy) {
|
|
2905
|
+
var onComplete = _onComplete;
|
|
2906
|
+
if (onComplete && onComplete[_DYN_LENGTH$2 ] > 0) {
|
|
2907
|
+
arrForEach(onComplete, function (completeDetails) {
|
|
2908
|
+
try {
|
|
2909
|
+
completeDetails.func[_DYN_CALL ](completeDetails.self, completeDetails.args);
|
|
3203
2910
|
}
|
|
3204
|
-
|
|
3205
|
-
|
|
2911
|
+
catch (e) {
|
|
2912
|
+
_throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
3206
2913
|
}
|
|
3207
|
-
}
|
|
3208
|
-
|
|
3209
|
-
_setCookieFn(name, _formatCookieValue(theValue, values));
|
|
3210
|
-
result = true;
|
|
2914
|
+
});
|
|
2915
|
+
_onComplete = [];
|
|
3211
2916
|
}
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
2917
|
+
}
|
|
2918
|
+
return nextProxy;
|
|
2919
|
+
}
|
|
2920
|
+
function _getExtCfg(identifier, createIfMissing) {
|
|
2921
|
+
var idCfg = null;
|
|
2922
|
+
var cfg = dynamicHandler.cfg;
|
|
2923
|
+
if (cfg && identifier) {
|
|
2924
|
+
var extCfg = cfg[STR_EXTENSION_CONFIG ];
|
|
2925
|
+
if (!extCfg && createIfMissing) {
|
|
2926
|
+
extCfg = {};
|
|
3218
2927
|
}
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
2928
|
+
dynamicHandler.set(cfg, STR_EXTENSION_CONFIG, extCfg);
|
|
2929
|
+
extCfg = cfg[STR_EXTENSION_CONFIG ];
|
|
2930
|
+
if (extCfg) {
|
|
2931
|
+
idCfg = extCfg[identifier];
|
|
2932
|
+
if (!idCfg && createIfMissing) {
|
|
2933
|
+
idCfg = {};
|
|
2934
|
+
}
|
|
2935
|
+
dynamicHandler.set(extCfg, identifier, idCfg);
|
|
2936
|
+
idCfg = extCfg[identifier];
|
|
3225
2937
|
}
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
2938
|
+
}
|
|
2939
|
+
return idCfg;
|
|
2940
|
+
}
|
|
2941
|
+
function _resolveExtCfg(identifier, defaultValues) {
|
|
2942
|
+
var newConfig = _getExtCfg(identifier, true);
|
|
2943
|
+
if (defaultValues) {
|
|
2944
|
+
objForEachKey(defaultValues, function (field, defaultValue) {
|
|
2945
|
+
if (isNullOrUndefined(newConfig[field])) {
|
|
2946
|
+
var cfgValue = dynamicHandler.cfg[field];
|
|
2947
|
+
if (cfgValue || !isNullOrUndefined(cfgValue)) {
|
|
2948
|
+
newConfig[field] = cfgValue;
|
|
2949
|
+
}
|
|
3238
2950
|
}
|
|
3239
|
-
|
|
3240
|
-
|
|
2951
|
+
_applyDefaultValue(dynamicHandler, newConfig, field, defaultValue);
|
|
2952
|
+
});
|
|
2953
|
+
}
|
|
2954
|
+
return dynamicHandler[_DYN_SET_DF ](newConfig, defaultValues);
|
|
2955
|
+
}
|
|
2956
|
+
function _getConfig(identifier, field, defaultValue) {
|
|
2957
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
2958
|
+
var theValue;
|
|
2959
|
+
var extConfig = _getExtCfg(identifier, false);
|
|
2960
|
+
var rootConfig = dynamicHandler.cfg;
|
|
2961
|
+
if (extConfig && (extConfig[field] || !isNullOrUndefined(extConfig[field]))) {
|
|
2962
|
+
theValue = extConfig[field];
|
|
2963
|
+
}
|
|
2964
|
+
else if (rootConfig[field] || !isNullOrUndefined(rootConfig[field])) {
|
|
2965
|
+
theValue = rootConfig[field];
|
|
2966
|
+
}
|
|
2967
|
+
return (theValue || !isNullOrUndefined(theValue)) ? theValue : defaultValue;
|
|
2968
|
+
}
|
|
2969
|
+
function _iterateChain(cb) {
|
|
2970
|
+
var nextPlugin;
|
|
2971
|
+
while (!!(nextPlugin = context._next())) {
|
|
2972
|
+
var plugin = nextPlugin[_DYN_GET_PLUGIN ]();
|
|
2973
|
+
if (plugin) {
|
|
2974
|
+
cb(plugin);
|
|
3241
2975
|
}
|
|
3242
|
-
return result;
|
|
3243
2976
|
}
|
|
3244
|
-
}
|
|
3245
|
-
|
|
3246
|
-
return cookieMgr;
|
|
2977
|
+
}
|
|
2978
|
+
return context;
|
|
3247
2979
|
}
|
|
3248
|
-
function
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
2980
|
+
function createProcessTelemetryContext(telemetryChain, cfg, core, startAt) {
|
|
2981
|
+
var config = createDynamicConfig(cfg);
|
|
2982
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
2983
|
+
var context = internalContext.ctx;
|
|
2984
|
+
function _processNext(env) {
|
|
2985
|
+
var nextPlugin = internalContext._next();
|
|
2986
|
+
if (nextPlugin) {
|
|
2987
|
+
nextPlugin[STR_PROCESS_TELEMETRY ](env, context);
|
|
3254
2988
|
}
|
|
3255
|
-
|
|
3256
|
-
|
|
2989
|
+
return !nextPlugin;
|
|
2990
|
+
}
|
|
2991
|
+
function _createNew(plugins, startAt) {
|
|
2992
|
+
if (plugins === void 0) { plugins = null; }
|
|
2993
|
+
if (isArray(plugins)) {
|
|
2994
|
+
plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);
|
|
3257
2995
|
}
|
|
2996
|
+
return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT ](), config.cfg, core, startAt);
|
|
3258
2997
|
}
|
|
3259
|
-
|
|
2998
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
2999
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
3000
|
+
return context;
|
|
3260
3001
|
}
|
|
3261
|
-
function
|
|
3262
|
-
var
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3002
|
+
function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {
|
|
3003
|
+
var config = createDynamicConfig(core.config);
|
|
3004
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
3005
|
+
var context = internalContext.ctx;
|
|
3006
|
+
function _processNext(unloadState) {
|
|
3007
|
+
var nextPlugin = internalContext._next();
|
|
3008
|
+
nextPlugin && nextPlugin.unload(context, unloadState);
|
|
3009
|
+
return !nextPlugin;
|
|
3010
|
+
}
|
|
3011
|
+
function _createNew(plugins, startAt) {
|
|
3012
|
+
if (plugins === void 0) { plugins = null; }
|
|
3013
|
+
if (isArray(plugins)) {
|
|
3014
|
+
plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);
|
|
3015
|
+
}
|
|
3016
|
+
return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT ](), core, startAt);
|
|
3017
|
+
}
|
|
3018
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
3019
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
3020
|
+
return context;
|
|
3021
|
+
}
|
|
3022
|
+
function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {
|
|
3023
|
+
var config = createDynamicConfig(core.config);
|
|
3024
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
3025
|
+
var context = internalContext.ctx;
|
|
3026
|
+
function _processNext(updateState) {
|
|
3027
|
+
return context.iterate(function (plugin) {
|
|
3028
|
+
if (isFunction(plugin[_DYN_UPDATE ])) {
|
|
3029
|
+
plugin[_DYN_UPDATE ](context, updateState);
|
|
3275
3030
|
}
|
|
3276
3031
|
});
|
|
3277
3032
|
}
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3033
|
+
function _createNew(plugins, startAt) {
|
|
3034
|
+
if (plugins === void 0) { plugins = null; }
|
|
3035
|
+
if (isArray(plugins)) {
|
|
3036
|
+
plugins = createTelemetryProxyChain(plugins, config.cfg, core, startAt);
|
|
3037
|
+
}
|
|
3038
|
+
return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT ](), core, startAt);
|
|
3283
3039
|
}
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
var cookieValue = value || STR_EMPTY;
|
|
3288
|
-
objForEachKey(values, function (name, theValue) {
|
|
3289
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY);
|
|
3290
|
-
});
|
|
3291
|
-
return cookieValue;
|
|
3040
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
3041
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
3042
|
+
return context;
|
|
3292
3043
|
}
|
|
3293
|
-
function
|
|
3294
|
-
var
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3044
|
+
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
3045
|
+
var firstProxy = null;
|
|
3046
|
+
var add = startAt ? false : true;
|
|
3047
|
+
if (isArray(plugins) && plugins[_DYN_LENGTH$2 ] > 0) {
|
|
3048
|
+
var lastProxy_1 = null;
|
|
3049
|
+
arrForEach(plugins, function (thePlugin) {
|
|
3050
|
+
if (!add && startAt === thePlugin) {
|
|
3051
|
+
add = true;
|
|
3052
|
+
}
|
|
3053
|
+
if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) {
|
|
3054
|
+
var newProxy = createTelemetryPluginProxy(thePlugin, config, core);
|
|
3055
|
+
if (!firstProxy) {
|
|
3056
|
+
firstProxy = newProxy;
|
|
3057
|
+
}
|
|
3058
|
+
if (lastProxy_1) {
|
|
3059
|
+
lastProxy_1._setNext(newProxy);
|
|
3060
|
+
}
|
|
3061
|
+
lastProxy_1 = newProxy;
|
|
3062
|
+
}
|
|
3063
|
+
});
|
|
3302
3064
|
}
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
function _setCookieValue(name, cookieValue) {
|
|
3306
|
-
if (_doc) {
|
|
3307
|
-
_doc[strCookie] = name + "=" + cookieValue;
|
|
3065
|
+
if (startAt && !firstProxy) {
|
|
3066
|
+
return createTelemetryProxyChain([startAt], config, core);
|
|
3308
3067
|
}
|
|
3068
|
+
return firstProxy;
|
|
3309
3069
|
}
|
|
3310
|
-
function
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
3318
|
-
return true;
|
|
3319
|
-
}
|
|
3320
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
3321
|
-
return true;
|
|
3322
|
-
}
|
|
3323
|
-
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
3324
|
-
return true;
|
|
3070
|
+
function createTelemetryPluginProxy(plugin, config, core) {
|
|
3071
|
+
var nextProxy = null;
|
|
3072
|
+
var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]);
|
|
3073
|
+
var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
|
|
3074
|
+
var chainId;
|
|
3075
|
+
if (plugin) {
|
|
3076
|
+
chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
3325
3077
|
}
|
|
3326
|
-
|
|
3327
|
-
|
|
3078
|
+
else {
|
|
3079
|
+
chainId = "Unknown-0-" + _chainId++;
|
|
3328
3080
|
}
|
|
3329
|
-
|
|
3330
|
-
|
|
3081
|
+
var proxyChain = {
|
|
3082
|
+
getPlugin: function () {
|
|
3083
|
+
return plugin;
|
|
3084
|
+
},
|
|
3085
|
+
getNext: function () {
|
|
3086
|
+
return nextProxy;
|
|
3087
|
+
},
|
|
3088
|
+
processTelemetry: _processTelemetry,
|
|
3089
|
+
unload: _unloadPlugin,
|
|
3090
|
+
update: _updatePlugin,
|
|
3091
|
+
_id: chainId,
|
|
3092
|
+
_setNext: function (nextPlugin) {
|
|
3093
|
+
nextProxy = nextPlugin;
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
function _getTelCtx() {
|
|
3097
|
+
var itemCtx;
|
|
3098
|
+
if (plugin && isFunction(plugin[strGetTelCtx])) {
|
|
3099
|
+
itemCtx = plugin[strGetTelCtx]();
|
|
3100
|
+
}
|
|
3101
|
+
if (!itemCtx) {
|
|
3102
|
+
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
3103
|
+
}
|
|
3104
|
+
return itemCtx;
|
|
3331
3105
|
}
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
if (
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
}
|
|
3344
|
-
else {
|
|
3106
|
+
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
3107
|
+
var hasRun = false;
|
|
3108
|
+
var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain;
|
|
3109
|
+
var hasRunContext = itemCtx[strHasRunFlags];
|
|
3110
|
+
if (!hasRunContext) {
|
|
3111
|
+
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
3112
|
+
}
|
|
3113
|
+
itemCtx.setNext(nextProxy);
|
|
3114
|
+
if (plugin) {
|
|
3115
|
+
doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () {
|
|
3116
|
+
hasRunContext[chainId] = true;
|
|
3345
3117
|
try {
|
|
3346
|
-
|
|
3118
|
+
var nextId = nextProxy ? nextProxy._id : STR_EMPTY;
|
|
3119
|
+
if (nextId) {
|
|
3120
|
+
hasRunContext[nextId] = false;
|
|
3121
|
+
}
|
|
3122
|
+
hasRun = processPluginFn(itemCtx);
|
|
3347
3123
|
}
|
|
3348
|
-
catch (
|
|
3124
|
+
catch (error) {
|
|
3125
|
+
var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true;
|
|
3126
|
+
if (hasNextRun) {
|
|
3127
|
+
hasRun = true;
|
|
3128
|
+
}
|
|
3129
|
+
if (!nextProxy || !hasNextRun) {
|
|
3130
|
+
_throwInternal(itemCtx[_DYN_DIAG_LOG$1 ](), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
3131
|
+
}
|
|
3349
3132
|
}
|
|
3133
|
+
}, details, isAsync);
|
|
3134
|
+
}
|
|
3135
|
+
return hasRun;
|
|
3136
|
+
}
|
|
3137
|
+
function _processTelemetry(env, itemCtx) {
|
|
3138
|
+
itemCtx = itemCtx || _getTelCtx();
|
|
3139
|
+
function _callProcessTelemetry(itemCtx) {
|
|
3140
|
+
if (!plugin || !hasProcessTelemetry) {
|
|
3141
|
+
return false;
|
|
3142
|
+
}
|
|
3143
|
+
var pluginState = _getPluginState(plugin);
|
|
3144
|
+
if (pluginState[_DYN_TEARDOWN ] || pluginState[STR_DISABLED]) {
|
|
3145
|
+
return false;
|
|
3146
|
+
}
|
|
3147
|
+
if (hasSetNext) {
|
|
3148
|
+
plugin[_DYN_SET_NEXT_PLUGIN ](nextProxy);
|
|
3350
3149
|
}
|
|
3150
|
+
plugin[STR_PROCESS_TELEMETRY ](env, itemCtx);
|
|
3151
|
+
return true;
|
|
3351
3152
|
}
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
_self.listeners[_DYN_SPLICE ](index, 1);
|
|
3370
|
-
index = arrIndexOf(_self[_DYN_LISTENERS ], listener);
|
|
3153
|
+
if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) {
|
|
3154
|
+
itemCtx[_DYN_PROCESS_NEXT ](env);
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
function _unloadPlugin(unloadCtx, unloadState) {
|
|
3158
|
+
function _callTeardown() {
|
|
3159
|
+
var hasRun = false;
|
|
3160
|
+
if (plugin) {
|
|
3161
|
+
var pluginState = _getPluginState(plugin);
|
|
3162
|
+
var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ];
|
|
3163
|
+
if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN ]) {
|
|
3164
|
+
pluginState[STR_CORE ] = null;
|
|
3165
|
+
pluginState[_DYN_TEARDOWN ] = true;
|
|
3166
|
+
pluginState[_DYN_IS_INITIALIZED ] = false;
|
|
3167
|
+
if (plugin[_DYN_TEARDOWN ] && plugin[_DYN_TEARDOWN ](unloadCtx, unloadState) === true) {
|
|
3168
|
+
hasRun = true;
|
|
3169
|
+
}
|
|
3371
3170
|
}
|
|
3372
|
-
}
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
_self[STR_PERF_EVENT ] = function (perfEvent) {
|
|
3389
|
-
if (perfEvent) {
|
|
3390
|
-
if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) {
|
|
3391
|
-
_runListeners(_self[_DYN_LISTENERS ], STR_PERF_EVENT, false, function (listener) {
|
|
3392
|
-
if (perfEvent[_DYN_IS_ASYNC ]) {
|
|
3393
|
-
scheduleTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0);
|
|
3394
|
-
}
|
|
3395
|
-
else {
|
|
3396
|
-
listener[STR_PERF_EVENT ](perfEvent);
|
|
3397
|
-
}
|
|
3398
|
-
});
|
|
3171
|
+
}
|
|
3172
|
+
return hasRun;
|
|
3173
|
+
}
|
|
3174
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState[_DYN_IS_ASYNC ])) {
|
|
3175
|
+
unloadCtx[_DYN_PROCESS_NEXT ](unloadState);
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
function _updatePlugin(updateCtx, updateState) {
|
|
3179
|
+
function _callUpdate() {
|
|
3180
|
+
var hasRun = false;
|
|
3181
|
+
if (plugin) {
|
|
3182
|
+
var pluginState = _getPluginState(plugin);
|
|
3183
|
+
var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ];
|
|
3184
|
+
if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN ]) {
|
|
3185
|
+
if (plugin[_DYN_UPDATE ] && plugin[_DYN_UPDATE ](updateCtx, updateState) === true) {
|
|
3186
|
+
hasRun = true;
|
|
3399
3187
|
}
|
|
3400
3188
|
}
|
|
3401
|
-
}
|
|
3402
|
-
|
|
3189
|
+
}
|
|
3190
|
+
return hasRun;
|
|
3191
|
+
}
|
|
3192
|
+
if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
|
|
3193
|
+
updateCtx[_DYN_PROCESS_NEXT ](updateState);
|
|
3194
|
+
}
|
|
3403
3195
|
}
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
}());
|
|
3196
|
+
return objFreeze(proxyChain);
|
|
3197
|
+
}
|
|
3407
3198
|
|
|
3408
3199
|
function createUnloadHandlerContainer() {
|
|
3409
3200
|
var handlers = [];
|
|
@@ -3666,6 +3457,7 @@
|
|
|
3666
3457
|
function _validateExtensions(logger, channelPriority, allExtensions) {
|
|
3667
3458
|
var _a;
|
|
3668
3459
|
var coreExtensions = [];
|
|
3460
|
+
var channels = [];
|
|
3669
3461
|
var extPriorities = {};
|
|
3670
3462
|
arrForEach(allExtensions, function (ext) {
|
|
3671
3463
|
if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE ])) {
|
|
@@ -3684,11 +3476,13 @@
|
|
|
3684
3476
|
if (!extPriority || extPriority < channelPriority) {
|
|
3685
3477
|
coreExtensions[_DYN_PUSH$1 ](ext);
|
|
3686
3478
|
}
|
|
3479
|
+
else {
|
|
3480
|
+
channels[_DYN_PUSH$1 ](ext);
|
|
3481
|
+
}
|
|
3687
3482
|
});
|
|
3688
|
-
return _a = {
|
|
3689
|
-
all: allExtensions
|
|
3690
|
-
},
|
|
3483
|
+
return _a = {},
|
|
3691
3484
|
_a[STR_CORE ] = coreExtensions,
|
|
3485
|
+
_a[STR_CHANNELS ] = channels,
|
|
3692
3486
|
_a;
|
|
3693
3487
|
}
|
|
3694
3488
|
function _isPluginPresent(thePlugin, plugins) {
|
|
@@ -3766,10 +3560,8 @@
|
|
|
3766
3560
|
var _cookieManager;
|
|
3767
3561
|
var _pluginChain;
|
|
3768
3562
|
var _configExtensions;
|
|
3769
|
-
var _coreExtensions;
|
|
3770
|
-
var _channelControl;
|
|
3771
3563
|
var _channelConfig;
|
|
3772
|
-
var
|
|
3564
|
+
var _channels;
|
|
3773
3565
|
var _isUnloading;
|
|
3774
3566
|
var _telemetryInitializerPlugin;
|
|
3775
3567
|
var _internalLogsEventName;
|
|
@@ -3816,20 +3608,26 @@
|
|
|
3816
3608
|
_configExtensions[_DYN_PUSH$1 ].apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), cfgExtensions));
|
|
3817
3609
|
_channelConfig = config[STR_CHANNELS ];
|
|
3818
3610
|
_initPluginChain(null);
|
|
3819
|
-
if (!
|
|
3611
|
+
if (!_channels || _channels[_DYN_LENGTH$2 ] === 0) {
|
|
3820
3612
|
throwError("No " + STR_CHANNELS + " available");
|
|
3821
3613
|
}
|
|
3614
|
+
if (_channels[_DYN_LENGTH$2 ] > 1) {
|
|
3615
|
+
var teeController = _self[_DYN_GET_PLUGIN ]("TeeChannelController");
|
|
3616
|
+
if (!teeController || !teeController.plugin) {
|
|
3617
|
+
_throwInternal(_self[_DYN_LOGGER ], 1 , 28 , "TeeChannel required");
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3822
3620
|
_registerDelayedCfgListener(config, _cfgListeners, _self[_DYN_LOGGER ]);
|
|
3823
3621
|
_cfgListeners = null;
|
|
3824
3622
|
_isInitialized = true;
|
|
3825
3623
|
_self.releaseQueue();
|
|
3826
3624
|
_self[_DYN_POLL_INTERNAL_LOGS ]();
|
|
3827
3625
|
};
|
|
3828
|
-
_self.
|
|
3626
|
+
_self.getChannels = function () {
|
|
3829
3627
|
var controls = [];
|
|
3830
|
-
if (
|
|
3831
|
-
arrForEach(
|
|
3832
|
-
controls[_DYN_PUSH$1 ](
|
|
3628
|
+
if (_channels) {
|
|
3629
|
+
arrForEach(_channels, function (channel) {
|
|
3630
|
+
controls[_DYN_PUSH$1 ](channel);
|
|
3833
3631
|
});
|
|
3834
3632
|
}
|
|
3835
3633
|
return objFreeze(controls);
|
|
@@ -3980,9 +3778,7 @@
|
|
|
3980
3778
|
_self[_DYN_STOP_POLLING_INTERNA3 ]();
|
|
3981
3779
|
processUnloadCtx[_DYN_PROCESS_NEXT ](unloadState);
|
|
3982
3780
|
}
|
|
3983
|
-
if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout))
|
|
3984
|
-
_doUnload(false);
|
|
3985
|
-
}
|
|
3781
|
+
if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) ;
|
|
3986
3782
|
};
|
|
3987
3783
|
_self[_DYN_GET_PLUGIN ] = _getPlugin;
|
|
3988
3784
|
_self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) {
|
|
@@ -4063,7 +3859,7 @@
|
|
|
4063
3859
|
_self.evtNamespace = function () {
|
|
4064
3860
|
return _evtNamespace;
|
|
4065
3861
|
};
|
|
4066
|
-
_self
|
|
3862
|
+
_self.flush = _flushChannels;
|
|
4067
3863
|
_self.getTraceCtx = function (createNew) {
|
|
4068
3864
|
if (!_traceCtx) {
|
|
4069
3865
|
_traceCtx = createDistributedTraceContext();
|
|
@@ -4160,11 +3956,9 @@
|
|
|
4160
3956
|
_cfgPerfManager = null;
|
|
4161
3957
|
_cookieManager = null;
|
|
4162
3958
|
_pluginChain = null;
|
|
4163
|
-
_coreExtensions = null;
|
|
4164
3959
|
_configExtensions = [];
|
|
4165
|
-
_channelControl = null;
|
|
4166
3960
|
_channelConfig = null;
|
|
4167
|
-
|
|
3961
|
+
_channels = null;
|
|
4168
3962
|
_isUnloading = false;
|
|
4169
3963
|
_internalLogsEventName = null;
|
|
4170
3964
|
_evtNamespace = createUniqueNamespace("AIBaseCore", true);
|
|
@@ -4181,32 +3975,18 @@
|
|
|
4181
3975
|
}
|
|
4182
3976
|
function _initPluginChain(updateState) {
|
|
4183
3977
|
var theExtensions = _validateExtensions(_self[_DYN_LOGGER ], ChannelControllerPriority, _configExtensions);
|
|
4184
|
-
_coreExtensions = theExtensions[STR_CORE ];
|
|
4185
3978
|
_pluginChain = null;
|
|
4186
3979
|
_pluginVersionString = null;
|
|
4187
3980
|
_pluginVersionStringArr = null;
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
_coreExtensions[_DYN_SPLICE ](idx, 1);
|
|
4198
|
-
}
|
|
4199
|
-
_channelControl._setQueue(_channelQueue);
|
|
4200
|
-
}
|
|
4201
|
-
else {
|
|
4202
|
-
_channelControl = createChannelControllerPlugin(_channelQueue, _self);
|
|
4203
|
-
}
|
|
4204
|
-
allExtensions[_DYN_PUSH$1 ](_channelControl);
|
|
4205
|
-
_coreExtensions[_DYN_PUSH$1 ](_channelControl);
|
|
4206
|
-
_extensions = sortPlugins(allExtensions);
|
|
4207
|
-
_channelControl[_DYN_INITIALIZE ](_configHandler.cfg, _self, allExtensions);
|
|
4208
|
-
initializePlugins(_createTelCtx(), allExtensions);
|
|
4209
|
-
_extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice();
|
|
3981
|
+
_channels = (_channelConfig || [])[0] || [];
|
|
3982
|
+
_channels = sortPlugins(arrAppend(_channels, theExtensions[STR_CHANNELS ]));
|
|
3983
|
+
var allExtensions = arrAppend(sortPlugins(theExtensions[STR_CORE ]), _channels);
|
|
3984
|
+
_extensions = objFreeze(allExtensions);
|
|
3985
|
+
var rootCtx = _createTelCtx();
|
|
3986
|
+
if (_channels && _channels[_DYN_LENGTH$2 ] > 0) {
|
|
3987
|
+
initializePlugins(rootCtx[_DYN_CREATE_NEW ](_channels), allExtensions);
|
|
3988
|
+
}
|
|
3989
|
+
initializePlugins(rootCtx, allExtensions);
|
|
4210
3990
|
if (updateState) {
|
|
4211
3991
|
_doUpdate(updateState);
|
|
4212
3992
|
}
|
|
@@ -4215,14 +3995,11 @@
|
|
|
4215
3995
|
var theExt = null;
|
|
4216
3996
|
var thePlugin = null;
|
|
4217
3997
|
arrForEach(_extensions, function (ext) {
|
|
4218
|
-
if (ext[_DYN_IDENTIFIER ] === pluginIdentifier && ext !==
|
|
3998
|
+
if (ext[_DYN_IDENTIFIER ] === pluginIdentifier && ext !== _telemetryInitializerPlugin) {
|
|
4219
3999
|
thePlugin = ext;
|
|
4220
4000
|
return -1;
|
|
4221
4001
|
}
|
|
4222
4002
|
});
|
|
4223
|
-
if (!thePlugin && _channelControl) {
|
|
4224
|
-
thePlugin = _channelControl.getChannel(pluginIdentifier);
|
|
4225
|
-
}
|
|
4226
4003
|
if (thePlugin) {
|
|
4227
4004
|
theExt = {
|
|
4228
4005
|
plugin: thePlugin,
|
|
@@ -4258,7 +4035,7 @@
|
|
|
4258
4035
|
}
|
|
4259
4036
|
function _getPluginChain() {
|
|
4260
4037
|
if (!_pluginChain) {
|
|
4261
|
-
var extensions = (
|
|
4038
|
+
var extensions = (_extensions || []).slice();
|
|
4262
4039
|
if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {
|
|
4263
4040
|
extensions[_DYN_PUSH$1 ](_telemetryInitializerPlugin);
|
|
4264
4041
|
}
|
|
@@ -4326,10 +4103,46 @@
|
|
|
4326
4103
|
}
|
|
4327
4104
|
}
|
|
4328
4105
|
function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {
|
|
4329
|
-
|
|
4330
|
-
|
|
4106
|
+
var waiting = 1;
|
|
4107
|
+
var doneIterating = false;
|
|
4108
|
+
var cbTimer = null;
|
|
4109
|
+
cbTimeout = cbTimeout || 5000;
|
|
4110
|
+
function doCallback() {
|
|
4111
|
+
waiting--;
|
|
4112
|
+
if (doneIterating && waiting === 0) {
|
|
4113
|
+
cbTimer && cbTimer[_DYN_CANCEL ]();
|
|
4114
|
+
cbTimer = null;
|
|
4115
|
+
callBack && callBack(doneIterating);
|
|
4116
|
+
callBack = null;
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
if (_channels && _channels[_DYN_LENGTH$2 ] > 0) {
|
|
4120
|
+
var flushCtx = _createTelCtx()[_DYN_CREATE_NEW ](_channels);
|
|
4121
|
+
flushCtx.iterate(function (plugin) {
|
|
4122
|
+
if (plugin.flush) {
|
|
4123
|
+
waiting++;
|
|
4124
|
+
var handled_1 = false;
|
|
4125
|
+
if (!plugin.flush(isAsync, function () {
|
|
4126
|
+
handled_1 = true;
|
|
4127
|
+
doCallback();
|
|
4128
|
+
}, sendReason)) {
|
|
4129
|
+
if (!handled_1) {
|
|
4130
|
+
if (isAsync && cbTimer == null) {
|
|
4131
|
+
cbTimer = scheduleTimeout(function () {
|
|
4132
|
+
cbTimer = null;
|
|
4133
|
+
doCallback();
|
|
4134
|
+
}, cbTimeout);
|
|
4135
|
+
}
|
|
4136
|
+
else {
|
|
4137
|
+
doCallback();
|
|
4138
|
+
}
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
});
|
|
4331
4143
|
}
|
|
4332
|
-
|
|
4144
|
+
doneIterating = true;
|
|
4145
|
+
doCallback();
|
|
4333
4146
|
return true;
|
|
4334
4147
|
}
|
|
4335
4148
|
function _initDebugListener() {
|
|
@@ -4586,6 +4399,7 @@
|
|
|
4586
4399
|
var _DYN_SPLIT = "split";
|
|
4587
4400
|
var _DYN_LENGTH$1 = "length";
|
|
4588
4401
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
4402
|
+
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
4589
4403
|
var _DYN_TO_STRING$1 = "toString";
|
|
4590
4404
|
var _DYN_EXCEPTIONS = "exceptions";
|
|
4591
4405
|
var _DYN_PARSED_STACK = "parsedStack";
|
|
@@ -4885,6 +4699,32 @@
|
|
|
4885
4699
|
return false;
|
|
4886
4700
|
}
|
|
4887
4701
|
|
|
4702
|
+
var _FIELDS_SEPARATOR = ";";
|
|
4703
|
+
var _FIELD_KEY_VALUE_SEPARATOR = "=";
|
|
4704
|
+
function parseConnectionString(connectionString) {
|
|
4705
|
+
if (!connectionString) {
|
|
4706
|
+
return {};
|
|
4707
|
+
}
|
|
4708
|
+
var kvPairs = connectionString[_DYN_SPLIT ](_FIELDS_SEPARATOR);
|
|
4709
|
+
var result = arrReduce(kvPairs, function (fields, kv) {
|
|
4710
|
+
var kvParts = kv[_DYN_SPLIT ](_FIELD_KEY_VALUE_SEPARATOR);
|
|
4711
|
+
if (kvParts[_DYN_LENGTH$1 ] === 2) {
|
|
4712
|
+
var key = kvParts[0][_DYN_TO_LOWER_CASE ]();
|
|
4713
|
+
var value = kvParts[1];
|
|
4714
|
+
fields[key] = value;
|
|
4715
|
+
}
|
|
4716
|
+
return fields;
|
|
4717
|
+
}, {});
|
|
4718
|
+
if (objKeys(result)[_DYN_LENGTH$1 ] > 0) {
|
|
4719
|
+
if (result.endpointsuffix) {
|
|
4720
|
+
var locationPrefix = result.location ? result.location + "." : "";
|
|
4721
|
+
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix);
|
|
4722
|
+
}
|
|
4723
|
+
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || DEFAULT_BREEZE_ENDPOINT;
|
|
4724
|
+
}
|
|
4725
|
+
return result;
|
|
4726
|
+
}
|
|
4727
|
+
|
|
4888
4728
|
var Envelope = /** @class */ (function () {
|
|
4889
4729
|
function Envelope(logger, data, name) {
|
|
4890
4730
|
var _this = this;
|
|
@@ -5724,7 +5564,7 @@
|
|
|
5724
5564
|
var _DYN__BUFFER = "_buffer";
|
|
5725
5565
|
var _DYN_ENABLE_SESSION_STORA4 = "enableSessionStorageBuffer";
|
|
5726
5566
|
var _DYN_SAMPLING_PERCENTAGE = "samplingPercentage";
|
|
5727
|
-
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
5567
|
+
var _DYN_INSTRUMENTATION_KEY$1 = "instrumentationKey";
|
|
5728
5568
|
var _DYN_CUSTOM_HEADERS = "customHeaders";
|
|
5729
5569
|
var _DYN_DISABLE_XHR = "disableXhr";
|
|
5730
5570
|
var _DYN_ONUNLOAD_DISABLE_FET5 = "onunloadDisableFetch";
|
|
@@ -5852,7 +5692,7 @@
|
|
|
5852
5692
|
}
|
|
5853
5693
|
}
|
|
5854
5694
|
var EnvelopeCreator = {
|
|
5855
|
-
Version: "3.0.0-beta.
|
|
5695
|
+
Version: "3.0.0-beta.2212-03"
|
|
5856
5696
|
};
|
|
5857
5697
|
function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
|
|
5858
5698
|
EnvelopeCreatorInit(logger, telemetryItem);
|
|
@@ -6497,7 +6337,7 @@
|
|
|
6497
6337
|
_a[_DYN_DISABLE_XHR ] = false,
|
|
6498
6338
|
_a[_DYN_ONUNLOAD_DISABLE_FET5 ] = false,
|
|
6499
6339
|
_a[_DYN_ONUNLOAD_DISABLE_BEA2 ] = false,
|
|
6500
|
-
_a[_DYN_INSTRUMENTATION_KEY ] = UNDEFINED_VALUE,
|
|
6340
|
+
_a[_DYN_INSTRUMENTATION_KEY$1 ] = UNDEFINED_VALUE,
|
|
6501
6341
|
_a[_DYN_NAME_PREFIX ] = UNDEFINED_VALUE,
|
|
6502
6342
|
_a[_DYN_SAMPLING_PERCENTAGE ] = 100,
|
|
6503
6343
|
_a[_DYN_CUSTOM_HEADERS ] = UNDEFINED_VALUE,
|
|
@@ -6621,7 +6461,7 @@
|
|
|
6621
6461
|
? new SessionStorageSendBuffer(diagLog, senderConfig) : new ArraySendBuffer(diagLog, senderConfig);
|
|
6622
6462
|
}
|
|
6623
6463
|
_self._sample = new Sample(senderConfig[_DYN_SAMPLING_PERCENTAGE ], diagLog);
|
|
6624
|
-
_instrumentationKey = senderConfig[_DYN_INSTRUMENTATION_KEY ];
|
|
6464
|
+
_instrumentationKey = senderConfig[_DYN_INSTRUMENTATION_KEY$1 ];
|
|
6625
6465
|
if (!_validateInstrumentationKey(_instrumentationKey, config)) {
|
|
6626
6466
|
_throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + _instrumentationKey);
|
|
6627
6467
|
}
|
|
@@ -7240,28 +7080,27 @@
|
|
|
7240
7080
|
return Sender;
|
|
7241
7081
|
}(BaseTelemetryPlugin));
|
|
7242
7082
|
|
|
7243
|
-
var
|
|
7083
|
+
var _DYN_CONNECTION_STRING = "connectionString";
|
|
7084
|
+
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
7244
7085
|
|
|
7086
|
+
var defaultConfigValues = {
|
|
7087
|
+
diagnosticLogInterval: { isVal: _chkDiagLevel, v: 10000 }
|
|
7088
|
+
};
|
|
7089
|
+
function _chkDiagLevel(value) {
|
|
7090
|
+
return value && value > 0;
|
|
7091
|
+
}
|
|
7245
7092
|
var ApplicationInsights = /** @class */ (function () {
|
|
7246
7093
|
function ApplicationInsights(config) {
|
|
7247
7094
|
var core = new AppInsightsCore();
|
|
7248
|
-
|
|
7249
|
-
isNullOrUndefined(config.instrumentationKey)) {
|
|
7250
|
-
throwError("Invalid input configuration");
|
|
7251
|
-
}
|
|
7095
|
+
var _config;
|
|
7252
7096
|
dynamicProto(ApplicationInsights, this, function (_self) {
|
|
7253
7097
|
objDefineProp(_self, "config", {
|
|
7254
7098
|
configurable: true,
|
|
7255
7099
|
enumerable: true,
|
|
7256
|
-
get: function () { return
|
|
7100
|
+
get: function () { return _config; }
|
|
7257
7101
|
});
|
|
7258
7102
|
_initialize();
|
|
7259
7103
|
_self.initialize = _initialize;
|
|
7260
|
-
_self.getSKUDefaults = function () {
|
|
7261
|
-
_self.config[_DYN_DIAGNOSTIC_LOG_INTER0 ] =
|
|
7262
|
-
_self.config[_DYN_DIAGNOSTIC_LOG_INTER0 ] && _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 ] > 0 ? _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 ] : 10000;
|
|
7263
|
-
};
|
|
7264
|
-
_self.getSKUDefaults();
|
|
7265
7104
|
proxyFunctions(_self, core, [
|
|
7266
7105
|
"track",
|
|
7267
7106
|
"flush",
|
|
@@ -7271,10 +7110,21 @@
|
|
|
7271
7110
|
"getPlugin",
|
|
7272
7111
|
"addPlugin",
|
|
7273
7112
|
"evtNamespace",
|
|
7274
|
-
"addUnloadCb"
|
|
7113
|
+
"addUnloadCb",
|
|
7114
|
+
"onCfgChange"
|
|
7275
7115
|
]);
|
|
7276
7116
|
function _initialize() {
|
|
7277
|
-
|
|
7117
|
+
var cfgHandler = createDynamicConfig(config || {}, defaultConfigValues);
|
|
7118
|
+
_config = cfgHandler.cfg;
|
|
7119
|
+
core.addUnloadHook(onConfigChange(cfgHandler, function () {
|
|
7120
|
+
if (_config[_DYN_CONNECTION_STRING ]) {
|
|
7121
|
+
var cs = parseConnectionString(_config[_DYN_CONNECTION_STRING ]);
|
|
7122
|
+
var ingest = cs.ingestionendpoint;
|
|
7123
|
+
_config.endpointUrl = ingest ? (ingest + DEFAULT_BREEZE_PATH) : _config.endpointUrl;
|
|
7124
|
+
_config[_DYN_INSTRUMENTATION_KEY ] = cs.instrumentationkey || _config[_DYN_INSTRUMENTATION_KEY ];
|
|
7125
|
+
}
|
|
7126
|
+
}));
|
|
7127
|
+
core.initialize(_config, [new Sender()]);
|
|
7278
7128
|
}
|
|
7279
7129
|
});
|
|
7280
7130
|
}
|