@microsoft/1ds-post-js 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/bundle/{ms.post-3.2.1.gbl.js → ms.post-3.2.2.gbl.js} +296 -266
  3. package/bundle/ms.post-3.2.2.gbl.js.map +1 -0
  4. package/bundle/ms.post-3.2.2.gbl.min.js +7 -0
  5. package/bundle/ms.post-3.2.2.gbl.min.js.map +1 -0
  6. package/bundle/ms.post-3.2.2.integrity.json +46 -0
  7. package/bundle/{ms.post-3.2.1.js → ms.post-3.2.2.js} +296 -266
  8. package/bundle/ms.post-3.2.2.js.map +1 -0
  9. package/bundle/ms.post-3.2.2.min.js +7 -0
  10. package/bundle/ms.post-3.2.2.min.js.map +1 -0
  11. package/bundle/ms.post.gbl.js +295 -265
  12. package/bundle/ms.post.gbl.js.map +1 -1
  13. package/bundle/ms.post.gbl.min.js +2 -2
  14. package/bundle/ms.post.gbl.min.js.map +1 -1
  15. package/bundle/ms.post.integrity.json +17 -17
  16. package/bundle/ms.post.js +295 -265
  17. package/bundle/ms.post.js.map +1 -1
  18. package/bundle/ms.post.min.js +2 -2
  19. package/bundle/ms.post.min.js.map +1 -1
  20. package/dist/ms.post.js +40 -17
  21. package/dist/ms.post.js.map +1 -1
  22. package/dist/ms.post.min.js +2 -2
  23. package/dist/ms.post.min.js.map +1 -1
  24. package/dist-esm/src/BatchNotificationActions.js +1 -1
  25. package/dist-esm/src/ClockSkewManager.js +1 -1
  26. package/dist-esm/src/Constants.js +1 -1
  27. package/dist-esm/src/DataModels.js +1 -1
  28. package/dist-esm/src/EventBatch.js +1 -1
  29. package/dist-esm/src/HttpManager.d.ts +2 -1
  30. package/dist-esm/src/HttpManager.js +5 -5
  31. package/dist-esm/src/HttpManager.js.map +1 -1
  32. package/dist-esm/src/Index.js +1 -1
  33. package/dist-esm/src/KillSwitch.js +1 -1
  34. package/dist-esm/src/PostChannel.d.ts +2 -5
  35. package/dist-esm/src/PostChannel.js +21 -11
  36. package/dist-esm/src/PostChannel.js.map +1 -1
  37. package/dist-esm/src/RetryPolicy.js +1 -1
  38. package/dist-esm/src/Serializer.js +1 -1
  39. package/dist-esm/src/TimeoutOverrideWrapper.d.ts +18 -0
  40. package/dist-esm/src/TimeoutOverrideWrapper.js +28 -0
  41. package/dist-esm/src/TimeoutOverrideWrapper.js.map +1 -0
  42. package/dist-esm/src/typings/XDomainRequest.js +1 -1
  43. package/package.json +3 -3
  44. package/src/HttpManager.ts +5 -4
  45. package/src/PostChannel.ts +30 -11
  46. package/src/TimeoutOverrideWrapper.ts +29 -0
  47. package/bundle/ms.post-3.2.1.gbl.js.map +0 -1
  48. package/bundle/ms.post-3.2.1.gbl.min.js +0 -7
  49. package/bundle/ms.post-3.2.1.gbl.min.js.map +0 -1
  50. package/bundle/ms.post-3.2.1.integrity.json +0 -46
  51. package/bundle/ms.post-3.2.1.js.map +0 -1
  52. package/bundle/ms.post-3.2.1.min.js +0 -7
  53. package/bundle/ms.post-3.2.1.min.js.map +0 -1
package/bundle/ms.post.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * 1DS JS SDK POST plugin, 3.2.1
2
+ * 1DS JS SDK POST plugin, 3.2.2
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -83,6 +83,254 @@
83
83
  d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
84
84
  }
85
85
 
86
+ /*!
87
+ * Microsoft Dynamic Proto Utility, 1.1.6
88
+ * Copyright (c) Microsoft and contributors. All rights reserved.
89
+ */
90
+ var Constructor = 'constructor';
91
+ var Prototype = 'prototype';
92
+ var strFunction = 'function';
93
+ var DynInstFuncTable = '_dynInstFuncs';
94
+ var DynProxyTag = '_isDynProxy';
95
+ var DynClassName = '_dynClass';
96
+ var DynClassNamePrefix = '_dynCls$';
97
+ var DynInstChkTag = '_dynInstChk';
98
+ var DynAllowInstChkTag = DynInstChkTag;
99
+ var DynProtoDefaultOptions = '_dfOpts';
100
+ var UnknownValue = '_unknown_';
101
+ var str__Proto$1 = "__proto__";
102
+ var DynProtoBaseProto = "_dyn" + str__Proto$1;
103
+ var DynProtoCurrent = "_dynInstProto";
104
+ var strUseBaseInst = 'useBaseInst';
105
+ var strSetInstFuncs = 'setInstFuncs';
106
+ var Obj = Object;
107
+ var _objGetPrototypeOf$1 = Obj["getPrototypeOf"];
108
+ var _objGetOwnProps = Obj["getOwnPropertyNames"];
109
+ var _dynamicNames = 0;
110
+ function _hasOwnProperty(obj, prop) {
111
+ return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
112
+ }
113
+ function _isObjectOrArrayPrototype(target) {
114
+ return target && (target === Obj[Prototype] || target === Array[Prototype]);
115
+ }
116
+ function _isObjectArrayOrFunctionPrototype(target) {
117
+ return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
118
+ }
119
+ function _getObjProto$1(target) {
120
+ var newProto;
121
+ if (target) {
122
+ if (_objGetPrototypeOf$1) {
123
+ return _objGetPrototypeOf$1(target);
124
+ }
125
+ var curProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
126
+ newProto = target[DynProtoBaseProto] || curProto;
127
+ if (!_hasOwnProperty(target, DynProtoBaseProto)) {
128
+ delete target[DynProtoCurrent];
129
+ newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];
130
+ target[DynProtoCurrent] = curProto;
131
+ }
132
+ }
133
+ return newProto;
134
+ }
135
+ function _forEachProp(target, func) {
136
+ var props = [];
137
+ if (_objGetOwnProps) {
138
+ props = _objGetOwnProps(target);
139
+ }
140
+ else {
141
+ for (var name_1 in target) {
142
+ if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
143
+ props.push(name_1);
144
+ }
145
+ }
146
+ }
147
+ if (props && props.length > 0) {
148
+ for (var lp = 0; lp < props.length; lp++) {
149
+ func(props[lp]);
150
+ }
151
+ }
152
+ }
153
+ function _isDynamicCandidate(target, funcName, skipOwn) {
154
+ return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
155
+ }
156
+ function _throwTypeError(message) {
157
+ throw new TypeError("DynamicProto: " + message);
158
+ }
159
+ function _getInstanceFuncs(thisTarget) {
160
+ var instFuncs = {};
161
+ _forEachProp(thisTarget, function (name) {
162
+ if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
163
+ instFuncs[name] = thisTarget[name];
164
+ }
165
+ });
166
+ return instFuncs;
167
+ }
168
+ function _hasVisited(values, value) {
169
+ for (var lp = values.length - 1; lp >= 0; lp--) {
170
+ if (values[lp] === value) {
171
+ return true;
172
+ }
173
+ }
174
+ return false;
175
+ }
176
+ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
177
+ function _instFuncProxy(target, funcHost, funcName) {
178
+ var theFunc = funcHost[funcName];
179
+ if (theFunc[DynProxyTag] && useBaseInst) {
180
+ var instFuncTable = target[DynInstFuncTable] || {};
181
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
182
+ theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
183
+ }
184
+ }
185
+ return function () {
186
+ return theFunc.apply(target, arguments);
187
+ };
188
+ }
189
+ var baseFuncs = {};
190
+ _forEachProp(instFuncs, function (name) {
191
+ baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
192
+ });
193
+ var baseProto = _getObjProto$1(classProto);
194
+ var visited = [];
195
+ while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
196
+ _forEachProp(baseProto, function (name) {
197
+ if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) {
198
+ baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
199
+ }
200
+ });
201
+ visited.push(baseProto);
202
+ baseProto = _getObjProto$1(baseProto);
203
+ }
204
+ return baseFuncs;
205
+ }
206
+ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
207
+ var instFunc = null;
208
+ if (target && _hasOwnProperty(proto, DynClassName)) {
209
+ var instFuncTable = target[DynInstFuncTable] || {};
210
+ instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
211
+ if (!instFunc) {
212
+ _throwTypeError("Missing [" + funcName + "] " + strFunction);
213
+ }
214
+ if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
215
+ var canAddInst = !_hasOwnProperty(target, funcName);
216
+ var objProto = _getObjProto$1(target);
217
+ var visited = [];
218
+ while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
219
+ var protoFunc = objProto[funcName];
220
+ if (protoFunc) {
221
+ canAddInst = (protoFunc === currentDynProtoProxy);
222
+ break;
223
+ }
224
+ visited.push(objProto);
225
+ objProto = _getObjProto$1(objProto);
226
+ }
227
+ try {
228
+ if (canAddInst) {
229
+ target[funcName] = instFunc;
230
+ }
231
+ instFunc[DynInstChkTag] = 1;
232
+ }
233
+ catch (e) {
234
+ instFuncTable[DynAllowInstChkTag] = false;
235
+ }
236
+ }
237
+ }
238
+ return instFunc;
239
+ }
240
+ function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
241
+ var protoFunc = proto[funcName];
242
+ if (protoFunc === currentDynProtoProxy) {
243
+ protoFunc = _getObjProto$1(proto)[funcName];
244
+ }
245
+ if (typeof protoFunc !== strFunction) {
246
+ _throwTypeError("[" + funcName + "] is not a " + strFunction);
247
+ }
248
+ return protoFunc;
249
+ }
250
+ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
251
+ function _createDynamicPrototype(proto, funcName) {
252
+ var dynProtoProxy = function () {
253
+ var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
254
+ return instFunc.apply(this, arguments);
255
+ };
256
+ dynProtoProxy[DynProxyTag] = 1;
257
+ return dynProtoProxy;
258
+ }
259
+ if (!_isObjectOrArrayPrototype(proto)) {
260
+ var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
261
+ var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
262
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
263
+ instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
264
+ }
265
+ _forEachProp(target, function (name) {
266
+ if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
267
+ instFuncs_1[name] = target[name];
268
+ delete target[name];
269
+ if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
270
+ proto[name] = _createDynamicPrototype(proto, name);
271
+ }
272
+ }
273
+ });
274
+ }
275
+ }
276
+ function _checkPrototype(classProto, thisTarget) {
277
+ if (_objGetPrototypeOf$1) {
278
+ var visited = [];
279
+ var thisProto = _getObjProto$1(thisTarget);
280
+ while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
281
+ if (thisProto === classProto) {
282
+ return true;
283
+ }
284
+ visited.push(thisProto);
285
+ thisProto = _getObjProto$1(thisProto);
286
+ }
287
+ return false;
288
+ }
289
+ return true;
290
+ }
291
+ function _getObjName(target, unknownValue) {
292
+ if (_hasOwnProperty(target, Prototype)) {
293
+ return target.name || unknownValue || UnknownValue;
294
+ }
295
+ return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
296
+ }
297
+ function dynamicProto(theClass, target, delegateFunc, options) {
298
+ if (!_hasOwnProperty(theClass, Prototype)) {
299
+ _throwTypeError("theClass is an invalid class definition.");
300
+ }
301
+ var classProto = theClass[Prototype];
302
+ if (!_checkPrototype(classProto, target)) {
303
+ _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
304
+ }
305
+ var className = null;
306
+ if (_hasOwnProperty(classProto, DynClassName)) {
307
+ className = classProto[DynClassName];
308
+ }
309
+ else {
310
+ className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
311
+ _dynamicNames++;
312
+ classProto[DynClassName] = className;
313
+ }
314
+ var perfOptions = dynamicProto[DynProtoDefaultOptions];
315
+ var useBaseInst = !!perfOptions[strUseBaseInst];
316
+ if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
317
+ useBaseInst = !!options[strUseBaseInst];
318
+ }
319
+ var instFuncs = _getInstanceFuncs(target);
320
+ var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
321
+ delegateFunc(target, baseFuncs);
322
+ var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs];
323
+ if (setInstanceFunc && options) {
324
+ setInstanceFunc = !!options[strSetInstFuncs];
325
+ }
326
+ _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
327
+ }
328
+ var perfDefaults = {
329
+ setInstFuncs: true,
330
+ useBaseInst: true
331
+ };
332
+ dynamicProto[DynProtoDefaultOptions] = perfDefaults;
333
+
86
334
  var strEmpty = "";
87
335
  var strSetNextPlugin = "setNextPlugin";
88
336
  var strIsInitialized = "isInitialized";
@@ -96,7 +344,7 @@
96
344
  var strIndexOf = "indexOf";
97
345
  var cStrTrim = "trim";
98
346
  var strToString = "toString";
99
- var str__Proto$1 = "__proto__";
347
+ var str__Proto = "__proto__";
100
348
  var strConstructor = "constructor";
101
349
  var _objDefineProperty$1 = ObjDefineProperty;
102
350
  var _objFreeze = ObjClass.freeze;
@@ -111,13 +359,13 @@
111
359
  var rCamelCase = /-([a-z])/g;
112
360
  var rNormalizeInvalid = /([^\w\d_$])/g;
113
361
  var rLeadingNumeric = /^(\d+[\w\d_$])/;
114
- var _objGetPrototypeOf$1 = Object["getPrototypeOf"];
115
- function _getObjProto$1(target) {
362
+ var _objGetPrototypeOf = Object["getPrototypeOf"];
363
+ function _getObjProto(target) {
116
364
  if (target) {
117
- if (_objGetPrototypeOf$1) {
118
- return _objGetPrototypeOf$1(target);
365
+ if (_objGetPrototypeOf) {
366
+ return _objGetPrototypeOf(target);
119
367
  }
120
- var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor];
368
+ var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
121
369
  if (newProto) {
122
370
  return newProto;
123
371
  }
@@ -203,7 +451,7 @@
203
451
  function isPlainObject(value) {
204
452
  var result = false;
205
453
  if (value && typeof value === "object") {
206
- var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value);
454
+ var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
207
455
  if (!proto) {
208
456
  result = true;
209
457
  }
@@ -434,247 +682,6 @@
434
682
  QueueFull: 5
435
683
  });
436
684
 
437
- /*!
438
- * Microsoft Dynamic Proto Utility, 1.1.4
439
- * Copyright (c) Microsoft and contributors. All rights reserved.
440
- */
441
- var Constructor = 'constructor';
442
- var Prototype = 'prototype';
443
- var strFunction = 'function';
444
- var DynInstFuncTable = '_dynInstFuncs';
445
- var DynProxyTag = '_isDynProxy';
446
- var DynClassName = '_dynClass';
447
- var DynClassNamePrefix = '_dynCls$';
448
- var DynInstChkTag = '_dynInstChk';
449
- var DynAllowInstChkTag = DynInstChkTag;
450
- var DynProtoDefaultOptions = '_dfOpts';
451
- var UnknownValue = '_unknown_';
452
- var str__Proto = "__proto__";
453
- var strUseBaseInst = 'useBaseInst';
454
- var strSetInstFuncs = 'setInstFuncs';
455
- var Obj = Object;
456
- var _objGetPrototypeOf = Obj["getPrototypeOf"];
457
- var _dynamicNames = 0;
458
- function _hasOwnProperty(obj, prop) {
459
- return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
460
- }
461
- function _isObjectOrArrayPrototype(target) {
462
- return target && (target === Obj[Prototype] || target === Array[Prototype]);
463
- }
464
- function _isObjectArrayOrFunctionPrototype(target) {
465
- return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
466
- }
467
- function _getObjProto(target) {
468
- if (target) {
469
- if (_objGetPrototypeOf) {
470
- return _objGetPrototypeOf(target);
471
- }
472
- var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
473
- if (newProto) {
474
- return newProto;
475
- }
476
- }
477
- return null;
478
- }
479
- function _forEachProp(target, func) {
480
- var props = [];
481
- var getOwnProps = Obj["getOwnPropertyNames"];
482
- if (getOwnProps) {
483
- props = getOwnProps(target);
484
- }
485
- else {
486
- for (var name_1 in target) {
487
- if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
488
- props.push(name_1);
489
- }
490
- }
491
- }
492
- if (props && props.length > 0) {
493
- for (var lp = 0; lp < props.length; lp++) {
494
- func(props[lp]);
495
- }
496
- }
497
- }
498
- function _isDynamicCandidate(target, funcName, skipOwn) {
499
- return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
500
- }
501
- function _throwTypeError(message) {
502
- throw new TypeError("DynamicProto: " + message);
503
- }
504
- function _getInstanceFuncs(thisTarget) {
505
- var instFuncs = {};
506
- _forEachProp(thisTarget, function (name) {
507
- if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
508
- instFuncs[name] = thisTarget[name];
509
- }
510
- });
511
- return instFuncs;
512
- }
513
- function _hasVisited(values, value) {
514
- for (var lp = values.length - 1; lp >= 0; lp--) {
515
- if (values[lp] === value) {
516
- return true;
517
- }
518
- }
519
- return false;
520
- }
521
- function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
522
- function _instFuncProxy(target, funcHost, funcName) {
523
- var theFunc = funcHost[funcName];
524
- if (theFunc[DynProxyTag] && useBaseInst) {
525
- var instFuncTable = target[DynInstFuncTable] || {};
526
- if (instFuncTable[DynAllowInstChkTag] !== false) {
527
- theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
528
- }
529
- }
530
- return function () {
531
- return theFunc.apply(target, arguments);
532
- };
533
- }
534
- var baseFuncs = {};
535
- _forEachProp(instFuncs, function (name) {
536
- baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
537
- });
538
- var baseProto = _getObjProto(classProto);
539
- var visited = [];
540
- while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
541
- _forEachProp(baseProto, function (name) {
542
- if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
543
- baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
544
- }
545
- });
546
- visited.push(baseProto);
547
- baseProto = _getObjProto(baseProto);
548
- }
549
- return baseFuncs;
550
- }
551
- function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
552
- var instFunc = null;
553
- if (target && _hasOwnProperty(proto, DynClassName)) {
554
- var instFuncTable = target[DynInstFuncTable] || {};
555
- instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
556
- if (!instFunc) {
557
- _throwTypeError("Missing [" + funcName + "] " + strFunction);
558
- }
559
- if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
560
- var canAddInst = !_hasOwnProperty(target, funcName);
561
- var objProto = _getObjProto(target);
562
- var visited = [];
563
- while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
564
- var protoFunc = objProto[funcName];
565
- if (protoFunc) {
566
- canAddInst = (protoFunc === currentDynProtoProxy);
567
- break;
568
- }
569
- visited.push(objProto);
570
- objProto = _getObjProto(objProto);
571
- }
572
- try {
573
- if (canAddInst) {
574
- target[funcName] = instFunc;
575
- }
576
- instFunc[DynInstChkTag] = 1;
577
- }
578
- catch (e) {
579
- instFuncTable[DynAllowInstChkTag] = false;
580
- }
581
- }
582
- }
583
- return instFunc;
584
- }
585
- function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
586
- var protoFunc = proto[funcName];
587
- if (protoFunc === currentDynProtoProxy) {
588
- protoFunc = _getObjProto(proto)[funcName];
589
- }
590
- if (typeof protoFunc !== strFunction) {
591
- _throwTypeError("[" + funcName + "] is not a " + strFunction);
592
- }
593
- return protoFunc;
594
- }
595
- function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
596
- function _createDynamicPrototype(proto, funcName) {
597
- var dynProtoProxy = function () {
598
- var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
599
- return instFunc.apply(this, arguments);
600
- };
601
- dynProtoProxy[DynProxyTag] = 1;
602
- return dynProtoProxy;
603
- }
604
- if (!_isObjectOrArrayPrototype(proto)) {
605
- var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
606
- var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
607
- if (instFuncTable[DynAllowInstChkTag] !== false) {
608
- instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
609
- }
610
- _forEachProp(target, function (name) {
611
- if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
612
- instFuncs_1[name] = target[name];
613
- delete target[name];
614
- if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
615
- proto[name] = _createDynamicPrototype(proto, name);
616
- }
617
- }
618
- });
619
- }
620
- }
621
- function _checkPrototype(classProto, thisTarget) {
622
- if (_objGetPrototypeOf) {
623
- var visited = [];
624
- var thisProto = _getObjProto(thisTarget);
625
- while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
626
- if (thisProto === classProto) {
627
- return true;
628
- }
629
- visited.push(thisProto);
630
- thisProto = _getObjProto(thisProto);
631
- }
632
- }
633
- return false;
634
- }
635
- function _getObjName(target, unknownValue) {
636
- if (_hasOwnProperty(target, Prototype)) {
637
- return target.name || unknownValue || UnknownValue;
638
- }
639
- return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
640
- }
641
- function dynamicProto(theClass, target, delegateFunc, options) {
642
- if (!_hasOwnProperty(theClass, Prototype)) {
643
- _throwTypeError("theClass is an invalid class definition.");
644
- }
645
- var classProto = theClass[Prototype];
646
- if (!_checkPrototype(classProto, target)) {
647
- _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
648
- }
649
- var className = null;
650
- if (_hasOwnProperty(classProto, DynClassName)) {
651
- className = classProto[DynClassName];
652
- }
653
- else {
654
- className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
655
- _dynamicNames++;
656
- classProto[DynClassName] = className;
657
- }
658
- var perfOptions = dynamicProto[DynProtoDefaultOptions];
659
- var useBaseInst = !!perfOptions[strUseBaseInst];
660
- if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
661
- useBaseInst = !!options[strUseBaseInst];
662
- }
663
- var instFuncs = _getInstanceFuncs(target);
664
- var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
665
- delegateFunc(target, baseFuncs);
666
- var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
667
- if (setInstanceFunc && options) {
668
- setInstanceFunc = !!options[strSetInstFuncs];
669
- }
670
- _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
671
- }
672
- var perfDefaults = {
673
- setInstFuncs: true,
674
- useBaseInst: true
675
- };
676
- dynamicProto[DynProtoDefaultOptions] = perfDefaults;
677
-
678
685
  var strWindow = "window";
679
686
  var strDocument = "document";
680
687
  var strNavigator = "navigator";
@@ -936,7 +943,7 @@
936
943
  if (isUserAct === void 0) { isUserAct = false; }
937
944
  var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
938
945
  if (_self.enableDebugExceptions()) {
939
- throw message;
946
+ throw dumpObj(message);
940
947
  }
941
948
  else {
942
949
  var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole;
@@ -1210,7 +1217,7 @@
1210
1217
  }
1211
1218
 
1212
1219
  var _objDefineProperty = ObjDefineProperty;
1213
- var version = "2.8.1";
1220
+ var version = "2.8.3";
1214
1221
  var instanceName = "." + newId(6);
1215
1222
  var _dataUid = 0;
1216
1223
  function _createAccessor(target, prop, value) {
@@ -2096,7 +2103,7 @@
2096
2103
  }
2097
2104
 
2098
2105
  var _a$1;
2099
- var Version = '3.2.1';
2106
+ var Version = '3.2.2';
2100
2107
  var FullVersionString = "1DS-Web-JS-" + Version;
2101
2108
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
2102
2109
  var strWithCredentials = "withCredentials";
@@ -2111,7 +2118,7 @@
2111
2118
  _a$1[4096 | 3 ] = 7 ,
2112
2119
  _a$1);
2113
2120
  Boolean(getDocument());
2114
- var isWindowObjectAvailable = Boolean(getWindow());
2121
+ Boolean(getWindow());
2115
2122
  function isValueAssigned(value) {
2116
2123
  return !(value === "" || isNullOrUndefined(value));
2117
2124
  }
@@ -2805,7 +2812,7 @@
2805
2812
  }
2806
2813
  }
2807
2814
  var HttpManager = /** @class */ (function () {
2808
- function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions) {
2815
+ function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) {
2809
2816
  this._responseHandlers = [];
2810
2817
  var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType;
2811
2818
  var _killSwitch = new EVTKillSwitch();
@@ -2944,7 +2951,7 @@
2944
2951
  xdr.send(payload.data);
2945
2952
  }
2946
2953
  else {
2947
- _postManager._setTimeoutOverride(function () {
2954
+ timeoutOverride.set(function () {
2948
2955
  xdr.send(payload.data);
2949
2956
  }, 0);
2950
2957
  }
@@ -3002,7 +3009,7 @@
3002
3009
  _doOnComplete(oncomplete, 200, {});
3003
3010
  }
3004
3011
  if (!responseHandled && payload.timeout > 0) {
3005
- _postManager._setTimeoutOverride(function () {
3012
+ timeoutOverride.set(function () {
3006
3013
  if (!responseHandled) {
3007
3014
  responseHandled = true;
3008
3015
  _doOnComplete(oncomplete, 500, {});
@@ -3541,7 +3548,7 @@
3541
3548
  cb();
3542
3549
  }
3543
3550
  else {
3544
- _postManager._setTimeoutOverride(cb, interval);
3551
+ timeoutOverride.set(cb, interval);
3545
3552
  }
3546
3553
  }
3547
3554
  function _convertAllHeadersToMap(headersString) {
@@ -3633,13 +3640,29 @@
3633
3640
  return HttpManager;
3634
3641
  }());
3635
3642
 
3643
+ function defaultSetTimeout(callback, ms) {
3644
+ var args = [];
3645
+ for (var _i = 2; _i < arguments.length; _i++) {
3646
+ args[_i - 2] = arguments[_i];
3647
+ }
3648
+ return setTimeout(callback, ms, args);
3649
+ }
3650
+ function defaultClearTimeout(timeoutId) {
3651
+ clearTimeout(timeoutId);
3652
+ }
3653
+ function createTimeoutWrapper(argSetTimeout, argClearTimeout) {
3654
+ return {
3655
+ set: argSetTimeout || defaultSetTimeout,
3656
+ clear: argClearTimeout || defaultClearTimeout
3657
+ };
3658
+ }
3659
+
3636
3660
  var FlushCheckTimer = 0.250;
3637
3661
  var MaxNumberEventPerBatch = 500;
3638
3662
  var EventsDroppedAtOneTime = 20;
3639
3663
  var MaxSendAttempts = 6;
3640
3664
  var MaxSyncUnloadSendAttempts = 2;
3641
3665
  var MaxBackoffCount = 4;
3642
- var globalContext = isWindowObjectAvailable ? window : undefined;
3643
3666
  var MaxConnections = 2;
3644
3667
  var MaxRequestRetriesBeforeBackoff = 1;
3645
3668
  var strEventsDiscarded = "eventsDiscarded";
@@ -3653,7 +3676,7 @@
3653
3676
  var _this = _super.call(this) || this;
3654
3677
  _this.identifier = "PostChannel";
3655
3678
  _this.priority = 1011;
3656
- _this.version = '3.2.1';
3679
+ _this.version = '3.2.2';
3657
3680
  var _config;
3658
3681
  var _isTeardownCalled = false;
3659
3682
  var _flushCallbackQueue = [];
@@ -3682,6 +3705,7 @@
3682
3705
  var _maxEventSendAttempts = MaxSendAttempts;
3683
3706
  var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts;
3684
3707
  var _evtNamespace;
3708
+ var _timeoutWrapper;
3685
3709
  dynamicProto(PostChannel, _this, function (_self, _base) {
3686
3710
  _initDefaults();
3687
3711
  _self["_getDbgPlgTargets"] = function () {
@@ -3697,8 +3721,7 @@
3697
3721
  var ctx = _self._getTelCtx();
3698
3722
  coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {};
3699
3723
  _config = ctx.getExtCfg(_self.identifier);
3700
- _self._setTimeoutOverride = _config.setTimeoutOverride ? _config.setTimeoutOverride : setTimeout.bind(globalContext);
3701
- _self._clearTimeoutOverride = _config.clearTimeoutOverride ? _config.clearTimeoutOverride : clearTimeout.bind(globalContext);
3724
+ _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride);
3702
3725
  _optimizeObject = !_config.disableOptimizeObj && isChromium();
3703
3726
  _hookWParam(extendedCore);
3704
3727
  if (_config.eventsLimitInMem > 0) {
@@ -4031,6 +4054,7 @@
4031
4054
  _maxEventSendAttempts = MaxSendAttempts;
4032
4055
  _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts;
4033
4056
  _evtNamespace = null;
4057
+ _timeoutWrapper = createTimeoutWrapper();
4034
4058
  _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, {
4035
4059
  requeue: _requeueEvents,
4036
4060
  send: _sendingEvent,
@@ -4038,7 +4062,7 @@
4038
4062
  drop: _eventsDropped,
4039
4063
  rspFail: _eventsResponseFail,
4040
4064
  oth: _otherEvent
4041
- });
4065
+ }, _timeoutWrapper);
4042
4066
  _initializeProfiles();
4043
4067
  _clearQueues();
4044
4068
  _setAutoLimits();
@@ -4051,11 +4075,11 @@
4051
4075
  if (_currentBackoffCount) {
4052
4076
  timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1);
4053
4077
  }
4054
- return _self._setTimeoutOverride(theTimerFunc, timeOut * timerMultiplier);
4078
+ return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier);
4055
4079
  }
4056
4080
  function _clearScheduledTimer() {
4057
4081
  if (_scheduledTimerId !== null) {
4058
- _self._clearTimeoutOverride(_scheduledTimerId);
4082
+ _timeoutWrapper.clear(_scheduledTimerId);
4059
4083
  _scheduledTimerId = null;
4060
4084
  _timerCount = 0;
4061
4085
  }
@@ -4063,7 +4087,7 @@
4063
4087
  function _releaseAllQueues(sendType, sendReason) {
4064
4088
  _clearScheduledTimer();
4065
4089
  if (_flushCallbackTimerId) {
4066
- _self._clearTimeoutOverride(_flushCallbackTimerId);
4090
+ _timeoutWrapper.clear(_flushCallbackTimerId);
4067
4091
  _flushCallbackTimerId = null;
4068
4092
  }
4069
4093
  if (!_paused) {
@@ -4357,6 +4381,12 @@
4357
4381
  _autoFlushBatchLimit = 0;
4358
4382
  }
4359
4383
  }
4384
+ objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) {
4385
+ _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear);
4386
+ });
4387
+ objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) {
4388
+ _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value);
4389
+ });
4360
4390
  });
4361
4391
  return _this;
4362
4392
  }