@microsoft/1ds-core-js 3.2.12 → 4.0.1

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 (95) hide show
  1. package/README.md +1 -1
  2. package/bundle/es5/ms.core-4.0.1.gbl.js +6321 -0
  3. package/bundle/es5/ms.core-4.0.1.gbl.js.map +1 -0
  4. package/bundle/es5/ms.core-4.0.1.gbl.min.js +7 -0
  5. package/bundle/es5/ms.core-4.0.1.gbl.min.js.map +1 -0
  6. package/bundle/es5/ms.core-4.0.1.integrity.json +46 -0
  7. package/bundle/es5/ms.core-4.0.1.js +6325 -0
  8. package/bundle/es5/ms.core-4.0.1.js.map +1 -0
  9. package/bundle/es5/ms.core-4.0.1.min.js +7 -0
  10. package/bundle/es5/ms.core-4.0.1.min.js.map +1 -0
  11. package/bundle/es5/ms.core.gbl.js +6321 -0
  12. package/bundle/es5/ms.core.gbl.js.map +1 -0
  13. package/bundle/es5/ms.core.gbl.min.js +7 -0
  14. package/bundle/es5/ms.core.gbl.min.js.map +1 -0
  15. package/bundle/es5/ms.core.integrity.json +46 -0
  16. package/bundle/es5/ms.core.js +6325 -0
  17. package/bundle/es5/ms.core.js.map +1 -0
  18. package/bundle/es5/ms.core.min.js +7 -0
  19. package/bundle/es5/ms.core.min.js.map +1 -0
  20. package/{bundle → dist/es5}/ms.core.js +3945 -3022
  21. package/dist/es5/ms.core.js.map +1 -0
  22. package/dist/es5/ms.core.min.js +7 -0
  23. package/dist/es5/ms.core.min.js.map +1 -0
  24. package/dist-es5/AppInsightsCore.js +91 -0
  25. package/dist-es5/AppInsightsCore.js.map +1 -0
  26. package/{dist-esm/src → dist-es5}/BaseCore.js +18 -11
  27. package/dist-es5/BaseCore.js.map +1 -0
  28. package/{dist-esm/src → dist-es5}/DataModels.js +1 -1
  29. package/{dist-esm/src → dist-es5}/Enums.js +3 -26
  30. package/dist-es5/Enums.js.map +1 -0
  31. package/{dist-esm/src → dist-es5}/Index.js +9 -14
  32. package/dist-es5/Index.js.map +1 -0
  33. package/{dist-esm/src → dist-es5}/InternalConstants.js +1 -3
  34. package/{dist-esm/src → dist-es5}/InternalConstants.js.map +1 -1
  35. package/{dist-esm/src → dist-es5}/Utils.js +19 -144
  36. package/dist-es5/Utils.js.map +1 -0
  37. package/{dist-esm/src → dist-es5}/ValueSanitizer.js +42 -3
  38. package/dist-es5/ValueSanitizer.js.map +1 -0
  39. package/package.json +16 -9
  40. package/tsconfig.json +5 -3
  41. package/types/1ds-core-js.d.ts +1110 -0
  42. package/types/1ds-core-js.namespaced.d.ts +1106 -0
  43. package/bundle/ms.core-3.2.12.gbl.js +0 -5378
  44. package/bundle/ms.core-3.2.12.gbl.js.map +0 -1
  45. package/bundle/ms.core-3.2.12.gbl.min.js +0 -7
  46. package/bundle/ms.core-3.2.12.gbl.min.js.map +0 -1
  47. package/bundle/ms.core-3.2.12.integrity.json +0 -46
  48. package/bundle/ms.core-3.2.12.js +0 -5381
  49. package/bundle/ms.core-3.2.12.js.map +0 -1
  50. package/bundle/ms.core-3.2.12.min.js +0 -7
  51. package/bundle/ms.core-3.2.12.min.js.map +0 -1
  52. package/bundle/ms.core.gbl.js +0 -5378
  53. package/bundle/ms.core.gbl.js.map +0 -1
  54. package/bundle/ms.core.gbl.min.js +0 -7
  55. package/bundle/ms.core.gbl.min.js.map +0 -1
  56. package/bundle/ms.core.integrity.json +0 -46
  57. package/bundle/ms.core.js.map +0 -1
  58. package/bundle/ms.core.min.js +0 -7
  59. package/bundle/ms.core.min.js.map +0 -1
  60. package/dist/ms.core.js +0 -1305
  61. package/dist/ms.core.js.map +0 -1
  62. package/dist/ms.core.min.js +0 -7
  63. package/dist/ms.core.min.js.map +0 -1
  64. package/dist-esm/src/AppInsightsCore.d.ts +0 -15
  65. package/dist-esm/src/AppInsightsCore.js +0 -114
  66. package/dist-esm/src/AppInsightsCore.js.map +0 -1
  67. package/dist-esm/src/BaseCore.d.ts +0 -13
  68. package/dist-esm/src/BaseCore.js.map +0 -1
  69. package/dist-esm/src/DataModels.d.ts +0 -273
  70. package/dist-esm/src/ESPromise.d.ts +0 -110
  71. package/dist-esm/src/ESPromise.js +0 -286
  72. package/dist-esm/src/ESPromise.js.map +0 -1
  73. package/dist-esm/src/ESPromiseScheduler.d.ts +0 -36
  74. package/dist-esm/src/ESPromiseScheduler.js +0 -274
  75. package/dist-esm/src/ESPromiseScheduler.js.map +0 -1
  76. package/dist-esm/src/Enums.d.ts +0 -356
  77. package/dist-esm/src/Enums.js.map +0 -1
  78. package/dist-esm/src/Index.d.ts +0 -19
  79. package/dist-esm/src/Index.js.map +0 -1
  80. package/dist-esm/src/InternalConstants.d.ts +0 -6
  81. package/dist-esm/src/Utils.d.ts +0 -190
  82. package/dist-esm/src/Utils.js.map +0 -1
  83. package/dist-esm/src/ValueSanitizer.d.ts +0 -40
  84. package/dist-esm/src/ValueSanitizer.js.map +0 -1
  85. package/src/AppInsightsCore.ts +0 -135
  86. package/src/BaseCore.ts +0 -72
  87. package/src/DataModels.ts +0 -297
  88. package/src/ESPromise.ts +0 -365
  89. package/src/ESPromiseScheduler.ts +0 -328
  90. package/src/Enums.ts +0 -386
  91. package/src/Index.ts +0 -81
  92. package/src/InternalConstants.ts +0 -16
  93. package/src/Utils.ts +0 -565
  94. package/src/ValueSanitizer.ts +0 -285
  95. /package/{dist-esm/src → dist-es5}/DataModels.js.map +0 -0
@@ -0,0 +1,91 @@
1
+ /*
2
+ * 1DS JS SDK Core, 4.0.1
3
+ * Copyright (c) Microsoft and contributors. All rights reserved.
4
+ * (Microsoft Internal Only)
5
+ */
6
+ import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
7
+ /**
8
+ * AppInsightsCore.ts
9
+ * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)
10
+ * @copyright Microsoft 2018
11
+ */
12
+ import dynamicProto from "@microsoft/dynamicproto-js";
13
+ import { AppInsightsCore as InternalCore, _throwInternal, createDynamicConfig, doPerf, dumpObj, throwError } from "@microsoft/applicationinsights-core-js";
14
+ import { objDeepFreeze } from "@nevware21/ts-utils";
15
+ import { STR_DEFAULT_ENDPOINT_URL, STR_EMPTY, STR_VERSION } from "./InternalConstants";
16
+ import { FullVersionString, getTime, isLatency } from "./Utils";
17
+ /**
18
+ * The default settings for the config.
19
+ * WE MUST include all defaults here to ensure that the config is created with all of the properties
20
+ * defined as dynamic.
21
+ */
22
+ var defaultConfig = objDeepFreeze({
23
+ endpointUrl: STR_DEFAULT_ENDPOINT_URL,
24
+ propertyStorageOverride: { isVal: _chkPropOverride }
25
+ });
26
+ function _chkPropOverride(propertyStorageOverride) {
27
+ // Validate property storage override
28
+ if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {
29
+ throwError("Invalid property storage override passed.");
30
+ }
31
+ return true;
32
+ }
33
+ var AppInsightsCore = /** @class */ (function (_super) {
34
+ __extends(AppInsightsCore, _super);
35
+ function AppInsightsCore() {
36
+ var _this = _super.call(this) || this;
37
+ dynamicProto(AppInsightsCore, _this, function (_self, _base) {
38
+ _self.initialize = function (config, extensions, logger, notificationManager) {
39
+ doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () {
40
+ try {
41
+ _base.initialize(createDynamicConfig(config, defaultConfig, logger || _self.logger, false).cfg, extensions, logger, notificationManager);
42
+ }
43
+ catch (e) {
44
+ var logger_1 = _self.logger;
45
+ var message = dumpObj(e);
46
+ if (message.indexOf("channels") !== -1) {
47
+ // Add some additional context to the underlying reported error
48
+ message += "\n - Channels must be provided through config.channels only!";
49
+ }
50
+ _throwInternal(logger_1, 1 /* eLoggingSeverity.CRITICAL */, 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */, "SDK Initialization Failed - no telemetry will be sent: " + message);
51
+ }
52
+ }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });
53
+ };
54
+ _self.track = function (item) {
55
+ doPerf(_self, function () { return "AppInsightsCore.track"; }, function () {
56
+ var telemetryItem = item;
57
+ if (telemetryItem) {
58
+ telemetryItem.timings = telemetryItem.timings || {};
59
+ telemetryItem.timings.trackStart = getTime();
60
+ if (!isLatency(telemetryItem.latency)) {
61
+ telemetryItem.latency = 1 /* EventLatencyValue.Normal */;
62
+ }
63
+ var itemExt = telemetryItem.ext = telemetryItem.ext || {};
64
+ itemExt.sdk = itemExt.sdk || {};
65
+ itemExt.sdk.ver = FullVersionString;
66
+ var baseData = telemetryItem.baseData = telemetryItem.baseData || {};
67
+ baseData.properties = baseData.properties || {};
68
+ var itemProperties = baseData.properties;
69
+ itemProperties[STR_VERSION] = itemProperties[STR_VERSION] || _self.pluginVersionString || STR_EMPTY;
70
+ }
71
+ _base.track(telemetryItem);
72
+ }, function () { return ({ item: item }); }, !(item.sync));
73
+ };
74
+ _self.pollInternalLogs = function (eventName) {
75
+ return _base.pollInternalLogs(eventName || "InternalLog");
76
+ };
77
+ });
78
+ return _this;
79
+ }
80
+ // Removed Stub for AppInsightsCore.prototype.initialize.
81
+ // Removed Stub for AppInsightsCore.prototype.track.
82
+ // Removed Stub for AppInsightsCore.prototype.pollInternalLogs.
83
+ // This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
84
+ // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
85
+ // this will be removed when ES3 support is dropped.
86
+ AppInsightsCore.__ieDyn=1;
87
+
88
+ return AppInsightsCore;
89
+ }(InternalCore));
90
+ export { AppInsightsCore };
91
+ //# sourceMappingURL=AppInsightsCore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppInsightsCore.js.map","sources":["AppInsightsCore.js"],"sourcesContent":["import { __extends } from \"tslib\";\r\n/**\r\n* AppInsightsCore.ts\r\n* @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { AppInsightsCore as InternalCore, _throwInternal, createDynamicConfig, doPerf, dumpObj, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDeepFreeze } from \"@nevware21/ts-utils\";\r\nimport { STR_DEFAULT_ENDPOINT_URL, STR_EMPTY, STR_VERSION } from \"./InternalConstants\";\r\nimport { FullVersionString, getTime, isLatency } from \"./Utils\";\r\n/**\r\n * The default settings for the config.\r\n * WE MUST include all defaults here to ensure that the config is created with all of the properties\r\n * defined as dynamic.\r\n */\r\nvar defaultConfig = objDeepFreeze({\r\n endpointUrl: STR_DEFAULT_ENDPOINT_URL,\r\n propertyStorageOverride: { isVal: _chkPropOverride }\r\n});\r\nfunction _chkPropOverride(propertyStorageOverride) {\r\n // Validate property storage override\r\n if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {\r\n throwError(\"Invalid property storage override passed.\");\r\n }\r\n return true;\r\n}\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n __extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n var _this = _super.call(this) || this;\r\n dynamicProto(AppInsightsCore, _this, function (_self, _base) {\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n doPerf(_self, function () { return \"AppInsightsCore.initialize\"; }, function () {\r\n try {\r\n _base.initialize(createDynamicConfig(config, defaultConfig, logger || _self.logger, false).cfg, extensions, logger, notificationManager);\r\n }\r\n catch (e) {\r\n var logger_1 = _self.logger;\r\n var message = dumpObj(e);\r\n if (message.indexOf(\"channels\") !== -1) {\r\n // Add some additional context to the underlying reported error\r\n message += \"\\n - Channels must be provided through config.channels only!\";\r\n }\r\n _throwInternal(logger_1, 1 /* eLoggingSeverity.CRITICAL */, 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */, \"SDK Initialization Failed - no telemetry will be sent: \" + message);\r\n }\r\n }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });\r\n };\r\n _self.track = function (item) {\r\n doPerf(_self, function () { return \"AppInsightsCore.track\"; }, function () {\r\n var telemetryItem = item;\r\n if (telemetryItem) {\r\n telemetryItem.timings = telemetryItem.timings || {};\r\n telemetryItem.timings.trackStart = getTime();\r\n if (!isLatency(telemetryItem.latency)) {\r\n telemetryItem.latency = 1 /* EventLatencyValue.Normal */;\r\n }\r\n var itemExt = telemetryItem.ext = telemetryItem.ext || {};\r\n itemExt.sdk = itemExt.sdk || {};\r\n itemExt.sdk.ver = FullVersionString;\r\n var baseData = telemetryItem.baseData = telemetryItem.baseData || {};\r\n baseData.properties = baseData.properties || {};\r\n var itemProperties = baseData.properties;\r\n itemProperties[STR_VERSION] = itemProperties[STR_VERSION] || _self.pluginVersionString || STR_EMPTY;\r\n }\r\n _base.track(telemetryItem);\r\n }, function () { return ({ item: item }); }, !(item.sync));\r\n };\r\n _self.pollInternalLogs = function (eventName) {\r\n return _base.pollInternalLogs(eventName || \"InternalLog\");\r\n };\r\n });\r\n return _this;\r\n }\r\n /**\r\n * Initialize the sdk.\r\n * @param config - The configuration to initialize the SDK.\r\n * @param extensions - An array of extensions that are to be used by the core.\r\n */\r\n AppInsightsCore.prototype.initialize = function (config, extensions, logger, notificationManager) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n AppInsightsCore.prototype.track = function (item) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Periodically check logger.queue for\r\n */\r\n AppInsightsCore.prototype.pollInternalLogs = function (eventName) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return AppInsightsCore;\r\n}(InternalCore));\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map"],"names":[],"mappings":";;;;;AAAA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;+DAiBM,CAAC;;;;;;2BACoB;AAC3B;AACA;AACA"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * 1DS JS SDK Core, 3.2.12
2
+ * 1DS JS SDK Core, 4.0.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -13,23 +13,26 @@ import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
13
13
  * @copyright Microsoft 2018
14
14
  */
15
15
  import dynamicProto from "@microsoft/dynamicproto-js";
16
- import { BaseCore as InternalCore, _throwInternal, dumpObj } from "@microsoft/applicationinsights-core-js";
16
+ import { AppInsightsCore as InternalCore, _throwInternal, createDynamicConfig, dumpObj } from "@microsoft/applicationinsights-core-js";
17
+ import { objDeepFreeze } from "@nevware21/ts-utils";
17
18
  import { STR_DEFAULT_ENDPOINT_URL } from "./InternalConstants";
18
- import { FullVersionString, isDocumentObjectAvailable } from "./Utils";
19
+ import { FullVersionString } from "./Utils";
20
+ /**
21
+ * The default settings for the config.
22
+ * WE MUST include all defaults here to ensure that the config is created with all of the properties
23
+ * defined as dynamic.
24
+ */
25
+ var defaultConfig = objDeepFreeze({
26
+ endpointUrl: STR_DEFAULT_ENDPOINT_URL
27
+ });
19
28
  var BaseCore = /** @class */ (function (_super) {
20
29
  __extends(BaseCore, _super);
21
30
  function BaseCore() {
22
31
  var _this = _super.call(this) || this;
23
32
  dynamicProto(BaseCore, _this, function (_self, _base) {
24
33
  _self.initialize = function (config, extensions, logger, notificationManager) {
25
- if (config && !config.endpointUrl) {
26
- config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
27
- }
28
- _self.getWParam = function () {
29
- return (isDocumentObjectAvailable || !!config.enableWParam) ? 0 : -1;
30
- };
31
34
  try {
32
- _base.initialize(config, extensions, logger, notificationManager);
35
+ _base.initialize(createDynamicConfig(config, defaultConfig, logger || _self.logger, false).cfg, extensions, logger, notificationManager);
33
36
  }
34
37
  catch (e) {
35
38
  _throwInternal(_self.logger, 1 /* eLoggingSeverity.CRITICAL */, 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */, "Initialization Failed: " + dumpObj(e) + "\n - Note: Channels must be provided through config.channels only");
@@ -44,11 +47,15 @@ var BaseCore = /** @class */ (function (_super) {
44
47
  }
45
48
  _base.track(telemetryItem);
46
49
  };
50
+ _self.pollInternalLogs = function (eventName) {
51
+ return _base.pollInternalLogs(eventName || "InternalLog");
52
+ };
47
53
  });
48
54
  return _this;
49
55
  }
50
56
  // Removed Stub for BaseCore.prototype.initialize.
51
57
  // Removed Stub for BaseCore.prototype.track.
58
+ // Removed Stub for BaseCore.prototype.pollInternalLogs.
52
59
  // This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
53
60
  // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
54
61
  // this will be removed when ES3 support is dropped.
@@ -56,5 +63,5 @@ var BaseCore = /** @class */ (function (_super) {
56
63
 
57
64
  return BaseCore;
58
65
  }(InternalCore));
59
- export default BaseCore;
66
+ export { BaseCore };
60
67
  //# sourceMappingURL=BaseCore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseCore.js.map","sources":["BaseCore.js"],"sourcesContent":["import { __extends } from \"tslib\";\r\n/**\r\n* BaseCore.ts\r\n* Base Core is a subset of 1DS Web SDK Core. The purpose of Base Core is to generate a smaller bundle size while providing essential features of Core. Features that are not included in Base Core are:\r\n* 1. Internal logging\r\n* 2. Sending notifications on telemetry sent/discarded\r\n* @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { AppInsightsCore as InternalCore, _throwInternal, createDynamicConfig, dumpObj } from \"@microsoft/applicationinsights-core-js\";\r\nimport { objDeepFreeze } from \"@nevware21/ts-utils\";\r\nimport { STR_DEFAULT_ENDPOINT_URL } from \"./InternalConstants\";\r\nimport { FullVersionString } from \"./Utils\";\r\n/**\r\n * The default settings for the config.\r\n * WE MUST include all defaults here to ensure that the config is created with all of the properties\r\n * defined as dynamic.\r\n */\r\nvar defaultConfig = objDeepFreeze({\r\n endpointUrl: STR_DEFAULT_ENDPOINT_URL\r\n});\r\nvar BaseCore = /** @class */ (function (_super) {\r\n __extends(BaseCore, _super);\r\n function BaseCore() {\r\n var _this = _super.call(this) || this;\r\n dynamicProto(BaseCore, _this, function (_self, _base) {\r\n _self.initialize = function (config, extensions, logger, notificationManager) {\r\n try {\r\n _base.initialize(createDynamicConfig(config, defaultConfig, logger || _self.logger, false).cfg, extensions, logger, notificationManager);\r\n }\r\n catch (e) {\r\n _throwInternal(_self.logger, 1 /* eLoggingSeverity.CRITICAL */, 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */, \"Initialization Failed: \" + dumpObj(e) + \"\\n - Note: Channels must be provided through config.channels only\");\r\n }\r\n };\r\n _self.track = function (item) {\r\n var telemetryItem = item;\r\n if (telemetryItem) {\r\n var ext = telemetryItem.ext = telemetryItem.ext || {};\r\n ext.sdk = ext.sdk || {};\r\n ext.sdk.ver = FullVersionString;\r\n }\r\n _base.track(telemetryItem);\r\n };\r\n _self.pollInternalLogs = function (eventName) {\r\n return _base.pollInternalLogs(eventName || \"InternalLog\");\r\n };\r\n });\r\n return _this;\r\n }\r\n /**\r\n * Initialize the sdk.\r\n * @param config - The configuration to initialize the SDK.\r\n * @param extensions - An array of extensions that are to be used by the core.\r\n */\r\n BaseCore.prototype.initialize = function (config, extensions, logger, notificationManager) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n BaseCore.prototype.track = function (item) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Periodically check logger.queue for\r\n */\r\n BaseCore.prototype.pollInternalLogs = function (eventName) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return BaseCore;\r\n}(InternalCore));\r\nexport { BaseCore };\r\n//# sourceMappingURL=BaseCore.js.map"],"names":[],"mappings":";;;;;AAAA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;wDAiBM,CAAC;;;;;;oBACa;AACpB;AACA;AACA"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * 1DS JS SDK Core, 3.2.12
2
+ * 1DS JS SDK Core, 4.0.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * 1DS JS SDK Core, 3.2.12
2
+ * 1DS JS SDK Core, 4.0.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -9,8 +9,7 @@
9
9
  * @copyright Microsoft 2018
10
10
  * File containing the enums as constants.
11
11
  */
12
- import { __assignFn as __assign } from "@microsoft/applicationinsights-shims";
13
- import { _InternalMessageId, createEnumStyle, objFreeze } from "@microsoft/applicationinsights-core-js";
12
+ import { createEnumStyle } from "@microsoft/applicationinsights-core-js";
14
13
  /**
15
14
  * The ValueKind contains a set of values that specify value kind of the property.
16
15
  * Either PII (Personal Identifiable Information) or customer content.
@@ -86,28 +85,6 @@ export var TraceLevel = createEnumStyle({
86
85
  NONE: 0 /* eTraceLevel.NONE */,
87
86
  ERROR: 1 /* eTraceLevel.ERROR */,
88
87
  WARNING: 2 /* eTraceLevel.WARNING */,
89
- INFORMATION: 3 /* eTraceLevel.INFORMATION */
88
+ INFORMATION: 3 /* eTraceLevel.INFORMATION */,
90
89
  });
91
- export var _ExtendedInternalMessageId = objFreeze(__assign(__assign({}, _InternalMessageId), createEnumStyle({
92
- AuthHandShakeError: 501 /* _eExtendedInternalMessageId.AuthHandShakeError */,
93
- AuthRedirectFail: 502 /* _eExtendedInternalMessageId.AuthRedirectFail */,
94
- BrowserCannotReadLocalStorage: 503 /* _eExtendedInternalMessageId.BrowserCannotReadLocalStorage */,
95
- BrowserCannotWriteLocalStorage: 504 /* _eExtendedInternalMessageId.BrowserCannotWriteLocalStorage */,
96
- BrowserDoesNotSupportLocalStorage: 505 /* _eExtendedInternalMessageId.BrowserDoesNotSupportLocalStorage */,
97
- CannotParseBiBlobValue: 506 /* _eExtendedInternalMessageId.CannotParseBiBlobValue */,
98
- CannotParseDataAttribute: 507 /* _eExtendedInternalMessageId.CannotParseDataAttribute */,
99
- CVPluginNotAvailable: 508 /* _eExtendedInternalMessageId.CVPluginNotAvailable */,
100
- DroppedEvent: 509 /* _eExtendedInternalMessageId.DroppedEvent */,
101
- ErrorParsingAISessionCookie: 510 /* _eExtendedInternalMessageId.ErrorParsingAISessionCookie */,
102
- ErrorProvidedChannels: 511 /* _eExtendedInternalMessageId.ErrorProvidedChannels */,
103
- FailedToGetCookies: 512 /* _eExtendedInternalMessageId.FailedToGetCookies */,
104
- FailedToInitializeCorrelationVector: 513 /* _eExtendedInternalMessageId.FailedToInitializeCorrelationVector */,
105
- FailedToInitializeSDK: 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */,
106
- InvalidContentBlob: 515 /* _eExtendedInternalMessageId.InvalidContentBlob */,
107
- InvalidCorrelationValue: 516 /* _eExtendedInternalMessageId.InvalidCorrelationValue */,
108
- SessionRenewalDateIsZero: 517 /* _eExtendedInternalMessageId.SessionRenewalDateIsZero */,
109
- SendPostOnCompleteFailure: 518 /* _eExtendedInternalMessageId.SendPostOnCompleteFailure */,
110
- PostResponseHandler: 519 /* _eExtendedInternalMessageId.PostResponseHandler */,
111
- SDKNotInitialized: 520 /* _eExtendedInternalMessageId.SDKNotInitialized */
112
- })));
113
90
  //# sourceMappingURL=Enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Enums.js.map","sources":["Enums.js"],"sourcesContent":["/**\r\n* Enums.ts\r\n* @author Abhilash Panwar (abpanwar)\r\n* @copyright Microsoft 2018\r\n* File containing the enums as constants.\r\n*/\r\nimport { createEnumStyle } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * The ValueKind contains a set of values that specify value kind of the property.\r\n * Either PII (Personal Identifiable Information) or customer content.\r\n */\r\nexport var ValueKind = createEnumStyle({\r\n NotSet: 0 /* eValueKind.NotSet */,\r\n Pii_DistinguishedName: 1 /* eValueKind.Pii_DistinguishedName */,\r\n Pii_GenericData: 2 /* eValueKind.Pii_GenericData */,\r\n Pii_IPV4Address: 3 /* eValueKind.Pii_IPV4Address */,\r\n Pii_IPv6Address: 4 /* eValueKind.Pii_IPv6Address */,\r\n Pii_MailSubject: 5 /* eValueKind.Pii_MailSubject */,\r\n Pii_PhoneNumber: 6 /* eValueKind.Pii_PhoneNumber */,\r\n Pii_QueryString: 7 /* eValueKind.Pii_QueryString */,\r\n Pii_SipAddress: 8 /* eValueKind.Pii_SipAddress */,\r\n Pii_SmtpAddress: 9 /* eValueKind.Pii_SmtpAddress */,\r\n Pii_Identity: 10 /* eValueKind.Pii_Identity */,\r\n Pii_Uri: 11 /* eValueKind.Pii_Uri */,\r\n Pii_Fqdn: 12 /* eValueKind.Pii_Fqdn */,\r\n Pii_IPV4AddressLegacy: 13 /* eValueKind.Pii_IPV4AddressLegacy */,\r\n CustomerContent_GenericContent: 32 /* eValueKind.CustomerContent_GenericContent */\r\n});\r\n/**\r\n * The EventLatency contains a set of values that specify the latency with which an event is sent.\r\n */\r\nexport var EventLatency = createEnumStyle({\r\n /**\r\n * Normal latency.\r\n */\r\n Normal: 1 /* EventLatencyValue.Normal */,\r\n /**\r\n * Cost deferred latency. At the moment this latency is treated as Normal latency.\r\n */\r\n CostDeferred: 2 /* EventLatencyValue.CostDeferred */,\r\n /**\r\n * Real time latency.\r\n */\r\n RealTime: 3 /* EventLatencyValue.RealTime */,\r\n /**\r\n * Bypass normal batching/timing and send as soon as possible, this will still send asynchronously.\r\n * Added in v3.1.1\r\n */\r\n Immediate: 4 /* EventLatencyValue.Immediate */\r\n});\r\n/**\r\n * Enum for property types.\r\n */\r\nexport var EventPropertyType = createEnumStyle({\r\n Unspecified: 0 /* eEventPropertyType.Unspecified */,\r\n String: 1 /* eEventPropertyType.String */,\r\n Int32: 2 /* eEventPropertyType.Int32 */,\r\n UInt32: 3 /* eEventPropertyType.UInt32 */,\r\n Int64: 4 /* eEventPropertyType.Int64 */,\r\n UInt64: 5 /* eEventPropertyType.UInt64 */,\r\n Double: 6 /* eEventPropertyType.Double */,\r\n Bool: 7 /* eEventPropertyType.Bool */,\r\n Guid: 8 /* eEventPropertyType.Guid */,\r\n DateTime: 9 /* eEventPropertyType.DateTime */\r\n});\r\n/**\r\n * The EventPersistence contains a set of values that specify the event's persistence.\r\n */\r\nexport var EventPersistence = createEnumStyle({\r\n /**\r\n * Normal persistence.\r\n */\r\n Normal: 1 /* EventPersistenceValue.Normal */,\r\n /**\r\n * Critical persistence.\r\n */\r\n Critical: 2 /* EventPersistenceValue.Critical */\r\n});\r\nexport var TraceLevel = createEnumStyle({\r\n NONE: 0 /* eTraceLevel.NONE */,\r\n ERROR: 1 /* eTraceLevel.ERROR */,\r\n WARNING: 2 /* eTraceLevel.WARNING */,\r\n INFORMATION: 3 /* eTraceLevel.INFORMATION */,\r\n});\r\n//# sourceMappingURL=Enums.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * 1DS JS SDK Core, 3.2.12
2
+ * 1DS JS SDK Core, 4.0.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -9,24 +9,19 @@
9
9
  * @copyright Microsoft 2018
10
10
  * File to export public classes, interfaces and enums.
11
11
  */
12
- import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId } from "./Enums";
13
- import AppInsightsCore from "./AppInsightsCore";
14
- import BaseCore from "./BaseCore";
15
- import ESPromise from "./ESPromise";
16
- import ESPromiseScheduler from "./ESPromiseScheduler";
12
+ import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType } from "./Enums";
13
+ import { AppInsightsCore } from "./AppInsightsCore";
17
14
  import { ValueSanitizer } from "./ValueSanitizer";
18
- export { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer };
19
- export { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId, createEnumStyle, _throwInternal, _warnToConsole, _logInternalMessage,
15
+ export { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, EventPropertyType, ValueSanitizer };
16
+ export { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, AppInsightsCore as InternalAppInsightsCore, _InternalLogMessage, createEnumStyle, _throwInternal, _warnToConsole, _logInternalMessage,
20
17
  // The HelperFuncs functions
21
- isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal,
18
+ isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal,
22
19
  // EnvUtils
23
20
  getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined,
24
21
  // Random
25
22
  randomValue, random32, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr,
26
23
  // Aliases
27
- toISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, __getRegisteredEvents, createProcessTelemetryContext, createUnloadHandlerContainer, createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent } from "@microsoft/applicationinsights-core-js";
28
- export { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version for tree-shaking
29
- Utils, // Replacement for import * as Utils from "./Utils";
30
- isChromium, // Replace with ai-core version once published in ai-core
31
- openXhr } from "./Utils";
24
+ toISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, __getRegisteredEvents, createProcessTelemetryContext, createUnloadHandlerContainer, createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent, createDynamicConfig, onConfigChange, getDynamicConfigHandler, blockDynamicConversion, forceDynamicConversion } from "@microsoft/applicationinsights-core-js";
25
+ export { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, isChromium, // Replace with ai-core version once published in ai-core
26
+ openXhr, isGreaterThanZero } from "./Utils";
32
27
  //# sourceMappingURL=Index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Index.js.map","sources":["Index.js"],"sourcesContent":["/**\r\n * Index.ts\r\n * @author Abhilash Panwar (abpanwar)\r\n * @copyright Microsoft 2018\r\n * File to export public classes, interfaces and enums.\r\n */\r\nimport { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType } from \"./Enums\";\r\nimport { AppInsightsCore } from \"./AppInsightsCore\";\r\nimport { ValueSanitizer } from \"./ValueSanitizer\";\r\nexport { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, EventPropertyType, ValueSanitizer };\r\nexport { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, AppInsightsCore as InternalAppInsightsCore, _InternalLogMessage, createEnumStyle, _throwInternal, _warnToConsole, _logInternalMessage, \r\n// The HelperFuncs functions\r\nisTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal, \r\n// EnvUtils\r\ngetGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined, \r\n// Random\r\nrandomValue, random32, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr, \r\n// Aliases\r\ntoISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, __getRegisteredEvents, createProcessTelemetryContext, createUnloadHandlerContainer, createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent, createDynamicConfig, onConfigChange, getDynamicConfigHandler, blockDynamicConversion, forceDynamicConversion } from \"@microsoft/applicationinsights-core-js\";\r\nexport { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, isChromium, // Replace with ai-core version once published in ai-core\r\nopenXhr, isGreaterThanZero } from \"./Utils\";\r\n//# sourceMappingURL=Index.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * 1DS JS SDK Core, 3.2.12
2
+ * 1DS JS SDK Core, 4.0.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -12,8 +12,6 @@
12
12
  // as when using "short" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.
13
13
  export var STR_EMPTY = "";
14
14
  export var STR_DEFAULT_ENDPOINT_URL = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
15
- export var STR_PLUGIN_VERSION_STRING = "pluginVersionString";
16
- export var STR_PLUGIN_VERSION_STRING_ARR = STR_PLUGIN_VERSION_STRING + "Arr";
17
15
  export var STR_VERSION = "version";
18
16
  export var STR_PROPERTIES = "properties";
19
17
  //# sourceMappingURL=InternalConstants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalConstants.js.map","sources":["InternalConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)\r\n// as when using \"short\" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.\r\nexport var STR_EMPTY = \"\";\r\nexport var STR_DEFAULT_ENDPOINT_URL = \"https://browser.events.data.microsoft.com/OneCollector/1.0/\";\r\nexport var STR_PLUGIN_VERSION_STRING = \"pluginVersionString\";\r\nexport var STR_PLUGIN_VERSION_STRING_ARR = STR_PLUGIN_VERSION_STRING + \"Arr\";\r\nexport var STR_VERSION = \"version\";\r\nexport var STR_PROPERTIES = \"properties\";\r\n//# sourceMappingURL=InternalConstants.js.map"],"names":[],"mappings":";;;;;AAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"InternalConstants.js.map","sources":["InternalConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)\r\n// as when using \"short\" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.\r\nexport var STR_EMPTY = \"\";\r\nexport var STR_DEFAULT_ENDPOINT_URL = \"https://browser.events.data.microsoft.com/OneCollector/1.0/\";\r\nexport var STR_VERSION = \"version\";\r\nexport var STR_PROPERTIES = \"properties\";\r\n//# sourceMappingURL=InternalConstants.js.map"],"names":[],"mappings":";;;;;AAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * 1DS JS SDK Core, 3.2.12
2
+ * 1DS JS SDK Core, 4.0.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -10,11 +10,13 @@ var _a;
10
10
  * @copyright Microsoft 2018
11
11
  * File containing utility functions.
12
12
  */
13
- import { addEventHandler, addPageUnloadEventListener, areCookiesSupported, arrForEach, arrIndexOf, arrMap, arrReduce, dateNow, generateW3CId, getDocument, getGlobalInst, getNavigator, getWindow, hasOwnProperty, isArray, isBeaconsSupported, isBoolean, isDate, isError, isFunction, isIE, isNullOrUndefined, isNumber, isObject, isReactNative, isString, isTypeof, isUndefined, mwcRandom32, mwcRandomSeed, newGuid, newId, objDefineAccessors, objForEachKey, objKeys, perfNow, random32, randomValue, safeGetCookieMgr, strEndsWith, strObject, strTrim, strUndefined, toISOString, uaDisallowsSameSiteNone, useXDomainRequest } from "@microsoft/applicationinsights-core-js";
14
- import { ObjHasOwnProperty, objCreateFn, strShimObject, strShimPrototype } from "@microsoft/applicationinsights-shims";
13
+ import { arrForEach, getGlobalInst, getNavigator, hasDocument, hasWindow, isArray, isBoolean, isNullOrUndefined, isNumber, isObject, isReactNative, isString, isUndefined, newGuid, objForEachKey, perfNow } from "@microsoft/applicationinsights-core-js";
14
+ import { ObjProto, strShimObject } from "@microsoft/applicationinsights-shims";
15
+ import { strIndexOf, strLeft } from "@nevware21/ts-utils";
15
16
  import { STR_EMPTY } from "./InternalConstants";
16
- export var Version = '3.2.12';
17
+ export var Version = '4.0.1';
17
18
  export var FullVersionString = "1DS-Web-JS-" + Version;
19
+ var ObjHasOwnProperty = ObjProto.hasOwnProperty;
18
20
  // Defining here so we don't need to take (import) the ApplicationInsights Common module
19
21
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
20
22
  var strWithCredentials = "withCredentials";
@@ -38,11 +40,11 @@ var uInt8ArraySupported = null;
38
40
  /**
39
41
  * Checks if document object is available
40
42
  */
41
- export var isDocumentObjectAvailable = Boolean(getDocument());
43
+ export var isDocumentObjectAvailable = hasDocument();
42
44
  /**
43
45
  * Checks if window object is available
44
46
  */
45
- export var isWindowObjectAvailable = Boolean(getWindow());
47
+ export var isWindowObjectAvailable = hasWindow();
46
48
  /**
47
49
  * Checks if value is assigned to the given param.
48
50
  * @param value - The token from which the tenant id is to be extracted.
@@ -61,9 +63,9 @@ export function isValueAssigned(value) {
61
63
  */
62
64
  export function getTenantId(apiKey) {
63
65
  if (apiKey) {
64
- var indexTenantId = apiKey.indexOf("-");
66
+ var indexTenantId = strIndexOf(apiKey, "-");
65
67
  if (indexTenantId > -1) {
66
- return apiKey.substring(0, indexTenantId);
68
+ return strLeft(apiKey, indexTenantId);
67
69
  }
68
70
  }
69
71
  return STR_EMPTY;
@@ -170,48 +172,6 @@ export function getCommonSchemaMetaData(value, kind, type) {
170
172
  }
171
173
  return encodedTypeValue;
172
174
  }
173
- /**
174
- * @deprecated - Use the core.getCookieMgr().disable()
175
- * Force the SDK not to store and read any data from cookies.
176
- * Overriding the applicationinsights-core version for tree-shaking
177
- */
178
- export function disableCookies() {
179
- safeGetCookieMgr(null).setEnabled(false);
180
- }
181
- /**
182
- * @deprecated - Use the oneDs.getCookieMgr().set()
183
- * Sets the value of a cookie.
184
- * @param name - Cookie name.
185
- * @param value - Cookie value.
186
- * @param days - Expiration days.
187
- */
188
- export function setCookie(name, value, days) {
189
- if (areCookiesSupported(null)) {
190
- safeGetCookieMgr(null).set(name, value, days * 86400, null, "/");
191
- }
192
- }
193
- /**
194
- * @deprecated - Use the oneDs.getCookieMgr().del()
195
- * Deletes a cookie, by setting its expiration to -1.
196
- * @param name - Cookie name to delete.
197
- */
198
- export function deleteCookie(name) {
199
- if (areCookiesSupported(null)) {
200
- safeGetCookieMgr(null).del(name);
201
- }
202
- }
203
- /**
204
- * @deprecated - Use the oneDs.getCookieMgr().get()
205
- * Gets the cookie value for the specified cookie.
206
- * if value is k1=v1&k2==v2 then will return 'v1' for key 'k1'
207
- * @param cookieName - Cookie name.
208
- */
209
- export function getCookie(name) {
210
- if (areCookiesSupported(null)) {
211
- return getCookieValue(safeGetCookieMgr(null), name);
212
- }
213
- return STR_EMPTY;
214
- }
215
175
  /**
216
176
  * Helper to get and decode the cookie value using decodeURIComponent, this is for historical
217
177
  * backward compatibility where the document.cookie value was decoded before parsing.
@@ -269,10 +229,9 @@ export function extend(obj, obj2, obj3, obj4, obj5) {
269
229
  var deep = false;
270
230
  var i = 0;
271
231
  var length = arguments.length;
272
- var objProto = Object[strShimPrototype];
273
232
  var theArgs = arguments;
274
233
  // Check if a deep merge
275
- if (objProto.toString.call(theArgs[0]) === "[object Boolean]") {
234
+ if (isBoolean(theArgs[0])) {
276
235
  deep = theArgs[0];
277
236
  i++;
278
237
  }
@@ -374,98 +333,6 @@ export function getFieldValueType(value) {
374
333
  }
375
334
  return theType;
376
335
  }
377
- export var Utils = {
378
- Version: Version,
379
- FullVersionString: FullVersionString,
380
- strUndefined: strUndefined,
381
- strObject: strObject,
382
- Undefined: strUndefined,
383
- arrForEach: arrForEach,
384
- arrIndexOf: arrIndexOf,
385
- arrMap: arrMap,
386
- arrReduce: arrReduce,
387
- objKeys: objKeys,
388
- toISOString: toISOString,
389
- isReactNative: isReactNative,
390
- isString: isString,
391
- isNumber: isNumber,
392
- isBoolean: isBoolean,
393
- isFunction: isFunction,
394
- isArray: isArray,
395
- isObject: isObject,
396
- strTrim: strTrim,
397
- isDocumentObjectAvailable: isDocumentObjectAvailable,
398
- isWindowObjectAvailable: isWindowObjectAvailable,
399
- isValueAssigned: isValueAssigned,
400
- getTenantId: getTenantId,
401
- isBeaconsSupported: isBeaconsSupported,
402
- isUint8ArrayAvailable: isUint8ArrayAvailable,
403
- isLatency: isLatency,
404
- sanitizeProperty: sanitizeProperty,
405
- getISOString: toISOString,
406
- useXDomainRequest: useXDomainRequest,
407
- getCommonSchemaMetaData: getCommonSchemaMetaData,
408
- cookieAvailable: areCookiesSupported,
409
- disallowsSameSiteNone: uaDisallowsSameSiteNone,
410
- setCookie: setCookie,
411
- deleteCookie: deleteCookie,
412
- getCookie: getCookie,
413
- createGuid: createGuid,
414
- extend: extend,
415
- getTime: getTime,
416
- isValueKind: isValueKind,
417
- isArrayValid: isArrayValid,
418
- objDefineAccessors: objDefineAccessors,
419
- addPageUnloadEventListener: addPageUnloadEventListener,
420
- setProcessTelemetryTimings: setProcessTelemetryTimings,
421
- addEventHandler: addEventHandler,
422
- getFieldValueType: getFieldValueType,
423
- strEndsWith: strEndsWith,
424
- objForEachKey: objForEachKey
425
- };
426
- /**
427
- * Provides a collection of utility functions, included for backward compatibility with previous releases.
428
- * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions
429
- * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items
430
- * in your resulting code.
431
- * Overriding the applicationinsights-core version for tree-shaking
432
- */
433
- export var CoreUtils = {
434
- _canUseCookies: undefined,
435
- isTypeof: isTypeof,
436
- isUndefined: isUndefined,
437
- isNullOrUndefined: isNullOrUndefined,
438
- hasOwnProperty: hasOwnProperty,
439
- isFunction: isFunction,
440
- isObject: isObject,
441
- isDate: isDate,
442
- isArray: isArray,
443
- isError: isError,
444
- isString: isString,
445
- isNumber: isNumber,
446
- isBoolean: isBoolean,
447
- toISOString: toISOString,
448
- arrForEach: arrForEach,
449
- arrIndexOf: arrIndexOf,
450
- arrMap: arrMap,
451
- arrReduce: arrReduce,
452
- strTrim: strTrim,
453
- objCreate: objCreateFn,
454
- objKeys: objKeys,
455
- objDefineAccessors: objDefineAccessors,
456
- addEventHandler: addEventHandler,
457
- dateNow: dateNow,
458
- isIE: isIE,
459
- disableCookies: disableCookies,
460
- newGuid: newGuid,
461
- perfNow: perfNow,
462
- newId: newId,
463
- randomValue: randomValue,
464
- random32: random32,
465
- mwcRandomSeed: mwcRandomSeed,
466
- mwcRandom32: mwcRandom32,
467
- generateW3CId: generateW3CId
468
- };
469
336
  /**
470
337
  * Helper to identify whether we are running in a chromium based browser environment
471
338
  */
@@ -519,4 +386,12 @@ export function openXhr(method, urlString, withCredentials, disabled, isSync, ti
519
386
  }
520
387
  return xhr;
521
388
  }
389
+ /**
390
+ * Check to see if the value is > 0
391
+ * @param value - The value to check
392
+ * @returns true if > 0 otherwise false
393
+ */
394
+ export function isGreaterThanZero(value) {
395
+ return value > 0;
396
+ }
522
397
  //# sourceMappingURL=Utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Utils.js.map","sources":["Utils.js"],"sourcesContent":["var _a;\r\n/**\r\n* Utils.ts\r\n* @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2018\r\n* File containing utility functions.\r\n*/\r\nimport { arrForEach, getGlobalInst, getNavigator, hasDocument, hasWindow, isArray, isBoolean, isNullOrUndefined, isNumber, isObject, isReactNative, isString, isUndefined, newGuid, objForEachKey, perfNow } from \"@microsoft/applicationinsights-core-js\";\r\nimport { ObjProto, strShimObject } from \"@microsoft/applicationinsights-shims\";\r\nimport { strIndexOf, strLeft } from \"@nevware21/ts-utils\";\r\nimport { STR_EMPTY } from \"./InternalConstants\";\r\nexport var Version = '4.0.1';\r\nexport var FullVersionString = \"1DS-Web-JS-\" + Version;\r\nvar ObjHasOwnProperty = ObjProto.hasOwnProperty;\r\n// Defining here so we don't need to take (import) the ApplicationInsights Common module\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\nvar strTimeout = \"timeout\";\r\n// If value is array just get the type for the first element\r\nvar _fieldTypeEventPropMap = (_a = {},\r\n _a[0 /* FieldValueSanitizerType.NotSet */] = 0 /* eEventPropertyType.Unspecified */,\r\n _a[2 /* FieldValueSanitizerType.Number */] = 6 /* eEventPropertyType.Double */,\r\n _a[1 /* FieldValueSanitizerType.String */] = 1 /* eEventPropertyType.String */,\r\n _a[3 /* FieldValueSanitizerType.Boolean */] = 7 /* eEventPropertyType.Bool */,\r\n _a[4096 /* FieldValueSanitizerType.Array */ | 2 /* FieldValueSanitizerType.Number */] = 6 /* eEventPropertyType.Double */,\r\n _a[4096 /* FieldValueSanitizerType.Array */ | 1 /* FieldValueSanitizerType.String */] = 1 /* eEventPropertyType.String */,\r\n _a[4096 /* FieldValueSanitizerType.Array */ | 3 /* FieldValueSanitizerType.Boolean */] = 7 /* eEventPropertyType.Bool */,\r\n _a);\r\n/**\r\n * @ignore\r\n */\r\n// let _uaDisallowsSameSiteNone = null;\r\nvar uInt8ArraySupported = null;\r\n// var _areCookiesAvailable: boolean | undefined;\r\n/**\r\n * Checks if document object is available\r\n */\r\nexport var isDocumentObjectAvailable = hasDocument();\r\n/**\r\n * Checks if window object is available\r\n */\r\nexport var isWindowObjectAvailable = hasWindow();\r\n/**\r\n * Checks if value is assigned to the given param.\r\n * @param value - The token from which the tenant id is to be extracted.\r\n * @returns True/false denoting if value is assigned to the param.\r\n */\r\nexport function isValueAssigned(value) {\r\n /// <summary> takes a value and checks for undefined, null and empty string </summary>\r\n /// <param type=\"any\"> value to be tested </param>\r\n /// <returns> true if value is null undefined or emptyString </returns>\r\n return !(value === STR_EMPTY || isNullOrUndefined(value));\r\n}\r\n/**\r\n * Gets the tenant id from the tenant token.\r\n * @param apiKey - The token from which the tenant id is to be extracted.\r\n * @returns The tenant id.\r\n */\r\nexport function getTenantId(apiKey) {\r\n if (apiKey) {\r\n var indexTenantId = strIndexOf(apiKey, \"-\");\r\n if (indexTenantId > -1) {\r\n return strLeft(apiKey, indexTenantId);\r\n }\r\n }\r\n return STR_EMPTY;\r\n}\r\n/**\r\n * Checks if Uint8Array are available in the current environment. Safari and Firefox along with\r\n * ReactNative are known to not support Uint8Array properly.\r\n * @returns True if available, false otherwise.\r\n */\r\nexport function isUint8ArrayAvailable() {\r\n if (uInt8ArraySupported === null) {\r\n uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();\r\n }\r\n return uInt8ArraySupported;\r\n}\r\n/**\r\n * Checks if the value is a valid EventLatency.\r\n * @param value - The value that needs to be checked.\r\n * @returns True if the value is in AWTEventLatency, false otherwise.\r\n */\r\nexport function isLatency(value) {\r\n if (value && isNumber(value) && value >= 1 /* EventLatencyValue.Normal */ && value <= 4 /* EventLatencyValue.Immediate */) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Sanitizes the Property. It checks the that the property name and value are valid. It also\r\n * checks/populates the correct type and pii of the property value.\r\n * @param name - property name - The property name.\r\n * @param property - The property value or an IEventProperty containing value,\r\n * type ,pii and customer content.\r\n * @returns IEventProperty containing valid name, value, pii and type or null if invalid.\r\n */\r\nexport function sanitizeProperty(name, property, stringifyObjects) {\r\n // Check that property is valid\r\n if ((!property && !isValueAssigned(property)) || typeof name !== \"string\") {\r\n return null;\r\n }\r\n // Perf optimization -- only need to get the type once not multiple times\r\n var propType = typeof property;\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n if (propType === \"string\" || propType === \"number\" || propType === \"boolean\" || isArray(property)) {\r\n property = { value: property };\r\n }\r\n else if (propType === \"object\" && !ObjHasOwnProperty.call(property, \"value\")) {\r\n property = { value: stringifyObjects ? JSON.stringify(property) : property };\r\n }\r\n else if (isNullOrUndefined(property.value)\r\n || property.value === STR_EMPTY || (!isString(property.value)\r\n && !isNumber(property.value) && !isBoolean(property.value)\r\n && !isArray(property.value))) {\r\n // Since property is IEventProperty, we need to validate its value\r\n return null;\r\n }\r\n // We need to check that if the property value is an array, it is valid\r\n if (isArray(property.value) &&\r\n !isArrayValid(property.value)) {\r\n return null;\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property.kind)) {\r\n if (isArray(property.value) || !isValueKind(property.kind)) {\r\n return null;\r\n }\r\n property.value = property.value.toString();\r\n }\r\n return property;\r\n}\r\nexport function getCommonSchemaMetaData(value, kind, type) {\r\n var encodedTypeValue = -1;\r\n if (!isUndefined(value)) {\r\n if (kind > 0) {\r\n if (kind === 32) {\r\n // encode customer content. Value can only be string. bit 13-16 are for cc\r\n encodedTypeValue = (1 << 13);\r\n }\r\n else if (kind <= 13) {\r\n // encode PII. Value can only be string. bits 5-12 are for Pii\r\n encodedTypeValue = (kind << 5);\r\n }\r\n }\r\n // isDataType checks that the \"type\" is a number so we don't need to check for undefined\r\n if (isDataType(type)) {\r\n // Data Type is provided and valid, so use that\r\n if (encodedTypeValue === -1) {\r\n // Don't return -1\r\n encodedTypeValue = 0;\r\n }\r\n encodedTypeValue |= type;\r\n }\r\n else {\r\n var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;\r\n if (encodedTypeValue !== -1 && propType !== -1) {\r\n // pii exists so we must return correct type\r\n encodedTypeValue |= propType;\r\n }\r\n else if (propType === 6 /* eEventPropertyType.Double */) {\r\n encodedTypeValue = propType;\r\n }\r\n }\r\n }\r\n return encodedTypeValue;\r\n}\r\n/**\r\n * Helper to get and decode the cookie value using decodeURIComponent, this is for historical\r\n * backward compatibility where the document.cookie value was decoded before parsing.\r\n * @param cookieMgr - The cookie manager to use\r\n * @param name - The name of the cookie to get\r\n * @param decode - A flag to indicate whether the cookie value should be decoded\r\n * @returns The decoded cookie value (if available) otherwise an empty string.\r\n */\r\nexport function getCookieValue(cookieMgr, name, decode) {\r\n if (decode === void 0) { decode = true; }\r\n var cookieValue;\r\n if (cookieMgr) {\r\n cookieValue = cookieMgr.get(name);\r\n if (decode && cookieValue && decodeURIComponent) {\r\n cookieValue = decodeURIComponent(cookieValue);\r\n }\r\n }\r\n return cookieValue || STR_EMPTY;\r\n}\r\n/**\r\n * Create a new guid.\r\n * @param style - The style of guid to generated, defaults to Digits\r\n * Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000\r\n * Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000}\r\n * Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000)\r\n * Numeric - 32 digits: 00000000000000000000000000000000\r\n * @returns The formatted guid.\r\n */\r\nexport function createGuid(style) {\r\n if (style === void 0) { style = \"D\" /* GuidStyle.Digits */; }\r\n var theGuid = newGuid();\r\n if (style === \"B\" /* GuidStyle.Braces */) {\r\n theGuid = \"{\" + theGuid + \"}\";\r\n }\r\n else if (style === \"P\" /* GuidStyle.Parentheses */) {\r\n theGuid = \"(\" + theGuid + \")\";\r\n }\r\n else if (style === \"N\" /* GuidStyle.Numeric */) {\r\n theGuid = theGuid.replace(/-/g, STR_EMPTY);\r\n }\r\n return theGuid;\r\n}\r\n/**\r\n * Pass in the objects to merge as arguments.\r\n * @param obj1 - object to merge. Set this argument to 'true' for a deep extend.\r\n * @param obj2 - object to merge.\r\n * @param obj3 - object to merge.\r\n * @param obj4 - object to merge.\r\n * @param obj5 - object to merge.\r\n * @returns The extended object.\r\n */\r\nexport function extend(obj, obj2, obj3, obj4, obj5) {\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n var length = arguments.length;\r\n var theArgs = arguments;\r\n // Check if a deep merge\r\n if (isBoolean(theArgs[0])) {\r\n deep = theArgs[0];\r\n i++;\r\n }\r\n // Loop through each object and conduct a merge\r\n for (; i < length; i++) {\r\n var obj = theArgs[i];\r\n objForEachKey(obj, function (prop, value) {\r\n // If deep merge and property is an object, merge properties\r\n if (deep && value && isObject(value)) {\r\n if (isArray(value)) {\r\n extended[prop] = extended[prop] || [];\r\n arrForEach(value, function (arrayValue, arrayIndex) {\r\n if (arrayValue && isObject(arrayValue)) {\r\n extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);\r\n }\r\n else {\r\n extended[prop][arrayIndex] = arrayValue;\r\n }\r\n });\r\n }\r\n else {\r\n extended[prop] = extend(true, extended[prop], value);\r\n }\r\n }\r\n else {\r\n extended[prop] = value;\r\n }\r\n });\r\n }\r\n return extended;\r\n}\r\nexport var getTime = perfNow;\r\nexport function isValueKind(value) {\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value === 0 /* eValueKind.NotSet */ || ((value > 0 /* eValueKind.NotSet */ && value <= 13 /* eValueKind.Pii_IPV4AddressLegacy */) || value === 32 /* eValueKind.CustomerContent_GenericContent */)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isDataType(value) {\r\n // Remark: 0 returns false, but it doesn't affect encoding anyways\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value >= 0 && value <= 9) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSafariOrFirefox() {\r\n var nav = getNavigator();\r\n // If non-browser navigator will be undefined\r\n if (!isUndefined(nav) && nav.userAgent) {\r\n var ua = nav.userAgent.toLowerCase();\r\n if ((ua.indexOf(\"safari\") >= 0 || ua.indexOf(\"firefox\") >= 0) && ua.indexOf(\"chrome\") < 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function isArrayValid(value) {\r\n return value.length > 0;\r\n}\r\nexport function setProcessTelemetryTimings(event, identifier) {\r\n var evt = event;\r\n evt.timings = evt.timings || {};\r\n evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {};\r\n evt.timings.processTelemetryStart[identifier] = getTime();\r\n}\r\n/**\r\n * Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value\r\n * @param value The value to determine the type\r\n */\r\nexport function getFieldValueType(value) {\r\n var theType = 0 /* FieldValueSanitizerType.NotSet */;\r\n if (value !== null && value !== undefined) {\r\n var objType = typeof value;\r\n if (objType === \"string\") {\r\n theType = 1 /* FieldValueSanitizerType.String */;\r\n }\r\n else if (objType === \"number\") {\r\n theType = 2 /* FieldValueSanitizerType.Number */;\r\n }\r\n else if (objType === \"boolean\") {\r\n theType = 3 /* FieldValueSanitizerType.Boolean */;\r\n }\r\n else if (objType === strShimObject) {\r\n theType = 4 /* FieldValueSanitizerType.Object */;\r\n if (isArray(value)) {\r\n theType = 4096 /* FieldValueSanitizerType.Array */;\r\n if (value.length > 0) {\r\n // Empty arrays are not supported and are considered to be the same as null\r\n theType |= getFieldValueType(value[0]);\r\n }\r\n }\r\n else if (ObjHasOwnProperty.call(value, \"value\")) {\r\n // Looks like an IEventProperty\r\n theType = 8192 /* FieldValueSanitizerType.EventProperty */ | getFieldValueType(value.value);\r\n }\r\n }\r\n }\r\n return theType;\r\n}\r\n/**\r\n * Helper to identify whether we are running in a chromium based browser environment\r\n */\r\nexport function isChromium() {\r\n return !!getGlobalInst(\"chrome\");\r\n}\r\n/**\r\n * Create and open an XMLHttpRequest object\r\n * @param method - The request method\r\n * @param urlString - The url\r\n * @param withCredentials - Option flag indicating that credentials should be sent\r\n * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)\r\n * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)\r\n * @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) {\r\n if (disabled === void 0) { disabled = false; }\r\n if (isSync === void 0) { isSync = false; }\r\n function _wrapSetXhrProp(xhr, prop, value) {\r\n try {\r\n xhr[prop] = value;\r\n }\r\n catch (e) {\r\n // - Wrapping as depending on the environment setting the property may fail (non-terminally)\r\n }\r\n }\r\n var xhr = new XMLHttpRequest();\r\n if (disabled) {\r\n // Tag the instance so it's not tracked (trackDependency)\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);\r\n }\r\n if (withCredentials) {\r\n // Some libraries require that the withCredentials flag is set \"before\" open and\r\n // - Wrapping as IE 10 has started throwing when setting before open\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n xhr.open(method, urlString, !isSync);\r\n if (withCredentials) {\r\n // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)\r\n // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n // Only set the timeout for asynchronous requests as\r\n // \"Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception.\"\"\r\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout\r\n if (!isSync && timeout) {\r\n _wrapSetXhrProp(xhr, strTimeout, timeout);\r\n }\r\n return xhr;\r\n}\r\n/**\r\n * Check to see if the value is > 0\r\n * @param value - The value to check\r\n * @returns true if > 0 otherwise false\r\n */\r\nexport function isGreaterThanZero(value) {\r\n return value > 0;\r\n}\r\n//# sourceMappingURL=Utils.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}