@microsoft/applicationinsights-react-js 17.1.2-nightly.2403-01 → 17.1.3-nightly.2403-10

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Plugin, 17.1.2-nightly.2403-01
2
+ * Application Insights JavaScript SDK - React Plugin, 17.1.3-nightly.2403-10
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -42,22 +42,15 @@
42
42
  var NULL_VALUE = null;
43
43
  var EMPTY = "";
44
44
  var FUNCTION = "function";
45
- var NUMBER = "number";
46
45
  var OBJECT = "object";
47
46
  var PROTOTYPE = "prototype";
48
47
  var __PROTO__ = "__proto__";
49
- var STRING = "string";
50
48
  var UNDEFINED = "undefined";
51
49
  var CONSTRUCTOR = "constructor";
52
50
  var SYMBOL = "Symbol";
53
51
  var POLYFILL_TAG = "_polyfill";
54
- var INDEX_OF = "indexOf";
55
- var LAST_INDEX_OF = "lastIndexOf";
56
52
  var LENGTH = "length";
57
- var DONE = "done";
58
- var VALUE = "value";
59
53
  var NAME = "name";
60
- var SLICE = "slice";
61
54
  var CALL = "call";
62
55
  var TO_STRING = "toString";
63
56
  var ObjClass = Object;
@@ -67,6 +60,7 @@
67
60
  var MathCls = Math;
68
61
  var ArrCls = Array;
69
62
  var ArrProto = ArrCls[PROTOTYPE];
63
+ var ArrSlice = ArrProto["slice"];
70
64
 
71
65
  function safe(func, argArray) {
72
66
  try {
@@ -110,7 +104,7 @@
110
104
  function isDefined(arg) {
111
105
  return !!arg || arg !== UNDEF_VALUE;
112
106
  }
113
- var isString = ( _createIs(STRING));
107
+ var isString = ( _createIs("string"));
114
108
  var isFunction = ( _createIs(FUNCTION));
115
109
  function isObject(value) {
116
110
  if (!value && isNullOrUndefined(value)) {
@@ -259,7 +253,7 @@
259
253
  object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
260
254
  }
261
255
  try {
262
- propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === NUMBER) ? format : 4) : UNDEF_VALUE);
256
+ propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
263
257
  propertyValueDump = (propertyValueDump && propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ")) || asString(object);
264
258
  }
265
259
  catch (e) {
@@ -268,17 +262,14 @@
268
262
  return objType + ": " + propertyValueDump;
269
263
  }
270
264
 
271
- var _slice;
272
- var _unwrapInstFunction = _unwrapFunctionWithPoly;
273
265
  var _unwrapFunction = _unwrapFunctionWithPoly;
274
266
  function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
275
- _slice = _slice || ArrProto[SLICE];
276
267
  var clsFn = clsProto && clsProto[funcName];
277
268
  return function (thisArg) {
278
269
  var theFunc = (thisArg && thisArg[funcName]) || clsFn;
279
270
  if (theFunc || polyFunc) {
280
271
  var theArgs = arguments;
281
- return (theFunc || polyFunc).apply(thisArg, theFunc ? _slice[CALL](theArgs, 1) : theArgs);
272
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
282
273
  }
283
274
  throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
284
275
  };
@@ -286,7 +277,7 @@
286
277
 
287
278
  var mathMax = MathCls.max;
288
279
 
289
- var strSlice = ( _unwrapFunction(SLICE, StrProto));
280
+ var strSlice = ( _unwrapFunction("slice", StrProto));
290
281
 
291
282
  var strSubstring = ( _unwrapFunction("substring", StrProto));
292
283
  ( _unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
@@ -352,7 +343,7 @@
352
343
  var propMap = {
353
344
  e: "enumerable",
354
345
  c: "configurable",
355
- v: VALUE,
346
+ v: "value",
356
347
  w: "writable",
357
348
  g: "get",
358
349
  s: "set"
@@ -433,9 +424,14 @@
433
424
 
434
425
  var WINDOW = "window";
435
426
  var _cachedGlobal;
436
- var _cachedWindow;
437
- var _cachedDocument;
438
- var _cachedNavigator;
427
+ function _getGlobalInstFn(getFn, theArgs) {
428
+ var cachedValue;
429
+ return function () {
430
+ !_globalLazyTestHooks && _initTestHooks();
431
+ (!cachedValue || _globalLazyTestHooks.lzy) && (cachedValue = createCachedValue(safe(getFn, theArgs).v));
432
+ return cachedValue.v;
433
+ };
434
+ }
439
435
  function lazySafeGetInst(name) {
440
436
  return getLazy(function () { return safe((getInst), [name]).v || UNDEF_VALUE; });
441
437
  }
@@ -449,29 +445,17 @@
449
445
  if (gbl && gbl[name]) {
450
446
  return gbl[name];
451
447
  }
452
- if (name === WINDOW && _cachedWindow) {
453
- return _cachedWindow.v;
448
+ if (name === WINDOW) {
449
+ return getWindow();
454
450
  }
455
451
  return NULL_VALUE;
456
452
  }
457
- function getDocument() {
458
- !_globalLazyTestHooks && _initTestHooks();
459
- (!_cachedDocument || _globalLazyTestHooks.lzy) && (_cachedDocument = createCachedValue(safe((getInst), ["document"]).v));
460
- return _cachedDocument.v;
461
- }
453
+ var getDocument = ( _getGlobalInstFn(getInst, ["document"]));
462
454
  function hasWindow() {
463
455
  return !!getWindow();
464
456
  }
465
- function getWindow() {
466
- !_globalLazyTestHooks && _initTestHooks();
467
- (!_cachedWindow || _globalLazyTestHooks.lzy) && (_cachedWindow = createCachedValue(safe((getInst), [WINDOW]).v));
468
- return _cachedWindow.v;
469
- }
470
- function getNavigator() {
471
- !_globalLazyTestHooks && _initTestHooks();
472
- (!_cachedNavigator || _globalLazyTestHooks.lzy) && (_cachedNavigator = createCachedValue(safe((getInst), ["navigator"]).v));
473
- return _cachedNavigator.v;
474
- }
457
+ var getWindow = ( _getGlobalInstFn(getInst, [WINDOW]));
458
+ var getNavigator = ( _getGlobalInstFn(getInst, ["navigator"]));
475
459
 
476
460
  var _symbol;
477
461
  var _symbolFor;
@@ -518,8 +502,8 @@
518
502
  var iterResult = void 0;
519
503
  try {
520
504
  var count = 0;
521
- while (!(iterResult = iter.next())[DONE]) {
522
- if (callbackfn[CALL](thisArg || iter, iterResult[VALUE], count, iter) === -1) {
505
+ while (!(iterResult = iter.next()).done) {
506
+ if (callbackfn[CALL](thisArg || iter, iterResult.value, count, iter) === -1) {
523
507
  break;
524
508
  }
525
509
  count++;
@@ -534,7 +518,7 @@
534
518
  }
535
519
  finally {
536
520
  try {
537
- if (iterResult && !iterResult[DONE]) {
521
+ if (iterResult && !iterResult.done) {
538
522
  iter.return && iter.return(iterResult);
539
523
  }
540
524
  }
@@ -548,7 +532,9 @@
548
532
  }
549
533
  }
550
534
 
551
- var fnApply = ( _unwrapInstFunction("apply"));
535
+ function fnApply(fn, thisArg, argArray) {
536
+ return fn.apply(thisArg, argArray);
537
+ }
552
538
 
553
539
  function arrAppend(target, elms) {
554
540
  if (!isUndefined(elms) && target) {
@@ -580,8 +566,8 @@
580
566
  }
581
567
  }
582
568
 
583
- var arrIndexOf = ( _unwrapFunction(INDEX_OF, ArrProto));
584
- ( _unwrapFunction(LAST_INDEX_OF, ArrProto));
569
+ var arrIndexOf = ( _unwrapFunction("indexOf", ArrProto));
570
+ ( _unwrapFunction("lastIndexOf", ArrProto));
585
571
 
586
572
  var objCreate = ObjClass["create"] || polyObjCreate;
587
573
  function polyObjCreate(obj) {
@@ -632,7 +618,7 @@
632
618
  var theArgs = arguments;
633
619
  try {
634
620
  safe(_setName, [theBaseClass, name]);
635
- var _self = fnApply(theBaseClass, _this, ArrProto[SLICE][CALL](theArgs)) || _this;
621
+ var _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;
636
622
  if (_self !== _this) {
637
623
  var orgProto = objGetPrototypeOf(_this);
638
624
  if (orgProto !== objGetPrototypeOf(_self)) {
@@ -717,59 +703,54 @@
717
703
  return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;
718
704
  }
719
705
 
720
- var strIndexOf = ( _unwrapFunction(INDEX_OF, StrProto));
721
- ( _unwrapFunction(LAST_INDEX_OF, StrProto));
706
+ var strIndexOf = ( _unwrapFunction("indexOf", StrProto));
707
+ ( _unwrapFunction("lastIndexOf", StrProto));
722
708
 
723
709
  var REF = "ref";
724
- var UNREF = "un" + REF;
710
+ var UNREF = "unref";
725
711
  var HAS_REF = "hasRef";
726
712
  var ENABLED = "enabled";
727
713
  function _createTimerHandler(startTimer, refreshFn, cancelFn) {
728
- var _a;
729
714
  var ref = true;
730
715
  var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE;
731
716
  var theTimerHandler;
732
- var _unref = function () {
717
+ function _unref() {
733
718
  ref = false;
734
719
  timerId && timerId[UNREF] && timerId[UNREF]();
735
720
  return theTimerHandler;
736
- };
737
- var _ref = function () {
738
- ref = true;
739
- timerId && timerId[REF] && timerId[REF]();
721
+ }
722
+ function _cancel() {
723
+ timerId && cancelFn(timerId);
724
+ timerId = NULL_VALUE;
725
+ }
726
+ function _refresh() {
727
+ timerId = refreshFn(timerId);
728
+ if (!ref) {
729
+ _unref();
730
+ }
740
731
  return theTimerHandler;
732
+ }
733
+ function _setEnabled(value) {
734
+ !value && timerId && _cancel();
735
+ value && !timerId && _refresh();
736
+ }
737
+ theTimerHandler = {
738
+ cancel: _cancel,
739
+ refresh: _refresh
741
740
  };
742
- var _hasRef = function () {
741
+ theTimerHandler[HAS_REF] = function () {
743
742
  if (timerId && timerId[HAS_REF]) {
744
743
  return timerId[HAS_REF]();
745
744
  }
746
745
  return ref;
747
746
  };
748
- var _refresh = function () {
749
- timerId = refreshFn(timerId);
750
- if (!ref) {
751
- _unref();
752
- }
747
+ theTimerHandler[REF] = function () {
748
+ ref = true;
749
+ timerId && timerId[REF] && timerId[REF]();
753
750
  return theTimerHandler;
754
751
  };
755
- var _cancel = function () {
756
- timerId && cancelFn(timerId);
757
- timerId = NULL_VALUE;
758
- };
759
- var _setEnabled = function (value) {
760
- !value && timerId && _cancel();
761
- value && !timerId && _refresh();
762
- };
763
- theTimerHandler = (_a = {
764
- cancel: _cancel,
765
- refresh: _refresh
766
- },
767
- _a[HAS_REF] = _hasRef,
768
- _a[REF] = _ref,
769
- _a[UNREF] = _unref,
770
- _a[ENABLED] = false,
771
- _a);
772
- objDefineProp(theTimerHandler, ENABLED, {
752
+ theTimerHandler[UNREF] = _unref;
753
+ theTimerHandler = objDefineProp(theTimerHandler, ENABLED, {
773
754
  get: function () { return !!timerId; },
774
755
  set: _setEnabled
775
756
  });
@@ -781,7 +762,7 @@
781
762
  };
782
763
  }
783
764
 
784
- function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
765
+ function _createTimeoutWith(startTimer, overrideFn, theArgs) {
785
766
  var isArr = isArray(overrideFn);
786
767
  var len = isArr ? overrideFn.length : 0;
787
768
  var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
@@ -789,7 +770,7 @@
789
770
  var timerFn = theArgs[0];
790
771
  theArgs[0] = function () {
791
772
  handler.dn();
792
- fnApply(timerFn, self, ArrProto[SLICE][CALL](arguments));
773
+ fnApply(timerFn, UNDEF_VALUE, ArrSlice[CALL](arguments));
793
774
  };
794
775
  var handler = _createTimerHandler(startTimer, function (timerId) {
795
776
  if (timerId) {
@@ -797,16 +778,16 @@
797
778
  timerId.refresh();
798
779
  return timerId;
799
780
  }
800
- fnApply(clearFn, self, [timerId]);
781
+ fnApply(clearFn, UNDEF_VALUE, [timerId]);
801
782
  }
802
- return fnApply(setFn, self, theArgs);
783
+ return fnApply(setFn, UNDEF_VALUE, theArgs);
803
784
  }, function (timerId) {
804
- fnApply(clearFn, self, [timerId]);
785
+ fnApply(clearFn, UNDEF_VALUE, [timerId]);
805
786
  });
806
787
  return handler.h;
807
788
  }
808
789
  function scheduleTimeout(callback, timeout) {
809
- return _createTimeoutWith(this, true, UNDEF_VALUE, ArrProto[SLICE][CALL](arguments));
790
+ return _createTimeoutWith(true, UNDEF_VALUE, ArrSlice[CALL](arguments));
810
791
  }
811
792
 
812
793
  (getGlobal() || {})["Symbol"];
@@ -1123,7 +1104,7 @@
1123
1104
  var _DYN_NAME = "name";
1124
1105
  var _DYN_TIME = "time";
1125
1106
  var _DYN_PROCESS_NEXT = "processNext";
1126
- var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
1107
+ var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
1127
1108
  var _DYN_ENABLED = "enabled";
1128
1109
  var _DYN_UNLOAD = "unload";
1129
1110
  var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
@@ -1170,262 +1151,11 @@
1170
1151
  var STR_DISABLED = "disabled";
1171
1152
  var STR_EXTENSION_CONFIG = "extensionConfig";
1172
1153
  var STR_PROCESS_TELEMETRY = "processTelemetry";
1173
- var STR_PRIORITY = "priority";
1174
- var STR_GET_PERF_MGR = "getPerfMgr";
1175
- var STR_DOMAIN = "domain";
1176
- var STR_PATH = "path";
1177
- var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
1178
-
1179
- var _aiNamespace = null;
1180
- function _getExtensionNamespace() {
1181
- var target = getInst("Microsoft");
1182
- if (target) {
1183
- _aiNamespace = target["ApplicationInsights"];
1184
- }
1185
- return _aiNamespace;
1186
- }
1187
- function getDebugExt(config) {
1188
- var ns = _aiNamespace;
1189
- if (!ns && config.disableDbgExt !== true) {
1190
- ns = _aiNamespace || _getExtensionNamespace();
1191
- }
1192
- return ns ? ns["ChromeDbgExt"] : null;
1193
- }
1194
-
1195
- var strLocation = "location";
1196
- var strConsole = "console";
1197
- var strJSON = "JSON";
1198
- var strCrypto = "crypto";
1199
- var strMsCrypto = "msCrypto";
1200
- var strMsie = "msie";
1201
- var strTrident = "trident/";
1202
- var _isTrident = null;
1203
- var _navUserAgentCheck = null;
1204
- var _enableMocks = false;
1205
- function getLocation(checkForMock) {
1206
- if (checkForMock && _enableMocks) {
1207
- var mockLocation = getInst("__mockLocation");
1208
- if (mockLocation) {
1209
- return mockLocation;
1210
- }
1211
- }
1212
- if (typeof location === strShimObject && location) {
1213
- return location;
1214
- }
1215
- return getInst(strLocation);
1216
- }
1217
- function getConsole() {
1218
- if (typeof console !== strShimUndefined) {
1219
- return console;
1220
- }
1221
- return getInst(strConsole);
1222
- }
1223
- function hasJSON() {
1224
- return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
1225
- }
1226
- function getJSON() {
1227
- if (hasJSON()) {
1228
- return JSON || getInst(strJSON);
1229
- }
1230
- return null;
1231
- }
1232
- function getCrypto() {
1233
- return getInst(strCrypto);
1234
- }
1235
- function getMsCrypto() {
1236
- return getInst(strMsCrypto);
1237
- }
1238
- function isIE() {
1239
- var nav = getNavigator();
1240
- if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
1241
- _navUserAgentCheck = nav[_DYN_USER_AGENT ];
1242
- var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE ]();
1243
- _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
1244
- }
1245
- return _isTrident;
1246
- }
1247
-
1248
- var _a$2;
1249
- var STR_WARN_TO_CONSOLE = "warnToConsole";
1250
- var AiNonUserActionablePrefix = "AI (Internal): ";
1251
- var AiUserActionablePrefix = "AI: ";
1252
- var AIInternalMessagePrefix = "AITR_";
1253
- var defaultValues$1 = {
1254
- loggingLevelConsole: 0,
1255
- loggingLevelTelemetry: 1,
1256
- maxMessageLimit: 25,
1257
- enableDebug: false
1258
- };
1259
- var _logFuncs = (_a$2 = {},
1260
- _a$2[0 ] = null,
1261
- _a$2[1 ] = "errorToConsole",
1262
- _a$2[2 ] = STR_WARN_TO_CONSOLE,
1263
- _a$2[3 ] = "debugToConsole",
1264
- _a$2);
1265
- function _sanitizeDiagnosticText(text) {
1266
- if (text) {
1267
- return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY) + "\"";
1268
- }
1269
- return STR_EMPTY;
1270
- }
1271
- function _logToConsole(func, message) {
1272
- var theConsole = getConsole();
1273
- if (!!theConsole) {
1274
- var logFunc = "log";
1275
- if (theConsole[func]) {
1276
- logFunc = func;
1277
- }
1278
- if (isFunction(theConsole[logFunc])) {
1279
- theConsole[logFunc](message);
1280
- }
1281
- }
1282
- }
1283
- var _InternalLogMessage = /** @class */ (function () {
1284
- function _InternalLogMessage(msgId, msg, isUserAct, properties) {
1285
- if (isUserAct === void 0) { isUserAct = false; }
1286
- var _self = this;
1287
- _self[_DYN_MESSAGE_ID ] = msgId;
1288
- _self[_DYN_MESSAGE ] =
1289
- (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
1290
- msgId;
1291
- var strProps = STR_EMPTY;
1292
- if (hasJSON()) {
1293
- strProps = getJSON().stringify(properties);
1294
- }
1295
- var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY) +
1296
- (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY);
1297
- _self[_DYN_MESSAGE ] += diagnosticText;
1298
- }
1299
- _InternalLogMessage.dataType = "MessageData";
1300
- return _InternalLogMessage;
1301
- }());
1302
- function safeGetLogger(core, config) {
1303
- return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
1304
- }
1305
- var DiagnosticLogger = /** @class */ (function () {
1306
- function DiagnosticLogger(config) {
1307
- this.identifier = "DiagnosticLogger";
1308
- this.queue = [];
1309
- var _messageCount = 0;
1310
- var _messageLogged = {};
1311
- var _loggingLevelConsole;
1312
- var _loggingLevelTelemetry;
1313
- var _maxInternalMessageLimit;
1314
- var _enableDebug;
1315
- var _unloadHandler;
1316
- dynamicProto(DiagnosticLogger, this, function (_self) {
1317
- _unloadHandler = _setDefaultsFromConfig(config || {});
1318
- _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
1319
- _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
1320
- if (isUserAct === void 0) { isUserAct = false; }
1321
- var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
1322
- if (_enableDebug) {
1323
- throw dumpObj(message);
1324
- }
1325
- else {
1326
- var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
1327
- if (!isUndefined(message[_DYN_MESSAGE ])) {
1328
- if (isUserAct) {
1329
- var messageKey = +message[_DYN_MESSAGE_ID ];
1330
- if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
1331
- _self[logFunc](message[_DYN_MESSAGE ]);
1332
- _messageLogged[messageKey] = true;
1333
- }
1334
- }
1335
- else {
1336
- if (_loggingLevelConsole >= severity) {
1337
- _self[logFunc](message[_DYN_MESSAGE ]);
1338
- }
1339
- }
1340
- _logInternalMessage(severity, message);
1341
- }
1342
- else {
1343
- _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
1344
- }
1345
- }
1346
- };
1347
- _self.debugToConsole = function (message) {
1348
- _logToConsole("debug", message);
1349
- _debugExtMsg("warning", message);
1350
- };
1351
- _self[_DYN_WARN_TO_CONSOLE ] = function (message) {
1352
- _logToConsole("warn", message);
1353
- _debugExtMsg("warning", message);
1354
- };
1355
- _self.errorToConsole = function (message) {
1356
- _logToConsole("error", message);
1357
- _debugExtMsg("error", message);
1358
- };
1359
- _self.resetInternalMessageCount = function () {
1360
- _messageCount = 0;
1361
- _messageLogged = {};
1362
- };
1363
- _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
1364
- _self[_DYN_UNLOAD ] = function (isAsync) {
1365
- _unloadHandler && _unloadHandler.rm();
1366
- _unloadHandler = null;
1367
- };
1368
- function _logInternalMessage(severity, message) {
1369
- if (_areInternalMessagesThrottled()) {
1370
- return;
1371
- }
1372
- var logMessage = true;
1373
- var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
1374
- if (_messageLogged[messageKey]) {
1375
- logMessage = false;
1376
- }
1377
- else {
1378
- _messageLogged[messageKey] = true;
1379
- }
1380
- if (logMessage) {
1381
- if (severity <= _loggingLevelTelemetry) {
1382
- _self.queue[_DYN_PUSH ](message);
1383
- _messageCount++;
1384
- _debugExtMsg((severity === 1 ? "error" : "warn"), message);
1385
- }
1386
- if (_messageCount === _maxInternalMessageLimit) {
1387
- var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
1388
- var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
1389
- _self.queue[_DYN_PUSH ](throttleMessage);
1390
- if (severity === 1 ) {
1391
- _self.errorToConsole(throttleLimitMessage);
1392
- }
1393
- else {
1394
- _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
1395
- }
1396
- }
1397
- }
1398
- }
1399
- function _setDefaultsFromConfig(config) {
1400
- return onConfigChange(createDynamicConfig(config, defaultValues$1, _self).cfg, function (details) {
1401
- var config = details.cfg;
1402
- _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
1403
- _loggingLevelTelemetry = config.loggingLevelTelemetry;
1404
- _maxInternalMessageLimit = config.maxMessageLimit;
1405
- _enableDebug = config.enableDebug;
1406
- });
1407
- }
1408
- function _areInternalMessagesThrottled() {
1409
- return _messageCount >= _maxInternalMessageLimit;
1410
- }
1411
- function _debugExtMsg(name, data) {
1412
- var dbgExt = getDebugExt(config || {});
1413
- if (dbgExt && dbgExt[_DYN_DIAG_LOG ]) {
1414
- dbgExt[_DYN_DIAG_LOG ](name, data);
1415
- }
1416
- }
1417
- });
1418
- }
1419
- DiagnosticLogger.__ieDyn=1;
1420
- return DiagnosticLogger;
1421
- }());
1422
- function _getLogger(logger) {
1423
- return (logger || new DiagnosticLogger());
1424
- }
1425
- function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
1426
- if (isUserAct === void 0) { isUserAct = false; }
1427
- _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
1428
- }
1154
+ var STR_PRIORITY = "priority";
1155
+ var STR_GET_PERF_MGR = "getPerfMgr";
1156
+ var STR_DOMAIN = "domain";
1157
+ var STR_PATH = "path";
1158
+ var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
1429
1159
 
1430
1160
  var rCamelCase = /-([a-z])/g;
1431
1161
  var rNormalizeInvalid = /([^\w\d_$])/g;
@@ -1506,6 +1236,59 @@
1506
1236
  return target;
1507
1237
  }
1508
1238
 
1239
+ var strLocation = "location";
1240
+ var strConsole = "console";
1241
+ var strJSON = "JSON";
1242
+ var strCrypto = "crypto";
1243
+ var strMsCrypto = "msCrypto";
1244
+ var strMsie = "msie";
1245
+ var strTrident = "trident/";
1246
+ var _isTrident = null;
1247
+ var _navUserAgentCheck = null;
1248
+ var _enableMocks = false;
1249
+ function getLocation(checkForMock) {
1250
+ if (checkForMock && _enableMocks) {
1251
+ var mockLocation = getInst("__mockLocation");
1252
+ if (mockLocation) {
1253
+ return mockLocation;
1254
+ }
1255
+ }
1256
+ if (typeof location === strShimObject && location) {
1257
+ return location;
1258
+ }
1259
+ return getInst(strLocation);
1260
+ }
1261
+ function getConsole() {
1262
+ if (typeof console !== strShimUndefined) {
1263
+ return console;
1264
+ }
1265
+ return getInst(strConsole);
1266
+ }
1267
+ function hasJSON() {
1268
+ return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
1269
+ }
1270
+ function getJSON() {
1271
+ if (hasJSON()) {
1272
+ return JSON || getInst(strJSON);
1273
+ }
1274
+ return null;
1275
+ }
1276
+ function getCrypto() {
1277
+ return getInst(strCrypto);
1278
+ }
1279
+ function getMsCrypto() {
1280
+ return getInst(strMsCrypto);
1281
+ }
1282
+ function isIE() {
1283
+ var nav = getNavigator();
1284
+ if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
1285
+ _navUserAgentCheck = nav[_DYN_USER_AGENT ];
1286
+ var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE ]();
1287
+ _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
1288
+ }
1289
+ return _isTrident;
1290
+ }
1291
+
1509
1292
  var UInt32Mask = 0x100000000;
1510
1293
  var MaxUInt32 = 0xffffffff;
1511
1294
  var SEED1 = 123456789;
@@ -2135,6 +1918,7 @@
2135
1918
  configHandler = null;
2136
1919
  }
2137
1920
  };
1921
+ objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ? "" : "[X]"); } });
2138
1922
  state.use(handler, configHandler);
2139
1923
  return handler;
2140
1924
  }
@@ -2252,6 +2036,204 @@
2252
2036
  };
2253
2037
  }
2254
2038
 
2039
+ var _aiNamespace = null;
2040
+ function _getExtensionNamespace() {
2041
+ var target = getInst("Microsoft");
2042
+ if (target) {
2043
+ _aiNamespace = target["ApplicationInsights"];
2044
+ }
2045
+ return _aiNamespace;
2046
+ }
2047
+ function getDebugExt(config) {
2048
+ var ns = _aiNamespace;
2049
+ if (!ns && config.disableDbgExt !== true) {
2050
+ ns = _aiNamespace || _getExtensionNamespace();
2051
+ }
2052
+ return ns ? ns["ChromeDbgExt"] : null;
2053
+ }
2054
+
2055
+ var _a$2;
2056
+ var STR_WARN_TO_CONSOLE = "warnToConsole";
2057
+ var AiNonUserActionablePrefix = "AI (Internal): ";
2058
+ var AiUserActionablePrefix = "AI: ";
2059
+ var AIInternalMessagePrefix = "AITR_";
2060
+ var defaultValues$1 = {
2061
+ loggingLevelConsole: 0,
2062
+ loggingLevelTelemetry: 1,
2063
+ maxMessageLimit: 25,
2064
+ enableDebug: false
2065
+ };
2066
+ var _logFuncs = (_a$2 = {},
2067
+ _a$2[0 ] = null,
2068
+ _a$2[1 ] = "errorToConsole",
2069
+ _a$2[2 ] = STR_WARN_TO_CONSOLE,
2070
+ _a$2[3 ] = "debugToConsole",
2071
+ _a$2);
2072
+ function _sanitizeDiagnosticText(text) {
2073
+ if (text) {
2074
+ return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY) + "\"";
2075
+ }
2076
+ return STR_EMPTY;
2077
+ }
2078
+ function _logToConsole(func, message) {
2079
+ var theConsole = getConsole();
2080
+ if (!!theConsole) {
2081
+ var logFunc = "log";
2082
+ if (theConsole[func]) {
2083
+ logFunc = func;
2084
+ }
2085
+ if (isFunction(theConsole[logFunc])) {
2086
+ theConsole[logFunc](message);
2087
+ }
2088
+ }
2089
+ }
2090
+ var _InternalLogMessage = /** @class */ (function () {
2091
+ function _InternalLogMessage(msgId, msg, isUserAct, properties) {
2092
+ if (isUserAct === void 0) { isUserAct = false; }
2093
+ var _self = this;
2094
+ _self[_DYN_MESSAGE_ID ] = msgId;
2095
+ _self[_DYN_MESSAGE ] =
2096
+ (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
2097
+ msgId;
2098
+ var strProps = STR_EMPTY;
2099
+ if (hasJSON()) {
2100
+ strProps = getJSON().stringify(properties);
2101
+ }
2102
+ var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY) +
2103
+ (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY);
2104
+ _self[_DYN_MESSAGE ] += diagnosticText;
2105
+ }
2106
+ _InternalLogMessage.dataType = "MessageData";
2107
+ return _InternalLogMessage;
2108
+ }());
2109
+ function safeGetLogger(core, config) {
2110
+ return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
2111
+ }
2112
+ var DiagnosticLogger = /** @class */ (function () {
2113
+ function DiagnosticLogger(config) {
2114
+ this.identifier = "DiagnosticLogger";
2115
+ this.queue = [];
2116
+ var _messageCount = 0;
2117
+ var _messageLogged = {};
2118
+ var _loggingLevelConsole;
2119
+ var _loggingLevelTelemetry;
2120
+ var _maxInternalMessageLimit;
2121
+ var _enableDebug;
2122
+ var _unloadHandler;
2123
+ dynamicProto(DiagnosticLogger, this, function (_self) {
2124
+ _unloadHandler = _setDefaultsFromConfig(config || {});
2125
+ _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
2126
+ _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
2127
+ if (isUserAct === void 0) { isUserAct = false; }
2128
+ var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
2129
+ if (_enableDebug) {
2130
+ throw dumpObj(message);
2131
+ }
2132
+ else {
2133
+ var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
2134
+ if (!isUndefined(message[_DYN_MESSAGE ])) {
2135
+ if (isUserAct) {
2136
+ var messageKey = +message[_DYN_MESSAGE_ID ];
2137
+ if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
2138
+ _self[logFunc](message[_DYN_MESSAGE ]);
2139
+ _messageLogged[messageKey] = true;
2140
+ }
2141
+ }
2142
+ else {
2143
+ if (_loggingLevelConsole >= severity) {
2144
+ _self[logFunc](message[_DYN_MESSAGE ]);
2145
+ }
2146
+ }
2147
+ _logInternalMessage(severity, message);
2148
+ }
2149
+ else {
2150
+ _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
2151
+ }
2152
+ }
2153
+ };
2154
+ _self.debugToConsole = function (message) {
2155
+ _logToConsole("debug", message);
2156
+ _debugExtMsg("warning", message);
2157
+ };
2158
+ _self[_DYN_WARN_TO_CONSOLE ] = function (message) {
2159
+ _logToConsole("warn", message);
2160
+ _debugExtMsg("warning", message);
2161
+ };
2162
+ _self.errorToConsole = function (message) {
2163
+ _logToConsole("error", message);
2164
+ _debugExtMsg("error", message);
2165
+ };
2166
+ _self.resetInternalMessageCount = function () {
2167
+ _messageCount = 0;
2168
+ _messageLogged = {};
2169
+ };
2170
+ _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
2171
+ _self[_DYN_UNLOAD ] = function (isAsync) {
2172
+ _unloadHandler && _unloadHandler.rm();
2173
+ _unloadHandler = null;
2174
+ };
2175
+ function _logInternalMessage(severity, message) {
2176
+ if (_areInternalMessagesThrottled()) {
2177
+ return;
2178
+ }
2179
+ var logMessage = true;
2180
+ var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
2181
+ if (_messageLogged[messageKey]) {
2182
+ logMessage = false;
2183
+ }
2184
+ else {
2185
+ _messageLogged[messageKey] = true;
2186
+ }
2187
+ if (logMessage) {
2188
+ if (severity <= _loggingLevelTelemetry) {
2189
+ _self.queue[_DYN_PUSH ](message);
2190
+ _messageCount++;
2191
+ _debugExtMsg((severity === 1 ? "error" : "warn"), message);
2192
+ }
2193
+ if (_messageCount === _maxInternalMessageLimit) {
2194
+ var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
2195
+ var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
2196
+ _self.queue[_DYN_PUSH ](throttleMessage);
2197
+ if (severity === 1 ) {
2198
+ _self.errorToConsole(throttleLimitMessage);
2199
+ }
2200
+ else {
2201
+ _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
2202
+ }
2203
+ }
2204
+ }
2205
+ }
2206
+ function _setDefaultsFromConfig(config) {
2207
+ return onConfigChange(createDynamicConfig(config, defaultValues$1, _self).cfg, function (details) {
2208
+ var config = details.cfg;
2209
+ _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
2210
+ _loggingLevelTelemetry = config.loggingLevelTelemetry;
2211
+ _maxInternalMessageLimit = config.maxMessageLimit;
2212
+ _enableDebug = config.enableDebug;
2213
+ });
2214
+ }
2215
+ function _areInternalMessagesThrottled() {
2216
+ return _messageCount >= _maxInternalMessageLimit;
2217
+ }
2218
+ function _debugExtMsg(name, data) {
2219
+ var dbgExt = getDebugExt(config || {});
2220
+ if (dbgExt && dbgExt[_DYN_DIAG_LOG ]) {
2221
+ dbgExt[_DYN_DIAG_LOG ](name, data);
2222
+ }
2223
+ }
2224
+ });
2225
+ }
2226
+ DiagnosticLogger.__ieDyn=1;
2227
+ return DiagnosticLogger;
2228
+ }());
2229
+ function _getLogger(logger) {
2230
+ return (logger || new DiagnosticLogger());
2231
+ }
2232
+ function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
2233
+ if (isUserAct === void 0) { isUserAct = false; }
2234
+ _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
2235
+ }
2236
+
2255
2237
  var _a$1, _b;
2256
2238
  var strToGMTString = "toGMTString";
2257
2239
  var strToUTCString = "toUTCString";
@@ -3193,7 +3175,7 @@
3193
3175
  function _setDefaults(config, core, pluginChain) {
3194
3176
  createDynamicConfig(config, defaultValues, safeGetLogger(core));
3195
3177
  if (!pluginChain && core) {
3196
- pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ]();
3178
+ pluginChain = core[_DYN_GET_PROCESS_TEL_CONT2 ]()[_DYN_GET_NEXT ]();
3197
3179
  }
3198
3180
  var nextPlugin = _nextPlugin;
3199
3181
  if (_nextPlugin && _nextPlugin[strGetPlugin]) {