@microsoft/applicationinsights-common 2.7.5-nightly.2203-03 → 2.7.5

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 (189) hide show
  1. package/browser/applicationinsights-common.integrity.json +9 -9
  2. package/browser/applicationinsights-common.js +244 -853
  3. package/browser/applicationinsights-common.js.map +1 -1
  4. package/browser/applicationinsights-common.min.js +2 -2
  5. package/browser/applicationinsights-common.min.js.map +1 -1
  6. package/dist/applicationinsights-common.api.json +456 -386
  7. package/dist/applicationinsights-common.api.md +8 -21
  8. package/dist/applicationinsights-common.d.ts +12 -33
  9. package/dist/applicationinsights-common.js +244 -853
  10. package/dist/applicationinsights-common.js.map +1 -1
  11. package/dist/applicationinsights-common.min.js +2 -2
  12. package/dist/applicationinsights-common.min.js.map +1 -1
  13. package/dist/applicationinsights-common.rollup.d.ts +12 -33
  14. package/dist-esm/ConnectionStringParser.js +1 -1
  15. package/dist-esm/Constants.js +1 -1
  16. package/dist-esm/DomHelperFuncs.js +1 -1
  17. package/dist-esm/Enums.js +24 -11
  18. package/dist-esm/Enums.js.map +1 -1
  19. package/dist-esm/HelperFuncs.js +6 -7
  20. package/dist-esm/HelperFuncs.js.map +1 -1
  21. package/dist-esm/Interfaces/ConnectionString.js +1 -1
  22. package/dist-esm/Interfaces/Context/IApplication.js +1 -1
  23. package/dist-esm/Interfaces/Context/IDevice.js +1 -1
  24. package/dist-esm/Interfaces/Context/IInternal.js +1 -1
  25. package/dist-esm/Interfaces/Context/ILocation.js +1 -1
  26. package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
  27. package/dist-esm/Interfaces/Context/ISample.js +1 -1
  28. package/dist-esm/Interfaces/Context/ISession.js +1 -1
  29. package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
  30. package/dist-esm/Interfaces/Context/IUser.js +1 -1
  31. package/dist-esm/Interfaces/Context/IWeb.js +1 -1
  32. package/dist-esm/Interfaces/Contracts/Generated/AvailabilityData.js +1 -1
  33. package/dist-esm/Interfaces/Contracts/Generated/Base.js +1 -1
  34. package/dist-esm/Interfaces/Contracts/Generated/ContextTagKeys.js +1 -1
  35. package/dist-esm/Interfaces/Contracts/Generated/Data.js +1 -1
  36. package/dist-esm/Interfaces/Contracts/Generated/DataPoint.js +1 -1
  37. package/dist-esm/Interfaces/Contracts/Generated/DataPointType.js +1 -1
  38. package/dist-esm/Interfaces/Contracts/Generated/DependencyKind.js +1 -1
  39. package/dist-esm/Interfaces/Contracts/Generated/DependencySourceType.js +1 -1
  40. package/dist-esm/Interfaces/Contracts/Generated/Domain.js +1 -1
  41. package/dist-esm/Interfaces/Contracts/Generated/Envelope.js +1 -1
  42. package/dist-esm/Interfaces/Contracts/Generated/EventData.js +1 -1
  43. package/dist-esm/Interfaces/Contracts/Generated/ExceptionData.js +1 -1
  44. package/dist-esm/Interfaces/Contracts/Generated/ExceptionDetails.js +1 -1
  45. package/dist-esm/Interfaces/Contracts/Generated/MessageData.js +1 -1
  46. package/dist-esm/Interfaces/Contracts/Generated/MetricData.js +1 -1
  47. package/dist-esm/Interfaces/Contracts/Generated/PageViewData.js +1 -1
  48. package/dist-esm/Interfaces/Contracts/Generated/PageViewPerfData.js +1 -1
  49. package/dist-esm/Interfaces/Contracts/Generated/RemoteDependencyData.js +1 -1
  50. package/dist-esm/Interfaces/Contracts/Generated/RequestData.js +1 -1
  51. package/dist-esm/Interfaces/Contracts/Generated/SeverityLevel.js +1 -1
  52. package/dist-esm/Interfaces/Contracts/Generated/StackFrame.js +1 -1
  53. package/dist-esm/Interfaces/IAppInsights.js +1 -1
  54. package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
  55. package/dist-esm/Interfaces/IConfig.js +1 -1
  56. package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
  57. package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
  58. package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
  59. package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
  60. package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
  61. package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
  62. package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
  63. package/dist-esm/Interfaces/IPartC.js +1 -1
  64. package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
  65. package/dist-esm/Interfaces/IRequestContext.js +1 -1
  66. package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
  67. package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
  68. package/dist-esm/Interfaces/PartAExtensions.js +1 -1
  69. package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
  70. package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
  71. package/dist-esm/RequestResponseHeaders.js +1 -1
  72. package/dist-esm/StorageHelperFuncs.js +12 -27
  73. package/dist-esm/StorageHelperFuncs.js.map +1 -1
  74. package/dist-esm/Telemetry/Common/Base.js +1 -1
  75. package/dist-esm/Telemetry/Common/Data.js +1 -1
  76. package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
  77. package/dist-esm/Telemetry/Common/DataSanitizer.js +8 -8
  78. package/dist-esm/Telemetry/Common/DataSanitizer.js.map +1 -1
  79. package/dist-esm/Telemetry/Common/Envelope.js +1 -1
  80. package/dist-esm/Telemetry/Event.js +1 -1
  81. package/dist-esm/Telemetry/Exception.js +1 -1
  82. package/dist-esm/Telemetry/Metric.js +1 -1
  83. package/dist-esm/Telemetry/PageView.js +1 -1
  84. package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
  85. package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
  86. package/dist-esm/Telemetry/Trace.js +1 -1
  87. package/dist-esm/TelemetryItemCreator.js +1 -1
  88. package/dist-esm/UrlHelperFuncs.js +1 -1
  89. package/dist-esm/Util.js +3 -3
  90. package/dist-esm/Util.js.map +1 -1
  91. package/dist-esm/applicationinsights-common.js +2 -2
  92. package/dist-esm/applicationinsights-common.js.map +1 -1
  93. package/package.json +54 -57
  94. package/src/Enums.ts +3 -19
  95. package/src/HelperFuncs.ts +5 -7
  96. package/src/StorageHelperFuncs.ts +17 -34
  97. package/src/Telemetry/Common/DataSanitizer.ts +13 -13
  98. package/src/Telemetry/Exception.ts +15 -27
  99. package/src/TelemetryItemCreator.ts +1 -1
  100. package/src/Util.ts +3 -2
  101. package/src/applicationinsights-common.ts +2 -2
  102. package/types/Enums.d.ts +2 -13
  103. package/types/StorageHelperFuncs.d.ts +2 -14
  104. package/types/applicationinsights-common.d.ts +2 -2
  105. package/types/tsdoc-metadata.json +1 -1
  106. package/dist-esm/Interfaces/Contracts/AvailabilityData.js +0 -52
  107. package/dist-esm/Interfaces/Contracts/AvailabilityData.js.map +0 -1
  108. package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +0 -89
  109. package/dist-esm/Interfaces/Contracts/ContextTagKeys.js.map +0 -1
  110. package/dist-esm/Interfaces/Contracts/DataPointType.js +0 -8
  111. package/dist-esm/Interfaces/Contracts/DataPointType.js.map +0 -1
  112. package/dist-esm/Interfaces/Contracts/DependencyKind.js +0 -8
  113. package/dist-esm/Interfaces/Contracts/DependencyKind.js.map +0 -1
  114. package/dist-esm/Interfaces/Contracts/DependencySourceType.js +0 -8
  115. package/dist-esm/Interfaces/Contracts/DependencySourceType.js.map +0 -1
  116. package/dist-esm/Interfaces/Contracts/IBase.js +0 -8
  117. package/dist-esm/Interfaces/Contracts/IBase.js.map +0 -1
  118. package/dist-esm/Interfaces/Contracts/IData.js +0 -8
  119. package/dist-esm/Interfaces/Contracts/IData.js.map +0 -1
  120. package/dist-esm/Interfaces/Contracts/IDataPoint.js +0 -6
  121. package/dist-esm/Interfaces/Contracts/IDataPoint.js.map +0 -1
  122. package/dist-esm/Interfaces/Contracts/IDomain.js +0 -8
  123. package/dist-esm/Interfaces/Contracts/IDomain.js.map +0 -1
  124. package/dist-esm/Interfaces/Contracts/IEnvelope.js +0 -46
  125. package/dist-esm/Interfaces/Contracts/IEnvelope.js.map +0 -1
  126. package/dist-esm/Interfaces/Contracts/IEventData.js +0 -8
  127. package/dist-esm/Interfaces/Contracts/IEventData.js.map +0 -1
  128. package/dist-esm/Interfaces/Contracts/IExceptionData.js +0 -8
  129. package/dist-esm/Interfaces/Contracts/IExceptionData.js.map +0 -1
  130. package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +0 -8
  131. package/dist-esm/Interfaces/Contracts/IExceptionDetails.js.map +0 -1
  132. package/dist-esm/Interfaces/Contracts/IMessageData.js +0 -8
  133. package/dist-esm/Interfaces/Contracts/IMessageData.js.map +0 -1
  134. package/dist-esm/Interfaces/Contracts/IMetricData.js +0 -8
  135. package/dist-esm/Interfaces/Contracts/IMetricData.js.map +0 -1
  136. package/dist-esm/Interfaces/Contracts/IPageViewData.js +0 -8
  137. package/dist-esm/Interfaces/Contracts/IPageViewData.js.map +0 -1
  138. package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +0 -8
  139. package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js.map +0 -1
  140. package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +0 -8
  141. package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js.map +0 -1
  142. package/dist-esm/Interfaces/Contracts/IStackFrame.js +0 -8
  143. package/dist-esm/Interfaces/Contracts/IStackFrame.js.map +0 -1
  144. package/dist-esm/Interfaces/Contracts/RequestData.js +0 -46
  145. package/dist-esm/Interfaces/Contracts/RequestData.js.map +0 -1
  146. package/dist-esm/Interfaces/Contracts/SeverityLevel.js +0 -19
  147. package/dist-esm/Interfaces/Contracts/SeverityLevel.js.map +0 -1
  148. package/src/Interfaces/Contracts/AvailabilityData.ts +0 -57
  149. package/src/Interfaces/Contracts/ContextTagKeys.ts +0 -299
  150. package/src/Interfaces/Contracts/DataPointType.ts +0 -10
  151. package/src/Interfaces/Contracts/DependencyKind.ts +0 -11
  152. package/src/Interfaces/Contracts/DependencySourceType.ts +0 -11
  153. package/src/Interfaces/Contracts/IBase.ts +0 -13
  154. package/src/Interfaces/Contracts/IData.ts +0 -19
  155. package/src/Interfaces/Contracts/IDataPoint.ts +0 -44
  156. package/src/Interfaces/Contracts/IDomain.ts +0 -8
  157. package/src/Interfaces/Contracts/IEnvelope.ts +0 -50
  158. package/src/Interfaces/Contracts/IEventData.ts +0 -30
  159. package/src/Interfaces/Contracts/IExceptionData.ts +0 -37
  160. package/src/Interfaces/Contracts/IExceptionDetails.ts +0 -45
  161. package/src/Interfaces/Contracts/IMessageData.ts +0 -36
  162. package/src/Interfaces/Contracts/IMetricData.ts +0 -31
  163. package/src/Interfaces/Contracts/IPageViewData.ts +0 -26
  164. package/src/Interfaces/Contracts/IPageViewPerfData.ts +0 -35
  165. package/src/Interfaces/Contracts/IRemoteDependencyData.ts +0 -65
  166. package/src/Interfaces/Contracts/IStackFrame.ts +0 -33
  167. package/src/Interfaces/Contracts/RequestData.ts +0 -50
  168. package/src/Interfaces/Contracts/SeverityLevel.ts +0 -15
  169. package/types/Interfaces/Contracts/AvailabilityData.d.ts +0 -0
  170. package/types/Interfaces/Contracts/ContextTagKeys.d.ts +0 -175
  171. package/types/Interfaces/Contracts/DataPointType.d.ts +0 -7
  172. package/types/Interfaces/Contracts/DependencyKind.d.ts +0 -8
  173. package/types/Interfaces/Contracts/DependencySourceType.d.ts +0 -8
  174. package/types/Interfaces/Contracts/IBase.d.ts +0 -9
  175. package/types/Interfaces/Contracts/IData.d.ts +0 -14
  176. package/types/Interfaces/Contracts/IDataPoint.d.ts +0 -34
  177. package/types/Interfaces/Contracts/IDomain.d.ts +0 -5
  178. package/types/Interfaces/Contracts/IEnvelope.d.ts +0 -0
  179. package/types/Interfaces/Contracts/IEventData.d.ts +0 -22
  180. package/types/Interfaces/Contracts/IExceptionData.d.ts +0 -28
  181. package/types/Interfaces/Contracts/IExceptionDetails.d.ts +0 -34
  182. package/types/Interfaces/Contracts/IMessageData.d.ts +0 -27
  183. package/types/Interfaces/Contracts/IMetricData.d.ts +0 -23
  184. package/types/Interfaces/Contracts/IPageViewData.d.ts +0 -18
  185. package/types/Interfaces/Contracts/IPageViewPerfData.d.ts +0 -26
  186. package/types/Interfaces/Contracts/IRemoteDependencyData.d.ts +0 -50
  187. package/types/Interfaces/Contracts/IStackFrame.d.ts +0 -25
  188. package/types/Interfaces/Contracts/RequestData.d.ts +0 -0
  189. package/types/Interfaces/Contracts/SeverityLevel.d.ts +0 -10
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Common, 2.7.5-nightly.2203-03
2
+ * Application Insights JavaScript SDK - Common, 2.7.5
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -75,9 +75,7 @@
75
75
  var __assignFn = ObjAssign || __objAssignFnImpl;
76
76
  var extendStaticsFn = function (d, b) {
77
77
  extendStaticsFn = ObjClass["setPrototypeOf"] ||
78
- ({ __proto__: [] } instanceof Array && function (d, b) {
79
- d.__proto__ = b;
80
- }) ||
78
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
81
79
  function (d, b) {
82
80
  for (var p in b) {
83
81
  if (b[strShimHasOwnProperty](p)) {
@@ -92,255 +90,103 @@
92
90
  throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
93
91
  }
94
92
  extendStaticsFn(d, b);
95
- function __() {
96
- this.constructor = d;
97
- }
93
+ function __() { this.constructor = d; }
98
94
  d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
99
95
  }
100
96
 
101
- /*!
102
- * Microsoft Dynamic Proto Utility, 1.1.4
103
- * Copyright (c) Microsoft and contributors. All rights reserved.
104
- */
105
- var Constructor = 'constructor';
106
- var Prototype = 'prototype';
107
- var strFunction = 'function';
108
- var DynInstFuncTable = '_dynInstFuncs';
109
- var DynProxyTag = '_isDynProxy';
110
- var DynClassName = '_dynClass';
111
- var DynClassNamePrefix = '_dynCls$';
112
- var DynInstChkTag = '_dynInstChk';
113
- var DynAllowInstChkTag = DynInstChkTag;
114
- var DynProtoDefaultOptions = '_dfOpts';
115
- var UnknownValue = '_unknown_';
116
- var str__Proto = "__proto__";
117
- var strUseBaseInst = 'useBaseInst';
118
- var strSetInstFuncs = 'setInstFuncs';
119
- var Obj = Object;
120
- var _objGetPrototypeOf = Obj["getPrototypeOf"];
121
- var _dynamicNames = 0;
122
- function _hasOwnProperty(obj, prop) {
123
- return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
124
- }
125
- function _isObjectOrArrayPrototype(target) {
126
- return target && (target === Obj[Prototype] || target === Array[Prototype]);
127
- }
128
- function _isObjectArrayOrFunctionPrototype(target) {
129
- return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
130
- }
131
- function _getObjProto(target) {
132
- if (target) {
133
- if (_objGetPrototypeOf) {
134
- return _objGetPrototypeOf(target);
135
- }
136
- var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
137
- if (newProto) {
138
- return newProto;
139
- }
140
- }
141
- return null;
142
- }
143
- function _forEachProp(target, func) {
144
- var props = [];
145
- var getOwnProps = Obj["getOwnPropertyNames"];
146
- if (getOwnProps) {
147
- props = getOwnProps(target);
148
- }
149
- else {
150
- for (var name_1 in target) {
151
- if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
152
- props.push(name_1);
153
- }
154
- }
155
- }
156
- if (props && props.length > 0) {
157
- for (var lp = 0; lp < props.length; lp++) {
158
- func(props[lp]);
159
- }
160
- }
161
- }
162
- function _isDynamicCandidate(target, funcName, skipOwn) {
163
- return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
164
- }
165
- function _throwTypeError(message) {
166
- throw new TypeError("DynamicProto: " + message);
167
- }
168
- function _getInstanceFuncs(thisTarget) {
169
- var instFuncs = {};
170
- _forEachProp(thisTarget, function (name) {
171
- if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
172
- instFuncs[name] = thisTarget[name];
173
- }
174
- });
175
- return instFuncs;
176
- }
177
- function _hasVisited(values, value) {
178
- for (var lp = values.length - 1; lp >= 0; lp--) {
179
- if (values[lp] === value) {
180
- return true;
181
- }
182
- }
183
- return false;
184
- }
185
- function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
186
- function _instFuncProxy(target, funcHost, funcName) {
187
- var theFunc = funcHost[funcName];
188
- if (theFunc[DynProxyTag] && useBaseInst) {
189
- var instFuncTable = target[DynInstFuncTable] || {};
190
- if (instFuncTable[DynAllowInstChkTag] !== false) {
191
- theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
192
- }
193
- }
194
- return function () {
195
- return theFunc.apply(target, arguments);
196
- };
197
- }
198
- var baseFuncs = {};
199
- _forEachProp(instFuncs, function (name) {
200
- baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
201
- });
202
- var baseProto = _getObjProto(classProto);
203
- var visited = [];
204
- while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
205
- _forEachProp(baseProto, function (name) {
206
- if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
207
- baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
208
- }
209
- });
210
- visited.push(baseProto);
211
- baseProto = _getObjProto(baseProto);
212
- }
213
- return baseFuncs;
214
- }
215
- function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
216
- var instFunc = null;
217
- if (target && _hasOwnProperty(proto, DynClassName)) {
218
- var instFuncTable = target[DynInstFuncTable] || {};
219
- instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
220
- if (!instFunc) {
221
- _throwTypeError("Missing [" + funcName + "] " + strFunction);
222
- }
223
- if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
224
- var canAddInst = !_hasOwnProperty(target, funcName);
225
- var objProto = _getObjProto(target);
226
- var visited = [];
227
- while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
228
- var protoFunc = objProto[funcName];
229
- if (protoFunc) {
230
- canAddInst = (protoFunc === currentDynProtoProxy);
231
- break;
232
- }
233
- visited.push(objProto);
234
- objProto = _getObjProto(objProto);
235
- }
236
- try {
237
- if (canAddInst) {
238
- target[funcName] = instFunc;
239
- }
240
- instFunc[DynInstChkTag] = 1;
241
- }
242
- catch (e) {
243
- instFuncTable[DynAllowInstChkTag] = false;
244
- }
245
- }
246
- }
247
- return instFunc;
248
- }
249
- function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
250
- var protoFunc = proto[funcName];
251
- if (protoFunc === currentDynProtoProxy) {
252
- protoFunc = _getObjProto(proto)[funcName];
253
- }
254
- if (typeof protoFunc !== strFunction) {
255
- _throwTypeError("[" + funcName + "] is not a " + strFunction);
256
- }
257
- return protoFunc;
258
- }
259
- function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
260
- function _createDynamicPrototype(proto, funcName) {
261
- var dynProtoProxy = function () {
262
- var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
263
- return instFunc.apply(this, arguments);
264
- };
265
- dynProtoProxy[DynProxyTag] = 1;
266
- return dynProtoProxy;
267
- }
268
- if (!_isObjectOrArrayPrototype(proto)) {
269
- var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
270
- var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
271
- if (instFuncTable[DynAllowInstChkTag] !== false) {
272
- instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
273
- }
274
- _forEachProp(target, function (name) {
275
- if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
276
- instFuncs_1[name] = target[name];
277
- delete target[name];
278
- if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
279
- proto[name] = _createDynamicPrototype(proto, name);
280
- }
281
- }
282
- });
283
- }
284
- }
285
- function _checkPrototype(classProto, thisTarget) {
286
- if (_objGetPrototypeOf) {
287
- var visited = [];
288
- var thisProto = _getObjProto(thisTarget);
289
- while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
290
- if (thisProto === classProto) {
291
- return true;
292
- }
293
- visited.push(thisProto);
294
- thisProto = _getObjProto(thisProto);
295
- }
296
- }
297
- return false;
298
- }
299
- function _getObjName(target, unknownValue) {
300
- if (_hasOwnProperty(target, Prototype)) {
301
- return target.name || unknownValue || UnknownValue;
302
- }
303
- return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
304
- }
305
- function dynamicProto(theClass, target, delegateFunc, options) {
306
- if (!_hasOwnProperty(theClass, Prototype)) {
307
- _throwTypeError("theClass is an invalid class definition.");
308
- }
309
- var classProto = theClass[Prototype];
310
- if (!_checkPrototype(classProto, target)) {
311
- _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
312
- }
313
- var className = null;
314
- if (_hasOwnProperty(classProto, DynClassName)) {
315
- className = classProto[DynClassName];
316
- }
317
- else {
318
- className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
319
- _dynamicNames++;
320
- classProto[DynClassName] = className;
321
- }
322
- var perfOptions = dynamicProto[DynProtoDefaultOptions];
323
- var useBaseInst = !!perfOptions[strUseBaseInst];
324
- if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
325
- useBaseInst = !!options[strUseBaseInst];
326
- }
327
- var instFuncs = _getInstanceFuncs(target);
328
- var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
329
- delegateFunc(target, baseFuncs);
330
- var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
331
- if (setInstanceFunc && options) {
332
- setInstanceFunc = !!options[strSetInstFuncs];
333
- }
334
- _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
335
- }
336
- var perfDefaults = {
337
- setInstFuncs: true,
338
- useBaseInst: true
97
+ var LoggingSeverity;
98
+ (function (LoggingSeverity) {
99
+ LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL";
100
+ LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING";
101
+ })(LoggingSeverity || (LoggingSeverity = {}));
102
+ var _InternalMessageId = {
103
+ BrowserDoesNotSupportLocalStorage: 0,
104
+ BrowserCannotReadLocalStorage: 1,
105
+ BrowserCannotReadSessionStorage: 2,
106
+ BrowserCannotWriteLocalStorage: 3,
107
+ BrowserCannotWriteSessionStorage: 4,
108
+ BrowserFailedRemovalFromLocalStorage: 5,
109
+ BrowserFailedRemovalFromSessionStorage: 6,
110
+ CannotSendEmptyTelemetry: 7,
111
+ ClientPerformanceMathError: 8,
112
+ ErrorParsingAISessionCookie: 9,
113
+ ErrorPVCalc: 10,
114
+ ExceptionWhileLoggingError: 11,
115
+ FailedAddingTelemetryToBuffer: 12,
116
+ FailedMonitorAjaxAbort: 13,
117
+ FailedMonitorAjaxDur: 14,
118
+ FailedMonitorAjaxOpen: 15,
119
+ FailedMonitorAjaxRSC: 16,
120
+ FailedMonitorAjaxSend: 17,
121
+ FailedMonitorAjaxGetCorrelationHeader: 18,
122
+ FailedToAddHandlerForOnBeforeUnload: 19,
123
+ FailedToSendQueuedTelemetry: 20,
124
+ FailedToReportDataLoss: 21,
125
+ FlushFailed: 22,
126
+ MessageLimitPerPVExceeded: 23,
127
+ MissingRequiredFieldSpecification: 24,
128
+ NavigationTimingNotSupported: 25,
129
+ OnError: 26,
130
+ SessionRenewalDateIsZero: 27,
131
+ SenderNotInitialized: 28,
132
+ StartTrackEventFailed: 29,
133
+ StopTrackEventFailed: 30,
134
+ StartTrackFailed: 31,
135
+ StopTrackFailed: 32,
136
+ TelemetrySampledAndNotSent: 33,
137
+ TrackEventFailed: 34,
138
+ TrackExceptionFailed: 35,
139
+ TrackMetricFailed: 36,
140
+ TrackPVFailed: 37,
141
+ TrackPVFailedCalc: 38,
142
+ TrackTraceFailed: 39,
143
+ TransmissionFailed: 40,
144
+ FailedToSetStorageBuffer: 41,
145
+ FailedToRestoreStorageBuffer: 42,
146
+ InvalidBackendResponse: 43,
147
+ FailedToFixDepricatedValues: 44,
148
+ InvalidDurationValue: 45,
149
+ TelemetryEnvelopeInvalid: 46,
150
+ CreateEnvelopeError: 47,
151
+ CannotSerializeObject: 48,
152
+ CannotSerializeObjectNonSerializable: 49,
153
+ CircularReferenceDetected: 50,
154
+ ClearAuthContextFailed: 51,
155
+ ExceptionTruncated: 52,
156
+ IllegalCharsInName: 53,
157
+ ItemNotInArray: 54,
158
+ MaxAjaxPerPVExceeded: 55,
159
+ MessageTruncated: 56,
160
+ NameTooLong: 57,
161
+ SampleRateOutOfRange: 58,
162
+ SetAuthContextFailed: 59,
163
+ SetAuthContextFailedAccountName: 60,
164
+ StringValueTooLong: 61,
165
+ StartCalledMoreThanOnce: 62,
166
+ StopCalledWithoutStart: 63,
167
+ TelemetryInitializerFailed: 64,
168
+ TrackArgumentsNotSpecified: 65,
169
+ UrlTooLong: 66,
170
+ SessionStorageBufferFull: 67,
171
+ CannotAccessCookie: 68,
172
+ IdTooLong: 69,
173
+ InvalidEvent: 70,
174
+ FailedMonitorAjaxSetRequestHeader: 71,
175
+ SendBrowserInfoOnUserInit: 72,
176
+ PluginException: 73,
177
+ NotificationException: 74,
178
+ SnippetScriptLoadFailure: 99,
179
+ InvalidInstrumentationKey: 100,
180
+ CannotParseAiBlobValue: 101,
181
+ InvalidContentBlob: 102,
182
+ TrackPageActionEventFailed: 103,
183
+ FailedAddingCustomDefinedRequestContext: 104,
184
+ InMemoryStorageBufferFull: 105
339
185
  };
340
- dynamicProto[DynProtoDefaultOptions] = perfDefaults;
341
-
342
- var strEmpty$1 = "";
343
186
 
187
+ var strOnPrefix = "on";
188
+ var strAttachEvent = "attachEvent";
189
+ var strAddEventHelper = "addEventListener";
344
190
  var strToISOString = "toISOString";
345
191
  var cStrEndsWith = "endsWith";
346
192
  var strIndexOf = "indexOf";
@@ -348,8 +194,7 @@
348
194
  var strReduce = "reduce";
349
195
  var cStrTrim = "trim";
350
196
  var strToString = "toString";
351
- var _objDefineProperty$1 = ObjDefineProperty;
352
- var _objFreeze = ObjClass.freeze;
197
+ var _objDefineProperty = ObjDefineProperty;
353
198
  var _objKeys = ObjClass.keys;
354
199
  var StringProto = String[strShimPrototype];
355
200
  var _strTrim = StringProto[cStrTrim];
@@ -360,9 +205,6 @@
360
205
  var _objToString = ObjProto[strToString];
361
206
  var _fnToString = ObjHasOwnProperty[strToString];
362
207
  _fnToString.call(ObjClass);
363
- var rCamelCase = /-([a-z])/g;
364
- var rNormalizeInvalid = /([^\w\d_$])/g;
365
- var rLeadingNumeric = /^(\d+[\w\d_$])/;
366
208
  function isTypeof(value, theType) {
367
209
  return typeof value === theType;
368
210
  }
@@ -384,18 +226,24 @@
384
226
  function isFunction(value) {
385
227
  return !!(value && typeof value === strShimFunction);
386
228
  }
387
- function normalizeJsName(name) {
388
- var value = name;
389
- if (value && isString(value)) {
390
- value = value.replace(rCamelCase, function (_all, letter) {
391
- return letter.toUpperCase();
392
- });
393
- value = value.replace(rNormalizeInvalid, "_");
394
- value = value.replace(rLeadingNumeric, function (_all, match) {
395
- return "_" + match;
396
- });
229
+ function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
230
+ if (useCapture === void 0) { useCapture = false; }
231
+ var result = false;
232
+ if (!isNullOrUndefined(obj)) {
233
+ try {
234
+ if (!isNullOrUndefined(obj[strAddEventHelper])) {
235
+ obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);
236
+ result = true;
237
+ }
238
+ else if (!isNullOrUndefined(obj[strAttachEvent])) {
239
+ obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
240
+ result = true;
241
+ }
242
+ }
243
+ catch (e) {
244
+ }
397
245
  }
398
- return value;
246
+ return result;
399
247
  }
400
248
  function objForEachKey(target, callbackfn) {
401
249
  if (target) {
@@ -599,7 +447,7 @@
599
447
  return result;
600
448
  }
601
449
  function objDefineAccessors(target, prop, getProp, setProp) {
602
- if (_objDefineProperty$1) {
450
+ if (_objDefineProperty) {
603
451
  try {
604
452
  var descriptor = {
605
453
  enumerable: true,
@@ -611,7 +459,7 @@
611
459
  if (setProp) {
612
460
  descriptor.set = setProp;
613
461
  }
614
- _objDefineProperty$1(target, prop, descriptor);
462
+ _objDefineProperty(target, prop, descriptor);
615
463
  return true;
616
464
  }
617
465
  catch (e) {
@@ -619,10 +467,6 @@
619
467
  }
620
468
  return false;
621
469
  }
622
- function _doNothing(value) {
623
- return value;
624
- }
625
- var objFreeze = _objFreeze || _doNothing;
626
470
  function dateNow() {
627
471
  var dt = Date;
628
472
  return dt.now ? dt.now() : new dt().getTime();
@@ -631,7 +475,7 @@
631
475
  if (isError(object)) {
632
476
  return object.name;
633
477
  }
634
- return strEmpty$1;
478
+ return "";
635
479
  }
636
480
  function setValue(target, field, value, valChk, srcChk) {
637
481
  var theValue = value;
@@ -647,9 +491,6 @@
647
491
  function isTruthy(value) {
648
492
  return !!value;
649
493
  }
650
- function throwError(message) {
651
- throw new Error(message);
652
- }
653
494
  function createClassFromInterface(defaults) {
654
495
  return /** @class */ (function () {
655
496
  function class_1() {
@@ -663,24 +504,12 @@
663
504
  return class_1;
664
505
  }());
665
506
  }
666
- function createEnumStyle(values) {
667
- var enumClass = {};
668
- objForEachKey(values, function (field, value) {
669
- enumClass[field] = value;
670
- if (!isUndefined(enumClass[value])) {
671
- throwError("[" + value + "] exists for " + field);
672
- }
673
- enumClass[value] = field;
674
- });
675
- return objFreeze(enumClass);
676
- }
677
507
 
678
508
  var strWindow = "window";
679
509
  var strDocument = "document";
680
510
  var strDocumentMode = "documentMode";
681
511
  var strNavigator = "navigator";
682
512
  var strLocation = "location";
683
- var strConsole = "console";
684
513
  var strPerformance = "performance";
685
514
  var strJSON = "JSON";
686
515
  var strCrypto = "crypto";
@@ -740,12 +569,6 @@
740
569
  }
741
570
  return getGlobalInst(strLocation);
742
571
  }
743
- function getConsole() {
744
- if (typeof console !== strShimUndefined) {
745
- return console;
746
- }
747
- return getGlobalInst(strConsole);
748
- }
749
572
  function getPerformance() {
750
573
  return getGlobalInst(strPerformance);
751
574
  }
@@ -768,7 +591,7 @@
768
591
  var nav = getNavigator();
769
592
  if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
770
593
  _navUserAgentCheck = nav.userAgent;
771
- var userAgent = (_navUserAgentCheck || strEmpty$1).toLowerCase();
594
+ var userAgent = (_navUserAgentCheck || "").toLowerCase();
772
595
  _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
773
596
  }
774
597
  return _isTrident;
@@ -777,9 +600,9 @@
777
600
  if (userAgentStr === void 0) { userAgentStr = null; }
778
601
  if (!userAgentStr) {
779
602
  var navigator_1 = getNavigator() || {};
780
- userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty$1).toLowerCase() : strEmpty$1;
603
+ userAgentStr = navigator_1 ? (navigator_1.userAgent || "").toLowerCase() : "";
781
604
  }
782
- var ua = (userAgentStr || strEmpty$1).toLowerCase();
605
+ var ua = (userAgentStr || "").toLowerCase();
783
606
  if (strContains(ua, strMsie)) {
784
607
  var doc = getDocument() || {};
785
608
  return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0));
@@ -794,7 +617,7 @@
794
617
  }
795
618
  function dumpObj(object) {
796
619
  var objectTypeDump = Object[strShimPrototype].toString.call(object);
797
- var propertyValueDump = strEmpty$1;
620
+ var propertyValueDump = "";
798
621
  if (objectTypeDump === "[object Error]") {
799
622
  propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
800
623
  }
@@ -810,329 +633,6 @@
810
633
  return _beaconsSupported;
811
634
  }
812
635
 
813
- var _aiNamespace = null;
814
- function _getExtensionNamespace() {
815
- var target = getGlobalInst("Microsoft");
816
- if (target) {
817
- _aiNamespace = target["ApplicationInsights"];
818
- }
819
- return _aiNamespace;
820
- }
821
- function getDebugExt(config) {
822
- var ns = _aiNamespace;
823
- if (!ns && config.disableDbgExt !== true) {
824
- ns = _aiNamespace || _getExtensionNamespace();
825
- }
826
- return ns ? ns["ChromeDbgExt"] : null;
827
- }
828
-
829
- var AiNonUserActionablePrefix = "AI (Internal): ";
830
- var AiUserActionablePrefix = "AI: ";
831
- var AIInternalMessagePrefix = "AITR_";
832
- var strErrorToConsole = "errorToConsole";
833
- var strWarnToConsole = "warnToConsole";
834
- function _sanitizeDiagnosticText(text) {
835
- if (text) {
836
- return "\"" + text.replace(/\"/g, strEmpty$1) + "\"";
837
- }
838
- return strEmpty$1;
839
- }
840
- function _logToConsole(func, message) {
841
- var theConsole = getConsole();
842
- if (!!theConsole) {
843
- var logFunc = "log";
844
- if (theConsole[func]) {
845
- logFunc = func;
846
- }
847
- if (isFunction(theConsole[logFunc])) {
848
- theConsole[logFunc](message);
849
- }
850
- }
851
- }
852
- var _InternalLogMessage = /** @class */ (function () {
853
- function _InternalLogMessage(msgId, msg, isUserAct, properties) {
854
- if (isUserAct === void 0) { isUserAct = false; }
855
- var _self = this;
856
- _self.messageId = msgId;
857
- _self.message =
858
- (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
859
- msgId;
860
- var strProps = strEmpty$1;
861
- if (hasJSON()) {
862
- strProps = getJSON().stringify(properties);
863
- }
864
- var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty$1) +
865
- (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty$1);
866
- _self.message += diagnosticText;
867
- }
868
- _InternalLogMessage.dataType = "MessageData";
869
- return _InternalLogMessage;
870
- }());
871
- var DiagnosticLogger = /** @class */ (function () {
872
- function DiagnosticLogger(config) {
873
- this.identifier = "DiagnosticLogger";
874
- this.queue = [];
875
- var _messageCount = 0;
876
- var _messageLogged = {};
877
- dynamicProto(DiagnosticLogger, this, function (_self) {
878
- if (isNullOrUndefined(config)) {
879
- config = {};
880
- }
881
- _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); };
882
- _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); };
883
- _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); };
884
- _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); };
885
- _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {
886
- if (isUserAct === void 0) { isUserAct = false; }
887
- var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
888
- if (_self.enableDebugExceptions()) {
889
- throw message;
890
- }
891
- else {
892
- var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole;
893
- if (!isUndefined(message.message)) {
894
- var logLevel = _self.consoleLoggingLevel();
895
- if (isUserAct) {
896
- var messageKey = +message.messageId;
897
- if (!_messageLogged[messageKey] && logLevel >= severity) {
898
- _self[logFunc](message.message);
899
- _messageLogged[messageKey] = true;
900
- }
901
- }
902
- else {
903
- if (logLevel >= severity) {
904
- _self[logFunc](message.message);
905
- }
906
- }
907
- _self.logInternalMessage(severity, message);
908
- }
909
- else {
910
- _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
911
- }
912
- }
913
- };
914
- _self.warnToConsole = function (message) {
915
- _logToConsole("warn", message);
916
- _debugExtMsg("warning", message);
917
- };
918
- _self.errorToConsole = function (message) {
919
- _logToConsole("error", message);
920
- _debugExtMsg("error", message);
921
- };
922
- _self.resetInternalMessageCount = function () {
923
- _messageCount = 0;
924
- _messageLogged = {};
925
- };
926
- _self.logInternalMessage = function (severity, message) {
927
- if (_areInternalMessagesThrottled()) {
928
- return;
929
- }
930
- var logMessage = true;
931
- var messageKey = AIInternalMessagePrefix + message.messageId;
932
- if (_messageLogged[messageKey]) {
933
- logMessage = false;
934
- }
935
- else {
936
- _messageLogged[messageKey] = true;
937
- }
938
- if (logMessage) {
939
- if (severity <= _self.telemetryLoggingLevel()) {
940
- _self.queue.push(message);
941
- _messageCount++;
942
- _debugExtMsg((severity === 1 ? "error" : "warn"), message);
943
- }
944
- if (_messageCount === _self.maxInternalMessageLimit()) {
945
- var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
946
- var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
947
- _self.queue.push(throttleMessage);
948
- if (severity === 1 ) {
949
- _self.errorToConsole(throttleLimitMessage);
950
- }
951
- else {
952
- _self.warnToConsole(throttleLimitMessage);
953
- }
954
- }
955
- }
956
- };
957
- function _getConfigValue(name, defValue) {
958
- var value = config[name];
959
- if (!isNullOrUndefined(value)) {
960
- return value;
961
- }
962
- return defValue;
963
- }
964
- function _areInternalMessagesThrottled() {
965
- return _messageCount >= _self.maxInternalMessageLimit();
966
- }
967
- function _debugExtMsg(name, data) {
968
- var dbgExt = getDebugExt(config);
969
- if (dbgExt && dbgExt.diagLog) {
970
- dbgExt.diagLog(name, data);
971
- }
972
- }
973
- });
974
- }
975
- return DiagnosticLogger;
976
- }());
977
- function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
978
- if (isUserAct === void 0) { isUserAct = false; }
979
- (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
980
- }
981
-
982
- var UInt32Mask = 0x100000000;
983
- var MaxUInt32 = 0xffffffff;
984
- var _mwcSeeded = false;
985
- var _mwcW = 123456789;
986
- var _mwcZ = 987654321;
987
- function _mwcSeed(seedValue) {
988
- if (seedValue < 0) {
989
- seedValue >>>= 0;
990
- }
991
- _mwcW = (123456789 + seedValue) & MaxUInt32;
992
- _mwcZ = (987654321 - seedValue) & MaxUInt32;
993
- _mwcSeeded = true;
994
- }
995
- function _autoSeedMwc() {
996
- try {
997
- var now = dateNow() & 0x7fffffff;
998
- _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
999
- }
1000
- catch (e) {
1001
- }
1002
- }
1003
- function randomValue(maxValue) {
1004
- if (maxValue > 0) {
1005
- return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
1006
- }
1007
- return 0;
1008
- }
1009
- function random32(signed) {
1010
- var value = 0;
1011
- var c = getCrypto() || getMsCrypto();
1012
- if (c && c.getRandomValues) {
1013
- value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
1014
- }
1015
- if (value === 0 && isIE()) {
1016
- if (!_mwcSeeded) {
1017
- _autoSeedMwc();
1018
- }
1019
- value = mwcRandom32() & MaxUInt32;
1020
- }
1021
- if (value === 0) {
1022
- value = Math.floor((UInt32Mask * Math.random()) | 0);
1023
- }
1024
- if (!signed) {
1025
- value >>>= 0;
1026
- }
1027
- return value;
1028
- }
1029
- function mwcRandomSeed(value) {
1030
- if (!value) {
1031
- _autoSeedMwc();
1032
- }
1033
- else {
1034
- _mwcSeed(value);
1035
- }
1036
- }
1037
- function mwcRandom32(signed) {
1038
- _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
1039
- _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
1040
- var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
1041
- if (!signed) {
1042
- value >>>= 0;
1043
- }
1044
- return value;
1045
- }
1046
- function newId(maxLength) {
1047
- if (maxLength === void 0) { maxLength = 22; }
1048
- var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1049
- var number = random32() >>> 0;
1050
- var chars = 0;
1051
- var result = strEmpty$1;
1052
- while (result.length < maxLength) {
1053
- chars++;
1054
- result += base64chars.charAt(number & 0x3F);
1055
- number >>>= 6;
1056
- if (chars === 5) {
1057
- number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
1058
- chars = 0;
1059
- }
1060
- }
1061
- return result;
1062
- }
1063
-
1064
- var _objDefineProperty = ObjDefineProperty;
1065
- var version = "2.7.5-nightly.2203-03";
1066
- var instanceName = "." + newId(6);
1067
- var _dataUid = 0;
1068
- function _createAccessor(target, prop, value) {
1069
- if (_objDefineProperty) {
1070
- try {
1071
- _objDefineProperty(target, prop, {
1072
- value: value,
1073
- enumerable: false,
1074
- configurable: true
1075
- });
1076
- return true;
1077
- }
1078
- catch (e) {
1079
- }
1080
- }
1081
- return false;
1082
- }
1083
- function _canAcceptData(target) {
1084
- return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);
1085
- }
1086
- function _getCache(data, target) {
1087
- var theCache = target[data.id];
1088
- if (!theCache) {
1089
- theCache = {};
1090
- try {
1091
- if (_canAcceptData(target)) {
1092
- if (!_createAccessor(target, data.id, theCache)) {
1093
- target[data.id] = theCache;
1094
- }
1095
- }
1096
- }
1097
- catch (e) {
1098
- }
1099
- }
1100
- return theCache;
1101
- }
1102
- function createUniqueNamespace(name, includeVersion) {
1103
- if (includeVersion === void 0) { includeVersion = false; }
1104
- return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName);
1105
- }
1106
- function createElmNodeData(name) {
1107
- var data = {
1108
- id: createUniqueNamespace("_aiData-" + (name || "") + "." + version),
1109
- accept: function (target) {
1110
- return _canAcceptData(target);
1111
- },
1112
- get: function (target, name, defValue, addDefault) {
1113
- var theCache = target[data.id];
1114
- if (!theCache) {
1115
- if (addDefault) {
1116
- theCache = _getCache(data, target);
1117
- theCache[normalizeJsName(name)] = defValue;
1118
- }
1119
- return defValue;
1120
- }
1121
- return theCache[normalizeJsName(name)];
1122
- },
1123
- kill: function (target, name) {
1124
- if (target && target[name]) {
1125
- try {
1126
- delete target[name];
1127
- }
1128
- catch (e) {
1129
- }
1130
- }
1131
- }
1132
- };
1133
- return data;
1134
- }
1135
-
1136
636
  var strToGMTString = "toGMTString";
1137
637
  var strToUTCString = "toUTCString";
1138
638
  var strCookie = "cookie";
@@ -1141,6 +641,7 @@
1141
641
  var strIsCookieUseDisabled = "isCookieUseDisabled";
1142
642
  var strDisableCookiesUsage = "disableCookiesUsage";
1143
643
  var strConfigCookieMgr = "_ckMgr";
644
+ var strEmpty = "";
1144
645
  var _supportsCookies = null;
1145
646
  var _allowUaSameSite = null;
1146
647
  var _parsedCookieValue = null;
@@ -1198,7 +699,7 @@
1198
699
  var result = false;
1199
700
  if (_isMgrEnabled(cookieMgr)) {
1200
701
  var values = {};
1201
- var theValue = strTrim(value || strEmpty$1);
702
+ var theValue = strTrim(value || strEmpty);
1202
703
  var idx = theValue.indexOf(";");
1203
704
  if (idx !== -1) {
1204
705
  theValue = strTrim(value.substring(0, idx));
@@ -1213,11 +714,11 @@
1213
714
  if (expireMs > 0) {
1214
715
  var expiry = new Date();
1215
716
  expiry.setTime(expireMs);
1216
- setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty$1, isTruthy);
717
+ setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy);
1217
718
  }
1218
719
  }
1219
720
  if (!_isIE) {
1220
- setValue(values, "max-age", strEmpty$1 + maxAgeSec, null, isUndefined);
721
+ setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined);
1221
722
  }
1222
723
  }
1223
724
  var location_1 = getLocation();
@@ -1238,7 +739,7 @@
1238
739
  return result;
1239
740
  },
1240
741
  get: function (name) {
1241
- var value = strEmpty$1;
742
+ var value = strEmpty;
1242
743
  if (_isMgrEnabled(cookieMgr)) {
1243
744
  value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
1244
745
  }
@@ -1263,7 +764,7 @@
1263
764
  values["max-age"] = "0";
1264
765
  }
1265
766
  var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
1266
- delCookie(name, _formatCookieValue(strEmpty$1, values));
767
+ delCookie(name, _formatCookieValue(strEmpty, values));
1267
768
  result = true;
1268
769
  }
1269
770
  return result;
@@ -1280,7 +781,7 @@
1280
781
  _supportsCookies = doc[strCookie] !== undefined;
1281
782
  }
1282
783
  catch (e) {
1283
- _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
784
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
1284
785
  }
1285
786
  }
1286
787
  return _supportsCookies;
@@ -1290,7 +791,7 @@
1290
791
  if (theValue && theValue.length) {
1291
792
  var parts = strTrim(theValue).split(";");
1292
793
  arrForEach(parts, function (thePart) {
1293
- thePart = strTrim(thePart || strEmpty$1);
794
+ thePart = strTrim(thePart || strEmpty);
1294
795
  if (thePart) {
1295
796
  var idx = thePart.indexOf("=");
1296
797
  if (idx === -1) {
@@ -1311,21 +812,21 @@
1311
812
  return null;
1312
813
  }
1313
814
  function _formatCookieValue(value, values) {
1314
- var cookieValue = value || strEmpty$1;
815
+ var cookieValue = value || strEmpty;
1315
816
  objForEachKey(values, function (name, theValue) {
1316
- cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty$1);
817
+ cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty);
1317
818
  });
1318
819
  return cookieValue;
1319
820
  }
1320
821
  function _getCookieValue(name) {
1321
- var cookieValue = strEmpty$1;
822
+ var cookieValue = strEmpty;
1322
823
  if (_doc) {
1323
- var theCookie = _doc[strCookie] || strEmpty$1;
824
+ var theCookie = _doc[strCookie] || strEmpty;
1324
825
  if (_parsedCookieValue !== theCookie) {
1325
826
  _cookieCache = _extractParts(theCookie);
1326
827
  _parsedCookieValue = theCookie;
1327
828
  }
1328
- cookieValue = strTrim(_cookieCache[name] || strEmpty$1);
829
+ cookieValue = strTrim(_cookieCache[name] || strEmpty);
1329
830
  }
1330
831
  return cookieValue;
1331
832
  }
@@ -1359,119 +860,86 @@
1359
860
  return false;
1360
861
  }
1361
862
 
1362
- var strOnPrefix = "on";
1363
- var strAttachEvent = "attachEvent";
1364
- var strAddEventHelper = "addEventListener";
1365
- var strEvents = "events";
1366
- createUniqueNamespace("aiEvtPageHide");
1367
- createUniqueNamespace("aiEvtPageShow");
1368
- var rRemoveEmptyNs = /\.[\.]+/g;
1369
- var rRemoveTrailingEmptyNs = /[\.]+$/;
1370
- var _guid = 1;
1371
- var elmNodeData = createElmNodeData("events");
1372
- var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
1373
- function _normalizeNamespace(name) {
1374
- if (name && name.replace) {
1375
- return name.replace(/^\s*\.*|\.*\s*$/g, "");
1376
- }
1377
- return name;
1378
- }
1379
- function _getEvtNamespace(eventName, evtNamespace) {
1380
- if (evtNamespace) {
1381
- var theNamespace_1 = "";
1382
- if (isArray(evtNamespace)) {
1383
- theNamespace_1 = "";
1384
- arrForEach(evtNamespace, function (name) {
1385
- name = _normalizeNamespace(name);
1386
- if (name) {
1387
- if (name[0] !== ".") {
1388
- name = "." + name;
1389
- }
1390
- theNamespace_1 += name;
1391
- }
1392
- });
1393
- }
1394
- else {
1395
- theNamespace_1 = _normalizeNamespace(evtNamespace);
1396
- }
1397
- if (theNamespace_1) {
1398
- if (theNamespace_1[0] !== ".") {
1399
- theNamespace_1 = "." + theNamespace_1;
1400
- }
1401
- eventName = (eventName || "") + theNamespace_1;
1402
- }
863
+ var UInt32Mask = 0x100000000;
864
+ var MaxUInt32 = 0xffffffff;
865
+ var _mwcSeeded = false;
866
+ var _mwcW = 123456789;
867
+ var _mwcZ = 987654321;
868
+ function _mwcSeed(seedValue) {
869
+ if (seedValue < 0) {
870
+ seedValue >>>= 0;
1403
871
  }
1404
- var parsedEvent = (eventNamespace.exec(eventName || "") || []);
1405
- return {
1406
- type: parsedEvent[1],
1407
- ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
1408
- };
872
+ _mwcW = (123456789 + seedValue) & MaxUInt32;
873
+ _mwcZ = (987654321 - seedValue) & MaxUInt32;
874
+ _mwcSeeded = true;
1409
875
  }
1410
- function _getRegisteredEvents(target, evtName, addDefault) {
1411
- if (addDefault === void 0) { addDefault = true; }
1412
- var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
1413
- var registeredEvents = aiEvts[evtName];
1414
- if (!registeredEvents) {
1415
- registeredEvents = aiEvts[evtName] = [];
876
+ function _autoSeedMwc() {
877
+ try {
878
+ var now = dateNow() & 0x7fffffff;
879
+ _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
880
+ }
881
+ catch (e) {
1416
882
  }
1417
- return registeredEvents;
1418
883
  }
1419
- function _doAttach(obj, evtName, handlerRef, useCapture) {
1420
- var result = false;
1421
- if (obj && evtName && evtName.type && handlerRef) {
1422
- if (obj[strAddEventHelper]) {
1423
- obj[strAddEventHelper](evtName.type, handlerRef, useCapture);
1424
- result = true;
1425
- }
1426
- else if (obj[strAttachEvent]) {
1427
- obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef);
1428
- result = true;
1429
- }
884
+ function randomValue(maxValue) {
885
+ if (maxValue > 0) {
886
+ return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
1430
887
  }
1431
- return result;
888
+ return 0;
1432
889
  }
1433
- function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
1434
- if (useCapture === void 0) { useCapture = false; }
1435
- var result = false;
1436
- if (target) {
1437
- try {
1438
- var evtName = _getEvtNamespace(eventName, evtNamespace);
1439
- result = _doAttach(target, evtName, handlerRef, useCapture);
1440
- if (result && elmNodeData.accept(target)) {
1441
- var registeredEvent = {
1442
- guid: _guid++,
1443
- evtName: evtName,
1444
- handler: handlerRef,
1445
- capture: useCapture
1446
- };
1447
- _getRegisteredEvents(target, evtName.type).push(registeredEvent);
1448
- }
1449
- }
1450
- catch (e) {
890
+ function random32(signed) {
891
+ var value;
892
+ var c = getCrypto() || getMsCrypto();
893
+ if (c && c.getRandomValues) {
894
+ value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
895
+ }
896
+ else if (isIE()) {
897
+ if (!_mwcSeeded) {
898
+ _autoSeedMwc();
1451
899
  }
900
+ value = mwcRandom32() & MaxUInt32;
1452
901
  }
1453
- return result;
902
+ else {
903
+ value = Math.floor((UInt32Mask * Math.random()) | 0);
904
+ }
905
+ if (!signed) {
906
+ value >>>= 0;
907
+ }
908
+ return value;
1454
909
  }
1455
- function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
1456
- if (useCapture === void 0) { useCapture = false; }
1457
- return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
910
+ function mwcRandomSeed(value) {
911
+ if (!value) {
912
+ _autoSeedMwc();
913
+ }
914
+ else {
915
+ _mwcSeed(value);
916
+ }
917
+ }
918
+ function mwcRandom32(signed) {
919
+ _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
920
+ _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
921
+ var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
922
+ if (!signed) {
923
+ value >>>= 0;
924
+ }
925
+ return value;
1458
926
  }
1459
- function addEventHandler(eventName, callback, evtNamespace) {
927
+
928
+ var _cookieMgrs = null;
929
+ var _canUseCookies;
930
+ function addEventHandler(eventName, callback) {
1460
931
  var result = false;
1461
932
  var w = getWindow();
1462
933
  if (w) {
1463
- result = eventOn(w, eventName, callback, evtNamespace);
1464
- result = eventOn(w["body"], eventName, callback, evtNamespace) || result;
934
+ result = attachEvent(w, eventName, callback);
935
+ result = attachEvent(w["body"], eventName, callback) || result;
1465
936
  }
1466
937
  var doc = getDocument();
1467
938
  if (doc) {
1468
- result = eventOn(doc, eventName, callback, evtNamespace) || result;
939
+ result = attachEvent(doc, eventName, callback) || result;
1469
940
  }
1470
941
  return result;
1471
942
  }
1472
-
1473
- var _cookieMgrs = null;
1474
- var _canUseCookies;
1475
943
  function newGuid() {
1476
944
  function randomHexDigit() {
1477
945
  return randomValue(15);
@@ -1488,9 +956,26 @@
1488
956
  }
1489
957
  return dateNow();
1490
958
  }
959
+ function newId(maxLength) {
960
+ if (maxLength === void 0) { maxLength = 22; }
961
+ var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
962
+ var number = random32() >>> 0;
963
+ var chars = 0;
964
+ var result = "";
965
+ while (result.length < maxLength) {
966
+ chars++;
967
+ result += base64chars.charAt(number & 0x3F);
968
+ number >>>= 6;
969
+ if (chars === 5) {
970
+ number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
971
+ chars = 0;
972
+ }
973
+ }
974
+ return result;
975
+ }
1491
976
  function generateW3CId() {
1492
977
  var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
1493
- var oct = strEmpty$1, tmp;
978
+ var oct = "", tmp;
1494
979
  for (var a = 0; a < 4; a++) {
1495
980
  tmp = random32();
1496
981
  oct +=
@@ -1585,95 +1070,6 @@
1585
1070
  return _legacyCookieMgr(null, logger).del(name);
1586
1071
  }
1587
1072
 
1588
- createEnumStyle({
1589
- CRITICAL: 1 ,
1590
- WARNING: 2
1591
- });
1592
- var _InternalMessageId = createEnumStyle({
1593
- BrowserDoesNotSupportLocalStorage: 0 ,
1594
- BrowserCannotReadLocalStorage: 1 ,
1595
- BrowserCannotReadSessionStorage: 2 ,
1596
- BrowserCannotWriteLocalStorage: 3 ,
1597
- BrowserCannotWriteSessionStorage: 4 ,
1598
- BrowserFailedRemovalFromLocalStorage: 5 ,
1599
- BrowserFailedRemovalFromSessionStorage: 6 ,
1600
- CannotSendEmptyTelemetry: 7 ,
1601
- ClientPerformanceMathError: 8 ,
1602
- ErrorParsingAISessionCookie: 9 ,
1603
- ErrorPVCalc: 10 ,
1604
- ExceptionWhileLoggingError: 11 ,
1605
- FailedAddingTelemetryToBuffer: 12 ,
1606
- FailedMonitorAjaxAbort: 13 ,
1607
- FailedMonitorAjaxDur: 14 ,
1608
- FailedMonitorAjaxOpen: 15 ,
1609
- FailedMonitorAjaxRSC: 16 ,
1610
- FailedMonitorAjaxSend: 17 ,
1611
- FailedMonitorAjaxGetCorrelationHeader: 18 ,
1612
- FailedToAddHandlerForOnBeforeUnload: 19 ,
1613
- FailedToSendQueuedTelemetry: 20 ,
1614
- FailedToReportDataLoss: 21 ,
1615
- FlushFailed: 22 ,
1616
- MessageLimitPerPVExceeded: 23 ,
1617
- MissingRequiredFieldSpecification: 24 ,
1618
- NavigationTimingNotSupported: 25 ,
1619
- OnError: 26 ,
1620
- SessionRenewalDateIsZero: 27 ,
1621
- SenderNotInitialized: 28 ,
1622
- StartTrackEventFailed: 29 ,
1623
- StopTrackEventFailed: 30 ,
1624
- StartTrackFailed: 31 ,
1625
- StopTrackFailed: 32 ,
1626
- TelemetrySampledAndNotSent: 33 ,
1627
- TrackEventFailed: 34 ,
1628
- TrackExceptionFailed: 35 ,
1629
- TrackMetricFailed: 36 ,
1630
- TrackPVFailed: 37 ,
1631
- TrackPVFailedCalc: 38 ,
1632
- TrackTraceFailed: 39 ,
1633
- TransmissionFailed: 40 ,
1634
- FailedToSetStorageBuffer: 41 ,
1635
- FailedToRestoreStorageBuffer: 42 ,
1636
- InvalidBackendResponse: 43 ,
1637
- FailedToFixDepricatedValues: 44 ,
1638
- InvalidDurationValue: 45 ,
1639
- TelemetryEnvelopeInvalid: 46 ,
1640
- CreateEnvelopeError: 47 ,
1641
- CannotSerializeObject: 48 ,
1642
- CannotSerializeObjectNonSerializable: 49 ,
1643
- CircularReferenceDetected: 50 ,
1644
- ClearAuthContextFailed: 51 ,
1645
- ExceptionTruncated: 52 ,
1646
- IllegalCharsInName: 53 ,
1647
- ItemNotInArray: 54 ,
1648
- MaxAjaxPerPVExceeded: 55 ,
1649
- MessageTruncated: 56 ,
1650
- NameTooLong: 57 ,
1651
- SampleRateOutOfRange: 58 ,
1652
- SetAuthContextFailed: 59 ,
1653
- SetAuthContextFailedAccountName: 60 ,
1654
- StringValueTooLong: 61 ,
1655
- StartCalledMoreThanOnce: 62 ,
1656
- StopCalledWithoutStart: 63 ,
1657
- TelemetryInitializerFailed: 64 ,
1658
- TrackArgumentsNotSpecified: 65 ,
1659
- UrlTooLong: 66 ,
1660
- SessionStorageBufferFull: 67 ,
1661
- CannotAccessCookie: 68 ,
1662
- IdTooLong: 69 ,
1663
- InvalidEvent: 70 ,
1664
- FailedMonitorAjaxSetRequestHeader: 71 ,
1665
- SendBrowserInfoOnUserInit: 72 ,
1666
- PluginException: 73 ,
1667
- NotificationException: 74 ,
1668
- SnippetScriptLoadFailure: 99 ,
1669
- InvalidInstrumentationKey: 100 ,
1670
- CannotParseAiBlobValue: 101 ,
1671
- InvalidContentBlob: 102 ,
1672
- TrackPageActionEventFailed: 103 ,
1673
- FailedAddingCustomDefinedRequestContext: 104 ,
1674
- InMemoryStorageBufferFull: 105
1675
- });
1676
-
1677
1073
  var RequestHeaders = {
1678
1074
  requestContextHeader: "Request-Context",
1679
1075
  requestContextTargetKey: "appId",
@@ -1706,7 +1102,7 @@
1706
1102
  name = strTrim(name.toString());
1707
1103
  if (name.length > 150 ) {
1708
1104
  nameTrunc = name.substring(0, 150 );
1709
- _throwInternal(logger, 2 , _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
1105
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
1710
1106
  }
1711
1107
  }
1712
1108
  return nameTrunc || name;
@@ -1719,7 +1115,7 @@
1719
1115
  value = strTrim(value);
1720
1116
  if (value.toString().length > maxLength) {
1721
1117
  valueTrunc = value.toString().substring(0, maxLength);
1722
- _throwInternal(logger, 2 , _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
1118
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
1723
1119
  }
1724
1120
  }
1725
1121
  return valueTrunc || value;
@@ -1732,7 +1128,7 @@
1732
1128
  if (message) {
1733
1129
  if (message.length > 32768 ) {
1734
1130
  messageTrunc = message.substring(0, 32768 );
1735
- _throwInternal(logger, 2 , _InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
1131
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
1736
1132
  }
1737
1133
  }
1738
1134
  return messageTrunc || message;
@@ -1743,7 +1139,7 @@
1743
1139
  var value = "" + exception;
1744
1140
  if (value.length > 32768 ) {
1745
1141
  exceptionTrunc = value.substring(0, 32768 );
1746
- _throwInternal(logger, 2 , _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
1142
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
1747
1143
  }
1748
1144
  }
1749
1145
  return exceptionTrunc || exception;
@@ -1757,7 +1153,7 @@
1757
1153
  value = getJSON().stringify(value);
1758
1154
  }
1759
1155
  catch (e) {
1760
- _throwInternal(logger, 2 , _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
1156
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
1761
1157
  }
1762
1158
  }
1763
1159
  value = dataSanitizeString(logger, value, 8192 );
@@ -1788,7 +1184,7 @@
1788
1184
  input = strTrim(input);
1789
1185
  if (input.length > maxLength) {
1790
1186
  inputTrunc = input.substring(0, maxLength);
1791
- _throwInternal(logger, 2 , _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
1187
+ logger && logger.throwInternal(LoggingSeverity.WARNING, _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
1792
1188
  }
1793
1189
  }
1794
1190
  return inputTrunc || input;
@@ -1834,7 +1230,6 @@
1834
1230
  return event;
1835
1231
  }
1836
1232
 
1837
- var strEmpty = "";
1838
1233
  function stringToBoolOrDefault(str, defaultValue) {
1839
1234
  if (defaultValue === void 0) { defaultValue = false; }
1840
1235
  if (str === undefined || str === null) {
@@ -1847,16 +1242,16 @@
1847
1242
  totalms = 0;
1848
1243
  }
1849
1244
  totalms = Math.round(totalms);
1850
- var ms = strEmpty + totalms % 1000;
1851
- var sec = strEmpty + Math.floor(totalms / 1000) % 60;
1852
- var min = strEmpty + Math.floor(totalms / (1000 * 60)) % 60;
1853
- var hour = strEmpty + Math.floor(totalms / (1000 * 60 * 60)) % 24;
1245
+ var ms = "" + totalms % 1000;
1246
+ var sec = "" + Math.floor(totalms / 1000) % 60;
1247
+ var min = "" + Math.floor(totalms / (1000 * 60)) % 60;
1248
+ var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24;
1854
1249
  var days = Math.floor(totalms / (1000 * 60 * 60 * 24));
1855
1250
  ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms;
1856
1251
  sec = sec.length < 2 ? "0" + sec : sec;
1857
1252
  min = min.length < 2 ? "0" + min : min;
1858
1253
  hour = hour.length < 2 ? "0" + hour : hour;
1859
- return (days > 0 ? days + "." : strEmpty) + hour + ":" + min + ":" + sec + "." + ms;
1254
+ return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms;
1860
1255
  }
1861
1256
  function getExtensionByName(extensions, identifier) {
1862
1257
  var extension = null;
@@ -1880,15 +1275,17 @@
1880
1275
  var strNotSpecified = "not_specified";
1881
1276
  var strIkey = "iKey";
1882
1277
 
1883
- var StorageType = createEnumStyle({
1884
- LocalStorage: 0 ,
1885
- SessionStorage: 1
1886
- });
1887
- var DistributedTracingModes = createEnumStyle({
1888
- AI: 0 ,
1889
- AI_AND_W3C: 1 ,
1890
- W3C: 2
1891
- });
1278
+ var StorageType;
1279
+ (function (StorageType) {
1280
+ StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage";
1281
+ StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage";
1282
+ })(StorageType || (StorageType = {}));
1283
+ exports.DistributedTracingModes = void 0;
1284
+ (function (DistributedTracingModes) {
1285
+ DistributedTracingModes[DistributedTracingModes["AI"] = 0] = "AI";
1286
+ DistributedTracingModes[DistributedTracingModes["AI_AND_W3C"] = 1] = "AI_AND_W3C";
1287
+ DistributedTracingModes[DistributedTracingModes["W3C"] = 2] = "W3C";
1288
+ })(exports.DistributedTracingModes || (exports.DistributedTracingModes = {}));
1892
1289
 
1893
1290
  var _canUseLocalStorage = undefined;
1894
1291
  var _canUseSessionStorage = undefined;
@@ -1926,12 +1323,8 @@
1926
1323
  _canUseLocalStorage = false;
1927
1324
  _canUseSessionStorage = false;
1928
1325
  }
1929
- function utlEnableStorage() {
1930
- _canUseLocalStorage = utlCanUseLocalStorage(true);
1931
- _canUseSessionStorage = utlCanUseSessionStorage(true);
1932
- }
1933
- function utlCanUseLocalStorage(reset) {
1934
- if (reset || _canUseLocalStorage === undefined) {
1326
+ function utlCanUseLocalStorage() {
1327
+ if (_canUseLocalStorage === undefined) {
1935
1328
  _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
1936
1329
  }
1937
1330
  return _canUseLocalStorage;
@@ -1944,7 +1337,7 @@
1944
1337
  }
1945
1338
  catch (e) {
1946
1339
  _canUseLocalStorage = false;
1947
- _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
1340
+ logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
1948
1341
  }
1949
1342
  }
1950
1343
  return null;
@@ -1958,7 +1351,7 @@
1958
1351
  }
1959
1352
  catch (e) {
1960
1353
  _canUseLocalStorage = false;
1961
- _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
1354
+ logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
1962
1355
  }
1963
1356
  }
1964
1357
  return false;
@@ -1972,13 +1365,13 @@
1972
1365
  }
1973
1366
  catch (e) {
1974
1367
  _canUseLocalStorage = false;
1975
- _throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
1368
+ logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
1976
1369
  }
1977
1370
  }
1978
1371
  return false;
1979
1372
  }
1980
- function utlCanUseSessionStorage(reset) {
1981
- if (reset || _canUseSessionStorage === undefined) {
1373
+ function utlCanUseSessionStorage() {
1374
+ if (_canUseSessionStorage === undefined) {
1982
1375
  _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
1983
1376
  }
1984
1377
  return _canUseSessionStorage;
@@ -2000,7 +1393,7 @@
2000
1393
  }
2001
1394
  catch (e) {
2002
1395
  _canUseSessionStorage = false;
2003
- _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
1396
+ logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2004
1397
  }
2005
1398
  }
2006
1399
  return null;
@@ -2014,7 +1407,7 @@
2014
1407
  }
2015
1408
  catch (e) {
2016
1409
  _canUseSessionStorage = false;
2017
- _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
1410
+ logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2018
1411
  }
2019
1412
  }
2020
1413
  return false;
@@ -2028,7 +1421,7 @@
2028
1421
  }
2029
1422
  catch (e) {
2030
1423
  _canUseSessionStorage = false;
2031
- _throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
1424
+ logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2032
1425
  }
2033
1426
  }
2034
1427
  return false;
@@ -2115,7 +1508,7 @@
2115
1508
  "https://dc-int.services.visualstudio.com/v2/track"
2116
1509
  ];
2117
1510
  function isInternalApplicationInsightsEndpoint(endpointUrl) {
2118
- return _internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1;
1511
+ return arrIndexOf(_internalEndpoints, endpointUrl.toLowerCase()) !== -1;
2119
1512
  }
2120
1513
  var Util = {
2121
1514
  NotSpecified: strNotSpecified,
@@ -3298,7 +2691,6 @@
3298
2691
  exports.DataSanitizer = DataSanitizer;
3299
2692
  exports.DateTimeUtils = DateTimeUtils;
3300
2693
  exports.DisabledPropertyName = DisabledPropertyName;
3301
- exports.DistributedTracingModes = DistributedTracingModes;
3302
2694
  exports.Envelope = Envelope;
3303
2695
  exports.Event = Event$1;
3304
2696
  exports.Exception = Exception;
@@ -3348,7 +2740,6 @@
3348
2740
  exports.utlCanUseLocalStorage = utlCanUseLocalStorage;
3349
2741
  exports.utlCanUseSessionStorage = utlCanUseSessionStorage;
3350
2742
  exports.utlDisableStorage = utlDisableStorage;
3351
- exports.utlEnableStorage = utlEnableStorage;
3352
2743
  exports.utlGetLocalStorage = utlGetLocalStorage;
3353
2744
  exports.utlGetSessionStorage = utlGetSessionStorage;
3354
2745
  exports.utlGetSessionStorageKeys = utlGetSessionStorageKeys;