o11y 242.3.3 → 242.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/modules/o11y/client/client.js +210 -170
  2. package/dist/modules/o11y/client/client.js.map +1 -1
  3. package/dist/modules/o11y/client/interfaces/InstrumentationContext.d.ts +1 -0
  4. package/dist/modules/o11y/client/library/AppInstrumentationImpl.d.ts +1 -1
  5. package/dist/modules/o11y/client/library/AutomaticClickTracker.d.ts +7 -7
  6. package/dist/modules/o11y/client/library/IdleDetectorImpl.d.ts +8 -8
  7. package/dist/modules/o11y/client/library/InstrumentationImpl.d.ts +1 -1
  8. package/dist/modules/o11y/client/library/LogValidator.d.ts +5 -5
  9. package/dist/modules/o11y/client/library/MockObj.d.ts +3 -0
  10. package/dist/modules/o11y/client/library/NextgenImpl.d.ts +3 -3
  11. package/dist/modules/o11y/client/library/Tracing.d.ts +2 -2
  12. package/dist/modules/o11y/client/shared/SchemaUtil.d.ts +1 -1
  13. package/dist/modules/o11y/client/shared/Utility.d.ts +1 -1
  14. package/dist/modules/o11y/client/test/MockMouseEvent.d.ts +47 -0
  15. package/dist/modules/o11y/client/test/TestEnvironment.d.ts +7 -0
  16. package/dist/modules/o11y/client/version.d.ts +1 -1
  17. package/dist/modules/o11y/collectors/collectors.js +4 -1
  18. package/dist/modules/o11y/collectors/collectors.js.map +1 -1
  19. package/dist/modules/o11y/collectors/interfaces/InstrumentationContext.d.ts +1 -0
  20. package/dist/modules/o11y/collectors/library/AppInstrumentationImpl.d.ts +1 -1
  21. package/dist/modules/o11y/collectors/library/AutomaticClickTracker.d.ts +7 -7
  22. package/dist/modules/o11y/collectors/library/IdleDetectorImpl.d.ts +8 -8
  23. package/dist/modules/o11y/collectors/library/InstrumentationImpl.d.ts +1 -1
  24. package/dist/modules/o11y/collectors/library/LogValidator.d.ts +5 -5
  25. package/dist/modules/o11y/collectors/library/MockObj.d.ts +3 -0
  26. package/dist/modules/o11y/collectors/library/NextgenImpl.d.ts +3 -3
  27. package/dist/modules/o11y/collectors/library/Tracing.d.ts +2 -2
  28. package/dist/modules/o11y/collectors/shared/SchemaUtil.d.ts +1 -1
  29. package/dist/modules/o11y/collectors/shared/Utility.d.ts +1 -1
  30. package/dist/modules/o11y/collectors/test/MockMouseEvent.d.ts +47 -0
  31. package/dist/modules/o11y/collectors/test/TestEnvironment.d.ts +7 -0
  32. package/dist/modules/o11y/collectors/version.d.ts +1 -1
  33. package/dist/modules/o11y/core_envelope/core_envelope.js +1 -1
  34. package/dist/modules/o11y/core_envelope/core_envelope.js.map +1 -1
  35. package/dist/modules/o11y/core_envelope/interfaces/InstrumentationContext.d.ts +1 -0
  36. package/dist/modules/o11y/core_envelope/library/AppInstrumentationImpl.d.ts +1 -1
  37. package/dist/modules/o11y/core_envelope/library/AutomaticClickTracker.d.ts +7 -7
  38. package/dist/modules/o11y/core_envelope/library/IdleDetectorImpl.d.ts +8 -8
  39. package/dist/modules/o11y/core_envelope/library/InstrumentationImpl.d.ts +1 -1
  40. package/dist/modules/o11y/core_envelope/library/LogValidator.d.ts +5 -5
  41. package/dist/modules/o11y/core_envelope/library/MockObj.d.ts +3 -0
  42. package/dist/modules/o11y/core_envelope/library/NextgenImpl.d.ts +3 -3
  43. package/dist/modules/o11y/core_envelope/library/Tracing.d.ts +2 -2
  44. package/dist/modules/o11y/core_envelope/shared/SchemaUtil.d.ts +1 -1
  45. package/dist/modules/o11y/core_envelope/shared/Utility.d.ts +1 -1
  46. package/dist/modules/o11y/core_envelope/test/MockMouseEvent.d.ts +47 -0
  47. package/dist/modules/o11y/core_envelope/test/TestEnvironment.d.ts +7 -0
  48. package/dist/modules/o11y/core_envelope/version.d.ts +1 -1
  49. package/dist/modules/o11y/shared/interfaces/InstrumentationContext.d.ts +1 -0
  50. package/dist/modules/o11y/shared/library/AppInstrumentationImpl.d.ts +1 -1
  51. package/dist/modules/o11y/shared/library/AutomaticClickTracker.d.ts +7 -7
  52. package/dist/modules/o11y/shared/library/IdleDetectorImpl.d.ts +8 -8
  53. package/dist/modules/o11y/shared/library/InstrumentationImpl.d.ts +1 -1
  54. package/dist/modules/o11y/shared/library/LogValidator.d.ts +5 -5
  55. package/dist/modules/o11y/shared/library/MockObj.d.ts +3 -0
  56. package/dist/modules/o11y/shared/library/NextgenImpl.d.ts +3 -3
  57. package/dist/modules/o11y/shared/library/Tracing.d.ts +2 -2
  58. package/dist/modules/o11y/shared/shared/SchemaUtil.d.ts +1 -1
  59. package/dist/modules/o11y/shared/shared/Utility.d.ts +1 -1
  60. package/dist/modules/o11y/shared/shared.js +11 -15
  61. package/dist/modules/o11y/shared/shared.js.map +1 -1
  62. package/dist/modules/o11y/shared/test/MockMouseEvent.d.ts +47 -0
  63. package/dist/modules/o11y/shared/test/TestEnvironment.d.ts +7 -0
  64. package/dist/modules/o11y/shared/version.d.ts +1 -1
  65. package/dist/modules/o11y/simple_collector/interfaces/InstrumentationContext.d.ts +1 -0
  66. package/dist/modules/o11y/simple_collector/library/AppInstrumentationImpl.d.ts +1 -1
  67. package/dist/modules/o11y/simple_collector/library/AutomaticClickTracker.d.ts +7 -7
  68. package/dist/modules/o11y/simple_collector/library/IdleDetectorImpl.d.ts +8 -8
  69. package/dist/modules/o11y/simple_collector/library/InstrumentationImpl.d.ts +1 -1
  70. package/dist/modules/o11y/simple_collector/library/LogValidator.d.ts +5 -5
  71. package/dist/modules/o11y/simple_collector/library/MockObj.d.ts +3 -0
  72. package/dist/modules/o11y/simple_collector/library/NextgenImpl.d.ts +3 -3
  73. package/dist/modules/o11y/simple_collector/library/Tracing.d.ts +2 -2
  74. package/dist/modules/o11y/simple_collector/shared/SchemaUtil.d.ts +1 -1
  75. package/dist/modules/o11y/simple_collector/shared/Utility.d.ts +1 -1
  76. package/dist/modules/o11y/simple_collector/simple_collector.js +2 -1
  77. package/dist/modules/o11y/simple_collector/simple_collector.js.map +1 -1
  78. package/dist/modules/o11y/simple_collector/test/MockMouseEvent.d.ts +47 -0
  79. package/dist/modules/o11y/simple_collector/test/TestEnvironment.d.ts +7 -0
  80. package/dist/modules/o11y/simple_collector/version.d.ts +1 -1
  81. package/dist/modules/o11y/web_vitals/interfaces/InstrumentationContext.d.ts +1 -0
  82. package/dist/modules/o11y/web_vitals/library/AppInstrumentationImpl.d.ts +1 -1
  83. package/dist/modules/o11y/web_vitals/library/AutomaticClickTracker.d.ts +7 -7
  84. package/dist/modules/o11y/web_vitals/library/IdleDetectorImpl.d.ts +8 -8
  85. package/dist/modules/o11y/web_vitals/library/InstrumentationImpl.d.ts +1 -1
  86. package/dist/modules/o11y/web_vitals/library/LogValidator.d.ts +5 -5
  87. package/dist/modules/o11y/web_vitals/library/MockObj.d.ts +3 -0
  88. package/dist/modules/o11y/web_vitals/library/NextgenImpl.d.ts +3 -3
  89. package/dist/modules/o11y/web_vitals/library/Tracing.d.ts +2 -2
  90. package/dist/modules/o11y/web_vitals/shared/SchemaUtil.d.ts +1 -1
  91. package/dist/modules/o11y/web_vitals/shared/Utility.d.ts +1 -1
  92. package/dist/modules/o11y/web_vitals/test/MockMouseEvent.d.ts +47 -0
  93. package/dist/modules/o11y/web_vitals/test/TestEnvironment.d.ts +7 -0
  94. package/dist/modules/o11y/web_vitals/version.d.ts +1 -1
  95. package/package.json +2 -2
  96. package/dist/modules/o11y/client/library/MockEvent.d.ts +0 -7
  97. package/dist/modules/o11y/collectors/library/MockEvent.d.ts +0 -7
  98. package/dist/modules/o11y/core_envelope/library/MockEvent.d.ts +0 -7
  99. package/dist/modules/o11y/shared/library/MockEvent.d.ts +0 -7
  100. package/dist/modules/o11y/simple_collector/library/MockEvent.d.ts +0 -7
  101. package/dist/modules/o11y/web_vitals/library/MockEvent.d.ts +0 -7
@@ -12,9 +12,9 @@ const headerParentSpanId = 'X-B3-ParentSpanId';
12
12
  const defaultActivityNameForFetch = 'fetch';
13
13
  const defaultActivityNameForXhrSend = 'xhr_send';
14
14
  class Tracing {
15
- constructor(instr) {
16
- this.instr = instr;
17
- utility.requireArgument(instr, 'instr', 'object');
15
+ constructor(_instr) {
16
+ this._instr = _instr;
17
+ utility.requireArgument(_instr, '_instr', 'object');
18
18
  }
19
19
  static _getB3CompactFormat(traceId, spanId, isSampled, parentSpanId) {
20
20
  let b3 = `${traceId}-${spanId}`;
@@ -49,8 +49,8 @@ class Tracing {
49
49
  static getHeaders(traceId, spanId, isSampled, options) {
50
50
  utility.requireArgument(traceId, 'traceId', 'string');
51
51
  utility.requireArgument(spanId, 'spanId', 'string');
52
- const useB3Headers = options && options.useB3Headers;
53
- traceId = this._conformTextAsId(traceId, options && options.traceIdEffectiveLength !== undefined
52
+ const useB3Headers = options === null || options === void 0 ? void 0 : options.useB3Headers;
53
+ traceId = this._conformTextAsId(traceId, (options === null || options === void 0 ? void 0 : options.traceIdEffectiveLength) !== undefined
54
54
  ? options.traceIdEffectiveLength
55
55
  : useB3Headers
56
56
  ? defaultTraceIdLengthB3
@@ -62,7 +62,7 @@ class Tracing {
62
62
  undefined;
63
63
  const headers = {};
64
64
  if (useB3Headers) {
65
- const isCompact = options && options.useCompactHeader;
65
+ const isCompact = options === null || options === void 0 ? void 0 : options.useCompactHeader;
66
66
  if (isCompact) {
67
67
  headers[headerB3] = this._getB3CompactFormat(traceId, spanId, isSampled, parentSpanId);
68
68
  }
@@ -210,7 +210,7 @@ class Tracing {
210
210
  if (options) {
211
211
  this._disableNetworkInstrumentation();
212
212
  const tracingOptions = typeof options === 'object' ? options : {};
213
- this._enableNetworkInstrumentation(utility.definedValueOrDefault(tracingOptions.instrumentation, this.instr), utility.definedValueOrDefault(tracingOptions.logErrors, true), tracingOptions.activityName, utility.definedValueOrDefault(tracingOptions.useTracing, true), tracingOptions.tracingHeadersOptions);
213
+ this._enableNetworkInstrumentation(utility.definedValueOrDefault(tracingOptions.instrumentation, this._instr), utility.definedValueOrDefault(tracingOptions.logErrors, true), tracingOptions.activityName, utility.definedValueOrDefault(tracingOptions.useTracing, true), tracingOptions.tracingHeadersOptions);
214
214
  }
215
215
  else {
216
216
  this._disableNetworkInstrumentation();
@@ -418,21 +418,19 @@ class ActivityImpl {
418
418
  }
419
419
  ActivityImpl._count = 0;
420
420
 
421
- const activity={namespace:"sf.instrumentation",name:"Activity",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"Activity":{"reserved":[[5,5],[7,7]],"fields":{"duration":{"options":{},"id":3,"type":"double"},"stopReason":{"options":{},"id":6,"type":"string"},"isRoot":{"options":{},"id":8,"type":"bool"},"timerOverridden":{"options":{},"id":12,"type":"uint32"},"name":{"options":{"(meta.max_length)":25},"id":2,"type":"string"},"isSampled":{"options":{},"id":11,"type":"bool"},
422
- "preRootId":{"options":{},"id":9,"type":"string"},"id":{"options":{},"id":1,"type":"string"},"userPayload":{"options":{},"id":4,"type":"Payload"},"errorCount":{"options":{},"id":10,"type":"uint32"},"parentId":{"options":{},"id":13,"type":"string"}}},"Payload":{"fields":{"payload":{"options":{},"id":2,"type":"bytes"},"schemaName":{"options":{},"id":1,"type":"string"}}}}}}}}}};
421
+ const activity={namespace:"sf.instrumentation",name:"Activity",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"Activity":{"reserved":[[5,5],[7,7]],"fields":{"duration":{"id":3,"type":"double"},"stopReason":{"id":6,"type":"string"},"isRoot":{"id":8,"type":"bool"},"timerOverridden":{"id":12,"type":"uint32"},"name":{"options":{"(meta.max_length)":25},"id":2,"type":"string"},"isSampled":{"id":11,"type":"bool"},"preRootId":{"id":9,"type":"string"},"id":{"id":1,"type":"string"},
422
+ "userPayload":{"id":4,"type":"Payload"},"errorCount":{"id":10,"type":"uint32"},"parentId":{"id":13,"type":"string"}}},"Payload":{"fields":{"payload":{"id":2,"type":"bytes"},"schemaName":{"id":1,"type":"string"}}}}}}}}}};
423
423
 
424
- const error={namespace:"sf.instrumentation",name:"Error",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"Error":{"reserved":[[5,5],[7,7]],"fields":{"activityId":{"options":{},"id":6,"type":"string"},"stack":{"options":{},"id":3,"type":"string"},"name":{"options":{},"id":1,"type":"string"},"message":{"options":{"(meta.max_length)":200},"id":2,"type":"string"},"userPayload":{"options":{},"id":4,"type":"Payload"}}},"Payload":{"fields":{"payload":{"options":{},"id":2,"type":"bytes"},
425
- "schemaName":{"options":{},"id":1,"type":"string"}}}}}}}}}};
424
+ const error={namespace:"sf.instrumentation",name:"Error",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"Error":{"reserved":[[5,5],[7,7]],"fields":{"activityId":{"id":6,"type":"string"},"stack":{"id":3,"type":"string"},"name":{"id":1,"type":"string"},"message":{"options":{"(meta.max_length)":200},"id":2,"type":"string"},"userPayload":{"id":4,"type":"Payload"}}},"Payload":{"fields":{"payload":{"id":2,"type":"bytes"},"schemaName":{"id":1,"type":"string"}}}}}}}}}};
426
425
 
427
- const idle_detector_report={namespace:"sf.instrumentation",name:"IdleDetectorReport",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"IdleDetectorReport":{"options":{"(meta.msg.desc)":"This is used by the Idle Detector in o11y"},"fields":{"listenerCount":{"options":{},"id":3,"type":"uint32"},"busyTasks":{"options":{},"rule":"repeated","id":5,"type":"string"},"busyDurations":{"options":{},"rule":"repeated","id":6,"type":"double"},"pollableCount":{"options":{},"id":4,"type":"uint32"},
428
- "pollCounts":{"options":{},"rule":"repeated","id":8,"type":"double"},"logThreshold":{"options":{},"id":2,"type":"double"},"maxDuration":{"options":{},"id":1,"type":"double"},"pollables":{"options":{},"rule":"repeated","id":7,"type":"string"}}}}}}}}}};
426
+ const idle_detector_report={namespace:"sf.instrumentation",name:"IdleDetectorReport",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"IdleDetectorReport":{"fields":{"listenerCount":{"id":3,"type":"uint32"},"busyTasks":{"rule":"repeated","id":5,"type":"string"},"busyDurations":{"rule":"repeated","id":6,"type":"double"},"pollableCount":{"id":4,"type":"uint32"},"pollCounts":{"rule":"repeated","id":8,"type":"double"},"logThreshold":{"id":2,"type":"double"},"maxDuration":{"id":1,
427
+ "type":"double"},"pollables":{"rule":"repeated","id":7,"type":"string"}}}}}}}}}};
429
428
 
430
- const instrumented_event={namespace:"sf.instrumentation",name:"InstrumentedEvent",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"MouseEvent":{"fields":{"cancelable":{"options":{},"id":5,"type":"bool"},"ctrlKey":{"options":{},"id":9,"type":"bool"},"type":{"options":{},"id":25,"type":"string"},"button":{"options":{},"id":3,"type":"uint32"},"offsetX":{"options":{},"id":17,"type":"uint32"},"eventPhase":{"options":{},"id":12,"type":"uint32"},"shiftKey":{"options":{},"id":23,
431
- "type":"bool"},"offsetY":{"options":{},"id":18,"type":"uint32"},"composed":{"options":{},"id":8,"type":"bool"},"altKey":{"options":{},"id":1,"type":"bool"},"isTrusted":{"options":{},"id":13,"type":"bool"},"buttons":{"options":{},"id":4,"type":"uint32"},"movementY":{"options":{},"id":16,"type":"uint32"},"clientY":{"options":{},"id":7,"type":"uint32"},"clientX":{"options":{},"id":6,"type":"uint32"},"movementX":{"options":{},"id":15,"type":"uint32"},"defaultPrevented":{"options":{},"id":10,"type":"bool"},
432
- "metaKey":{"options":{},"id":14,"type":"bool"},"timeStamp":{"options":{},"id":24,"type":"double"},"bubbles":{"options":{},"id":2,"type":"bool"},"detail":{"options":{},"id":11,"type":"int64"},"pageY":{"options":{},"id":20,"type":"uint32"},"pageX":{"options":{},"id":19,"type":"uint32"},"screenX":{"options":{},"id":21,"type":"uint32"},"screenY":{"options":{},"id":22,"type":"uint32"}}},"InstrumentedEvent":{"oneofs":{"event":{"oneof":["mouseEvent"]}},"reserved":[[4,4],"xpath",[6,6],[8,8]],"fields":{"mouseEvent":{"options":{},
433
- "id":7,"type":"MouseEvent"},"auto":{"options":{},"id":3,"type":"bool"},"parentComponent":{"options":{},"id":2,"type":"string"},"ownerComponent":{"options":{},"id":1,"type":"string"},"userPayload":{"options":{},"id":5,"type":"Payload"},"simplePath":{"options":{},"id":9,"type":"string"}}},"Payload":{"fields":{"payload":{"options":{},"id":2,"type":"bytes"},"schemaName":{"options":{},"id":1,"type":"string"}}}}}}}}}};
429
+ const instrumented_event={namespace:"sf.instrumentation",name:"InstrumentedEvent",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"MouseEvent":{"fields":{"cancelable":{"id":5,"type":"bool"},"ctrlKey":{"id":9,"type":"bool"},"type":{"id":25,"type":"string"},"button":{"id":3,"type":"uint32"},"offsetX":{"id":17,"type":"uint32"},"eventPhase":{"id":12,"type":"uint32"},"shiftKey":{"id":23,"type":"bool"},"offsetY":{"id":18,"type":"uint32"},"composed":{"id":8,"type":"bool"},"altKey":{"id":1,
430
+ "type":"bool"},"isTrusted":{"id":13,"type":"bool"},"buttons":{"id":4,"type":"uint32"},"movementY":{"id":16,"type":"uint32"},"clientY":{"id":7,"type":"uint32"},"clientX":{"id":6,"type":"uint32"},"movementX":{"id":15,"type":"uint32"},"defaultPrevented":{"id":10,"type":"bool"},"metaKey":{"id":14,"type":"bool"},"timeStamp":{"id":24,"type":"double"},"bubbles":{"id":2,"type":"bool"},"detail":{"id":11,"type":"int64"},"pageY":{"id":20,"type":"uint32"},"pageX":{"id":19,"type":"uint32"},"screenX":{"id":21,
431
+ "type":"uint32"},"screenY":{"id":22,"type":"uint32"}}},"InstrumentedEvent":{"oneofs":{"event":{"oneof":["mouseEvent"]}},"reserved":[[4,4],"xpath",[6,6],[8,8]],"fields":{"mouseEvent":{"id":7,"type":"MouseEvent"},"auto":{"id":3,"type":"bool"},"parentComponent":{"id":2,"type":"string"},"ownerComponent":{"id":1,"type":"string"},"userPayload":{"id":5,"type":"Payload"},"simplePath":{"id":9,"type":"string"}}},"Payload":{"fields":{"payload":{"id":2,"type":"bytes"},"schemaName":{"id":1,"type":"string"}}}}}}}}}};
434
432
 
435
- const simple={namespace:"sf.instrumentation",name:"Simple",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"Simple":{"options":{"(meta.msg.desc)":"This message is used internally to allow convenient logging of simple text via the API without requiring a schema."},"fields":{"text":{"options":{"(meta.max_length)":25},"id":1,"type":"string"}}}}}}}}}};
433
+ const simple={namespace:"sf.instrumentation",name:"Simple",pbjsSchema:{"nested":{"sf":{"nested":{"instrumentation":{"nested":{"Simple":{"fields":{"text":{"options":{"(meta.max_length)":25},"id":1,"type":"string"}}}}}}}}}};
436
434
 
437
435
  const id = new Array(16).fill(0).join('');
438
436
  class ActivityNoOp {
@@ -466,9 +464,10 @@ const activityNoOp = Object.freeze(new ActivityNoOp());
466
464
 
467
465
  class DomEventHelpers {
468
466
  getInstrumentedEventData(eventData, handledBy, userPayload) {
467
+ var _a;
469
468
  const instrumentedEvent = {
470
469
  ownerComponent: handledBy.tagName,
471
- parentComponent: (handledBy.parentElement && handledBy.parentElement.tagName) || undefined,
470
+ parentComponent: ((_a = handledBy.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) || undefined,
472
471
  event: eventData,
473
472
  simplePath: utility.getXpath(handledBy)
474
473
  };
@@ -554,6 +553,12 @@ class ValidationEntry {
554
553
  case 7:
555
554
  msg = 'Exceeded app limit for item count';
556
555
  break;
556
+ case 12:
557
+ msg = 'Value must be an integer';
558
+ break;
559
+ case 13:
560
+ msg = 'Values like null or undefined are not allowed for items in repeated fields';
561
+ break;
557
562
  default:
558
563
  msg = `Unknown error code: ${this.errorCode}`;
559
564
  break;
@@ -568,113 +573,146 @@ class LogValidator {
568
573
  const schemaId = schemaUtil.getSchemaId(schema);
569
574
  const errorInfos = new Array();
570
575
  const nestedSchema = schemaUtil.getTypes(schema);
571
- this.validateFields(errorInfos, [], data, nestedSchema[schemaTokens.message], nestedSchema, schemaId);
576
+ this._validateFields(errorInfos, [], data, nestedSchema[schemaTokens.message], nestedSchema, schemaId);
572
577
  if (errorInfos.length && !noThrow) {
573
578
  throw new Error(errorInfos[0].asMessage(schemaId));
574
579
  }
575
580
  return errorInfos;
576
581
  }
577
- validateFields(errorInfos, fieldNames, data, message, descriptor, schemaId) {
582
+ _validateFields(errorInfos, fieldNames, data, message, descriptor, schemaId) {
578
583
  const oneofs = message.oneofs || {};
579
584
  const fields = message.fields || {};
580
585
  for (const key in data) {
581
586
  const value = data[key];
582
- if (!this.isNullOrUndefinedOrEmpty(value)) {
583
- const mft = (fieldType, rule) => this.matchFieldTypes(errorInfos, [...fieldNames, key], value, fieldType, descriptor, schemaId, key, rule);
587
+ if (value !== undefined && value !== null) {
588
+ const mft = (fieldType, isRepeated, isItem) => this._matchFieldTypes(errorInfos, [...fieldNames, key], value, fieldType, descriptor, schemaId, key, isRepeated, isItem);
584
589
  if (oneofs[key]) {
585
590
  mft(fields[oneofs[key].oneof[0]].type);
586
591
  }
587
592
  else if (fields[key]) {
588
- mft(fields[key].type, fields[key].rule);
593
+ mft(fields[key].type, fields[key].rule === 'repeated');
589
594
  }
590
595
  }
591
596
  }
592
597
  }
593
- isNullOrUndefinedOrEmpty(val) {
594
- return val === undefined || val === null || val === '';
595
- }
596
- matchFieldTypes(errorInfos, fieldNames, fieldDataValue, protobufType, descriptor, schemaId, key, rule) {
598
+ _matchFieldTypes(errorInfos, fieldNames, fieldDataValue, protobufType, descriptor, schemaId, key, isRepeated, isItem) {
597
599
  let errorCode;
598
- if (rule === 'repeated') {
600
+ if (isRepeated) {
599
601
  if (Array.isArray(fieldDataValue)) {
600
602
  if (fieldDataValue.length > maxItemCountAppLimit) {
601
603
  errorCode = 7;
602
604
  }
603
605
  fieldDataValue.forEach((value, index) => {
604
- this.matchFieldTypes(errorInfos, [...fieldNames, index.toString()], value, protobufType, descriptor, schemaId, key);
606
+ this._matchFieldTypes(errorInfos, [...fieldNames, index.toString()], value, protobufType, descriptor, schemaId, key, undefined, true);
605
607
  });
606
608
  }
607
609
  else {
608
610
  errorCode = 1;
609
611
  }
610
- if (errorCode) {
611
- errorInfos.push(new ValidationEntry(errorCode, fieldNames));
612
+ }
613
+ else if (fieldDataValue == null || fieldDataValue === undefined) {
614
+ if (isItem) {
615
+ errorCode = 13;
612
616
  }
613
- return;
614
617
  }
615
- let javaScriptType;
616
- switch (protobufType) {
617
- case 'string':
618
- javaScriptType = 'string';
619
- if (fieldDataValue.length > maxStringLengthAppLimit) {
620
- errorCode = 6;
621
- }
622
- break;
623
- case 'bytes':
624
- javaScriptType = 'object';
625
- if (!(fieldDataValue instanceof Uint8Array)) {
626
- errorCode = 5;
627
- }
628
- break;
629
- case 'bool':
630
- javaScriptType = 'boolean';
631
- break;
632
- case 'uint32':
633
- javaScriptType = 'number';
634
- errorCode = this.checkNumberRange(fieldDataValue, minUnsigned, maxFourBytesUnsigned);
635
- break;
636
- case 'int32':
637
- case 'sint32':
638
- case 'fixed32':
639
- case 'sfixed32':
640
- javaScriptType = 'number';
641
- errorCode = this.checkNumberRange(fieldDataValue, minFourBytes, maxFourBytes);
642
- break;
643
- case 'uint64':
644
- javaScriptType = 'number';
645
- errorCode = this.checkNumberRange(fieldDataValue, minUnsigned, maxEightBytesUnsigned);
646
- break;
647
- case 'fixed64':
648
- case 'sfixed64':
649
- case 'int64':
650
- case 'sint64':
651
- javaScriptType = 'number';
652
- errorCode = this.checkNumberRange(fieldDataValue, minEightBytes, maxEightBytes);
653
- break;
654
- case 'double':
655
- case 'float':
656
- javaScriptType = 'number';
657
- if (!Number.isFinite(fieldDataValue)) {
618
+ else {
619
+ let numOpts;
620
+ let javaScriptType;
621
+ switch (protobufType) {
622
+ case 'string':
623
+ javaScriptType = 'string';
624
+ if (fieldDataValue.length > maxStringLengthAppLimit) {
625
+ errorCode = 6;
626
+ }
627
+ break;
628
+ case 'bytes':
629
+ javaScriptType = 'object';
630
+ if (!(fieldDataValue instanceof Uint8Array)) {
631
+ errorCode = 5;
632
+ }
633
+ break;
634
+ case 'bool':
635
+ javaScriptType = 'boolean';
636
+ break;
637
+ case 'uint32':
638
+ javaScriptType = 'number';
639
+ numOpts = {
640
+ min: minUnsigned,
641
+ max: maxFourBytesUnsigned,
642
+ isInt: true,
643
+ isItem
644
+ };
645
+ break;
646
+ case 'int32':
647
+ case 'sint32':
648
+ case 'fixed32':
649
+ case 'sfixed32':
650
+ javaScriptType = 'number';
651
+ numOpts = {
652
+ min: minFourBytes,
653
+ max: maxFourBytes,
654
+ isInt: true,
655
+ isItem
656
+ };
657
+ break;
658
+ case 'uint64':
659
+ javaScriptType = 'number';
660
+ numOpts = {
661
+ min: minUnsigned,
662
+ max: maxEightBytesUnsigned,
663
+ isInt: true,
664
+ isItem
665
+ };
666
+ break;
667
+ case 'fixed64':
668
+ case 'sfixed64':
669
+ case 'int64':
670
+ case 'sint64':
671
+ javaScriptType = 'number';
672
+ numOpts = {
673
+ min: minEightBytes,
674
+ max: maxEightBytes,
675
+ isInt: true,
676
+ isItem
677
+ };
678
+ break;
679
+ case 'double':
680
+ case 'float':
681
+ javaScriptType = 'number';
682
+ numOpts = {
683
+ min: Number.NEGATIVE_INFINITY,
684
+ max: Number.POSITIVE_INFINITY,
685
+ isInt: false,
686
+ isItem
687
+ };
688
+ break;
689
+ default:
690
+ if (new Set(Object.keys(descriptor)).has(protobufType)) {
691
+ this._validateFields(errorInfos, fieldNames, fieldDataValue, descriptor[protobufType], descriptor, schemaId);
692
+ javaScriptType = 'object';
693
+ }
694
+ break;
695
+ }
696
+ if (typeof fieldDataValue !== javaScriptType) {
697
+ errorInfos.push(new ValidationEntry(2, fieldNames, protobufType, typeof fieldDataValue));
698
+ }
699
+ else if (numOpts) {
700
+ if (numOpts.isInt && !Number.isFinite(fieldDataValue)) {
658
701
  errorCode = 3;
659
702
  }
660
- break;
661
- default:
662
- if (new Set(Object.keys(descriptor)).has(protobufType)) {
663
- this.validateFields(errorInfos, fieldNames, fieldDataValue, descriptor[protobufType], descriptor, schemaId);
664
- javaScriptType = 'object';
703
+ else if (numOpts.isInt && !Number.isInteger(fieldDataValue)) {
704
+ errorCode = 12;
665
705
  }
666
- break;
667
- }
668
- if (typeof fieldDataValue !== javaScriptType) {
669
- errorInfos.push(new ValidationEntry(2, fieldNames, protobufType, typeof fieldDataValue));
706
+ else if (!(!numOpts.isInt && Number.isNaN(fieldDataValue)) &&
707
+ !(fieldDataValue >= numOpts.min && fieldDataValue <= numOpts.max)) {
708
+ errorCode = 4;
709
+ }
710
+ }
670
711
  }
671
712
  if (errorCode) {
672
713
  errorInfos.push(new ValidationEntry(errorCode, fieldNames));
673
714
  }
674
715
  }
675
- checkNumberRange(value, min, max) {
676
- return value > max || value < min ? 4 : undefined;
677
- }
678
716
  }
679
717
  const logValidator = new LogValidator();
680
718
 
@@ -945,14 +983,9 @@ class MetricsImpl {
945
983
  }
946
984
  }
947
985
 
948
- class MockEvent {
949
- constructor(type, composed, _composedPaths) {
950
- this.type = type;
951
- this.composed = composed;
952
- this._composedPaths = _composedPaths;
953
- }
954
- composedPath() {
955
- return this._composedPaths;
986
+ class MockBase {
987
+ constructor() {
988
+ this.isMock = true;
956
989
  }
957
990
  }
958
991
 
@@ -1009,7 +1042,7 @@ class InstrumentationImpl {
1009
1042
  }
1010
1043
  return schemaUtil.makePayload(userSchema, userData, onlyIfBoth);
1011
1044
  }
1012
- getEffectiveRootId(options) {
1045
+ _getEffectiveRootId(options) {
1013
1046
  var _a, _b;
1014
1047
  return ((_b = (_a = options === null || options === void 0 ? void 0 : options.instrumentationContext) === null || _a === void 0 ? void 0 : _a.rootId) !== null && _b !== void 0 ? _b : this._nextGen.getDefaultInstrumentationContext().rootId);
1015
1048
  }
@@ -1021,7 +1054,7 @@ class InstrumentationImpl {
1021
1054
  utility.requireArgumentIfDefined(options, 'options', 'object');
1022
1055
  const userPayload = this._wrapUserPayload(userSchemaOrText, userData);
1023
1056
  if (userPayload === null || userPayload === void 0 ? void 0 : userPayload.payload) {
1024
- this._logInternal(this.name, userPayload.schema, userPayload.payload, timestamp, this.getEffectiveRootId(options));
1057
+ this._logInternal(this.name, userPayload.schema, userPayload.payload, timestamp, this._getEffectiveRootId(options));
1025
1058
  }
1026
1059
  });
1027
1060
  }
@@ -1039,7 +1072,7 @@ class InstrumentationImpl {
1039
1072
  ]);
1040
1073
  utility.requireArgumentIfDefined(userData, 'userData', 'object');
1041
1074
  utility.requireArgumentIfDefined(options, 'options', 'object');
1042
- const rootId = this.getEffectiveRootId(options);
1075
+ const rootId = this._getEffectiveRootId(options);
1043
1076
  this._errorInternal(error, userSchemaOrText, userData, undefined, rootId);
1044
1077
  });
1045
1078
  }
@@ -1124,8 +1157,9 @@ class InstrumentationImpl {
1124
1157
  }
1125
1158
  domEvent(event, handledBy, userSchemaOrText, userData, options) {
1126
1159
  this._safety.tryCatch(() => {
1160
+ var _a;
1127
1161
  const tsNow = utility.time().tsNow;
1128
- utility.requireArgument(event, 'event', [Event, MockEvent]);
1162
+ utility.requireArgument(event, 'event', [Event, MockBase]);
1129
1163
  utility.requireArgument(handledBy, 'handledBy', [HTMLElement, 'object']);
1130
1164
  let htmlElement;
1131
1165
  if (handledBy instanceof HTMLElement) {
@@ -1133,7 +1167,7 @@ class InstrumentationImpl {
1133
1167
  }
1134
1168
  else {
1135
1169
  handledBy = handledBy;
1136
- if (handledBy.template && handledBy.template.host instanceof HTMLElement) {
1170
+ if (((_a = handledBy.template) === null || _a === void 0 ? void 0 : _a.host) instanceof HTMLElement) {
1137
1171
  htmlElement = handledBy.template.host;
1138
1172
  }
1139
1173
  else {
@@ -1141,7 +1175,7 @@ class InstrumentationImpl {
1141
1175
  }
1142
1176
  }
1143
1177
  const userPayload = this._wrapUserPayload(userSchemaOrText, userData, true);
1144
- const rootId = this.getEffectiveRootId(options);
1178
+ const rootId = this._getEffectiveRootId(options);
1145
1179
  switch (event.type) {
1146
1180
  case 'click': {
1147
1181
  const mouseEvent = event;
@@ -1151,7 +1185,7 @@ class InstrumentationImpl {
1151
1185
  }
1152
1186
  const mouseEventData = domEventHelpers.getMouseEventData(mouseEvent);
1153
1187
  const instrumentedEvent = domEventHelpers.getInstrumentedEventData(mouseEventData, htmlElement, userPayload);
1154
- instrumentedEvent.auto = options && options._auto;
1188
+ instrumentedEvent.auto = options === null || options === void 0 ? void 0 : options._auto;
1155
1189
  this._logInternal(this.name, instrumented_event, instrumentedEvent, tsNow, rootId);
1156
1190
  break;
1157
1191
  }
@@ -1357,7 +1391,7 @@ class AppInstrumentationImpl extends InstrumentationImpl {
1357
1391
  constructor(_nextGen, _name, _allowMulti) {
1358
1392
  super(_nextGen, _name);
1359
1393
  this._allowMulti = _allowMulti;
1360
- this._onRootActivityStoppedCallback = this.handleRootActivityStop.bind(this);
1394
+ this._onRootActivityStoppedCallback = this._handleRootActivityStop.bind(this);
1361
1395
  }
1362
1396
  startRootActivity(name, rootId, isSampled) {
1363
1397
  return this._safety.tryCatchReturn(() => {
@@ -1374,7 +1408,7 @@ class AppInstrumentationImpl extends InstrumentationImpl {
1374
1408
  return newRootActivity;
1375
1409
  }, rootActivityNoOp);
1376
1410
  }
1377
- handleRootActivityStop(detail) {
1411
+ _handleRootActivityStop(detail) {
1378
1412
  if (detail.stopReason === discarded) {
1379
1413
  return;
1380
1414
  }
@@ -1403,56 +1437,58 @@ class AppInstrumentationImpl extends InstrumentationImpl {
1403
1437
 
1404
1438
  const pathLimit = 5;
1405
1439
  class AutomaticClickTracker {
1406
- constructor(instrumentation, document) {
1407
- this.isActive = false;
1408
- this._boundClickListener = this.clickListener.bind(this);
1409
- utility.requireArgument(instrumentation, 'instrumentation');
1410
- utility.requireArgument(document, 'document');
1411
- this.instr = instrumentation;
1412
- this.document = document;
1440
+ constructor(_instr, _doc) {
1441
+ this._instr = _instr;
1442
+ this._doc = _doc;
1443
+ this._isActive = false;
1444
+ this._boundClickListener = this._clickListener.bind(this);
1445
+ utility.requireArgument(_instr, '_instr');
1446
+ utility.requireArgument(_doc, '_doc');
1413
1447
  }
1414
1448
  activate() {
1415
- if (!this.isActive) {
1416
- this.document.addEventListener('click', this._boundClickListener, true);
1417
- this.isActive = true;
1449
+ if (!this._isActive) {
1450
+ this._doc.addEventListener('click', this._boundClickListener, true);
1451
+ this._isActive = true;
1418
1452
  }
1419
1453
  }
1420
1454
  deactivate() {
1421
- if (this.isActive) {
1422
- this.document.removeEventListener('click', this._boundClickListener, true);
1423
- this.isActive = false;
1455
+ if (this._isActive) {
1456
+ this._doc.removeEventListener('click', this._boundClickListener, true);
1457
+ this._isActive = false;
1424
1458
  }
1425
1459
  }
1426
1460
  markEventHandled(event) {
1427
- this.ignoredEvent = event;
1461
+ this._ignoredEvent = event;
1428
1462
  }
1429
- clickListener(event) {
1430
- let eventTargets = event.composedPath && event.composedPath();
1463
+ _clickListener(event) {
1464
+ var _a;
1465
+ let eventTargets = (_a = event.composedPath) === null || _a === void 0 ? void 0 : _a.call(event);
1431
1466
  if (!eventTargets || !eventTargets.length) {
1432
1467
  eventTargets = event.path;
1433
1468
  }
1434
- const handledBy = this.getClickableElement(eventTargets);
1469
+ const handledBy = this._getClickableElement(eventTargets);
1435
1470
  if (handledBy) {
1436
1471
  setTimeout(() => {
1437
- if (event !== this.ignoredEvent) {
1438
- this.instr.domEvent(event, handledBy, undefined, undefined, {
1472
+ if (event !== this._ignoredEvent) {
1473
+ this._instr.domEvent(event, handledBy, undefined, undefined, {
1439
1474
  _auto: true
1440
1475
  });
1441
1476
  }
1442
1477
  });
1443
1478
  }
1444
1479
  }
1445
- getClickableElement(path) {
1480
+ _getClickableElement(path) {
1481
+ var _a, _b;
1446
1482
  const limit = path ? Math.min(path.length, pathLimit) : 0;
1447
1483
  for (let x = 0; x < limit; x += 1) {
1448
1484
  const currentElement = path[x];
1449
- const tagName = currentElement.tagName && currentElement.tagName.toLowerCase();
1485
+ const tagName = (_a = currentElement.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase();
1450
1486
  if (tagName === 'a' || tagName === 'button') {
1451
1487
  return currentElement;
1452
1488
  }
1453
1489
  if (tagName === 'input') {
1454
1490
  const inputElement = currentElement;
1455
- if (inputElement.type && inputElement.type.toLowerCase() === 'button') {
1491
+ if (((_b = inputElement.type) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'button') {
1456
1492
  return inputElement;
1457
1493
  }
1458
1494
  }
@@ -1497,9 +1533,9 @@ class NextgenImpl {
1497
1533
  if (instr) {
1498
1534
  throw new Error(`The instrumentation name ${name} is already taken`);
1499
1535
  }
1500
- this._appInstr = new AppInstrumentationImpl(this, name, options && options.allowMultipleRootActivities);
1536
+ this._appInstr = new AppInstrumentationImpl(this, name, options === null || options === void 0 ? void 0 : options.allowMultipleRootActivities);
1501
1537
  this._instruments.set(name, this._appInstr);
1502
- this._isBufferingEnabled = options && options.enableBuffering;
1538
+ this._isBufferingEnabled = options === null || options === void 0 ? void 0 : options.enableBuffering;
1503
1539
  const tracing = new Tracing(this._appInstr);
1504
1540
  return {
1505
1541
  log: this._appInstr.log.bind(this._appInstr),
@@ -1538,7 +1574,8 @@ class NextgenImpl {
1538
1574
  return instr;
1539
1575
  }
1540
1576
  get appName() {
1541
- return this._appInstr && this._appInstr.name;
1577
+ var _a;
1578
+ return (_a = this._appInstr) === null || _a === void 0 ? void 0 : _a.name;
1542
1579
  }
1543
1580
  addLog(loggerName, schema, data, timestamp, rootId, pagePayload, appPayload) {
1544
1581
  this._sequence += 1;
@@ -1560,8 +1597,11 @@ class NextgenImpl {
1560
1597
  if (this._isBufferingEnabled) {
1561
1598
  this._buffer.push({ schema, data: utility.clone(data), logMeta });
1562
1599
  }
1563
- const eligibleCollectors = Array.from(this._logCollectors).filter((collector) => !this._forceDisabledLogCollectors.has(collector) &&
1564
- !(collector.getIsCollectDisabled && collector.getIsCollectDisabled()));
1600
+ const eligibleCollectors = Array.from(this._logCollectors).filter((collector) => {
1601
+ var _a;
1602
+ return !this._forceDisabledLogCollectors.has(collector) &&
1603
+ !((_a = collector.getIsCollectDisabled) === null || _a === void 0 ? void 0 : _a.call(collector));
1604
+ });
1565
1605
  if (eligibleCollectors.length > 0) {
1566
1606
  for (const collector of eligibleCollectors) {
1567
1607
  const dataClone = utility.clone(data);
@@ -1606,10 +1646,12 @@ class NextgenImpl {
1606
1646
  };
1607
1647
  }
1608
1648
  activateClickTracker() {
1609
- if (!this._autoClickTracker) {
1610
- this._autoClickTracker = new AutomaticClickTracker(this._appInstr, window.document);
1649
+ if (typeof document !== 'undefined') {
1650
+ if (!this._autoClickTracker) {
1651
+ this._autoClickTracker = new AutomaticClickTracker(this._appInstr, document);
1652
+ }
1653
+ this._autoClickTracker.activate();
1611
1654
  }
1612
- this._autoClickTracker.activate();
1613
1655
  }
1614
1656
  deactivateClickTracker() {
1615
1657
  if (this._autoClickTracker) {
@@ -1639,20 +1681,20 @@ class NextgenImpl {
1639
1681
  }
1640
1682
  this._metricsCollector = collector;
1641
1683
  this._metricsCollector.receiveMetricsExtractors({
1642
- getAllUpCounters: this.getAllUpCounters.bind(this),
1643
- getAllValueRecorders: this.getAllValueRecorders.bind(this),
1644
- getAllBucketHistograms: this.getAllBucketHistograms.bind(this)
1684
+ getAllUpCounters: this._getAllUpCounters.bind(this),
1685
+ getAllValueRecorders: this._getAllValueRecorders.bind(this),
1686
+ getAllBucketHistograms: this._getAllBucketHistograms.bind(this)
1645
1687
  });
1646
1688
  }
1647
- getAllUpCounters() {
1689
+ _getAllUpCounters() {
1648
1690
  const arrOfArrs = Array.from(this._instruments.values()).map((instr) => instr.getUpCounters());
1649
1691
  return arrOfArrs.reduce((pv, cv) => pv.concat(cv), []);
1650
1692
  }
1651
- getAllValueRecorders() {
1693
+ _getAllValueRecorders() {
1652
1694
  const arrOfArrs = Array.from(this._instruments.values()).map((instr) => instr.getValueRecorders());
1653
1695
  return arrOfArrs.reduce((pv, cv) => pv.concat(cv), []);
1654
1696
  }
1655
- getAllBucketHistograms() {
1697
+ _getAllBucketHistograms() {
1656
1698
  const arrOfArrs = Array.from(this._instruments.values()).map((instr) => instr.getBucketHistograms());
1657
1699
  return arrOfArrs.reduce((pv, cv) => pv.concat(cv), []);
1658
1700
  }
@@ -1744,7 +1786,6 @@ class IdleDetectorImpl {
1744
1786
  this._logThreshold = defaultLogThreshold;
1745
1787
  this._endedTasks = new Array();
1746
1788
  this._pollableReport = new Array();
1747
- this._timerCheckQueued = 0;
1748
1789
  if (utility.requireArgumentIfDefined(options === null || options === void 0 ? void 0 : options.logThreshold, 'options.logThreshold', 'number')) {
1749
1790
  this._logThreshold = options.logThreshold;
1750
1791
  }
@@ -1755,9 +1796,9 @@ class IdleDetectorImpl {
1755
1796
  this._firstCallbackTime = utility.time().perfNow;
1756
1797
  }
1757
1798
  this._listeners.add(callback);
1758
- this.checkIfLoaded();
1799
+ this._checkIfLoaded();
1759
1800
  }
1760
- reportTaskEnded(tasker) {
1801
+ _reportTaskEnded(tasker) {
1761
1802
  if (this._listeners.size) {
1762
1803
  const snapshot = Object.assign({}, this._taskers.get(tasker));
1763
1804
  this._endedTasks.push(snapshot);
@@ -1765,7 +1806,7 @@ class IdleDetectorImpl {
1765
1806
  }
1766
1807
  declareNotifierTaskSingle(name) {
1767
1808
  utility.requireArgument(name, 'name', 'string');
1768
- const tasker = this.addTasker(name, 1);
1809
+ const tasker = this._addTasker(name, 1);
1769
1810
  const retVal = {
1770
1811
  get isBusy() {
1771
1812
  return tasker.isBusy;
@@ -1781,12 +1822,11 @@ class IdleDetectorImpl {
1781
1822
  utility.requireArgument(name, 'name', 'string');
1782
1823
  if (existingBusyCount !== undefined) {
1783
1824
  utility.requireArgument(existingBusyCount, 'existingBusyCount', 'number');
1784
- if (existingBusyCount < 0 ||
1785
- parseInt(existingBusyCount.toString(), 10) !== existingBusyCount) {
1825
+ if (!Number.isInteger(existingBusyCount) || existingBusyCount < 0) {
1786
1826
  throw new Error('existingBusyCount accepts only non-negative integers');
1787
1827
  }
1788
1828
  }
1789
- const tasker = this.addTasker(name, existingBusyCount);
1829
+ const tasker = this._addTasker(name, existingBusyCount);
1790
1830
  const retVal = {
1791
1831
  get isBusy() {
1792
1832
  return tasker.isBusy;
@@ -1808,11 +1848,11 @@ class IdleDetectorImpl {
1808
1848
  utility.requireArgument(isBusyChecker, 'isBusyChecker', 'function');
1809
1849
  this._busyCheckers.set(isBusyChecker, name);
1810
1850
  }
1811
- addTasker(name, existingBusyCount) {
1851
+ _addTasker(name, existingBusyCount) {
1812
1852
  const tasker = new TaskerImpl(name, existingBusyCount, () => {
1813
1853
  this._taskers.get(tasker).end = utility.time().perfNow;
1814
- this.reportTaskEnded(tasker);
1815
- this.checkIfLoaded();
1854
+ this._reportTaskEnded(tasker);
1855
+ this._checkIfLoaded();
1816
1856
  }, () => {
1817
1857
  this._instr.error(`Overdone: ${tasker.name}`);
1818
1858
  utility.noProdThrow(`Tasker '${tasker.name}' is done too many times.`);
@@ -1824,10 +1864,10 @@ class IdleDetectorImpl {
1824
1864
  });
1825
1865
  return tasker;
1826
1866
  }
1827
- areAllNotifiersIdle() {
1867
+ _areAllNotifiersIdle() {
1828
1868
  return !Array.from(this._taskers.keys()).some((t) => t.isBusy);
1829
1869
  }
1830
- getFirstBusyPollable() {
1870
+ _getFirstBusyPollable() {
1831
1871
  const entry = Array.from(this._busyCheckers).find((entry) => {
1832
1872
  const isBusyChecker = entry[0];
1833
1873
  const name = entry[1];
@@ -1842,29 +1882,29 @@ class IdleDetectorImpl {
1842
1882
  });
1843
1883
  return entry ? entry[1] : undefined;
1844
1884
  }
1845
- checkIfLoaded() {
1885
+ _checkIfLoaded() {
1846
1886
  if (!this._listeners.size) {
1847
1887
  return;
1848
1888
  }
1849
1889
  if (this._timerCheckQueued) {
1850
- window.clearTimeout(this._timerCheckQueued);
1890
+ clearTimeout(this._timerCheckQueued);
1851
1891
  }
1852
- if (this.areAllNotifiersIdle()) {
1853
- this._timerCheckQueued = window.setTimeout(() => {
1854
- this._timerCheckQueued = window.setTimeout(() => {
1855
- this.doubleCheck();
1892
+ if (this._areAllNotifiersIdle()) {
1893
+ this._timerCheckQueued = setTimeout(() => {
1894
+ this._timerCheckQueued = setTimeout(() => {
1895
+ this._doubleCheck();
1856
1896
  }, 40);
1857
1897
  }, 0);
1858
1898
  }
1859
1899
  }
1860
- doubleCheck() {
1861
- this._timerCheckQueued = 0;
1862
- if (this.areAllNotifiersIdle()) {
1863
- const pollableName = this.getFirstBusyPollable();
1900
+ _doubleCheck() {
1901
+ this._timerCheckQueued = undefined;
1902
+ if (this._areAllNotifiersIdle()) {
1903
+ const pollableName = this._getFirstBusyPollable();
1864
1904
  if (pollableName !== undefined) {
1865
- this.addToPollableReport(pollableName);
1866
- this._timerCheckQueued = window.setTimeout(() => {
1867
- this.doubleCheck();
1905
+ this._addToPollableReport(pollableName);
1906
+ this._timerCheckQueued = setTimeout(() => {
1907
+ this._doubleCheck();
1868
1908
  }, 15);
1869
1909
  }
1870
1910
  else {
@@ -1874,11 +1914,11 @@ class IdleDetectorImpl {
1874
1914
  this._firstCallbackTime = undefined;
1875
1915
  const endedTasks = this._endedTasks.splice(0);
1876
1916
  const pollableReport = this._pollableReport.splice(0);
1877
- this.notify(listeners, maxDuration, endedTasks, pollableReport);
1917
+ this._notify(listeners, maxDuration, endedTasks, pollableReport);
1878
1918
  }
1879
1919
  }
1880
1920
  }
1881
- addToPollableReport(name) {
1921
+ _addToPollableReport(name) {
1882
1922
  const lastEntry = this._pollableReport.length
1883
1923
  ? this._pollableReport[this._pollableReport.length - 1]
1884
1924
  : undefined;
@@ -1892,7 +1932,7 @@ class IdleDetectorImpl {
1892
1932
  });
1893
1933
  }
1894
1934
  }
1895
- notify(listeners, maxDuration, taskReport, pollableReport) {
1935
+ _notify(listeners, maxDuration, taskReport, pollableReport) {
1896
1936
  if (maxDuration >= this._logThreshold) {
1897
1937
  const logData = this._getReport(maxDuration, listeners.length, taskReport, pollableReport);
1898
1938
  this._instr.log(idle_detector_report, logData);
@@ -1978,7 +2018,7 @@ class ConsoleCollector {
1978
2018
  }
1979
2019
  }
1980
2020
 
1981
- const version = '242.3.3';
2021
+ const version = '242.8.1';
1982
2022
 
1983
2023
  const idleDetector = new IdleDetectorImpl({
1984
2024
  logThreshold: 300