@microsoft/1ds-core-js 4.1.1 → 4.1.2

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.
Files changed (43) hide show
  1. package/bundle/es5/{ms.core-4.1.1.gbl.js → ms.core-4.1.2.gbl.js} +1056 -1038
  2. package/bundle/es5/ms.core-4.1.2.gbl.js.map +1 -0
  3. package/bundle/es5/ms.core-4.1.2.gbl.min.js +7 -0
  4. package/bundle/es5/ms.core-4.1.2.gbl.min.js.map +1 -0
  5. package/bundle/es5/ms.core-4.1.2.integrity.json +46 -0
  6. package/bundle/es5/{ms.core-4.1.1.js → ms.core-4.1.2.js} +1056 -1038
  7. package/bundle/es5/ms.core-4.1.2.js.map +1 -0
  8. package/bundle/es5/ms.core-4.1.2.min.js +7 -0
  9. package/bundle/es5/ms.core-4.1.2.min.js.map +1 -0
  10. package/bundle/es5/ms.core.gbl.js +1055 -1037
  11. package/bundle/es5/ms.core.gbl.js.map +1 -1
  12. package/bundle/es5/ms.core.gbl.min.js +2 -2
  13. package/bundle/es5/ms.core.gbl.min.js.map +1 -1
  14. package/bundle/es5/ms.core.integrity.json +17 -17
  15. package/bundle/es5/ms.core.js +1055 -1037
  16. package/bundle/es5/ms.core.js.map +1 -1
  17. package/bundle/es5/ms.core.min.js +2 -2
  18. package/bundle/es5/ms.core.min.js.map +1 -1
  19. package/dist/es5/ms.core.js +1054 -1036
  20. package/dist/es5/ms.core.js.map +1 -1
  21. package/dist/es5/ms.core.min.js +2 -2
  22. package/dist/es5/ms.core.min.js.map +1 -1
  23. package/dist-es5/AppInsightsCore.js +1 -1
  24. package/dist-es5/BaseCore.js +1 -1
  25. package/dist-es5/DataModels.js +1 -1
  26. package/dist-es5/Enums.js +1 -1
  27. package/dist-es5/Index.js +4 -2
  28. package/dist-es5/Index.js.map +1 -1
  29. package/dist-es5/InternalConstants.js +1 -1
  30. package/dist-es5/Utils.js +2 -2
  31. package/dist-es5/Utils.js.map +1 -1
  32. package/dist-es5/ValueSanitizer.js +1 -1
  33. package/dist-es5/__DynamicConstants.js +1 -1
  34. package/package.json +3 -3
  35. package/types/1ds-core-js.d.ts +5 -2
  36. package/types/1ds-core-js.namespaced.d.ts +15 -6
  37. package/bundle/es5/ms.core-4.1.1.gbl.js.map +0 -1
  38. package/bundle/es5/ms.core-4.1.1.gbl.min.js +0 -7
  39. package/bundle/es5/ms.core-4.1.1.gbl.min.js.map +0 -1
  40. package/bundle/es5/ms.core-4.1.1.integrity.json +0 -46
  41. package/bundle/es5/ms.core-4.1.1.js.map +0 -1
  42. package/bundle/es5/ms.core-4.1.1.min.js +0 -7
  43. package/bundle/es5/ms.core-4.1.1.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * 1DS JS SDK Core, 4.1.1
2
+ * 1DS JS SDK Core, 4.1.2
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -19,23 +19,16 @@
19
19
  var UNDEF_VALUE = undefined;
20
20
  var NULL_VALUE = null;
21
21
  var EMPTY = "";
22
- var BOOLEAN = "boolean";
23
22
  var FUNCTION = "function";
24
- var NUMBER = "number";
25
23
  var OBJECT = "object";
26
24
  var PROTOTYPE = "prototype";
27
25
  var __PROTO__ = "__proto__";
28
- var STRING = "string";
29
26
  var UNDEFINED = "undefined";
30
27
  var CONSTRUCTOR = "constructor";
31
28
  var SYMBOL = "Symbol";
32
29
  var POLYFILL_TAG = "_polyfill";
33
- var INDEX_OF = "indexOf";
34
30
  var LENGTH = "length";
35
- var DONE = "done";
36
- var VALUE = "value";
37
31
  var NAME = "name";
38
- var SLICE = "slice";
39
32
  var CALL = "call";
40
33
  var TO_STRING = "toString";
41
34
  var ObjClass = Object;
@@ -45,6 +38,7 @@
45
38
  var MathCls = Math;
46
39
  var ArrCls = Array;
47
40
  var ArrProto = ArrCls[PROTOTYPE];
41
+ var ArrSlice = ArrProto["slice"];
48
42
 
49
43
  function safe(func, argArray) {
50
44
  try {
@@ -57,12 +51,13 @@
57
51
  }
58
52
  }
59
53
 
54
+ /*#__NO_SIDE_EFFECTS__*/
60
55
  function safeGet(cb, defValue) {
61
56
  var result = safe(cb);
62
57
  return result.e ? defValue : result.v;
63
58
  }
64
59
 
65
- var PRIMITIVE_TYPES = [STRING, NUMBER, BOOLEAN, UNDEFINED, "symbol", "bigint"];
60
+ var _primitiveTypes;
66
61
  /*#__NO_SIDE_EFFECTS__*/
67
62
  function _createIs(theType) {
68
63
  return function (value) {
@@ -102,9 +97,10 @@
102
97
  }
103
98
  /*#__NO_SIDE_EFFECTS__*/
104
99
  function isPrimitiveType(theType) {
105
- return theType !== OBJECT && PRIMITIVE_TYPES.indexOf(theType) !== -1;
100
+ !_primitiveTypes && (_primitiveTypes = ["string", "number", "boolean", UNDEFINED, "symbol", "bigint"]);
101
+ return theType !== OBJECT && _primitiveTypes.indexOf(theType) !== -1;
106
102
  }
107
- var isString = ( /*#__PURE__*/_createIs(STRING));
103
+ var isString = ( /*#__PURE__*/_createIs("string"));
108
104
  var isFunction = ( /*#__PURE__*/_createIs(FUNCTION));
109
105
  /*#__NO_SIDE_EFFECTS__*/
110
106
  function isObject(value) {
@@ -115,8 +111,8 @@
115
111
  }
116
112
  var isArray = ArrCls.isArray;
117
113
  var isDate = ( /*#__PURE__*/_createObjIs("Date"));
118
- var isNumber = ( /*#__PURE__*/_createIs(NUMBER));
119
- var isBoolean = ( /*#__PURE__*/_createIs(BOOLEAN));
114
+ var isNumber = ( /*#__PURE__*/_createIs("number"));
115
+ var isBoolean = ( /*#__PURE__*/_createIs("boolean"));
120
116
  var isError = ( /*#__PURE__*/_createObjIs("Error"));
121
117
  /*#__NO_SIDE_EFFECTS__*/
122
118
  function isPromiseLike(value) {
@@ -226,6 +222,7 @@
226
222
 
227
223
  var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg";
228
224
  var _globalCfg;
225
+ /*#__NO_SIDE_EFFECTS__*/
229
226
  function _getGlobalValue() {
230
227
  var result;
231
228
  if (typeof globalThis !== UNDEFINED) {
@@ -260,7 +257,7 @@
260
257
  object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
261
258
  }
262
259
  try {
263
- propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === NUMBER) ? format : 4) : UNDEF_VALUE);
260
+ propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
264
261
  propertyValueDump = (propertyValueDump && propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ")) || asString(object);
265
262
  }
266
263
  catch (e) {
@@ -269,18 +266,15 @@
269
266
  return objType + ": " + propertyValueDump;
270
267
  }
271
268
 
272
- var _slice;
273
- var _unwrapInstFunction = _unwrapFunctionWithPoly;
274
269
  var _unwrapFunction = _unwrapFunctionWithPoly;
275
270
  /*#__NO_SIDE_EFFECTS__*/
276
271
  function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
277
- _slice = _slice || ArrProto[SLICE];
278
272
  var clsFn = clsProto && clsProto[funcName];
279
273
  return function (thisArg) {
280
274
  var theFunc = (thisArg && thisArg[funcName]) || clsFn;
281
275
  if (theFunc || polyFunc) {
282
276
  var theArgs = arguments;
283
- return (theFunc || polyFunc).apply(thisArg, theFunc ? _slice[CALL](theArgs, 1) : theArgs);
277
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
284
278
  }
285
279
  throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
286
280
  };
@@ -294,7 +288,7 @@
294
288
 
295
289
  var mathMax = MathCls.max;
296
290
 
297
- var strSlice = ( /*#__PURE__*/_unwrapFunction(SLICE, StrProto));
291
+ var strSlice = ( /*#__PURE__*/_unwrapFunction("slice", StrProto));
298
292
 
299
293
  var strSubstring = ( /*#__PURE__*/_unwrapFunction("substring", StrProto));
300
294
  var strSubstr = ( /*#__PURE__*/_unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
@@ -366,7 +360,7 @@
366
360
  var propMap = {
367
361
  e: "enumerable",
368
362
  c: "configurable",
369
- v: VALUE,
363
+ v: "value",
370
364
  w: "writable",
371
365
  g: "get",
372
366
  s: "set"
@@ -412,6 +406,7 @@
412
406
  function _initTestHooks() {
413
407
  _globalLazyTestHooks = _getGlobalConfig();
414
408
  }
409
+ /*#__NO_SIDE_EFFECTS__*/
415
410
  function getLazy(cb) {
416
411
  var lazyValue = {};
417
412
  !_globalLazyTestHooks && _initTestHooks();
@@ -449,11 +444,14 @@
449
444
 
450
445
  var WINDOW = "window";
451
446
  var _cachedGlobal;
452
- var _cachedWindow;
453
- var _cachedDocument;
454
- var _cachedNavigator;
455
- var _cachedHistory;
456
- var _isNode;
447
+ function _getGlobalInstFn(getFn, theArgs) {
448
+ var cachedValue;
449
+ return function () {
450
+ !_globalLazyTestHooks && _initTestHooks();
451
+ (!cachedValue || _globalLazyTestHooks.lzy) && (cachedValue = createCachedValue(safe(getFn, theArgs).v));
452
+ return cachedValue.v;
453
+ };
454
+ }
457
455
  /*#__NO_SIDE_EFFECTS__*/
458
456
  function lazySafeGetInst(name) {
459
457
  return getLazy(function () { return safe((getInst), [name]).v || UNDEF_VALUE; });
@@ -470,8 +468,8 @@
470
468
  if (gbl && gbl[name]) {
471
469
  return gbl[name];
472
470
  }
473
- if (name === WINDOW && _cachedWindow) {
474
- return _cachedWindow.v;
471
+ if (name === WINDOW) {
472
+ return getWindow();
475
473
  }
476
474
  return NULL_VALUE;
477
475
  }
@@ -479,46 +477,25 @@
479
477
  function hasDocument() {
480
478
  return !!getDocument();
481
479
  }
482
- /*#__NO_SIDE_EFFECTS__*/
483
- function getDocument() {
484
- !_globalLazyTestHooks && _initTestHooks();
485
- (!_cachedDocument || _globalLazyTestHooks.lzy) && (_cachedDocument = createCachedValue(safe((getInst), ["document"]).v));
486
- return _cachedDocument.v;
487
- }
480
+ var getDocument = ( /*#__PURE__*/_getGlobalInstFn(getInst, ["document"]));
488
481
  /*#__NO_SIDE_EFFECTS__*/
489
482
  function hasWindow() {
490
483
  return !!getWindow();
491
484
  }
492
- /*#__NO_SIDE_EFFECTS__*/
493
- function getWindow() {
494
- !_globalLazyTestHooks && _initTestHooks();
495
- (!_cachedWindow || _globalLazyTestHooks.lzy) && (_cachedWindow = createCachedValue(safe((getInst), [WINDOW]).v));
496
- return _cachedWindow.v;
497
- }
485
+ var getWindow = ( /*#__PURE__*/_getGlobalInstFn(getInst, [WINDOW]));
498
486
  /*#__NO_SIDE_EFFECTS__*/
499
487
  function hasNavigator() {
500
488
  return !!getNavigator();
501
489
  }
502
- /*#__NO_SIDE_EFFECTS__*/
503
- function getNavigator() {
504
- !_globalLazyTestHooks && _initTestHooks();
505
- (!_cachedNavigator || _globalLazyTestHooks.lzy) && (_cachedNavigator = createCachedValue(safe((getInst), ["navigator"]).v));
506
- return _cachedNavigator.v;
507
- }
490
+ var getNavigator = ( /*#__PURE__*/_getGlobalInstFn(getInst, ["navigator"]));
508
491
  /*#__NO_SIDE_EFFECTS__*/
509
492
  function hasHistory() {
510
493
  return !!getHistory();
511
494
  }
512
- /*#__NO_SIDE_EFFECTS__*/
513
- function getHistory() {
514
- !_globalLazyTestHooks && _initTestHooks();
515
- (!_cachedHistory || _globalLazyTestHooks.lzy) && (_cachedHistory = createCachedValue(safe((getInst), ["history"]).v));
516
- return _cachedHistory.v;
517
- }
518
- function isNode() {
519
- !_isNode && (_isNode = createCachedValue(!!safe(function () { return (process && (process.versions || {}).node); }).v));
520
- return _isNode.v;
521
- }
495
+ var getHistory = ( /*#__PURE__*/_getGlobalInstFn(getInst, ["history"]));
496
+ var isNode = ( /*#__PURE__*/_getGlobalInstFn(function () {
497
+ return !!safe(function () { return (process && (process.versions || {}).node); }).v;
498
+ }));
522
499
 
523
500
  var _symbol;
524
501
  var _symbolFor;
@@ -579,8 +556,8 @@
579
556
  var iterResult = void 0;
580
557
  try {
581
558
  var count = 0;
582
- while (!(iterResult = iter.next())[DONE]) {
583
- if (callbackfn[CALL](thisArg || iter, iterResult[VALUE], count, iter) === -1) {
559
+ while (!(iterResult = iter.next()).done) {
560
+ if (callbackfn[CALL](thisArg || iter, iterResult.value, count, iter) === -1) {
584
561
  break;
585
562
  }
586
563
  count++;
@@ -595,7 +572,7 @@
595
572
  }
596
573
  finally {
597
574
  try {
598
- if (iterResult && !iterResult[DONE]) {
575
+ if (iterResult && !iterResult.done) {
599
576
  iter.return && iter.return(iterResult);
600
577
  }
601
578
  }
@@ -609,7 +586,9 @@
609
586
  }
610
587
  }
611
588
 
612
- var fnApply = ( /*#__PURE__*/_unwrapInstFunction("apply"));
589
+ function fnApply(fn, thisArg, argArray) {
590
+ return fn.apply(thisArg, argArray);
591
+ }
613
592
 
614
593
  function arrAppend(target, elms) {
615
594
  if (!isUndefined(elms) && target) {
@@ -641,11 +620,13 @@
641
620
  }
642
621
  }
643
622
 
644
- var arrIndexOf = ( /*#__PURE__*/_unwrapFunction(INDEX_OF, ArrProto));
623
+ var arrIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", ArrProto));
645
624
 
646
625
  var arrMap = ( /*#__PURE__*/_unwrapFunction("map", ArrProto));
647
626
 
648
- var arrSlice = ( /*#__PURE__*/_unwrapFunction(SLICE, ArrProto));
627
+ function arrSlice(theArray, start, end) {
628
+ return ((theArray && theArray["slice"]) || ArrSlice).apply(theArray, ArrSlice[CALL](arguments, 1));
629
+ }
649
630
 
650
631
  /*#__NO_SIDE_EFFECTS__*/
651
632
  function polyArrIncludes(theArray, searchElement, fromIndex) {
@@ -684,6 +665,7 @@
684
665
  return fn(obj, proto);
685
666
  }
686
667
 
668
+ /*#__NO_SIDE_EFFECTS__*/
687
669
  function _createCustomError(name, d, b) {
688
670
  safe(objDefine, [d, NAME, { v: name, c: true, e: false }]);
689
671
  d = objSetPrototypeOf(d, b);
@@ -707,7 +689,7 @@
707
689
  var theArgs = arguments;
708
690
  try {
709
691
  safe(_setName, [theBaseClass, name]);
710
- var _self = fnApply(theBaseClass, _this, ArrProto[SLICE][CALL](theArgs)) || _this;
692
+ var _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;
711
693
  if (_self !== _this) {
712
694
  var orgProto = objGetPrototypeOf(_this);
713
695
  if (orgProto !== objGetPrototypeOf(_self)) {
@@ -782,16 +764,18 @@
782
764
  return result;
783
765
  }
784
766
 
785
- var _defaultDeepCopyHandler = function (details) {
767
+ /*#__NO_SIDE_EFFECTS__*/
768
+ function _defaultDeepCopyHandler(details) {
786
769
  details.value && plainObjDeepCopyHandler(details);
787
770
  return true;
788
- };
771
+ }
789
772
  var defaultDeepCopyHandlers = [
790
773
  arrayDeepCopyHandler,
791
774
  plainObjDeepCopyHandler,
792
775
  functionDeepCopyHandler,
793
776
  dateDeepCopyHandler
794
777
  ];
778
+ /*#__NO_SIDE_EFFECTS__*/
795
779
  function _getSetVisited(visitMap, source, newPath, cb) {
796
780
  var theEntry;
797
781
  arrForEach(visitMap, function (entry) {
@@ -926,7 +910,7 @@
926
910
  return target;
927
911
  }
928
912
  function deepExtend(target, obj1, obj2, obj3, obj4, obj5, obj6) {
929
- return _doExtend(objDeepCopy(target) || {}, ArrProto[SLICE][CALL](arguments));
913
+ return _doExtend(objDeepCopy(target) || {}, ArrSlice[CALL](arguments));
930
914
  }
931
915
 
932
916
  var getLength = ( /*#__PURE__*/_unwrapProp(LENGTH));
@@ -958,7 +942,7 @@
958
942
  return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;
959
943
  }
960
944
 
961
- var strIndexOf = ( /*#__PURE__*/_unwrapFunction(INDEX_OF, StrProto));
945
+ var strIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", StrProto));
962
946
 
963
947
  var strStartsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly("startsWith", StrProto, polyStrStartsWith));
964
948
  /*#__NO_SIDE_EFFECTS__*/
@@ -972,55 +956,51 @@
972
956
  }
973
957
 
974
958
  var REF = "ref";
975
- var UNREF = "un" + REF;
959
+ var UNREF = "unref";
976
960
  var HAS_REF = "hasRef";
977
961
  var ENABLED = "enabled";
962
+ /*#__NO_SIDE_EFFECTS__*/
978
963
  function _createTimerHandler(startTimer, refreshFn, cancelFn) {
979
- var _a;
980
964
  var ref = true;
981
965
  var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE;
982
966
  var theTimerHandler;
983
- var _unref = function () {
967
+ function _unref() {
984
968
  ref = false;
985
969
  timerId && timerId[UNREF] && timerId[UNREF]();
986
970
  return theTimerHandler;
987
- };
988
- var _ref = function () {
989
- ref = true;
990
- timerId && timerId[REF] && timerId[REF]();
971
+ }
972
+ function _cancel() {
973
+ timerId && cancelFn(timerId);
974
+ timerId = NULL_VALUE;
975
+ }
976
+ function _refresh() {
977
+ timerId = refreshFn(timerId);
978
+ if (!ref) {
979
+ _unref();
980
+ }
991
981
  return theTimerHandler;
982
+ }
983
+ function _setEnabled(value) {
984
+ !value && timerId && _cancel();
985
+ value && !timerId && _refresh();
986
+ }
987
+ theTimerHandler = {
988
+ cancel: _cancel,
989
+ refresh: _refresh
992
990
  };
993
- var _hasRef = function () {
991
+ theTimerHandler[HAS_REF] = function () {
994
992
  if (timerId && timerId[HAS_REF]) {
995
993
  return timerId[HAS_REF]();
996
994
  }
997
995
  return ref;
998
996
  };
999
- var _refresh = function () {
1000
- timerId = refreshFn(timerId);
1001
- if (!ref) {
1002
- _unref();
1003
- }
997
+ theTimerHandler[REF] = function () {
998
+ ref = true;
999
+ timerId && timerId[REF] && timerId[REF]();
1004
1000
  return theTimerHandler;
1005
1001
  };
1006
- var _cancel = function () {
1007
- timerId && cancelFn(timerId);
1008
- timerId = NULL_VALUE;
1009
- };
1010
- var _setEnabled = function (value) {
1011
- !value && timerId && _cancel();
1012
- value && !timerId && _refresh();
1013
- };
1014
- theTimerHandler = (_a = {
1015
- cancel: _cancel,
1016
- refresh: _refresh
1017
- },
1018
- _a[HAS_REF] = _hasRef,
1019
- _a[REF] = _ref,
1020
- _a[UNREF] = _unref,
1021
- _a[ENABLED] = false,
1022
- _a);
1023
- objDefineProp(theTimerHandler, ENABLED, {
1002
+ theTimerHandler[UNREF] = _unref;
1003
+ theTimerHandler = objDefineProp(theTimerHandler, ENABLED, {
1024
1004
  get: function () { return !!timerId; },
1025
1005
  set: _setEnabled
1026
1006
  });
@@ -1032,7 +1012,7 @@
1032
1012
  };
1033
1013
  }
1034
1014
 
1035
- function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
1015
+ function _createTimeoutWith(startTimer, overrideFn, theArgs) {
1036
1016
  var isArr = isArray(overrideFn);
1037
1017
  var len = isArr ? overrideFn.length : 0;
1038
1018
  var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
@@ -1040,7 +1020,7 @@
1040
1020
  var timerFn = theArgs[0];
1041
1021
  theArgs[0] = function () {
1042
1022
  handler.dn();
1043
- fnApply(timerFn, self, ArrProto[SLICE][CALL](arguments));
1023
+ fnApply(timerFn, UNDEF_VALUE, ArrSlice[CALL](arguments));
1044
1024
  };
1045
1025
  var handler = _createTimerHandler(startTimer, function (timerId) {
1046
1026
  if (timerId) {
@@ -1048,19 +1028,19 @@
1048
1028
  timerId.refresh();
1049
1029
  return timerId;
1050
1030
  }
1051
- fnApply(clearFn, self, [timerId]);
1031
+ fnApply(clearFn, UNDEF_VALUE, [timerId]);
1052
1032
  }
1053
- return fnApply(setFn, self, theArgs);
1033
+ return fnApply(setFn, UNDEF_VALUE, theArgs);
1054
1034
  }, function (timerId) {
1055
- fnApply(clearFn, self, [timerId]);
1035
+ fnApply(clearFn, UNDEF_VALUE, [timerId]);
1056
1036
  });
1057
1037
  return handler.h;
1058
1038
  }
1059
1039
  function scheduleTimeout(callback, timeout) {
1060
- return _createTimeoutWith(this, true, UNDEF_VALUE, ArrProto[SLICE][CALL](arguments));
1040
+ return _createTimeoutWith(true, UNDEF_VALUE, ArrSlice[CALL](arguments));
1061
1041
  }
1062
1042
  function createTimeout(callback, timeout) {
1063
- return _createTimeoutWith(this, false, UNDEF_VALUE, ArrProto[SLICE][CALL](arguments));
1043
+ return _createTimeoutWith(false, UNDEF_VALUE, ArrSlice[CALL](arguments));
1064
1044
  }
1065
1045
 
1066
1046
  var strHasOwnProperty = "hasOwnProperty";
@@ -1375,16 +1355,16 @@
1375
1355
  var _DYN_CANCEL = "cancel";
1376
1356
  var _DYN_INITIALIZE$1 = "initialize";
1377
1357
  var _DYN_IDENTIFIER = "identifier";
1358
+ var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
1359
+ var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
1378
1360
  var _DYN_IS_INITIALIZED = "isInitialized";
1361
+ var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
1379
1362
  var _DYN_GET_PLUGIN = "getPlugin";
1380
1363
  var _DYN_POLL_INTERNAL_LOGS$1 = "pollInternalLogs";
1381
1364
  var _DYN_NAME = "name";
1382
1365
  var _DYN_TIME = "time";
1383
1366
  var _DYN_PROCESS_NEXT = "processNext";
1384
- var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
1385
- var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
1386
- var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
1387
- var _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener";
1367
+ var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
1388
1368
  var _DYN_ENABLED = "enabled";
1389
1369
  var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
1390
1370
  var _DYN_UNLOAD = "unload";
@@ -1410,7 +1390,6 @@
1410
1390
  var _DYN_TYPE = "type";
1411
1391
  var _DYN_HANDLER = "handler";
1412
1392
  var _DYN_STATUS = "status";
1413
- var _DYN_ITEMS_RECEIVED = "itemsReceived";
1414
1393
  var _DYN_GET_RESPONSE_HEADER = "getResponseHeader";
1415
1394
  var _DYN_GET_ALL_RESPONSE_HEA5 = "getAllResponseHeaders";
1416
1395
  var _DYN_IS_CHILD_EVT = "isChildEvt";
@@ -1418,6 +1397,7 @@
1418
1397
  var _DYN_GET_CTX = "getCtx";
1419
1398
  var _DYN_SET_CTX = "setCtx";
1420
1399
  var _DYN_COMPLETE = "complete";
1400
+ var _DYN_ITEMS_RECEIVED = "itemsReceived";
1421
1401
  var _DYN_URL_STRING = "urlString";
1422
1402
  var _DYN_SEND_POST = "sendPOST";
1423
1403
  var _DYN_HEADERS = "headers";
@@ -1795,107 +1775,307 @@
1795
1775
  var STR_PATH = "path";
1796
1776
  var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
1797
1777
 
1798
- var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];
1799
- var _aiNamespace = null;
1800
- var _debugListener;
1801
- function _listenerProxyFunc(name, config) {
1802
- return function () {
1803
- var args = arguments;
1804
- var dbgExt = getDebugExt(config);
1805
- if (dbgExt) {
1806
- var listener = dbgExt.listener;
1807
- if (listener && listener[name]) {
1808
- listener[name][_DYN_APPLY ](listener, args);
1809
- }
1810
- }
1811
- };
1778
+ var rCamelCase = /-([a-z])/g;
1779
+ var rNormalizeInvalid = /([^\w\d_$])/g;
1780
+ var rLeadingNumeric = /^(\d+[\w\d_$])/;
1781
+ function isNotNullOrUndefined(value) {
1782
+ return !isNullOrUndefined(value);
1812
1783
  }
1813
- function _getExtensionNamespace() {
1814
- var target = getInst("Microsoft");
1815
- if (target) {
1816
- _aiNamespace = target["ApplicationInsights"];
1784
+ function normalizeJsName(name) {
1785
+ var value = name;
1786
+ if (value && isString(value)) {
1787
+ value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
1788
+ return letter.toUpperCase();
1789
+ });
1790
+ value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
1791
+ value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
1792
+ return "_" + match;
1793
+ });
1817
1794
  }
1818
- return _aiNamespace;
1795
+ return value;
1819
1796
  }
1820
- function getDebugExt(config) {
1821
- var ns = _aiNamespace;
1822
- if (!ns && config.disableDbgExt !== true) {
1823
- ns = _aiNamespace || _getExtensionNamespace();
1797
+ function strContains(value, search) {
1798
+ if (value && search) {
1799
+ return strIndexOf(value, search) !== -1;
1824
1800
  }
1825
- return ns ? ns["ChromeDbgExt"] : null;
1801
+ return false;
1826
1802
  }
1827
- function getDebugListener(config) {
1828
- if (!_debugListener) {
1829
- _debugListener = {};
1830
- for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH$1 ]; lp++) {
1831
- _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);
1803
+ function toISOString(date) {
1804
+ return date && date.toISOString() || "";
1805
+ }
1806
+ function getExceptionName(object) {
1807
+ if (isError(object)) {
1808
+ return object[_DYN_NAME ];
1809
+ }
1810
+ return STR_EMPTY$2;
1811
+ }
1812
+ function setValue(target, field, value, valChk, srcChk) {
1813
+ var theValue = value;
1814
+ if (target) {
1815
+ theValue = target[field];
1816
+ if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
1817
+ theValue = value;
1818
+ target[field] = theValue;
1832
1819
  }
1833
1820
  }
1834
- return _debugListener;
1821
+ return theValue;
1835
1822
  }
1836
-
1837
- var strDocumentMode = "documentMode";
1838
- var strLocation = "location";
1839
- var strConsole = "console";
1840
- var strJSON = "JSON";
1841
- var strCrypto = "crypto";
1842
- var strMsCrypto = "msCrypto";
1843
- var strReactNative = "ReactNative";
1844
- var strMsie = "msie";
1845
- var strTrident = "trident/";
1846
- var strXMLHttpRequest = "XMLHttpRequest";
1847
- var _isTrident = null;
1848
- var _navUserAgentCheck = null;
1849
- var _enableMocks = false;
1850
- var _useXDomainRequest = null;
1851
- var _beaconsSupported = null;
1852
- function _hasProperty(theClass, property) {
1853
- var supported = false;
1854
- if (theClass) {
1855
- try {
1856
- supported = property in theClass;
1857
- if (!supported) {
1858
- var proto = theClass[strShimPrototype];
1859
- if (proto) {
1860
- supported = property in proto;
1861
- }
1862
- }
1823
+ function getSetValue(target, field, defValue) {
1824
+ var theValue;
1825
+ if (target) {
1826
+ theValue = target[field];
1827
+ if (!theValue && isNullOrUndefined(theValue)) {
1828
+ theValue = !isUndefined(defValue) ? defValue : {};
1829
+ target[field] = theValue;
1863
1830
  }
1864
- catch (e) {
1831
+ }
1832
+ else {
1833
+ theValue = !isUndefined(defValue) ? defValue : {};
1834
+ }
1835
+ return theValue;
1836
+ }
1837
+ function _createProxyFunction(source, funcName) {
1838
+ var srcFunc = null;
1839
+ var src = null;
1840
+ if (isFunction(source)) {
1841
+ srcFunc = source;
1842
+ }
1843
+ else {
1844
+ src = source;
1845
+ }
1846
+ return function () {
1847
+ var originalArguments = arguments;
1848
+ if (srcFunc) {
1849
+ src = srcFunc();
1865
1850
  }
1866
- if (!supported) {
1867
- try {
1868
- var tmp = new theClass();
1869
- supported = !isUndefined(tmp[property]);
1870
- }
1871
- catch (e) {
1851
+ if (src) {
1852
+ return src[funcName][_DYN_APPLY ](src, originalArguments);
1853
+ }
1854
+ };
1855
+ }
1856
+ function proxyAssign(target, source, chkSet) {
1857
+ if (target && source && isObject(target) && isObject(source)) {
1858
+ var _loop_1 = function (field) {
1859
+ if (isString(field)) {
1860
+ var value = source[field];
1861
+ if (isFunction(value)) {
1862
+ if (!chkSet || chkSet(field, true, source, target)) {
1863
+ target[field] = _createProxyFunction(source, field);
1864
+ }
1865
+ }
1866
+ else if (!chkSet || chkSet(field, false, source, target)) {
1867
+ if (objHasOwn(target, field)) {
1868
+ delete target[field];
1869
+ }
1870
+ objDefine(target, field, {
1871
+ g: function () {
1872
+ return source[field];
1873
+ },
1874
+ s: function (theValue) {
1875
+ source[field] = theValue;
1876
+ }
1877
+ });
1878
+ }
1872
1879
  }
1880
+ };
1881
+ for (var field in source) {
1882
+ _loop_1(field);
1873
1883
  }
1874
1884
  }
1875
- return supported;
1876
- }
1877
- function setEnableEnvMocks(enabled) {
1878
- _enableMocks = enabled;
1885
+ return target;
1879
1886
  }
1880
- function getLocation(checkForMock) {
1881
- if (checkForMock && _enableMocks) {
1882
- var mockLocation = getInst("__mockLocation");
1883
- if (mockLocation) {
1884
- return mockLocation;
1887
+ function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
1888
+ if (target && name && source) {
1889
+ if (overwriteTarget !== false || isUndefined(target[name])) {
1890
+ target[name] = _createProxyFunction(source, theFunc);
1885
1891
  }
1886
1892
  }
1887
- if (typeof location === strShimObject && location) {
1888
- return location;
1893
+ }
1894
+ function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {
1895
+ if (target && source && isObject(target) && isArray(functionsToProxy)) {
1896
+ arrForEach(functionsToProxy, function (theFuncName) {
1897
+ if (isString(theFuncName)) {
1898
+ proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget);
1899
+ }
1900
+ });
1889
1901
  }
1890
- return getInst(strLocation);
1902
+ return target;
1891
1903
  }
1892
- function getConsole() {
1893
- if (typeof console !== strShimUndefined) {
1894
- return console;
1904
+ function optimizeObject(theObject) {
1905
+ if (theObject && objAssign) {
1906
+ theObject = ObjClass$1(objAssign({}, theObject));
1895
1907
  }
1896
- return getInst(strConsole);
1908
+ return theObject;
1897
1909
  }
1898
- function hasJSON() {
1910
+ function getResponseText(xhr) {
1911
+ try {
1912
+ return xhr.responseText;
1913
+ }
1914
+ catch (e) {
1915
+ }
1916
+ return null;
1917
+ }
1918
+ function formatErrorMessageXdr(xdr, message) {
1919
+ if (xdr) {
1920
+ return "XDomainRequest,Response:" + getResponseText(xdr) || "";
1921
+ }
1922
+ return message;
1923
+ }
1924
+ function formatErrorMessageXhr(xhr, message) {
1925
+ if (xhr) {
1926
+ return "XMLHttpRequest,Status:" + xhr[_DYN_STATUS ] + ",Response:" + getResponseText(xhr) || xhr.response || "";
1927
+ }
1928
+ return message;
1929
+ }
1930
+ function prependTransports(theTransports, newTransports) {
1931
+ if (newTransports) {
1932
+ if (isNumber(newTransports)) {
1933
+ theTransports = [newTransports].concat(theTransports);
1934
+ }
1935
+ else if (isArray(newTransports)) {
1936
+ theTransports = newTransports.concat(theTransports);
1937
+ }
1938
+ }
1939
+ return theTransports;
1940
+ }
1941
+ var strDisabledPropertyName$1 = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
1942
+ var strWithCredentials$1 = "withCredentials";
1943
+ var strTimeout$1 = "timeout";
1944
+ function openXhr$1(method, urlString, withCredentials, disabled, isSync, timeout) {
1945
+ if (disabled === void 0) { disabled = false; }
1946
+ if (isSync === void 0) { isSync = false; }
1947
+ function _wrapSetXhrProp(xhr, prop, value) {
1948
+ try {
1949
+ xhr[prop] = value;
1950
+ }
1951
+ catch (e) {
1952
+ }
1953
+ }
1954
+ var xhr = new XMLHttpRequest();
1955
+ if (disabled) {
1956
+ _wrapSetXhrProp(xhr, strDisabledPropertyName$1, disabled);
1957
+ }
1958
+ if (withCredentials) {
1959
+ _wrapSetXhrProp(xhr, strWithCredentials$1, withCredentials);
1960
+ }
1961
+ xhr.open(method, urlString, !isSync);
1962
+ if (withCredentials) {
1963
+ _wrapSetXhrProp(xhr, strWithCredentials$1, withCredentials);
1964
+ }
1965
+ if (!isSync && timeout) {
1966
+ _wrapSetXhrProp(xhr, strTimeout$1, timeout);
1967
+ }
1968
+ return xhr;
1969
+ }
1970
+ function convertAllHeadersToMap(headersString) {
1971
+ var headers = {};
1972
+ if (isString(headersString)) {
1973
+ var headersArray = strTrim(headersString)[_DYN_SPLIT ](/[\r\n]+/);
1974
+ arrForEach(headersArray, function (headerEntry) {
1975
+ if (headerEntry) {
1976
+ var idx = headerEntry.indexOf(": ");
1977
+ if (idx !== -1) {
1978
+ var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE ]();
1979
+ var value = strTrim(headerEntry.substring(idx + 1));
1980
+ headers[header] = value;
1981
+ }
1982
+ else {
1983
+ headers[strTrim(headerEntry)] = 1;
1984
+ }
1985
+ }
1986
+ });
1987
+ }
1988
+ return headers;
1989
+ }
1990
+ function _appendHeader(theHeaders, xhr, name) {
1991
+ if (!theHeaders[name] && xhr && xhr[_DYN_GET_RESPONSE_HEADER ]) {
1992
+ var value = xhr[_DYN_GET_RESPONSE_HEADER ](name);
1993
+ if (value) {
1994
+ theHeaders[name] = strTrim(value);
1995
+ }
1996
+ }
1997
+ return theHeaders;
1998
+ }
1999
+ var STR_KILL_DURATION_HEADER = "kill-duration";
2000
+ var STR_KILL_DURATION_SECONDS_HEADER = "kill-duration-seconds";
2001
+ var STR_TIME_DELTA_HEADER = "time-delta-millis";
2002
+ function _getAllResponseHeaders(xhr, isOneDs) {
2003
+ var theHeaders = {};
2004
+ if (!xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]) {
2005
+ if (!!isOneDs) {
2006
+ theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);
2007
+ theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);
2008
+ theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);
2009
+ }
2010
+ }
2011
+ else {
2012
+ theHeaders = convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]());
2013
+ }
2014
+ return theHeaders;
2015
+ }
2016
+
2017
+ var strDocumentMode = "documentMode";
2018
+ var strLocation = "location";
2019
+ var strConsole = "console";
2020
+ var strJSON = "JSON";
2021
+ var strCrypto = "crypto";
2022
+ var strMsCrypto = "msCrypto";
2023
+ var strReactNative = "ReactNative";
2024
+ var strMsie = "msie";
2025
+ var strTrident = "trident/";
2026
+ var strXMLHttpRequest = "XMLHttpRequest";
2027
+ var _isTrident = null;
2028
+ var _navUserAgentCheck = null;
2029
+ var _enableMocks = false;
2030
+ var _useXDomainRequest = null;
2031
+ var _beaconsSupported = null;
2032
+ function _hasProperty(theClass, property) {
2033
+ var supported = false;
2034
+ if (theClass) {
2035
+ try {
2036
+ supported = property in theClass;
2037
+ if (!supported) {
2038
+ var proto = theClass[strShimPrototype];
2039
+ if (proto) {
2040
+ supported = property in proto;
2041
+ }
2042
+ }
2043
+ }
2044
+ catch (e) {
2045
+ }
2046
+ if (!supported) {
2047
+ try {
2048
+ var tmp = new theClass();
2049
+ supported = !isUndefined(tmp[property]);
2050
+ }
2051
+ catch (e) {
2052
+ }
2053
+ }
2054
+ }
2055
+ return supported;
2056
+ }
2057
+ function setEnableEnvMocks(enabled) {
2058
+ _enableMocks = enabled;
2059
+ }
2060
+ function getLocation(checkForMock) {
2061
+ if (checkForMock && _enableMocks) {
2062
+ var mockLocation = getInst("__mockLocation");
2063
+ if (mockLocation) {
2064
+ return mockLocation;
2065
+ }
2066
+ }
2067
+ if (typeof location === strShimObject && location) {
2068
+ return location;
2069
+ }
2070
+ return getInst(strLocation);
2071
+ }
2072
+ function getConsole() {
2073
+ if (typeof console !== strShimUndefined) {
2074
+ return console;
2075
+ }
2076
+ return getInst(strConsole);
2077
+ }
2078
+ function hasJSON() {
1899
2079
  return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
1900
2080
  }
1901
2081
  function getJSON() {
@@ -2013,478 +2193,34 @@
2013
2193
  return value;
2014
2194
  }
2015
2195
 
2016
- var _a$4;
2017
- var STR_WARN_TO_CONSOLE = "warnToConsole";
2018
- var AiNonUserActionablePrefix = "AI (Internal): ";
2019
- var AiUserActionablePrefix = "AI: ";
2020
- var AIInternalMessagePrefix = "AITR_";
2021
- var defaultValues$2 = {
2022
- loggingLevelConsole: 0,
2023
- loggingLevelTelemetry: 1,
2024
- maxMessageLimit: 25,
2025
- enableDebug: false
2026
- };
2027
- var _logFuncs = (_a$4 = {},
2028
- _a$4[0 ] = null,
2029
- _a$4[1 ] = "errorToConsole",
2030
- _a$4[2 ] = STR_WARN_TO_CONSOLE,
2031
- _a$4[3 ] = "debugToConsole",
2032
- _a$4);
2033
- function _sanitizeDiagnosticText(text) {
2034
- if (text) {
2035
- return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$2) + "\"";
2196
+ var UInt32Mask = 0x100000000;
2197
+ var MaxUInt32 = 0xffffffff;
2198
+ var SEED1 = 123456789;
2199
+ var SEED2 = 987654321;
2200
+ var _mwcSeeded = false;
2201
+ var _mwcW = SEED1;
2202
+ var _mwcZ = SEED2;
2203
+ function _mwcSeed(seedValue) {
2204
+ if (seedValue < 0) {
2205
+ seedValue >>>= 0;
2036
2206
  }
2037
- return STR_EMPTY$2;
2207
+ _mwcW = (SEED1 + seedValue) & MaxUInt32;
2208
+ _mwcZ = (SEED2 - seedValue) & MaxUInt32;
2209
+ _mwcSeeded = true;
2038
2210
  }
2039
- function _logToConsole(func, message) {
2040
- var theConsole = getConsole();
2041
- if (!!theConsole) {
2042
- var logFunc = "log";
2043
- if (theConsole[func]) {
2044
- logFunc = func;
2045
- }
2046
- if (isFunction(theConsole[logFunc])) {
2047
- theConsole[logFunc](message);
2048
- }
2211
+ function _autoSeedMwc() {
2212
+ try {
2213
+ var now = utcNow() & 0x7fffffff;
2214
+ _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
2215
+ }
2216
+ catch (e) {
2049
2217
  }
2050
2218
  }
2051
- var _InternalLogMessage = /** @class */ (function () {
2052
- function _InternalLogMessage(msgId, msg, isUserAct, properties) {
2053
- if (isUserAct === void 0) { isUserAct = false; }
2054
- var _self = this;
2055
- _self[_DYN_MESSAGE_ID ] = msgId;
2056
- _self[_DYN_MESSAGE ] =
2057
- (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
2058
- msgId;
2059
- var strProps = STR_EMPTY$2;
2060
- if (hasJSON()) {
2061
- strProps = getJSON().stringify(properties);
2062
- }
2063
- var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$2) +
2064
- (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$2);
2065
- _self[_DYN_MESSAGE ] += diagnosticText;
2219
+ function randomValue(maxValue) {
2220
+ if (maxValue > 0) {
2221
+ return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
2066
2222
  }
2067
- _InternalLogMessage.dataType = "MessageData";
2068
- return _InternalLogMessage;
2069
- }());
2070
- function safeGetLogger(core, config) {
2071
- return (core || {})[_DYN_LOGGER$1 ] || new DiagnosticLogger(config);
2072
- }
2073
- var DiagnosticLogger = /** @class */ (function () {
2074
- function DiagnosticLogger(config) {
2075
- this.identifier = "DiagnosticLogger";
2076
- this.queue = [];
2077
- var _messageCount = 0;
2078
- var _messageLogged = {};
2079
- var _loggingLevelConsole;
2080
- var _loggingLevelTelemetry;
2081
- var _maxInternalMessageLimit;
2082
- var _enableDebug;
2083
- var _unloadHandler;
2084
- dynamicProto(DiagnosticLogger, this, function (_self) {
2085
- _unloadHandler = _setDefaultsFromConfig(config || {});
2086
- _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
2087
- _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
2088
- if (isUserAct === void 0) { isUserAct = false; }
2089
- var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
2090
- if (_enableDebug) {
2091
- throw dumpObj(message);
2092
- }
2093
- else {
2094
- var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
2095
- if (!isUndefined(message[_DYN_MESSAGE ])) {
2096
- if (isUserAct) {
2097
- var messageKey = +message[_DYN_MESSAGE_ID ];
2098
- if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
2099
- _self[logFunc](message[_DYN_MESSAGE ]);
2100
- _messageLogged[messageKey] = true;
2101
- }
2102
- }
2103
- else {
2104
- if (_loggingLevelConsole >= severity) {
2105
- _self[logFunc](message[_DYN_MESSAGE ]);
2106
- }
2107
- }
2108
- _logInternalMessage(severity, message);
2109
- }
2110
- else {
2111
- _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
2112
- }
2113
- }
2114
- };
2115
- _self.debugToConsole = function (message) {
2116
- _logToConsole("debug", message);
2117
- _debugExtMsg("warning", message);
2118
- };
2119
- _self[_DYN_WARN_TO_CONSOLE ] = function (message) {
2120
- _logToConsole("warn", message);
2121
- _debugExtMsg("warning", message);
2122
- };
2123
- _self.errorToConsole = function (message) {
2124
- _logToConsole("error", message);
2125
- _debugExtMsg("error", message);
2126
- };
2127
- _self.resetInternalMessageCount = function () {
2128
- _messageCount = 0;
2129
- _messageLogged = {};
2130
- };
2131
- _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
2132
- _self[_DYN_UNLOAD ] = function (isAsync) {
2133
- _unloadHandler && _unloadHandler.rm();
2134
- _unloadHandler = null;
2135
- };
2136
- function _logInternalMessage(severity, message) {
2137
- if (_areInternalMessagesThrottled()) {
2138
- return;
2139
- }
2140
- var logMessage = true;
2141
- var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
2142
- if (_messageLogged[messageKey]) {
2143
- logMessage = false;
2144
- }
2145
- else {
2146
- _messageLogged[messageKey] = true;
2147
- }
2148
- if (logMessage) {
2149
- if (severity <= _loggingLevelTelemetry) {
2150
- _self.queue[_DYN_PUSH ](message);
2151
- _messageCount++;
2152
- _debugExtMsg((severity === 1 ? "error" : "warn"), message);
2153
- }
2154
- if (_messageCount === _maxInternalMessageLimit) {
2155
- var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
2156
- var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
2157
- _self.queue[_DYN_PUSH ](throttleMessage);
2158
- if (severity === 1 ) {
2159
- _self.errorToConsole(throttleLimitMessage);
2160
- }
2161
- else {
2162
- _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
2163
- }
2164
- }
2165
- }
2166
- }
2167
- function _setDefaultsFromConfig(config) {
2168
- return onConfigChange(createDynamicConfig(config, defaultValues$2, _self).cfg, function (details) {
2169
- var config = details.cfg;
2170
- _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
2171
- _loggingLevelTelemetry = config.loggingLevelTelemetry;
2172
- _maxInternalMessageLimit = config.maxMessageLimit;
2173
- _enableDebug = config.enableDebug;
2174
- });
2175
- }
2176
- function _areInternalMessagesThrottled() {
2177
- return _messageCount >= _maxInternalMessageLimit;
2178
- }
2179
- function _debugExtMsg(name, data) {
2180
- var dbgExt = getDebugExt(config || {});
2181
- if (dbgExt && dbgExt[_DYN_DIAG_LOG ]) {
2182
- dbgExt[_DYN_DIAG_LOG ](name, data);
2183
- }
2184
- }
2185
- });
2186
- }
2187
- DiagnosticLogger.__ieDyn=1;
2188
- return DiagnosticLogger;
2189
- }());
2190
- function _getLogger(logger) {
2191
- return (logger || new DiagnosticLogger());
2192
- }
2193
- function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
2194
- if (isUserAct === void 0) { isUserAct = false; }
2195
- _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
2196
- }
2197
- function _warnToConsole(logger, message) {
2198
- _getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message);
2199
- }
2200
- function _logInternalMessage(logger, severity, message) {
2201
- _getLogger(logger)[_DYN_LOG_INTERNAL_MESSAGE ](severity, message);
2202
- }
2203
-
2204
- var rCamelCase = /-([a-z])/g;
2205
- var rNormalizeInvalid = /([^\w\d_$])/g;
2206
- var rLeadingNumeric = /^(\d+[\w\d_$])/;
2207
- function isNotNullOrUndefined(value) {
2208
- return !isNullOrUndefined(value);
2209
- }
2210
- function normalizeJsName(name) {
2211
- var value = name;
2212
- if (value && isString(value)) {
2213
- value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
2214
- return letter.toUpperCase();
2215
- });
2216
- value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
2217
- value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
2218
- return "_" + match;
2219
- });
2220
- }
2221
- return value;
2222
- }
2223
- function strContains(value, search) {
2224
- if (value && search) {
2225
- return strIndexOf(value, search) !== -1;
2226
- }
2227
- return false;
2228
- }
2229
- function toISOString(date) {
2230
- return date && date.toISOString() || "";
2231
- }
2232
- function getExceptionName(object) {
2233
- if (isError(object)) {
2234
- return object[_DYN_NAME ];
2235
- }
2236
- return STR_EMPTY$2;
2237
- }
2238
- function setValue(target, field, value, valChk, srcChk) {
2239
- var theValue = value;
2240
- if (target) {
2241
- theValue = target[field];
2242
- if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
2243
- theValue = value;
2244
- target[field] = theValue;
2245
- }
2246
- }
2247
- return theValue;
2248
- }
2249
- function getSetValue(target, field, defValue) {
2250
- var theValue;
2251
- if (target) {
2252
- theValue = target[field];
2253
- if (!theValue && isNullOrUndefined(theValue)) {
2254
- theValue = !isUndefined(defValue) ? defValue : {};
2255
- target[field] = theValue;
2256
- }
2257
- }
2258
- else {
2259
- theValue = !isUndefined(defValue) ? defValue : {};
2260
- }
2261
- return theValue;
2262
- }
2263
- function _createProxyFunction(source, funcName) {
2264
- var srcFunc = null;
2265
- var src = null;
2266
- if (isFunction(source)) {
2267
- srcFunc = source;
2268
- }
2269
- else {
2270
- src = source;
2271
- }
2272
- return function () {
2273
- var originalArguments = arguments;
2274
- if (srcFunc) {
2275
- src = srcFunc();
2276
- }
2277
- if (src) {
2278
- return src[funcName][_DYN_APPLY ](src, originalArguments);
2279
- }
2280
- };
2281
- }
2282
- function proxyAssign(target, source, chkSet) {
2283
- if (target && source && isObject(target) && isObject(source)) {
2284
- var _loop_1 = function (field) {
2285
- if (isString(field)) {
2286
- var value = source[field];
2287
- if (isFunction(value)) {
2288
- if (!chkSet || chkSet(field, true, source, target)) {
2289
- target[field] = _createProxyFunction(source, field);
2290
- }
2291
- }
2292
- else if (!chkSet || chkSet(field, false, source, target)) {
2293
- if (objHasOwn(target, field)) {
2294
- delete target[field];
2295
- }
2296
- objDefine(target, field, {
2297
- g: function () {
2298
- return source[field];
2299
- },
2300
- s: function (theValue) {
2301
- source[field] = theValue;
2302
- }
2303
- });
2304
- }
2305
- }
2306
- };
2307
- for (var field in source) {
2308
- _loop_1(field);
2309
- }
2310
- }
2311
- return target;
2312
- }
2313
- function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
2314
- if (target && name && source) {
2315
- if (overwriteTarget !== false || isUndefined(target[name])) {
2316
- target[name] = _createProxyFunction(source, theFunc);
2317
- }
2318
- }
2319
- }
2320
- function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {
2321
- if (target && source && isObject(target) && isArray(functionsToProxy)) {
2322
- arrForEach(functionsToProxy, function (theFuncName) {
2323
- if (isString(theFuncName)) {
2324
- proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget);
2325
- }
2326
- });
2327
- }
2328
- return target;
2329
- }
2330
- function optimizeObject(theObject) {
2331
- if (theObject && objAssign) {
2332
- theObject = ObjClass$1(objAssign({}, theObject));
2333
- }
2334
- return theObject;
2335
- }
2336
- function getResponseText(xhr) {
2337
- try {
2338
- return xhr.responseText;
2339
- }
2340
- catch (e) {
2341
- }
2342
- return null;
2343
- }
2344
- function formatErrorMessageXdr(xdr, message) {
2345
- if (xdr) {
2346
- return "XDomainRequest,Response:" + getResponseText(xdr) || "";
2347
- }
2348
- return message;
2349
- }
2350
- function formatErrorMessageXhr(xhr, message) {
2351
- if (xhr) {
2352
- return "XMLHttpRequest,Status:" + xhr[_DYN_STATUS ] + ",Response:" + getResponseText(xhr) || xhr.response || "";
2353
- }
2354
- return message;
2355
- }
2356
- function prependTransports(theTransports, newTransports) {
2357
- if (newTransports) {
2358
- if (isNumber(newTransports)) {
2359
- theTransports = [newTransports].concat(theTransports);
2360
- }
2361
- else if (isArray(newTransports)) {
2362
- theTransports = newTransports.concat(theTransports);
2363
- }
2364
- }
2365
- return theTransports;
2366
- }
2367
- function parseResponse(response, diagLog) {
2368
- try {
2369
- if (response && response !== "") {
2370
- var result = getJSON().parse(response);
2371
- if (result && result[_DYN_ITEMS_RECEIVED ] && result[_DYN_ITEMS_RECEIVED ] >= result.itemsAccepted &&
2372
- result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$1 ]) {
2373
- return result;
2374
- }
2375
- }
2376
- }
2377
- catch (e) {
2378
- _throwInternal(diagLog, 1 , 43 , "Cannot parse the response. " + getExceptionName(e), {
2379
- response: response
2380
- });
2381
- }
2382
- return null;
2383
- }
2384
- var strDisabledPropertyName$1 = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
2385
- var strWithCredentials$1 = "withCredentials";
2386
- var strTimeout$1 = "timeout";
2387
- function openXhr$1(method, urlString, withCredentials, disabled, isSync, timeout) {
2388
- if (disabled === void 0) { disabled = false; }
2389
- if (isSync === void 0) { isSync = false; }
2390
- function _wrapSetXhrProp(xhr, prop, value) {
2391
- try {
2392
- xhr[prop] = value;
2393
- }
2394
- catch (e) {
2395
- }
2396
- }
2397
- var xhr = new XMLHttpRequest();
2398
- if (disabled) {
2399
- _wrapSetXhrProp(xhr, strDisabledPropertyName$1, disabled);
2400
- }
2401
- if (withCredentials) {
2402
- _wrapSetXhrProp(xhr, strWithCredentials$1, withCredentials);
2403
- }
2404
- xhr.open(method, urlString, !isSync);
2405
- if (withCredentials) {
2406
- _wrapSetXhrProp(xhr, strWithCredentials$1, withCredentials);
2407
- }
2408
- if (!isSync && timeout) {
2409
- _wrapSetXhrProp(xhr, strTimeout$1, timeout);
2410
- }
2411
- return xhr;
2412
- }
2413
- function convertAllHeadersToMap(headersString) {
2414
- var headers = {};
2415
- if (isString(headersString)) {
2416
- var headersArray = strTrim(headersString)[_DYN_SPLIT ](/[\r\n]+/);
2417
- arrForEach(headersArray, function (headerEntry) {
2418
- if (headerEntry) {
2419
- var idx = headerEntry.indexOf(": ");
2420
- if (idx !== -1) {
2421
- var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE ]();
2422
- var value = strTrim(headerEntry.substring(idx + 1));
2423
- headers[header] = value;
2424
- }
2425
- else {
2426
- headers[strTrim(headerEntry)] = 1;
2427
- }
2428
- }
2429
- });
2430
- }
2431
- return headers;
2432
- }
2433
- function _appendHeader(theHeaders, xhr, name) {
2434
- if (!theHeaders[name] && xhr && xhr[_DYN_GET_RESPONSE_HEADER ]) {
2435
- var value = xhr[_DYN_GET_RESPONSE_HEADER ](name);
2436
- if (value) {
2437
- theHeaders[name] = strTrim(value);
2438
- }
2439
- }
2440
- return theHeaders;
2441
- }
2442
- var STR_KILL_DURATION_HEADER = "kill-duration";
2443
- var STR_KILL_DURATION_SECONDS_HEADER = "kill-duration-seconds";
2444
- var STR_TIME_DELTA_HEADER = "time-delta-millis";
2445
- function _getAllResponseHeaders(xhr, isOneDs) {
2446
- var theHeaders = {};
2447
- if (!xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]) {
2448
- if (!!isOneDs) {
2449
- theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);
2450
- theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);
2451
- theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);
2452
- }
2453
- }
2454
- else {
2455
- theHeaders = convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]());
2456
- }
2457
- return theHeaders;
2458
- }
2459
-
2460
- var UInt32Mask = 0x100000000;
2461
- var MaxUInt32 = 0xffffffff;
2462
- var SEED1 = 123456789;
2463
- var SEED2 = 987654321;
2464
- var _mwcSeeded = false;
2465
- var _mwcW = SEED1;
2466
- var _mwcZ = SEED2;
2467
- function _mwcSeed(seedValue) {
2468
- if (seedValue < 0) {
2469
- seedValue >>>= 0;
2470
- }
2471
- _mwcW = (SEED1 + seedValue) & MaxUInt32;
2472
- _mwcZ = (SEED2 - seedValue) & MaxUInt32;
2473
- _mwcSeeded = true;
2474
- }
2475
- function _autoSeedMwc() {
2476
- try {
2477
- var now = utcNow() & 0x7fffffff;
2478
- _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
2479
- }
2480
- catch (e) {
2481
- }
2482
- }
2483
- function randomValue(maxValue) {
2484
- if (maxValue > 0) {
2485
- return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
2486
- }
2487
- return 0;
2223
+ return 0;
2488
2224
  }
2489
2225
  function random32(signed) {
2490
2226
  var value = 0;
@@ -2880,369 +2616,597 @@
2880
2616
  isObjectOrArray = false;
2881
2617
  }
2882
2618
  }
2883
- else if (value && value[CFG_HANDLER_LINK]) {
2884
- objForEachKey(value, function (key) {
2885
- var getter = _getOwnPropGetter(value, key);
2886
- if (getter) {
2887
- var valueState = getter[state.prop];
2888
- valueState && valueState.chng();
2889
- }
2890
- });
2619
+ else if (value && value[CFG_HANDLER_LINK]) {
2620
+ objForEachKey(value, function (key) {
2621
+ var getter = _getOwnPropGetter(value, key);
2622
+ if (getter) {
2623
+ var valueState = getter[state.prop];
2624
+ valueState && valueState.chng();
2625
+ }
2626
+ });
2627
+ }
2628
+ }
2629
+ if (newValue !== value) {
2630
+ var newIsObjectOrArray = newValue && _canMakeDynamic(_getProperty, state, newValue);
2631
+ if (!isReferenced && newIsObjectOrArray) {
2632
+ newValue = _makeDynamicObject(state, newValue, name, "Converting");
2633
+ }
2634
+ value = newValue;
2635
+ isObjectOrArray = newIsObjectOrArray;
2636
+ }
2637
+ state.add(detail);
2638
+ }
2639
+ }
2640
+ objDefine(theConfig, detail.n, { g: _getProperty, s: _setProperty });
2641
+ }
2642
+ function _setDynamicProperty(state, target, name, value) {
2643
+ if (target) {
2644
+ var getter = _getOwnPropGetter(target, name);
2645
+ var isDynamic = getter && !!getter[state.prop];
2646
+ if (!isDynamic) {
2647
+ _createDynamicProperty(state, target, name, value);
2648
+ }
2649
+ else {
2650
+ target[name] = value;
2651
+ }
2652
+ }
2653
+ return target;
2654
+ }
2655
+ function _setDynamicPropertyState(state, target, name, flags) {
2656
+ if (target) {
2657
+ var getter = _getOwnPropGetter(target, name);
2658
+ var isDynamic = getter && !!getter[state.prop];
2659
+ var inPlace = flags && flags[0 ];
2660
+ var rdOnly = flags && flags[1 ];
2661
+ var blkProp = flags && flags[2 ];
2662
+ if (!isDynamic) {
2663
+ if (blkProp) {
2664
+ try {
2665
+ blockDynamicConversion(target);
2666
+ }
2667
+ catch (e) {
2668
+ _throwDynamicError((state.hdlr || {})[_DYN_LOGGER$1 ], name, "Blocking", e);
2669
+ }
2670
+ }
2671
+ try {
2672
+ _setDynamicProperty(state, target, name, target[name]);
2673
+ getter = _getOwnPropGetter(target, name);
2674
+ }
2675
+ catch (e) {
2676
+ _throwDynamicError((state.hdlr || {})[_DYN_LOGGER$1 ], name, "State", e);
2677
+ }
2678
+ }
2679
+ if (inPlace) {
2680
+ getter[state.rf] = inPlace;
2681
+ }
2682
+ if (rdOnly) {
2683
+ getter[state.ro] = rdOnly;
2684
+ }
2685
+ if (blkProp) {
2686
+ getter[state.blkVal] = true;
2687
+ }
2688
+ }
2689
+ return target;
2690
+ }
2691
+ function _makeDynamicObject(state, target, name, desc) {
2692
+ try {
2693
+ objForEachKey(target, function (key, value) {
2694
+ _setDynamicProperty(state, target, key, value);
2695
+ });
2696
+ if (!target[CFG_HANDLER_LINK]) {
2697
+ objDefineProp(target, CFG_HANDLER_LINK, {
2698
+ get: function () {
2699
+ return state[_DYN_HDLR ];
2700
+ }
2701
+ });
2702
+ _patchArray(state, target, name);
2703
+ }
2704
+ }
2705
+ catch (e) {
2706
+ _throwDynamicError((state.hdlr || {})[_DYN_LOGGER$1 ], name, desc, e);
2707
+ }
2708
+ return target;
2709
+ }
2710
+
2711
+ var symPrefix = "[[ai_";
2712
+ var symPostfix = "]]";
2713
+ function _createState(cfgHandler) {
2714
+ var _a;
2715
+ var dynamicPropertySymbol = newSymbol(symPrefix + "get" + cfgHandler.uid + symPostfix);
2716
+ var dynamicPropertyReadOnly = newSymbol(symPrefix + "ro" + cfgHandler.uid + symPostfix);
2717
+ var dynamicPropertyReferenced = newSymbol(symPrefix + "rf" + cfgHandler.uid + symPostfix);
2718
+ var dynamicPropertyBlockValue = newSymbol(symPrefix + "blkVal" + cfgHandler.uid + symPostfix);
2719
+ var dynamicPropertyDetail = newSymbol(symPrefix + "dtl" + cfgHandler.uid + symPostfix);
2720
+ var _waitingHandlers = null;
2721
+ var _watcherTimer = null;
2722
+ var theState;
2723
+ function _useHandler(activeHandler, callback) {
2724
+ var prevWatcher = theState.act;
2725
+ try {
2726
+ theState.act = activeHandler;
2727
+ if (activeHandler && activeHandler[dynamicPropertyDetail]) {
2728
+ arrForEach(activeHandler[dynamicPropertyDetail], function (detail) {
2729
+ detail.clr(activeHandler);
2730
+ });
2731
+ activeHandler[dynamicPropertyDetail] = [];
2732
+ }
2733
+ callback({
2734
+ cfg: cfgHandler.cfg,
2735
+ set: cfgHandler.set.bind(cfgHandler),
2736
+ setDf: cfgHandler[_DYN_SET_DF ].bind(cfgHandler),
2737
+ ref: cfgHandler.ref.bind(cfgHandler),
2738
+ rdOnly: cfgHandler[_DYN_RD_ONLY ].bind(cfgHandler)
2739
+ });
2740
+ }
2741
+ catch (e) {
2742
+ var logger = cfgHandler[_DYN_LOGGER$1 ];
2743
+ if (logger) {
2744
+ logger[_DYN_THROW_INTERNAL ](1 , 107 , dumpObj(e));
2745
+ }
2746
+ throw e;
2747
+ }
2748
+ finally {
2749
+ theState.act = prevWatcher || null;
2750
+ }
2751
+ }
2752
+ function _notifyWatchers() {
2753
+ if (_waitingHandlers) {
2754
+ var notifyHandlers = _waitingHandlers;
2755
+ _waitingHandlers = null;
2756
+ _watcherTimer && _watcherTimer[_DYN_CANCEL ]();
2757
+ _watcherTimer = null;
2758
+ var watcherFailures_1 = [];
2759
+ arrForEach(notifyHandlers, function (handler) {
2760
+ if (handler) {
2761
+ if (handler[dynamicPropertyDetail]) {
2762
+ arrForEach(handler[dynamicPropertyDetail], function (detail) {
2763
+ detail.clr(handler);
2764
+ });
2765
+ handler[dynamicPropertyDetail] = null;
2766
+ }
2767
+ if (handler.fn) {
2768
+ try {
2769
+ _useHandler(handler, handler.fn);
2770
+ }
2771
+ catch (e) {
2772
+ watcherFailures_1[_DYN_PUSH ](e);
2773
+ }
2774
+ }
2775
+ }
2776
+ });
2777
+ if (_waitingHandlers) {
2778
+ try {
2779
+ _notifyWatchers();
2780
+ }
2781
+ catch (e) {
2782
+ watcherFailures_1[_DYN_PUSH ](e);
2891
2783
  }
2892
2784
  }
2893
- if (newValue !== value) {
2894
- var newIsObjectOrArray = newValue && _canMakeDynamic(_getProperty, state, newValue);
2895
- if (!isReferenced && newIsObjectOrArray) {
2896
- newValue = _makeDynamicObject(state, newValue, name, "Converting");
2785
+ if (watcherFailures_1[_DYN_LENGTH$1 ] > 0) {
2786
+ throwAggregationError("Watcher error(s): ", watcherFailures_1);
2787
+ }
2788
+ }
2789
+ }
2790
+ function _addWatcher(detail) {
2791
+ if (detail && detail.h[_DYN_LENGTH$1 ] > 0) {
2792
+ if (!_waitingHandlers) {
2793
+ _waitingHandlers = [];
2794
+ }
2795
+ if (!_watcherTimer) {
2796
+ _watcherTimer = scheduleTimeout(function () {
2797
+ _watcherTimer = null;
2798
+ _notifyWatchers();
2799
+ }, 0);
2800
+ }
2801
+ for (var idx = 0; idx < detail.h[_DYN_LENGTH$1 ]; idx++) {
2802
+ var handler = detail.h[idx];
2803
+ if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
2804
+ _waitingHandlers[_DYN_PUSH ](handler);
2897
2805
  }
2898
- value = newValue;
2899
- isObjectOrArray = newIsObjectOrArray;
2900
2806
  }
2901
- state.add(detail);
2902
2807
  }
2903
2808
  }
2904
- objDefine(theConfig, detail.n, { g: _getProperty, s: _setProperty });
2809
+ function _trackHandler(handler, detail) {
2810
+ if (handler) {
2811
+ var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
2812
+ if (arrIndexOf(details, detail) === -1) {
2813
+ details[_DYN_PUSH ](detail);
2814
+ }
2815
+ }
2816
+ }
2817
+ theState = (_a = {
2818
+ prop: dynamicPropertySymbol,
2819
+ ro: dynamicPropertyReadOnly,
2820
+ rf: dynamicPropertyReferenced
2821
+ },
2822
+ _a[_DYN_BLK_VAL ] = dynamicPropertyBlockValue,
2823
+ _a[_DYN_HDLR ] = cfgHandler,
2824
+ _a.add = _addWatcher,
2825
+ _a[_DYN_NOTIFY ] = _notifyWatchers,
2826
+ _a.use = _useHandler,
2827
+ _a.trk = _trackHandler,
2828
+ _a);
2829
+ return theState;
2905
2830
  }
2906
- function _setDynamicProperty(state, target, name, value) {
2907
- if (target) {
2908
- var getter = _getOwnPropGetter(target, name);
2909
- var isDynamic = getter && !!getter[state.prop];
2910
- if (!isDynamic) {
2911
- _createDynamicProperty(state, target, name, value);
2831
+
2832
+ function _createAndUseHandler(state, configHandler) {
2833
+ var handler = {
2834
+ fn: configHandler,
2835
+ rm: function () {
2836
+ handler.fn = null;
2837
+ state = null;
2838
+ configHandler = null;
2912
2839
  }
2913
- else {
2914
- target[name] = value;
2840
+ };
2841
+ objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ? "" : "[X]"); } });
2842
+ state.use(handler, configHandler);
2843
+ return handler;
2844
+ }
2845
+ function _createDynamicHandler(logger, target, inPlace) {
2846
+ var _a;
2847
+ var dynamicHandler = getDynamicConfigHandler(target);
2848
+ if (dynamicHandler) {
2849
+ return dynamicHandler;
2850
+ }
2851
+ var uid = createUniqueNamespace("dyncfg", true);
2852
+ var newTarget = (target && inPlace !== false) ? target : _cfgDeepCopy(target);
2853
+ var theState;
2854
+ function _notifyWatchers() {
2855
+ theState[_DYN_NOTIFY ]();
2856
+ }
2857
+ function _setValue(target, name, value) {
2858
+ try {
2859
+ target = _setDynamicProperty(theState, target, name, value);
2860
+ }
2861
+ catch (e) {
2862
+ _throwDynamicError(logger, name, "Setting value", e);
2915
2863
  }
2864
+ return target[name];
2916
2865
  }
2917
- return target;
2918
- }
2919
- function _setDynamicPropertyState(state, target, name, flags) {
2920
- if (target) {
2921
- var getter = _getOwnPropGetter(target, name);
2922
- var isDynamic = getter && !!getter[state.prop];
2923
- var inPlace = flags && flags[0 ];
2924
- var rdOnly = flags && flags[1 ];
2925
- var blkProp = flags && flags[2 ];
2926
- if (!isDynamic) {
2927
- if (blkProp) {
2928
- try {
2929
- blockDynamicConversion(target);
2930
- }
2931
- catch (e) {
2932
- _throwDynamicError((state.hdlr || {})[_DYN_LOGGER$1 ], name, "Blocking", e);
2933
- }
2934
- }
2866
+ function _watch(configHandler) {
2867
+ return _createAndUseHandler(theState, configHandler);
2868
+ }
2869
+ function _block(configHandler, allowUpdate) {
2870
+ theState.use(null, function (details) {
2871
+ var prevUpd = theState.upd;
2935
2872
  try {
2936
- _setDynamicProperty(state, target, name, target[name]);
2937
- getter = _getOwnPropGetter(target, name);
2873
+ if (!isUndefined(allowUpdate)) {
2874
+ theState.upd = allowUpdate;
2875
+ }
2876
+ configHandler(details);
2938
2877
  }
2939
- catch (e) {
2940
- _throwDynamicError((state.hdlr || {})[_DYN_LOGGER$1 ], name, "State", e);
2878
+ finally {
2879
+ theState.upd = prevUpd;
2941
2880
  }
2881
+ });
2882
+ }
2883
+ function _ref(target, name) {
2884
+ var _a;
2885
+ return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[0 ] = true, _a))[name];
2886
+ }
2887
+ function _rdOnly(target, name) {
2888
+ var _a;
2889
+ return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[1 ] = true, _a))[name];
2890
+ }
2891
+ function _blkPropValue(target, name) {
2892
+ var _a;
2893
+ return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[2 ] = true, _a))[name];
2894
+ }
2895
+ function _applyDefaults(theConfig, defaultValues) {
2896
+ if (defaultValues) {
2897
+ objForEachKey(defaultValues, function (name, value) {
2898
+ _applyDefaultValue(cfgHandler, theConfig, name, value);
2899
+ });
2942
2900
  }
2943
- if (inPlace) {
2944
- getter[state.rf] = inPlace;
2945
- }
2946
- if (rdOnly) {
2947
- getter[state.ro] = rdOnly;
2948
- }
2949
- if (blkProp) {
2950
- getter[state.blkVal] = true;
2901
+ return theConfig;
2902
+ }
2903
+ var cfgHandler = (_a = {
2904
+ uid: null,
2905
+ cfg: newTarget
2906
+ },
2907
+ _a[_DYN_LOGGER$1 ] = logger,
2908
+ _a[_DYN_NOTIFY ] = _notifyWatchers,
2909
+ _a.set = _setValue,
2910
+ _a[_DYN_SET_DF ] = _applyDefaults,
2911
+ _a[_DYN_WATCH ] = _watch,
2912
+ _a.ref = _ref,
2913
+ _a[_DYN_RD_ONLY ] = _rdOnly,
2914
+ _a[_DYN_BLK_VAL ] = _blkPropValue,
2915
+ _a._block = _block,
2916
+ _a);
2917
+ objDefine(cfgHandler, "uid", {
2918
+ c: false,
2919
+ e: false,
2920
+ w: false,
2921
+ v: uid
2922
+ });
2923
+ theState = _createState(cfgHandler);
2924
+ _makeDynamicObject(theState, newTarget, "config", "Creating");
2925
+ return cfgHandler;
2926
+ }
2927
+ function _logInvalidAccess(logger, message) {
2928
+ if (logger) {
2929
+ logger[_DYN_WARN_TO_CONSOLE ](message);
2930
+ logger[_DYN_THROW_INTERNAL ](2 , 108 , message);
2931
+ }
2932
+ else {
2933
+ throwInvalidAccess(message);
2934
+ }
2935
+ }
2936
+ function createDynamicConfig(config, defaultConfig, logger, inPlace) {
2937
+ var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace);
2938
+ if (defaultConfig) {
2939
+ dynamicHandler[_DYN_SET_DF ](dynamicHandler.cfg, defaultConfig);
2940
+ }
2941
+ return dynamicHandler;
2942
+ }
2943
+ function onConfigChange(config, configHandler, logger) {
2944
+ var handler = config[CFG_HANDLER_LINK] || config;
2945
+ if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) {
2946
+ return handler[_DYN_WATCH ](configHandler);
2947
+ }
2948
+ _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));
2949
+ return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
2950
+ }
2951
+
2952
+ function runTargetUnload(target, isAsync) {
2953
+ if (target && target[_DYN_UNLOAD ]) {
2954
+ return target[_DYN_UNLOAD ](isAsync);
2955
+ }
2956
+ }
2957
+ function doUnloadAll(targets, isAsync, done) {
2958
+ var result;
2959
+ if (!done) {
2960
+ result = createPromise(function (resolved) {
2961
+ done = resolved;
2962
+ });
2963
+ }
2964
+ if (targets && getLength(targets) > 0) {
2965
+ doAwaitResponse(runTargetUnload(targets[0], isAsync), function () {
2966
+ doUnloadAll(arrSlice(targets, 1), isAsync, done);
2967
+ });
2968
+ }
2969
+ else {
2970
+ done();
2971
+ }
2972
+ return result;
2973
+ }
2974
+
2975
+ var ChannelControllerPriority = 500;
2976
+ var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
2977
+
2978
+ function cfgDfMerge(defaultValue) {
2979
+ return {
2980
+ mrg: true,
2981
+ v: defaultValue
2982
+ };
2983
+ }
2984
+
2985
+ var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];
2986
+ var _aiNamespace = null;
2987
+ var _debugListener;
2988
+ function _listenerProxyFunc(name, config) {
2989
+ return function () {
2990
+ var args = arguments;
2991
+ var dbgExt = getDebugExt(config);
2992
+ if (dbgExt) {
2993
+ var listener = dbgExt.listener;
2994
+ if (listener && listener[name]) {
2995
+ listener[name][_DYN_APPLY ](listener, args);
2996
+ }
2951
2997
  }
2998
+ };
2999
+ }
3000
+ function _getExtensionNamespace() {
3001
+ var target = getInst("Microsoft");
3002
+ if (target) {
3003
+ _aiNamespace = target["ApplicationInsights"];
2952
3004
  }
2953
- return target;
3005
+ return _aiNamespace;
2954
3006
  }
2955
- function _makeDynamicObject(state, target, name, desc) {
2956
- try {
2957
- objForEachKey(target, function (key, value) {
2958
- _setDynamicProperty(state, target, key, value);
2959
- });
2960
- if (!target[CFG_HANDLER_LINK]) {
2961
- objDefineProp(target, CFG_HANDLER_LINK, {
2962
- get: function () {
2963
- return state[_DYN_HDLR ];
2964
- }
2965
- });
2966
- _patchArray(state, target, name);
2967
- }
3007
+ function getDebugExt(config) {
3008
+ var ns = _aiNamespace;
3009
+ if (!ns && config.disableDbgExt !== true) {
3010
+ ns = _aiNamespace || _getExtensionNamespace();
2968
3011
  }
2969
- catch (e) {
2970
- _throwDynamicError((state.hdlr || {})[_DYN_LOGGER$1 ], name, desc, e);
3012
+ return ns ? ns["ChromeDbgExt"] : null;
3013
+ }
3014
+ function getDebugListener(config) {
3015
+ if (!_debugListener) {
3016
+ _debugListener = {};
3017
+ for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH$1 ]; lp++) {
3018
+ _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);
3019
+ }
2971
3020
  }
2972
- return target;
3021
+ return _debugListener;
2973
3022
  }
2974
3023
 
2975
- var symPrefix = "[[ai_";
2976
- var symPostfix = "]]";
2977
- function _createState(cfgHandler) {
2978
- var _a;
2979
- var dynamicPropertySymbol = newSymbol(symPrefix + "get" + cfgHandler.uid + symPostfix);
2980
- var dynamicPropertyReadOnly = newSymbol(symPrefix + "ro" + cfgHandler.uid + symPostfix);
2981
- var dynamicPropertyReferenced = newSymbol(symPrefix + "rf" + cfgHandler.uid + symPostfix);
2982
- var dynamicPropertyBlockValue = newSymbol(symPrefix + "blkVal" + cfgHandler.uid + symPostfix);
2983
- var dynamicPropertyDetail = newSymbol(symPrefix + "dtl" + cfgHandler.uid + symPostfix);
2984
- var _waitingHandlers = null;
2985
- var _watcherTimer = null;
2986
- var theState;
2987
- function _useHandler(activeHandler, callback) {
2988
- var prevWatcher = theState.act;
2989
- try {
2990
- theState.act = activeHandler;
2991
- if (activeHandler && activeHandler[dynamicPropertyDetail]) {
2992
- arrForEach(activeHandler[dynamicPropertyDetail], function (detail) {
2993
- detail.clr(activeHandler);
2994
- });
2995
- activeHandler[dynamicPropertyDetail] = [];
2996
- }
2997
- callback({
2998
- cfg: cfgHandler.cfg,
2999
- set: cfgHandler.set.bind(cfgHandler),
3000
- setDf: cfgHandler[_DYN_SET_DF ].bind(cfgHandler),
3001
- ref: cfgHandler.ref.bind(cfgHandler),
3002
- rdOnly: cfgHandler[_DYN_RD_ONLY ].bind(cfgHandler)
3003
- });
3024
+ var _a$4;
3025
+ var STR_WARN_TO_CONSOLE = "warnToConsole";
3026
+ var AiNonUserActionablePrefix = "AI (Internal): ";
3027
+ var AiUserActionablePrefix = "AI: ";
3028
+ var AIInternalMessagePrefix = "AITR_";
3029
+ var defaultValues$2 = {
3030
+ loggingLevelConsole: 0,
3031
+ loggingLevelTelemetry: 1,
3032
+ maxMessageLimit: 25,
3033
+ enableDebug: false
3034
+ };
3035
+ var _logFuncs = (_a$4 = {},
3036
+ _a$4[0 ] = null,
3037
+ _a$4[1 ] = "errorToConsole",
3038
+ _a$4[2 ] = STR_WARN_TO_CONSOLE,
3039
+ _a$4[3 ] = "debugToConsole",
3040
+ _a$4);
3041
+ function _sanitizeDiagnosticText(text) {
3042
+ if (text) {
3043
+ return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$2) + "\"";
3044
+ }
3045
+ return STR_EMPTY$2;
3046
+ }
3047
+ function _logToConsole(func, message) {
3048
+ var theConsole = getConsole();
3049
+ if (!!theConsole) {
3050
+ var logFunc = "log";
3051
+ if (theConsole[func]) {
3052
+ logFunc = func;
3004
3053
  }
3005
- catch (e) {
3006
- var logger = cfgHandler[_DYN_LOGGER$1 ];
3007
- if (logger) {
3008
- logger[_DYN_THROW_INTERNAL ](1 , 107 , dumpObj(e));
3009
- }
3010
- throw e;
3054
+ if (isFunction(theConsole[logFunc])) {
3055
+ theConsole[logFunc](message);
3011
3056
  }
3012
- finally {
3013
- theState.act = prevWatcher || null;
3057
+ }
3058
+ }
3059
+ var _InternalLogMessage = /** @class */ (function () {
3060
+ function _InternalLogMessage(msgId, msg, isUserAct, properties) {
3061
+ if (isUserAct === void 0) { isUserAct = false; }
3062
+ var _self = this;
3063
+ _self[_DYN_MESSAGE_ID ] = msgId;
3064
+ _self[_DYN_MESSAGE ] =
3065
+ (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
3066
+ msgId;
3067
+ var strProps = STR_EMPTY$2;
3068
+ if (hasJSON()) {
3069
+ strProps = getJSON().stringify(properties);
3014
3070
  }
3071
+ var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$2) +
3072
+ (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$2);
3073
+ _self[_DYN_MESSAGE ] += diagnosticText;
3015
3074
  }
3016
- function _notifyWatchers() {
3017
- if (_waitingHandlers) {
3018
- var notifyHandlers = _waitingHandlers;
3019
- _waitingHandlers = null;
3020
- _watcherTimer && _watcherTimer[_DYN_CANCEL ]();
3021
- _watcherTimer = null;
3022
- var watcherFailures_1 = [];
3023
- arrForEach(notifyHandlers, function (handler) {
3024
- if (handler) {
3025
- if (handler[dynamicPropertyDetail]) {
3026
- arrForEach(handler[dynamicPropertyDetail], function (detail) {
3027
- detail.clr(handler);
3028
- });
3029
- handler[dynamicPropertyDetail] = null;
3030
- }
3031
- if (handler.fn) {
3032
- try {
3033
- _useHandler(handler, handler.fn);
3075
+ _InternalLogMessage.dataType = "MessageData";
3076
+ return _InternalLogMessage;
3077
+ }());
3078
+ function safeGetLogger(core, config) {
3079
+ return (core || {})[_DYN_LOGGER$1 ] || new DiagnosticLogger(config);
3080
+ }
3081
+ var DiagnosticLogger = /** @class */ (function () {
3082
+ function DiagnosticLogger(config) {
3083
+ this.identifier = "DiagnosticLogger";
3084
+ this.queue = [];
3085
+ var _messageCount = 0;
3086
+ var _messageLogged = {};
3087
+ var _loggingLevelConsole;
3088
+ var _loggingLevelTelemetry;
3089
+ var _maxInternalMessageLimit;
3090
+ var _enableDebug;
3091
+ var _unloadHandler;
3092
+ dynamicProto(DiagnosticLogger, this, function (_self) {
3093
+ _unloadHandler = _setDefaultsFromConfig(config || {});
3094
+ _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
3095
+ _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
3096
+ if (isUserAct === void 0) { isUserAct = false; }
3097
+ var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
3098
+ if (_enableDebug) {
3099
+ throw dumpObj(message);
3100
+ }
3101
+ else {
3102
+ var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
3103
+ if (!isUndefined(message[_DYN_MESSAGE ])) {
3104
+ if (isUserAct) {
3105
+ var messageKey = +message[_DYN_MESSAGE_ID ];
3106
+ if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
3107
+ _self[logFunc](message[_DYN_MESSAGE ]);
3108
+ _messageLogged[messageKey] = true;
3109
+ }
3034
3110
  }
3035
- catch (e) {
3036
- watcherFailures_1[_DYN_PUSH ](e);
3111
+ else {
3112
+ if (_loggingLevelConsole >= severity) {
3113
+ _self[logFunc](message[_DYN_MESSAGE ]);
3114
+ }
3037
3115
  }
3116
+ _logInternalMessage(severity, message);
3117
+ }
3118
+ else {
3119
+ _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
3038
3120
  }
3039
3121
  }
3040
- });
3041
- if (_waitingHandlers) {
3042
- try {
3043
- _notifyWatchers();
3122
+ };
3123
+ _self.debugToConsole = function (message) {
3124
+ _logToConsole("debug", message);
3125
+ _debugExtMsg("warning", message);
3126
+ };
3127
+ _self[_DYN_WARN_TO_CONSOLE ] = function (message) {
3128
+ _logToConsole("warn", message);
3129
+ _debugExtMsg("warning", message);
3130
+ };
3131
+ _self.errorToConsole = function (message) {
3132
+ _logToConsole("error", message);
3133
+ _debugExtMsg("error", message);
3134
+ };
3135
+ _self.resetInternalMessageCount = function () {
3136
+ _messageCount = 0;
3137
+ _messageLogged = {};
3138
+ };
3139
+ _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
3140
+ _self[_DYN_UNLOAD ] = function (isAsync) {
3141
+ _unloadHandler && _unloadHandler.rm();
3142
+ _unloadHandler = null;
3143
+ };
3144
+ function _logInternalMessage(severity, message) {
3145
+ if (_areInternalMessagesThrottled()) {
3146
+ return;
3044
3147
  }
3045
- catch (e) {
3046
- watcherFailures_1[_DYN_PUSH ](e);
3148
+ var logMessage = true;
3149
+ var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
3150
+ if (_messageLogged[messageKey]) {
3151
+ logMessage = false;
3047
3152
  }
3048
- }
3049
- if (watcherFailures_1[_DYN_LENGTH$1 ] > 0) {
3050
- throwAggregationError("Watcher error(s): ", watcherFailures_1);
3051
- }
3052
- }
3053
- }
3054
- function _addWatcher(detail) {
3055
- if (detail && detail.h[_DYN_LENGTH$1 ] > 0) {
3056
- if (!_waitingHandlers) {
3057
- _waitingHandlers = [];
3058
- }
3059
- if (!_watcherTimer) {
3060
- _watcherTimer = scheduleTimeout(function () {
3061
- _watcherTimer = null;
3062
- _notifyWatchers();
3063
- }, 0);
3064
- }
3065
- for (var idx = 0; idx < detail.h[_DYN_LENGTH$1 ]; idx++) {
3066
- var handler = detail.h[idx];
3067
- if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
3068
- _waitingHandlers[_DYN_PUSH ](handler);
3153
+ else {
3154
+ _messageLogged[messageKey] = true;
3155
+ }
3156
+ if (logMessage) {
3157
+ if (severity <= _loggingLevelTelemetry) {
3158
+ _self.queue[_DYN_PUSH ](message);
3159
+ _messageCount++;
3160
+ _debugExtMsg((severity === 1 ? "error" : "warn"), message);
3161
+ }
3162
+ if (_messageCount === _maxInternalMessageLimit) {
3163
+ var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
3164
+ var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
3165
+ _self.queue[_DYN_PUSH ](throttleMessage);
3166
+ if (severity === 1 ) {
3167
+ _self.errorToConsole(throttleLimitMessage);
3168
+ }
3169
+ else {
3170
+ _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
3171
+ }
3172
+ }
3069
3173
  }
3070
3174
  }
3071
- }
3072
- }
3073
- function _trackHandler(handler, detail) {
3074
- if (handler) {
3075
- var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
3076
- if (arrIndexOf(details, detail) === -1) {
3077
- details[_DYN_PUSH ](detail);
3175
+ function _setDefaultsFromConfig(config) {
3176
+ return onConfigChange(createDynamicConfig(config, defaultValues$2, _self).cfg, function (details) {
3177
+ var config = details.cfg;
3178
+ _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
3179
+ _loggingLevelTelemetry = config.loggingLevelTelemetry;
3180
+ _maxInternalMessageLimit = config.maxMessageLimit;
3181
+ _enableDebug = config.enableDebug;
3182
+ });
3078
3183
  }
3079
- }
3080
- }
3081
- theState = (_a = {
3082
- prop: dynamicPropertySymbol,
3083
- ro: dynamicPropertyReadOnly,
3084
- rf: dynamicPropertyReferenced
3085
- },
3086
- _a[_DYN_BLK_VAL ] = dynamicPropertyBlockValue,
3087
- _a[_DYN_HDLR ] = cfgHandler,
3088
- _a.add = _addWatcher,
3089
- _a[_DYN_NOTIFY ] = _notifyWatchers,
3090
- _a.use = _useHandler,
3091
- _a.trk = _trackHandler,
3092
- _a);
3093
- return theState;
3094
- }
3095
-
3096
- function _createAndUseHandler(state, configHandler) {
3097
- var handler = {
3098
- fn: configHandler,
3099
- rm: function () {
3100
- handler.fn = null;
3101
- state = null;
3102
- configHandler = null;
3103
- }
3104
- };
3105
- state.use(handler, configHandler);
3106
- return handler;
3107
- }
3108
- function _createDynamicHandler(logger, target, inPlace) {
3109
- var _a;
3110
- var dynamicHandler = getDynamicConfigHandler(target);
3111
- if (dynamicHandler) {
3112
- return dynamicHandler;
3113
- }
3114
- var uid = createUniqueNamespace("dyncfg", true);
3115
- var newTarget = (target && inPlace !== false) ? target : _cfgDeepCopy(target);
3116
- var theState;
3117
- function _notifyWatchers() {
3118
- theState[_DYN_NOTIFY ]();
3119
- }
3120
- function _setValue(target, name, value) {
3121
- try {
3122
- target = _setDynamicProperty(theState, target, name, value);
3123
- }
3124
- catch (e) {
3125
- _throwDynamicError(logger, name, "Setting value", e);
3126
- }
3127
- return target[name];
3128
- }
3129
- function _watch(configHandler) {
3130
- return _createAndUseHandler(theState, configHandler);
3131
- }
3132
- function _block(configHandler, allowUpdate) {
3133
- theState.use(null, function (details) {
3134
- var prevUpd = theState.upd;
3135
- try {
3136
- if (!isUndefined(allowUpdate)) {
3137
- theState.upd = allowUpdate;
3138
- }
3139
- configHandler(details);
3184
+ function _areInternalMessagesThrottled() {
3185
+ return _messageCount >= _maxInternalMessageLimit;
3140
3186
  }
3141
- finally {
3142
- theState.upd = prevUpd;
3187
+ function _debugExtMsg(name, data) {
3188
+ var dbgExt = getDebugExt(config || {});
3189
+ if (dbgExt && dbgExt[_DYN_DIAG_LOG ]) {
3190
+ dbgExt[_DYN_DIAG_LOG ](name, data);
3191
+ }
3143
3192
  }
3144
3193
  });
3145
3194
  }
3146
- function _ref(target, name) {
3147
- var _a;
3148
- return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[0 ] = true, _a))[name];
3149
- }
3150
- function _rdOnly(target, name) {
3151
- var _a;
3152
- return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[1 ] = true, _a))[name];
3153
- }
3154
- function _blkPropValue(target, name) {
3155
- var _a;
3156
- return _setDynamicPropertyState(theState, target, name, (_a = {}, _a[2 ] = true, _a))[name];
3157
- }
3158
- function _applyDefaults(theConfig, defaultValues) {
3159
- if (defaultValues) {
3160
- objForEachKey(defaultValues, function (name, value) {
3161
- _applyDefaultValue(cfgHandler, theConfig, name, value);
3162
- });
3163
- }
3164
- return theConfig;
3165
- }
3166
- var cfgHandler = (_a = {
3167
- uid: null,
3168
- cfg: newTarget
3169
- },
3170
- _a[_DYN_LOGGER$1 ] = logger,
3171
- _a[_DYN_NOTIFY ] = _notifyWatchers,
3172
- _a.set = _setValue,
3173
- _a[_DYN_SET_DF ] = _applyDefaults,
3174
- _a[_DYN_WATCH ] = _watch,
3175
- _a.ref = _ref,
3176
- _a[_DYN_RD_ONLY ] = _rdOnly,
3177
- _a[_DYN_BLK_VAL ] = _blkPropValue,
3178
- _a._block = _block,
3179
- _a);
3180
- objDefine(cfgHandler, "uid", {
3181
- c: false,
3182
- e: false,
3183
- w: false,
3184
- v: uid
3185
- });
3186
- theState = _createState(cfgHandler);
3187
- _makeDynamicObject(theState, newTarget, "config", "Creating");
3188
- return cfgHandler;
3189
- }
3190
- function _logInvalidAccess(logger, message) {
3191
- if (logger) {
3192
- logger[_DYN_WARN_TO_CONSOLE ](message);
3193
- logger[_DYN_THROW_INTERNAL ](2 , 108 , message);
3194
- }
3195
- else {
3196
- throwInvalidAccess(message);
3197
- }
3198
- }
3199
- function createDynamicConfig(config, defaultConfig, logger, inPlace) {
3200
- var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace);
3201
- if (defaultConfig) {
3202
- dynamicHandler[_DYN_SET_DF ](dynamicHandler.cfg, defaultConfig);
3203
- }
3204
- return dynamicHandler;
3205
- }
3206
- function onConfigChange(config, configHandler, logger) {
3207
- var handler = config[CFG_HANDLER_LINK] || config;
3208
- if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) {
3209
- return handler[_DYN_WATCH ](configHandler);
3210
- }
3211
- _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));
3212
- return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
3195
+ DiagnosticLogger.__ieDyn=1;
3196
+ return DiagnosticLogger;
3197
+ }());
3198
+ function _getLogger(logger) {
3199
+ return (logger || new DiagnosticLogger());
3213
3200
  }
3214
-
3215
- function runTargetUnload(target, isAsync) {
3216
- if (target && target[_DYN_UNLOAD ]) {
3217
- return target[_DYN_UNLOAD ](isAsync);
3218
- }
3201
+ function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
3202
+ if (isUserAct === void 0) { isUserAct = false; }
3203
+ _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
3219
3204
  }
3220
- function doUnloadAll(targets, isAsync, done) {
3221
- var result;
3222
- if (!done) {
3223
- result = createPromise(function (resolved) {
3224
- done = resolved;
3225
- });
3226
- }
3227
- if (targets && getLength(targets) > 0) {
3228
- doAwaitResponse(runTargetUnload(targets[0], isAsync), function () {
3229
- doUnloadAll(arrSlice(targets, 1), isAsync, done);
3230
- });
3231
- }
3232
- else {
3233
- done();
3234
- }
3235
- return result;
3205
+ function _warnToConsole(logger, message) {
3206
+ _getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message);
3236
3207
  }
3237
-
3238
- var ChannelControllerPriority = 500;
3239
- var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
3240
-
3241
- function cfgDfMerge(defaultValue) {
3242
- return {
3243
- mrg: true,
3244
- v: defaultValue
3245
- };
3208
+ function _logInternalMessage(logger, severity, message) {
3209
+ _getLogger(logger)[_DYN_LOG_INTERNAL_MESSAGE ](severity, message);
3246
3210
  }
3247
3211
 
3248
3212
  var _a$3, _b;
@@ -3544,18 +3508,26 @@
3544
3508
  var defaultValues$1 = {
3545
3509
  perfEvtsSendAll: false
3546
3510
  };
3547
- function _runListeners(listeners, name, isAsync, callback) {
3511
+ function _runScheduledListeners(asyncNotifications) {
3512
+ asyncNotifications.h = null;
3513
+ var callbacks = asyncNotifications.cb;
3514
+ asyncNotifications.cb = [];
3515
+ arrForEach(callbacks, function (cb) {
3516
+ safe(cb.fn, [cb.arg]);
3517
+ });
3518
+ }
3519
+ function _runListeners(listeners, name, asyncNotifications, callback) {
3548
3520
  arrForEach(listeners, function (listener) {
3549
3521
  if (listener && listener[name]) {
3550
- if (isAsync) {
3551
- scheduleTimeout(function () { return callback(listener); }, 0);
3522
+ if (asyncNotifications) {
3523
+ asyncNotifications.cb[_DYN_PUSH ]({
3524
+ fn: callback,
3525
+ arg: listener
3526
+ });
3527
+ asyncNotifications.h = asyncNotifications.h || scheduleTimeout(_runScheduledListeners, 0, asyncNotifications);
3552
3528
  }
3553
3529
  else {
3554
- try {
3555
- callback(listener);
3556
- }
3557
- catch (e) {
3558
- }
3530
+ safe(callback, [listener]);
3559
3531
  }
3560
3532
  }
3561
3533
  });
@@ -3566,6 +3538,10 @@
3566
3538
  var perfEvtsSendAll;
3567
3539
  var unloadHandler;
3568
3540
  var _listeners = [];
3541
+ var _asyncNotifications = {
3542
+ h: null,
3543
+ cb: []
3544
+ };
3569
3545
  var cfgHandler = createDynamicConfig(config, defaultValues$1);
3570
3546
  unloadHandler = cfgHandler[_DYN_WATCH ](function (details) {
3571
3547
  perfEvtsSendAll = !!details.cfg.perfEvtsSendAll;
@@ -3577,7 +3553,7 @@
3577
3553
  _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
3578
3554
  _listeners[_DYN_PUSH ](listener);
3579
3555
  };
3580
- _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) {
3556
+ _self[_DYN_REMOVE_NOTIFICATION_0 ] = function (listener) {
3581
3557
  var index = arrIndexOf(_listeners, listener);
3582
3558
  while (index > -1) {
3583
3559
  _listeners[_DYN_SPLICE ](index, 1);
@@ -3585,24 +3561,24 @@
3585
3561
  }
3586
3562
  };
3587
3563
  _self[STR_EVENTS_SENT ] = function (events) {
3588
- _runListeners(_listeners, STR_EVENTS_SENT, true, function (listener) {
3564
+ _runListeners(_listeners, STR_EVENTS_SENT, _asyncNotifications, function (listener) {
3589
3565
  listener[STR_EVENTS_SENT ](events);
3590
3566
  });
3591
3567
  };
3592
3568
  _self[STR_EVENTS_DISCARDED ] = function (events, reason) {
3593
- _runListeners(_listeners, STR_EVENTS_DISCARDED, true, function (listener) {
3569
+ _runListeners(_listeners, STR_EVENTS_DISCARDED, _asyncNotifications, function (listener) {
3594
3570
  listener[STR_EVENTS_DISCARDED ](events, reason);
3595
3571
  });
3596
3572
  };
3597
3573
  _self[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) {
3598
- _runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync, function (listener) {
3574
+ _runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync ? _asyncNotifications : null, function (listener) {
3599
3575
  listener[STR_EVENTS_SEND_REQUEST ](sendReason, isAsync);
3600
3576
  });
3601
3577
  };
3602
3578
  _self[STR_PERF_EVENT ] = function (perfEvent) {
3603
3579
  if (perfEvent) {
3604
3580
  if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) {
3605
- _runListeners(_listeners, STR_PERF_EVENT, false, function (listener) {
3581
+ _runListeners(_listeners, STR_PERF_EVENT, null, function (listener) {
3606
3582
  if (perfEvent[_DYN_IS_ASYNC ]) {
3607
3583
  scheduleTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0);
3608
3584
  }
@@ -3615,14 +3591,14 @@
3615
3591
  };
3616
3592
  _self[STR_OFFLINE_STORE ] = function (events) {
3617
3593
  if (events && events[_DYN_LENGTH$1 ]) {
3618
- _runListeners(_listeners, STR_OFFLINE_STORE, true, function (listener) {
3594
+ _runListeners(_listeners, STR_OFFLINE_STORE, _asyncNotifications, function (listener) {
3619
3595
  listener[STR_OFFLINE_STORE ](events);
3620
3596
  });
3621
3597
  }
3622
3598
  };
3623
3599
  _self[STR_OFFLINE_SENT ] = function (batch) {
3624
3600
  if (batch && batch[_DYN_DATA ]) {
3625
- _runListeners(_listeners, STR_OFFLINE_SENT, true, function (listener) {
3601
+ _runListeners(_listeners, STR_OFFLINE_SENT, _asyncNotifications, function (listener) {
3626
3602
  listener[STR_OFFLINE_SENT ](batch);
3627
3603
  });
3628
3604
  }
@@ -3630,7 +3606,7 @@
3630
3606
  _self[STR_OFFLINE_DROP ] = function (cnt, reason) {
3631
3607
  if (cnt > 0) {
3632
3608
  var rn_1 = reason || 0;
3633
- _runListeners(_listeners, STR_OFFLINE_DROP, true, function (listener) {
3609
+ _runListeners(_listeners, STR_OFFLINE_DROP, _asyncNotifications, function (listener) {
3634
3610
  listener[STR_OFFLINE_DROP ](cnt, rn_1);
3635
3611
  });
3636
3612
  }
@@ -3640,9 +3616,12 @@
3640
3616
  unloadHandler && unloadHandler.rm();
3641
3617
  unloadHandler = null;
3642
3618
  _listeners = [];
3619
+ _asyncNotifications.h && _asyncNotifications.h[_DYN_CANCEL ]();
3620
+ _asyncNotifications.h = null;
3621
+ _asyncNotifications.cb = [];
3643
3622
  };
3644
3623
  var waiting;
3645
- _runListeners(_listeners, "unload", false, function (listener) {
3624
+ _runListeners(_listeners, "unload", null, function (listener) {
3646
3625
  var asyncUnload = listener[_DYN_UNLOAD ](isAsync);
3647
3626
  if (asyncUnload) {
3648
3627
  if (!waiting) {
@@ -4435,6 +4414,12 @@
4435
4414
  };
4436
4415
  }
4437
4416
 
4417
+ var _maxHooks;
4418
+ var _hookAddMonitor;
4419
+ function _testHookMaxUnloadHooksCb(maxHooks, addMonitor) {
4420
+ _maxHooks = maxHooks;
4421
+ _hookAddMonitor = addMonitor;
4422
+ }
4438
4423
  function createUnloadHookContainer() {
4439
4424
  var _hooks = [];
4440
4425
  function _doUnload(logger) {
@@ -4448,10 +4433,16 @@
4448
4433
  _throwInternal(logger, 2 , 73 , "Unloading:" + dumpObj(e));
4449
4434
  }
4450
4435
  });
4436
+ if (_maxHooks && oldHooks[_DYN_LENGTH$1 ] > _maxHooks) {
4437
+ _hookAddMonitor ? _hookAddMonitor("doUnload", oldHooks) : _throwInternal(null, 1 , 48 , "Max unload hooks exceeded. An excessive number of unload hooks has been detected.");
4438
+ }
4451
4439
  }
4452
4440
  function _addHook(hooks) {
4453
4441
  if (hooks) {
4454
4442
  arrAppend(_hooks, hooks);
4443
+ if (_maxHooks && _hooks[_DYN_LENGTH$1 ] > _maxHooks) {
4444
+ _hookAddMonitor ? _hookAddMonitor("Add", _hooks) : _throwInternal(null, 1 , 48 , "Max unload hooks exceeded. An excessive number of unload hooks has been detected.");
4445
+ }
4455
4446
  }
4456
4447
  }
4457
4448
  return {
@@ -4579,7 +4570,7 @@
4579
4570
  function _setDefaults(config, core, pluginChain) {
4580
4571
  createDynamicConfig(config, defaultValues, safeGetLogger(core));
4581
4572
  if (!pluginChain && core) {
4582
- pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ]();
4573
+ pluginChain = core[_DYN_GET_PROCESS_TEL_CONT2 ]()[_DYN_GET_NEXT ]();
4583
4574
  }
4584
4575
  var nextPlugin = _nextPlugin;
4585
4576
  if (_nextPlugin && _nextPlugin[strGetPlugin]) {
@@ -4783,6 +4774,27 @@
4783
4774
  };
4784
4775
  });
4785
4776
  }
4777
+ function _initDebugListener(configHandler, unloadContainer, notificationManager, debugListener) {
4778
+ unloadContainer.add(configHandler[_DYN_WATCH ](function (details) {
4779
+ var disableDbgExt = details.cfg.disableDbgExt;
4780
+ if (disableDbgExt === true && debugListener) {
4781
+ notificationManager[_DYN_REMOVE_NOTIFICATION_0 ](debugListener);
4782
+ debugListener = null;
4783
+ }
4784
+ if (notificationManager && !debugListener && disableDbgExt !== true) {
4785
+ debugListener = getDebugListener(details.cfg);
4786
+ notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](debugListener);
4787
+ }
4788
+ }));
4789
+ return debugListener;
4790
+ }
4791
+ function _createUnloadHook(unloadHook) {
4792
+ return objDefine({
4793
+ rm: function () {
4794
+ unloadHook.rm();
4795
+ }
4796
+ }, "toJSON", { v: function () { return "aicore::onCfgChange<" + JSON.stringify(unloadHook) + ">"; } });
4797
+ }
4786
4798
  var AppInsightsCore$1 = /** @class */ (function () {
4787
4799
  function AppInsightsCore() {
4788
4800
  var _configHandler;
@@ -4839,7 +4851,7 @@
4839
4851
  }
4840
4852
  }));
4841
4853
  _notificationManager = notificationManager;
4842
- _initDebugListener();
4854
+ _debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
4843
4855
  _initPerfManager();
4844
4856
  _self[_DYN_LOGGER$1 ] = logger;
4845
4857
  var cfgExtensions = config[STR_EXTENSIONS ];
@@ -4892,7 +4904,7 @@
4892
4904
  }
4893
4905
  }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
4894
4906
  };
4895
- _self[_DYN_GET_PROCESS_TEL_CONT0 ] = _createTelCtx;
4907
+ _self[_DYN_GET_PROCESS_TEL_CONT2 ] = _createTelCtx;
4896
4908
  _self[_DYN_GET_NOTIFY_MGR ] = function () {
4897
4909
  if (!_notificationManager) {
4898
4910
  _notificationManager = new NotificationManager(_configHandler.cfg);
@@ -4901,11 +4913,11 @@
4901
4913
  return _notificationManager;
4902
4914
  };
4903
4915
  _self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
4904
- _self[_DYN_GET_NOTIFY_MGR ]()[_DYN_ADD_NOTIFICATION_LIS1 ](listener);
4916
+ _self.getNotifyMgr()[_DYN_ADD_NOTIFICATION_LIS1 ](listener);
4905
4917
  };
4906
- _self[_DYN_REMOVE_NOTIFICATION_2 ] = function (listener) {
4918
+ _self[_DYN_REMOVE_NOTIFICATION_0 ] = function (listener) {
4907
4919
  if (_notificationManager) {
4908
- _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](listener);
4920
+ _notificationManager[_DYN_REMOVE_NOTIFICATION_0 ](listener);
4909
4921
  }
4910
4922
  };
4911
4923
  _self.getCookieMgr = function () {
@@ -4921,16 +4933,6 @@
4921
4933
  }
4922
4934
  };
4923
4935
  _self[STR_GET_PERF_MGR ] = function () {
4924
- if (!_perfManager && !_cfgPerfManager) {
4925
- _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
4926
- if (details.cfg.enablePerfMgr) {
4927
- var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR ];
4928
- if (isFunction(createPerfMgr)) {
4929
- _cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]());
4930
- }
4931
- }
4932
- }));
4933
- }
4934
4936
  return _perfManager || _cfgPerfManager || getGblPerfMgr();
4935
4937
  };
4936
4938
  _self.setPerfMgr = function (perfMgr) {
@@ -5125,11 +5127,7 @@
5125
5127
  else {
5126
5128
  unloadHook = onConfigChange(_configHandler.cfg, handler, _self[_DYN_LOGGER$1 ]);
5127
5129
  }
5128
- return {
5129
- rm: function () {
5130
- unloadHook.rm();
5131
- }
5132
- };
5130
+ return _createUnloadHook(unloadHook);
5133
5131
  };
5134
5132
  _self.getWParam = function () {
5135
5133
  return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1;
@@ -5229,6 +5227,8 @@
5229
5227
  _pluginVersionString = null;
5230
5228
  _pluginVersionStringArr = null;
5231
5229
  _forceStopInternalLogPoller = false;
5230
+ _internalLogPoller = null;
5231
+ _internalLogPollerListening = false;
5232
5232
  }
5233
5233
  function _createTelCtx() {
5234
5234
  var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
@@ -5423,28 +5423,27 @@
5423
5423
  doCallback();
5424
5424
  return true;
5425
5425
  }
5426
- function _initDebugListener() {
5427
- !_notificationManager && _self[_DYN_GET_NOTIFY_MGR ]();
5428
- _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
5429
- var disableDbgExt = details.cfg.disableDbgExt;
5430
- if (disableDbgExt === true && _debugListener) {
5431
- _notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](_debugListener);
5432
- _debugListener = null;
5433
- }
5434
- if (_notificationManager && !_debugListener && disableDbgExt !== true) {
5435
- _debugListener = getDebugListener(details.cfg);
5436
- _notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](_debugListener);
5437
- }
5438
- }));
5439
- }
5440
5426
  function _initPerfManager() {
5427
+ var prevCfgPerfMgr;
5441
5428
  _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
5442
5429
  var enablePerfMgr = details.cfg.enablePerfMgr;
5443
- if (!enablePerfMgr && _cfgPerfManager) {
5444
- _cfgPerfManager = null;
5445
- }
5446
5430
  if (enablePerfMgr) {
5447
- getSetValue(details.cfg, STR_CREATE_PERF_MGR, _createPerfManager);
5431
+ var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR ];
5432
+ if (prevCfgPerfMgr !== createPerfMgr) {
5433
+ if (!createPerfMgr) {
5434
+ createPerfMgr = _createPerfManager;
5435
+ }
5436
+ getSetValue(details.cfg, STR_CREATE_PERF_MGR, createPerfMgr);
5437
+ prevCfgPerfMgr = createPerfMgr;
5438
+ _cfgPerfManager = null;
5439
+ }
5440
+ if (!_perfManager && !_cfgPerfManager && isFunction(createPerfMgr)) {
5441
+ _cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]());
5442
+ }
5443
+ }
5444
+ else {
5445
+ _cfgPerfManager = null;
5446
+ prevCfgPerfMgr = null;
5448
5447
  }
5449
5448
  }));
5450
5449
  }
@@ -5480,6 +5479,24 @@
5480
5479
  return AppInsightsCore;
5481
5480
  }());
5482
5481
 
5482
+ function parseResponse(response, diagLog) {
5483
+ try {
5484
+ if (response && response !== "") {
5485
+ var result = getJSON().parse(response);
5486
+ if (result && result[_DYN_ITEMS_RECEIVED ] && result[_DYN_ITEMS_RECEIVED ] >= result.itemsAccepted &&
5487
+ result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$1 ]) {
5488
+ return result;
5489
+ }
5490
+ }
5491
+ }
5492
+ catch (e) {
5493
+ _throwInternal(diagLog, 1 , 43 , "Cannot parse the response. " + (e[_DYN_NAME ] || dumpObj(e)), {
5494
+ response: response
5495
+ });
5496
+ }
5497
+ return null;
5498
+ }
5499
+
5483
5500
  var STR_EMPTY$1 = "";
5484
5501
  var STR_NO_RESPONSE_BODY = "NoResponseBody";
5485
5502
  var _noResponseQs = "&" + STR_NO_RESPONSE_BODY + "=true";
@@ -6248,7 +6265,7 @@
6248
6265
  var _DYN_CAN_HANDLE = "canHandle";
6249
6266
 
6250
6267
  var _a;
6251
- var Version = '4.1.1';
6268
+ var Version = '4.1.2';
6252
6269
  var FullVersionString = "1DS-Web-JS-" + Version;
6253
6270
  var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
6254
6271
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
@@ -6850,6 +6867,7 @@
6850
6867
  exports._appendHeader = _appendHeader;
6851
6868
  exports._getAllResponseHeaders = _getAllResponseHeaders;
6852
6869
  exports._logInternalMessage = _logInternalMessage;
6870
+ exports._testHookMaxUnloadHooksCb = _testHookMaxUnloadHooksCb;
6853
6871
  exports._throwInternal = _throwInternal;
6854
6872
  exports._warnToConsole = _warnToConsole;
6855
6873
  exports.addEventHandler = addEventHandler;