@microsoft/1ds-post-js 4.0.0 → 4.0.2-nightly3.2307-24

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 (55) hide show
  1. package/README.md +10 -26
  2. package/bundle/es5/{ms.post-4.0.0.gbl.js → ms.post-4.0.2-nightly3.2307-24.gbl.js} +707 -524
  3. package/bundle/es5/ms.post-4.0.2-nightly3.2307-24.gbl.js.map +1 -0
  4. package/bundle/es5/ms.post-4.0.2-nightly3.2307-24.gbl.min.js +7 -0
  5. package/bundle/es5/ms.post-4.0.2-nightly3.2307-24.gbl.min.js.map +1 -0
  6. package/bundle/es5/ms.post-4.0.2-nightly3.2307-24.integrity.json +46 -0
  7. package/bundle/es5/{ms.post-4.0.0.js → ms.post-4.0.2-nightly3.2307-24.js} +707 -524
  8. package/bundle/es5/ms.post-4.0.2-nightly3.2307-24.js.map +1 -0
  9. package/bundle/es5/ms.post-4.0.2-nightly3.2307-24.min.js +7 -0
  10. package/bundle/es5/ms.post-4.0.2-nightly3.2307-24.min.js.map +1 -0
  11. package/bundle/es5/ms.post.gbl.js +706 -523
  12. package/bundle/es5/ms.post.gbl.js.map +1 -1
  13. package/bundle/es5/ms.post.gbl.min.js +2 -2
  14. package/bundle/es5/ms.post.gbl.min.js.map +1 -1
  15. package/bundle/es5/ms.post.integrity.json +17 -17
  16. package/bundle/es5/ms.post.js +706 -523
  17. package/bundle/es5/ms.post.js.map +1 -1
  18. package/bundle/es5/ms.post.min.js +2 -2
  19. package/bundle/es5/ms.post.min.js.map +1 -1
  20. package/dist/es5/ms.post.js +704 -521
  21. package/dist/es5/ms.post.js.map +1 -1
  22. package/dist/es5/ms.post.min.js +2 -2
  23. package/dist/es5/ms.post.min.js.map +1 -1
  24. package/dist-es5/BatchNotificationActions.js +1 -1
  25. package/dist-es5/ClockSkewManager.js +8 -8
  26. package/dist-es5/ClockSkewManager.js.map +1 -1
  27. package/dist-es5/DataModels.js +1 -1
  28. package/dist-es5/EventBatch.js +13 -12
  29. package/dist-es5/EventBatch.js.map +1 -1
  30. package/dist-es5/HttpManager.js +173 -173
  31. package/dist-es5/HttpManager.js.map +1 -1
  32. package/dist-es5/Index.js +3 -3
  33. package/dist-es5/Index.js.map +1 -1
  34. package/dist-es5/InternalConstants.js +1 -1
  35. package/dist-es5/KillSwitch.js +8 -8
  36. package/dist-es5/KillSwitch.js.map +1 -1
  37. package/dist-es5/PostChannel.js +92 -90
  38. package/dist-es5/PostChannel.js.map +1 -1
  39. package/dist-es5/RetryPolicy.js +1 -1
  40. package/dist-es5/Serializer.js +4 -5
  41. package/dist-es5/Serializer.js.map +1 -1
  42. package/dist-es5/TimeoutOverrideWrapper.js +1 -1
  43. package/dist-es5/__DynamicConstants.js +83 -0
  44. package/dist-es5/__DynamicConstants.js.map +1 -0
  45. package/dist-es5/typings/XDomainRequest.js +1 -1
  46. package/package.json +40 -24
  47. package/types/1ds-post-js.d.ts +5 -3
  48. package/types/1ds-post-js.namespaced.d.ts +5 -3
  49. package/bundle/es5/ms.post-4.0.0.gbl.js.map +0 -1
  50. package/bundle/es5/ms.post-4.0.0.gbl.min.js +0 -7
  51. package/bundle/es5/ms.post-4.0.0.gbl.min.js.map +0 -1
  52. package/bundle/es5/ms.post-4.0.0.integrity.json +0 -46
  53. package/bundle/es5/ms.post-4.0.0.js.map +0 -1
  54. package/bundle/es5/ms.post-4.0.0.min.js +0 -7
  55. package/bundle/es5/ms.post-4.0.0.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * 1DS JS SDK POST plugin, 4.0.0
2
+ * 1DS JS SDK POST plugin, 4.0.2-nightly3.2307-24
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -19,6 +19,7 @@ import { HttpManager } from "./HttpManager";
19
19
  import { STR_MSA_DEVICE_TICKET, STR_TRACE, STR_USER } from "./InternalConstants";
20
20
  import { retryPolicyGetMillisToBackoffForRetry } from "./RetryPolicy";
21
21
  import { createTimeoutWrapper } from "./TimeoutOverrideWrapper";
22
+ import { _DYN_AUTO_FLUSH_EVENTS_LI13, _DYN_BASE_DATA, _DYN_BATCHES, _DYN_CAN_SEND_REQUEST, _DYN_CLEAR_TIMEOUT_OVERRI3, _DYN_CONCAT, _DYN_COUNT, _DYN_DATA, _DYN_DISABLE_AUTO_BATCH_F14, _DYN_DISABLE_OPTIMIZE_OBJ, _DYN_DISABLE_TELEMETRY, _DYN_EVENTS, _DYN_EVENTS_LIMIT_IN_MEM, _DYN_GET_WPARAM, _DYN_IDENTIFIER, _DYN_IGNORE_MC1_MS0_COOKI12, _DYN_INITIALIZE, _DYN_IS_COMPLETELY_IDLE, _DYN_I_KEY, _DYN_LATENCY, _DYN_LENGTH, _DYN_OVERRIDE_INSTRUMENTA15, _DYN_PUSH, _DYN_SEND_ATTEMPT, _DYN_SEND_POST, _DYN_SEND_QUEUED_REQUESTS, _DYN_SEND_SYNCHRONOUS_BAT9, _DYN_SET_TIMEOUT_OVERRIDE, _DYN_SET_UNLOADING, _DYN_SPLICE, _DYN_SPLIT, _DYN_SYNC, _DYN__BACK_OFF_TRANSMISSI11 } from "./__DynamicConstants";
22
23
  var FlushCheckTimer = 0.250; // This needs to be in seconds, so this is 250ms
23
24
  var MaxNumberEventPerBatch = 500;
24
25
  var EventsDroppedAtOneTime = 20;
@@ -68,11 +69,13 @@ var defaultPostChannelConfig = objDeepFreeze({
68
69
  addNoResponse: undefValue
69
70
  });
70
71
  function isOverrideFn(httpXHROverride) {
71
- return httpXHROverride && httpXHROverride.sendPOST;
72
+ return httpXHROverride && httpXHROverride[_DYN_SEND_POST /* @min:%2esendPOST */];
72
73
  }
73
74
  /**
74
75
  * Class that manages adding events to inbound queues and batching of events
75
76
  * into requests.
77
+ * @group Classes
78
+ * @group Entrypoint
76
79
  */
77
80
  var PostChannel = /** @class */ (function (_super) {
78
81
  __extends(PostChannel, _super);
@@ -80,7 +83,7 @@ var PostChannel = /** @class */ (function (_super) {
80
83
  var _this = _super.call(this) || this;
81
84
  _this.identifier = "PostChannel";
82
85
  _this.priority = 1011;
83
- _this.version = '4.0.0';
86
+ _this.version = '4.0.2-nightly3.2307-24';
84
87
  var _postConfig;
85
88
  var _isTeardownCalled = false;
86
89
  var _flushCallbackQueue = [];
@@ -121,32 +124,32 @@ var PostChannel = /** @class */ (function (_super) {
121
124
  _self["_getDbgPlgTargets"] = function () {
122
125
  return [_httpManager, _postConfig];
123
126
  };
124
- _self.initialize = function (theConfig, core, extensions) {
127
+ _self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (theConfig, core, extensions) {
125
128
  doPerf(core, function () { return "PostChannel:initialize"; }, function () {
126
- _base.initialize(theConfig, core, extensions);
129
+ _base[_DYN_INITIALIZE /* @min:%2einitialize */](theConfig, core, extensions);
127
130
  _notificationManager = core.getNotifyMgr();
128
131
  try {
129
- _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());
132
+ _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self[_DYN_IDENTIFIER /* @min:%2eidentifier */]), core.evtNamespace && core.evtNamespace());
130
133
  _self._addHook(onConfigChange(theConfig, function (details) {
131
134
  var coreConfig = details.cfg;
132
135
  var ctx = createProcessTelemetryContext(null, coreConfig, core);
133
- _postConfig = ctx.getExtCfg(_self.identifier, defaultPostChannelConfig);
134
- _timeoutWrapper = createTimeoutWrapper(_postConfig.setTimeoutOverride, _postConfig.clearTimeoutOverride);
136
+ _postConfig = ctx.getExtCfg(_self[_DYN_IDENTIFIER /* @min:%2eidentifier */], defaultPostChannelConfig);
137
+ _timeoutWrapper = createTimeoutWrapper(_postConfig[_DYN_SET_TIMEOUT_OVERRIDE /* @min:%2esetTimeoutOverride */], _postConfig[_DYN_CLEAR_TIMEOUT_OVERRI3 /* @min:%2eclearTimeoutOverride */]);
135
138
  // Only try and use the optimizeObject() if this appears to be a chromium based browser and it has not been explicitly disabled
136
- _optimizeObject = !_postConfig.disableOptimizeObj && isChromium();
137
- _ignoreMc1Ms0CookieProcessing = _postConfig.ignoreMc1Ms0CookieProcessing;
138
- _hookWParam(core); // _hookWParam uses _ignoreMc1Ms0CookieProcessing
139
- _queueSizeLimit = _postConfig.eventsLimitInMem;
139
+ _optimizeObject = !_postConfig[_DYN_DISABLE_OPTIMIZE_OBJ /* @min:%2edisableOptimizeObj */] && isChromium();
140
+ _ignoreMc1Ms0CookieProcessing = _postConfig[_DYN_IGNORE_MC1_MS0_COOKI12 /* @min:%2eignoreMc1Ms0CookieProcessing */];
141
+ _hookWParam(core); // _hookWParam uses _ignoreMc1Ms0CookieProcessing
142
+ _queueSizeLimit = _postConfig[_DYN_EVENTS_LIMIT_IN_MEM /* @min:%2eeventsLimitInMem */];
140
143
  _immediateQueueSizeLimit = _postConfig.immediateEventLimit;
141
- _autoFlushEventsLimit = _postConfig.autoFlushEventsLimit;
144
+ _autoFlushEventsLimit = _postConfig[_DYN_AUTO_FLUSH_EVENTS_LI13 /* @min:%2eautoFlushEventsLimit */];
142
145
  _maxEventSendAttempts = _postConfig.maxEventRetryAttempts;
143
146
  _maxUnloadEventSendAttempts = _postConfig.maxUnloadEventRetryAttempts;
144
- _disableAutoBatchFlushLimit = _postConfig.disableAutoBatchFlushLimit;
147
+ _disableAutoBatchFlushLimit = _postConfig[_DYN_DISABLE_AUTO_BATCH_F14 /* @min:%2edisableAutoBatchFlushLimit */];
145
148
  _setAutoLimits();
146
149
  // Override iKey if provided in Post config if provided for during initialization
147
- _overrideInstrumentationKey = _postConfig.overrideInstrumentationKey;
150
+ _overrideInstrumentationKey = _postConfig[_DYN_OVERRIDE_INSTRUMENTA15 /* @min:%2eoverrideInstrumentationKey */];
148
151
  // DisableTelemetry was defined in the config provided during initialization
149
- _disableTelemetry = !!_postConfig.disableTelemetry;
152
+ _disableTelemetry = !!_postConfig[_DYN_DISABLE_TELEMETRY /* @min:%2edisableTelemetry */];
150
153
  if (_unloadHandlersAdded) {
151
154
  _removeUnloadHandlers();
152
155
  }
@@ -157,7 +160,7 @@ var PostChannel = /** @class */ (function (_super) {
157
160
  _unloadHandlersAdded = addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace) || _unloadHandlersAdded;
158
161
  }));
159
162
  // only initialize the manager once
160
- _httpManager.initialize(theConfig, _self.core, _self);
163
+ _httpManager[_DYN_INITIALIZE /* @min:%2einitialize */](theConfig, _self.core, _self);
161
164
  }
162
165
  catch (e) {
163
166
  // resetting the initialized state because of failure
@@ -167,13 +170,13 @@ var PostChannel = /** @class */ (function (_super) {
167
170
  }, function () { return ({ theConfig: theConfig, core: core, extensions: extensions }); });
168
171
  };
169
172
  _self.processTelemetry = function (ev, itemCtx) {
170
- setProcessTelemetryTimings(ev, _self.identifier);
173
+ setProcessTelemetryTimings(ev, _self[_DYN_IDENTIFIER /* @min:%2eidentifier */]);
171
174
  itemCtx = itemCtx || _self._getTelCtx(itemCtx);
172
175
  var event = ev;
173
176
  if (!_disableTelemetry && !_isTeardownCalled) {
174
177
  // Override iKey if provided in Post config if provided for during initialization
175
178
  if (_overrideInstrumentationKey) {
176
- event.iKey = _overrideInstrumentationKey;
179
+ event[_DYN_I_KEY /* @min:%2eiKey */] = _overrideInstrumentationKey;
177
180
  }
178
181
  _addEventToQueues(event, true);
179
182
  if (_isPageUnloadTriggered) {
@@ -200,8 +203,8 @@ var PostChannel = /** @class */ (function (_super) {
200
203
  removePageShowEventListener(null, _evtNamespace);
201
204
  }
202
205
  function _hookWParam(core) {
203
- var existingGetWParamMethod = core.getWParam;
204
- core.getWParam = function () {
206
+ var existingGetWParamMethod = core[_DYN_GET_WPARAM /* @min:%2egetWParam */];
207
+ core[_DYN_GET_WPARAM /* @min:%2egetWParam */] = function () {
205
208
  var wparam = 0;
206
209
  if (_ignoreMc1Ms0CookieProcessing) {
207
210
  wparam = wparam | 2;
@@ -215,23 +218,23 @@ var PostChannel = /** @class */ (function (_super) {
215
218
  if (theEvt.type !== "beforeunload") {
216
219
  // Only set the unload trigger if not beforeunload event as beforeunload can be cancelled while the other events can't
217
220
  _isPageUnloadTriggered = true;
218
- _httpManager.setUnloading(_isPageUnloadTriggered);
221
+ _httpManager[_DYN_SET_UNLOADING /* @min:%2esetUnloading */](_isPageUnloadTriggered);
219
222
  }
220
223
  _releaseAllQueues(2 /* EventSendType.SendBeacon */, 2 /* SendRequestReason.Unload */);
221
224
  }
222
225
  function _handleShowEvents(evt) {
223
226
  // Handle the page becoming visible again
224
227
  _isPageUnloadTriggered = false;
225
- _httpManager.setUnloading(_isPageUnloadTriggered);
228
+ _httpManager[_DYN_SET_UNLOADING /* @min:%2esetUnloading */](_isPageUnloadTriggered);
226
229
  }
227
230
  function _addEventToQueues(event, append) {
228
231
  // If send attempt field is undefined we should set it to 0.
229
- if (!event.sendAttempt) {
230
- event.sendAttempt = 0;
232
+ if (!event[_DYN_SEND_ATTEMPT /* @min:%2esendAttempt */]) {
233
+ event[_DYN_SEND_ATTEMPT /* @min:%2esendAttempt */] = 0;
231
234
  }
232
235
  // Add default latency
233
- if (!event.latency) {
234
- event.latency = 1 /* EventLatencyValue.Normal */;
236
+ if (!event[_DYN_LATENCY /* @min:%2elatency */]) {
237
+ event[_DYN_LATENCY /* @min:%2elatency */] = 1 /* EventLatencyValue.Normal */;
235
238
  }
236
239
  // Remove extra AI properties if present
237
240
  if (event.ext && event.ext[STR_TRACE]) {
@@ -243,19 +246,19 @@ var PostChannel = /** @class */ (function (_super) {
243
246
  // v8 performance optimization for iterating over the keys
244
247
  if (_optimizeObject) {
245
248
  event.ext = optimizeObject(event.ext);
246
- if (event.baseData) {
247
- event.baseData = optimizeObject(event.baseData);
249
+ if (event[_DYN_BASE_DATA /* @min:%2ebaseData */]) {
250
+ event[_DYN_BASE_DATA /* @min:%2ebaseData */] = optimizeObject(event[_DYN_BASE_DATA /* @min:%2ebaseData */]);
248
251
  }
249
- if (event.data) {
250
- event.data = optimizeObject(event.data);
252
+ if (event[_DYN_DATA /* @min:%2edata */]) {
253
+ event[_DYN_DATA /* @min:%2edata */] = optimizeObject(event[_DYN_DATA /* @min:%2edata */]);
251
254
  }
252
255
  }
253
- if (event.sync) {
256
+ if (event[_DYN_SYNC /* @min:%2esync */]) {
254
257
  // If the transmission is backed off then do not send synchronous events.
255
258
  // We will convert these events to Real time latency instead.
256
259
  if (_currentBackoffCount || _paused) {
257
- event.latency = 3 /* EventLatencyValue.RealTime */;
258
- event.sync = false;
260
+ event[_DYN_LATENCY /* @min:%2elatency */] = 3 /* EventLatencyValue.RealTime */;
261
+ event[_DYN_SYNC /* @min:%2esync */] = false;
259
262
  }
260
263
  else {
261
264
  // Log the event synchronously
@@ -264,12 +267,12 @@ var PostChannel = /** @class */ (function (_super) {
264
267
  if (_optimizeObject) {
265
268
  event = optimizeObject(event);
266
269
  }
267
- _httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 /* EventSendType.Synchronous */ : event.sync, 3 /* SendRequestReason.SyncEvent */);
270
+ _httpManager[_DYN_SEND_SYNCHRONOUS_BAT9 /* @min:%2esendSynchronousBatch */](EventBatch.create(event[_DYN_I_KEY /* @min:%2eiKey */], [event]), event[_DYN_SYNC /* @min:%2esync */] === true ? 1 /* EventSendType.Synchronous */ : event[_DYN_SYNC /* @min:%2esync */], 3 /* SendRequestReason.SyncEvent */);
268
271
  return;
269
272
  }
270
273
  }
271
274
  }
272
- var evtLatency = event.latency;
275
+ var evtLatency = event[_DYN_LATENCY /* @min:%2elatency */];
273
276
  var queueSize = _queueSize;
274
277
  var queueLimit = _queueSizeLimit;
275
278
  if (evtLatency === 4 /* EventLatencyValue.Immediate */) {
@@ -291,7 +294,7 @@ var PostChannel = /** @class */ (function (_super) {
291
294
  }
292
295
  // Drop old event from lower or equal latency
293
296
  eventDropped = true;
294
- if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) {
297
+ if (_dropEventWithLatencyOrLess(event[_DYN_I_KEY /* @min:%2eiKey */], event[_DYN_LATENCY /* @min:%2elatency */], dropLatency, dropNumber)) {
295
298
  eventDropped = !_addEventToProperQueue(event, append);
296
299
  }
297
300
  }
@@ -301,8 +304,8 @@ var PostChannel = /** @class */ (function (_super) {
301
304
  }
302
305
  }
303
306
  _self.setEventQueueLimits = function (eventLimit, autoFlushLimit) {
304
- _postConfig.eventsLimitInMem = _queueSizeLimit = isGreaterThanZero(eventLimit) ? eventLimit : MaxEventsLimitInMem;
305
- _postConfig.autoFlushEventsLimit = _autoFlushEventsLimit = isGreaterThanZero(autoFlushLimit) ? autoFlushLimit : 0;
307
+ _postConfig[_DYN_EVENTS_LIMIT_IN_MEM /* @min:%2eeventsLimitInMem */] = _queueSizeLimit = isGreaterThanZero(eventLimit) ? eventLimit : MaxEventsLimitInMem;
308
+ _postConfig[_DYN_AUTO_FLUSH_EVENTS_LI13 /* @min:%2eautoFlushEventsLimit */] = _autoFlushEventsLimit = isGreaterThanZero(autoFlushLimit) ? autoFlushLimit : 0;
306
309
  _setAutoLimits();
307
310
  // We only do this check here as during normal event addition if the queue is > then events start getting dropped
308
311
  var doFlush = _queueSize > eventLimit;
@@ -310,9 +313,9 @@ var PostChannel = /** @class */ (function (_super) {
310
313
  // Check the auto flush max batch size
311
314
  for (var latency = 1 /* EventLatencyValue.Normal */; !doFlush && latency <= 3 /* EventLatencyValue.RealTime */; latency++) {
312
315
  var batchQueue = _batchQueues[latency];
313
- if (batchQueue && batchQueue.batches) {
314
- arrForEach(batchQueue.batches, function (theBatch) {
315
- if (theBatch && theBatch.count() >= _autoFlushBatchLimit) {
316
+ if (batchQueue && batchQueue[_DYN_BATCHES /* @min:%2ebatches */]) {
317
+ arrForEach(batchQueue[_DYN_BATCHES /* @min:%2ebatches */], function (theBatch) {
318
+ if (theBatch && theBatch[_DYN_COUNT /* @min:%2ecount */]() >= _autoFlushBatchLimit) {
316
319
  // If any 1 batch is > than the limit then trigger an auto flush
317
320
  doFlush = true;
318
321
  }
@@ -335,10 +338,10 @@ var PostChannel = /** @class */ (function (_super) {
335
338
  _self._loadTransmitProfiles = function (profiles) {
336
339
  _resetTransmitProfiles();
337
340
  objForEachKey(profiles, function (profileName, profileValue) {
338
- var profLen = profileValue.length;
341
+ var profLen = profileValue[_DYN_LENGTH /* @min:%2elength */];
339
342
  if (profLen >= 2) {
340
343
  var directValue = (profLen > 2 ? profileValue[2] : 0);
341
- profileValue.splice(0, profLen - 2);
344
+ profileValue[_DYN_SPLICE /* @min:%2esplice */](0, profLen - 2);
342
345
  // Make sure if a higher latency is set to not send then don't send lower latency
343
346
  if (profileValue[1] < 0) {
344
347
  profileValue[0] = -1;
@@ -354,7 +357,7 @@ var PostChannel = /** @class */ (function (_super) {
354
357
  // Make sure if it's not disabled (< 0) then make sure it's not larger than RealTime
355
358
  directValue = profileValue[1];
356
359
  }
357
- profileValue.push(directValue);
360
+ profileValue[_DYN_PUSH /* @min:%2epush */](directValue);
358
361
  _profiles[profileName] = profileValue;
359
362
  }
360
363
  });
@@ -384,7 +387,7 @@ var PostChannel = /** @class */ (function (_super) {
384
387
  else {
385
388
  // Even if null (no callback) this will ensure after the flushImpl finishes waiting
386
389
  // for a completely idle connection it will attempt to re-flush any queued events on the next cycle
387
- _flushCallbackQueue.push(callback);
390
+ _flushCallbackQueue[_DYN_PUSH /* @min:%2epush */](callback);
388
391
  }
389
392
  }
390
393
  else {
@@ -420,7 +423,7 @@ var PostChannel = /** @class */ (function (_super) {
420
423
  function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) {
421
424
  var queued = _queueBatches(latency, sendType, sendReason);
422
425
  // Always trigger the request as while the post channel may not have queued additional events, the httpManager may already have waiting events
423
- _httpManager.sendQueuedRequests(sendType, sendReason);
426
+ _httpManager[_DYN_SEND_QUEUED_REQUESTS /* @min:%2esendQueuedRequests */](sendType, sendReason);
424
427
  return queued;
425
428
  }
426
429
  function _hasEvents() {
@@ -435,7 +438,7 @@ var PostChannel = /** @class */ (function (_super) {
435
438
  // If we had previously attempted to send requests, but the http manager didn't have any idle connections then the requests where delayed
436
439
  // so try and requeue then again now
437
440
  if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 /* EventSendType.Batched */, _delayedBatchReason)) {
438
- _httpManager.sendQueuedRequests(0 /* EventSendType.Batched */, _delayedBatchReason);
441
+ _httpManager[_DYN_SEND_QUEUED_REQUESTS /* @min:%2esendQueuedRequests */](0 /* EventSendType.Batched */, _delayedBatchReason);
439
442
  }
440
443
  if (_immediateQueueSize > 0 && !_immediateTimer && !_paused) {
441
444
  // During initialization _profiles enforce that the direct [2] is less than real time [1] timer value
@@ -468,7 +471,7 @@ var PostChannel = /** @class */ (function (_super) {
468
471
  }
469
472
  }
470
473
  }
471
- _self._backOffTransmission = function () {
474
+ _self[_DYN__BACK_OFF_TRANSMISSI11 /* @min:%2e_backOffTransmission */] = function () {
472
475
  if (_currentBackoffCount < MaxBackoffCount) {
473
476
  _currentBackoffCount++;
474
477
  _clearScheduledTimer();
@@ -590,14 +593,14 @@ var PostChannel = /** @class */ (function (_super) {
590
593
  var eventBatch = batchQueue.iKeyMap[iKey];
591
594
  if (!eventBatch && create) {
592
595
  eventBatch = EventBatch.create(iKey);
593
- batchQueue.batches.push(eventBatch);
596
+ batchQueue.batches[_DYN_PUSH /* @min:%2epush */](eventBatch);
594
597
  batchQueue.iKeyMap[iKey] = eventBatch;
595
598
  }
596
599
  return eventBatch;
597
600
  }
598
601
  function _performAutoFlush(isAsync, doFlush) {
599
602
  // Only perform the auto flush check if the httpManager has an idle connection and we are not in a backoff situation
600
- if (_httpManager.canSendRequest() && !_currentBackoffCount) {
603
+ if (_httpManager[_DYN_CAN_SEND_REQUEST /* @min:%2ecanSendRequest */]() && !_currentBackoffCount) {
601
604
  if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) {
602
605
  // Force flushing
603
606
  doFlush = true;
@@ -613,15 +616,15 @@ var PostChannel = /** @class */ (function (_super) {
613
616
  if (_optimizeObject) {
614
617
  event = optimizeObject(event);
615
618
  }
616
- var latency = event.latency;
617
- var eventBatch = _getEventBatch(event.iKey, latency, true);
619
+ var latency = event[_DYN_LATENCY /* @min:%2elatency */];
620
+ var eventBatch = _getEventBatch(event[_DYN_I_KEY /* @min:%2eiKey */], latency, true);
618
621
  if (eventBatch.addEvent(event)) {
619
622
  if (latency !== 4 /* EventLatencyValue.Immediate */) {
620
623
  _queueSize++;
621
624
  // Check for auto flushing based on total events in the queue, but not for requeued or retry events
622
- if (append && event.sendAttempt === 0) {
625
+ if (append && event[_DYN_SEND_ATTEMPT /* @min:%2esendAttempt */] === 0) {
623
626
  // Force the flushing of the batch if the batch (specific iKey / latency combination) reaches it's auto flush limit
624
- _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit);
627
+ _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch[_DYN_COUNT /* @min:%2ecount */]() >= _autoFlushBatchLimit);
625
628
  }
626
629
  }
627
630
  else {
@@ -635,10 +638,10 @@ var PostChannel = /** @class */ (function (_super) {
635
638
  function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) {
636
639
  while (currentLatency <= latency) {
637
640
  var eventBatch = _getEventBatch(iKey, latency, true);
638
- if (eventBatch && eventBatch.count() > 0) {
641
+ if (eventBatch && eventBatch[_DYN_COUNT /* @min:%2ecount */]() > 0) {
639
642
  // Dropped oldest events from lowest possible latency
640
- var droppedEvents = eventBatch.split(0, dropNumber);
641
- var droppedCount = droppedEvents.count();
643
+ var droppedEvents = eventBatch[_DYN_SPLIT /* @min:%2esplit */](0, dropNumber);
644
+ var droppedCount = droppedEvents[_DYN_COUNT /* @min:%2ecount */]();
642
645
  if (droppedCount > 0) {
643
646
  if (currentLatency === 4 /* EventLatencyValue.Immediate */) {
644
647
  _immediateQueueSize -= droppedCount;
@@ -665,13 +668,13 @@ var PostChannel = /** @class */ (function (_super) {
665
668
  var normalQueue = 0;
666
669
  var _loop_1 = function (latency) {
667
670
  var batchQueue = _batchQueues[latency];
668
- if (batchQueue && batchQueue.batches) {
669
- arrForEach(batchQueue.batches, function (theBatch) {
671
+ if (batchQueue && batchQueue[_DYN_BATCHES /* @min:%2ebatches */]) {
672
+ arrForEach(batchQueue[_DYN_BATCHES /* @min:%2ebatches */], function (theBatch) {
670
673
  if (latency === 4 /* EventLatencyValue.Immediate */) {
671
- immediateQueue += theBatch.count();
674
+ immediateQueue += theBatch[_DYN_COUNT /* @min:%2ecount */]();
672
675
  }
673
676
  else {
674
- normalQueue += theBatch.count();
677
+ normalQueue += theBatch[_DYN_COUNT /* @min:%2ecount */]();
675
678
  }
676
679
  });
677
680
  }
@@ -688,36 +691,36 @@ var PostChannel = /** @class */ (function (_super) {
688
691
  // Only queue batches (to the HttpManager) if this is a sync request or the httpManager has an idle connection
689
692
  // Thus keeping the events within the PostChannel until the HttpManager has a connection available
690
693
  // This is so we can drop "old" events if the queue is getting full because we can't successfully send events
691
- if (!isAsync || _httpManager.canSendRequest()) {
694
+ if (!isAsync || _httpManager[_DYN_CAN_SEND_REQUEST /* @min:%2ecanSendRequest */]()) {
692
695
  doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () {
693
696
  var droppedEvents = [];
694
697
  var latencyToProcess = 4 /* EventLatencyValue.Immediate */;
695
698
  while (latencyToProcess >= latency) {
696
699
  var batchQueue = _batchQueues[latencyToProcess];
697
- if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) {
698
- arrForEach(batchQueue.batches, function (theBatch) {
700
+ if (batchQueue && batchQueue.batches && batchQueue.batches[_DYN_LENGTH /* @min:%2elength */] > 0) {
701
+ arrForEach(batchQueue[_DYN_BATCHES /* @min:%2ebatches */], function (theBatch) {
699
702
  // Add the batch to the http manager to send the requests
700
703
  if (!_httpManager.addBatch(theBatch)) {
701
704
  // The events from this iKey are being dropped (killed)
702
- droppedEvents = droppedEvents.concat(theBatch.events());
705
+ droppedEvents = droppedEvents[_DYN_CONCAT /* @min:%2econcat */](theBatch[_DYN_EVENTS /* @min:%2eevents */]());
703
706
  }
704
707
  else {
705
- eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0);
708
+ eventsQueued = eventsQueued || (theBatch && theBatch[_DYN_COUNT /* @min:%2ecount */]() > 0);
706
709
  }
707
710
  if (latencyToProcess === 4 /* EventLatencyValue.Immediate */) {
708
- _immediateQueueSize -= theBatch.count();
711
+ _immediateQueueSize -= theBatch[_DYN_COUNT /* @min:%2ecount */]();
709
712
  }
710
713
  else {
711
- _queueSize -= theBatch.count();
714
+ _queueSize -= theBatch[_DYN_COUNT /* @min:%2ecount */]();
712
715
  }
713
716
  });
714
717
  // Remove all batches from this Queue
715
- batchQueue.batches = [];
718
+ batchQueue[_DYN_BATCHES /* @min:%2ebatches */] = [];
716
719
  batchQueue.iKeyMap = {};
717
720
  }
718
721
  latencyToProcess--;
719
722
  }
720
- if (droppedEvents.length > 0) {
723
+ if (droppedEvents[_DYN_LENGTH /* @min:%2elength */] > 0) {
721
724
  _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch);
722
725
  }
723
726
  if (eventsQueued && _delayedBatchSendLatency >= latency) {
@@ -749,7 +752,7 @@ var PostChannel = /** @class */ (function (_super) {
749
752
  if (callback) {
750
753
  callback();
751
754
  }
752
- if (_flushCallbackQueue.length > 0) {
755
+ if (_flushCallbackQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {
753
756
  _flushCallbackTimer = _createTimer(function () {
754
757
  _flushCallbackTimer = null;
755
758
  _flushImpl(_flushCallbackQueue.shift(), sendReason);
@@ -764,7 +767,7 @@ var PostChannel = /** @class */ (function (_super) {
764
767
  });
765
768
  }
766
769
  function _waitForIdleManager(callback) {
767
- if (_httpManager.isCompletelyIdle()) {
770
+ if (_httpManager[_DYN_IS_COMPLETELY_IDLE /* @min:%2eisCompletelyIdle */]()) {
768
771
  callback();
769
772
  }
770
773
  else {
@@ -802,27 +805,27 @@ var PostChannel = /** @class */ (function (_super) {
802
805
  maxSendAttempts = _maxUnloadEventSendAttempts;
803
806
  }
804
807
  arrForEach(batches, function (theBatch) {
805
- if (theBatch && theBatch.count() > 0) {
806
- arrForEach(theBatch.events(), function (theEvent) {
808
+ if (theBatch && theBatch[_DYN_COUNT /* @min:%2ecount */]() > 0) {
809
+ arrForEach(theBatch[_DYN_EVENTS /* @min:%2eevents */](), function (theEvent) {
807
810
  if (theEvent) {
808
811
  // Check if the request being added back is for a sync event in which case mark it no longer a sync event
809
- if (theEvent.sync) {
810
- theEvent.latency = 4 /* EventLatencyValue.Immediate */;
811
- theEvent.sync = false;
812
+ if (theEvent[_DYN_SYNC /* @min:%2esync */]) {
813
+ theEvent[_DYN_LATENCY /* @min:%2elatency */] = 4 /* EventLatencyValue.Immediate */;
814
+ theEvent[_DYN_SYNC /* @min:%2esync */] = false;
812
815
  }
813
- if (theEvent.sendAttempt < maxSendAttempts) {
816
+ if (theEvent[_DYN_SEND_ATTEMPT /* @min:%2esendAttempt */] < maxSendAttempts) {
814
817
  // Reset the event timings
815
- setProcessTelemetryTimings(theEvent, _self.identifier);
818
+ setProcessTelemetryTimings(theEvent, _self[_DYN_IDENTIFIER /* @min:%2eidentifier */]);
816
819
  _addEventToQueues(theEvent, false);
817
820
  }
818
821
  else {
819
- droppedEvents.push(theEvent);
822
+ droppedEvents[_DYN_PUSH /* @min:%2epush */](theEvent);
820
823
  }
821
824
  }
822
825
  });
823
826
  }
824
827
  });
825
- if (droppedEvents.length > 0) {
828
+ if (droppedEvents[_DYN_LENGTH /* @min:%2elength */] > 0) {
826
829
  _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus);
827
830
  }
828
831
  if (_isPageUnloadTriggered) {
@@ -847,8 +850,8 @@ var PostChannel = /** @class */ (function (_super) {
847
850
  for (var _i = 2; _i < arguments.length; _i++) {
848
851
  extraArgs[_i - 2] = arguments[_i];
849
852
  }
850
- if (theEvents && theEvents.length > 0) {
851
- _callNotification(evtName, [theEvents].concat(extraArgs));
853
+ if (theEvents && theEvents[_DYN_LENGTH /* @min:%2elength */] > 0) {
854
+ _callNotification(evtName, [theEvents][_DYN_CONCAT /* @min:%2econcat */](extraArgs));
852
855
  }
853
856
  }
854
857
  function _notifyBatchEvents(evtName, batches) {
@@ -856,10 +859,10 @@ var PostChannel = /** @class */ (function (_super) {
856
859
  for (var _i = 2; _i < arguments.length; _i++) {
857
860
  extraArgs[_i - 2] = arguments[_i];
858
861
  }
859
- if (batches && batches.length > 0) {
862
+ if (batches && batches[_DYN_LENGTH /* @min:%2elength */] > 0) {
860
863
  arrForEach(batches, function (theBatch) {
861
- if (theBatch && theBatch.count() > 0) {
862
- _callNotification(evtName, [theBatch.events()].concat(extraArgs));
864
+ if (theBatch && theBatch[_DYN_COUNT /* @min:%2ecount */]() > 0) {
865
+ _callNotification(evtName, [theBatch.events()][_DYN_CONCAT /* @min:%2econcat */](extraArgs));
863
866
  }
864
867
  });
865
868
  }
@@ -869,7 +872,7 @@ var PostChannel = /** @class */ (function (_super) {
869
872
  * @ignore
870
873
  */
871
874
  function _sendingEvent(batches, reason, isSyncRequest) {
872
- if (batches && batches.length > 0) {
875
+ if (batches && batches[_DYN_LENGTH /* @min:%2elength */] > 0) {
873
876
  _callNotification("eventsSendRequest", [(reason >= 1000 /* EventBatchNotificationReason.SendingUndefined */ && reason <= 1999 /* EventBatchNotificationReason.SendingEventMax */ ?
874
877
  reason - 1000 /* EventBatchNotificationReason.SendingUndefined */ :
875
878
  0 /* SendRequestReason.Undefined */), isSyncRequest !== true]);
@@ -924,9 +927,8 @@ var PostChannel = /** @class */ (function (_super) {
924
927
  // Removed Stub for PostChannel.prototype._setTransmitProfile.
925
928
  // Removed Stub for PostChannel.prototype._backOffTransmission.
926
929
  // Removed Stub for PostChannel.prototype._clearBackOff.
927
- // This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
930
+ // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any
928
931
  // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
929
- // this will be removed when ES3 support is dropped.
930
932
  PostChannel.__ieDyn=1;
931
933
 
932
934
  return PostChannel;