@@ -2146,7 +2146,7 @@ var logger = {
21462146/**
21472147 * Default options shared across platforms
21482148 */
2149- var version = '3.0.0-beta.2 ' ;
2149+ var version = '3.0.0-beta.3 ' ;
21502150var endpoint = 'api.rollbar.com/api/1/item/' ;
21512151var logLevel = 'debug' ;
21522152var reportLevel = 'debug' ;
@@ -2510,8 +2510,8 @@ function _currentTime() {
25102510; // external "url"
25112511const external_url_namespaceObject = require ( "url" ) ;
25122512; // ./src/telemetry.js
2513- function telemetry_typeof ( o ) { "@babel/helpers - typeof" ; return telemetry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol . iterator ? function ( o ) { return typeof o ; } : function ( o ) { return o && "function" == typeof Symbol && o . constructor === Symbol && o !== Symbol . prototype ? "symbol" : typeof o ; } , telemetry_typeof ( o ) ; }
25142513var _excluded = [ "otelAttributes" ] ;
2514+ function telemetry_typeof ( o ) { "@babel/helpers - typeof" ; return telemetry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol . iterator ? function ( o ) { return typeof o ; } : function ( o ) { return o && "function" == typeof Symbol && o . constructor === Symbol && o !== Symbol . prototype ? "symbol" : typeof o ; } , telemetry_typeof ( o ) ; }
25152515function telemetry_ownKeys ( e , r ) { var t = Object . keys ( e ) ; if ( Object . getOwnPropertySymbols ) { var o = Object . getOwnPropertySymbols ( e ) ; r && ( o = o . filter ( function ( r ) { return Object . getOwnPropertyDescriptor ( e , r ) . enumerable ; } ) ) , t . push . apply ( t , o ) ; } return t ; }
25162516function telemetry_objectSpread ( e ) { for ( var r = 1 ; r < arguments . length ; r ++ ) { var t = null != arguments [ r ] ? arguments [ r ] : { } ; r % 2 ? telemetry_ownKeys ( Object ( t ) , ! 0 ) . forEach ( function ( r ) { telemetry_defineProperty ( e , r , t [ r ] ) ; } ) : Object . getOwnPropertyDescriptors ? Object . defineProperties ( e , Object . getOwnPropertyDescriptors ( t ) ) : telemetry_ownKeys ( Object ( t ) ) . forEach ( function ( r ) { Object . defineProperty ( e , r , Object . getOwnPropertyDescriptor ( t , r ) ) ; } ) ; } return e ; }
25172517function telemetry_defineProperty ( e , r , t ) { return ( r = telemetry_toPropertyKey ( r ) ) in e ? Object . defineProperty ( e , r , { value : t , enumerable : ! 0 , configurable : ! 0 , writable : ! 0 } ) : e [ r ] = t , e ; }
@@ -2522,22 +2522,17 @@ function telemetry_defineProperties(e, r) { for (var t = 0; t < r.length; t++) {
25222522function telemetry_createClass ( e , r , t ) { return r && telemetry_defineProperties ( e . prototype , r ) , t && telemetry_defineProperties ( e , t ) , Object . defineProperty ( e , "prototype" , { writable : ! 1 } ) , e ; }
25232523function telemetry_toPropertyKey ( t ) { var i = telemetry_toPrimitive ( t , "string" ) ; return "symbol" == telemetry_typeof ( i ) ? i : i + "" ; }
25242524function telemetry_toPrimitive ( t , r ) { if ( "object" != telemetry_typeof ( t ) || ! t ) return t ; var e = t [ Symbol . toPrimitive ] ; if ( void 0 !== e ) { var i = e . call ( t , r || "default" ) ; if ( "object" != telemetry_typeof ( i ) ) return i ; throw new TypeError ( "@@toPrimitive must return a primitive value." ) ; } return ( "string" === r ? String : Number ) ( t ) ; }
2525- function _classPrivateMethodInitSpec ( e , a ) { _checkPrivateRedeclaration ( e , a ) , a . add ( e ) ; }
2526- function _checkPrivateRedeclaration ( e , t ) { if ( t . has ( e ) ) throw new TypeError ( "Cannot initialize the same private elements twice on an object" ) ; }
2527- function _assertClassBrand ( e , t , n ) { if ( "function" == typeof e ? e === t : e . has ( t ) ) return arguments . length < 3 ? t : n ; throw new TypeError ( "Private element is not present on this object" ) ; }
25282525
25292526var MAX_EVENTS = 100 ;
25302527
25312528// Temporary workaround while solving commonjs -> esm issues in Node 18 - 20.
25322529function fromMillis ( millis ) {
25332530 return [ Math . trunc ( millis / 1000 ) , Math . round ( millis % 1000 * 1e6 ) ] ;
25342531}
2535- var _Telemeter_brand = /*#__PURE__*/ new WeakSet ( ) ;
25362532var Telemeter = /*#__PURE__*/ function ( ) {
25372533 function Telemeter ( options , tracing ) {
25382534 var _this$tracing ;
25392535 telemetry_classCallCheck ( this , Telemeter ) ;
2540- _classPrivateMethodInitSpec ( this , _Telemeter_brand ) ;
25412536 this . queue = [ ] ;
25422537 this . options = src_merge ( options ) ;
25432538 var maxTelemetryEvents = this . options . maxTelemetryEvents || MAX_EVENTS ;
@@ -2749,9 +2744,9 @@ var Telemeter = /*#__PURE__*/function () {
27492744 value : value ,
27502745 endTimeUnixNano : fromMillis ( timestamp )
27512746 } ;
2752- var event = _assertClassBrand ( _Telemeter_brand , this , _getRepeatedEvent ) . call ( this , name , otelAttributes ) ;
2747+ var event = this . _getRepeatedEvent ( name , otelAttributes ) ;
27532748 if ( event ) {
2754- return _assertClassBrand ( _Telemeter_brand , this , _updateRepeatedEvent ) . call ( this , event , otelAttributes , timestamp ) ;
2749+ return this . _updateRepeatedEvent ( event , otelAttributes , timestamp ) ;
27552750 }
27562751 ( _this$telemetrySpan5 = this . telemetrySpan ) === null || _this$telemetrySpan5 === void 0 || _this$telemetrySpan5 . addEvent ( name , otelAttributes , fromMillis ( timestamp ) ) ;
27572752 return this . capture ( 'dom' , metadata , 'info' , null , timestamp , otelAttributes ) ;
@@ -2776,13 +2771,40 @@ var Telemeter = /*#__PURE__*/function () {
27762771 element : element ,
27772772 endTimeUnixNano : fromMillis ( timestamp )
27782773 } ;
2779- var event = _assertClassBrand ( _Telemeter_brand , this , _getRepeatedEvent ) . call ( this , name , otelAttributes ) ;
2774+ var event = this . _getRepeatedEvent ( name , otelAttributes ) ;
27802775 if ( event ) {
2781- return _assertClassBrand ( _Telemeter_brand , this , _updateRepeatedEvent ) . call ( this , event , otelAttributes , timestamp ) ;
2776+ return this . _updateRepeatedEvent ( event , otelAttributes , timestamp ) ;
27822777 }
27832778 ( _this$telemetrySpan6 = this . telemetrySpan ) === null || _this$telemetrySpan6 === void 0 || _this$telemetrySpan6 . addEvent ( name , otelAttributes , fromMillis ( timestamp ) ) ;
27842779 return this . capture ( 'dom' , metadata , 'info' , null , timestamp , otelAttributes ) ;
27852780 }
2781+ } , {
2782+ key : "_getRepeatedEvent" ,
2783+ value : function _getRepeatedEvent ( name , attributes ) {
2784+ var lastEvent = this . _lastEvent ( this . queue ) ;
2785+ if ( lastEvent && lastEvent . body . type === name && lastEvent . otelAttributes . target === attributes . target ) {
2786+ return lastEvent ;
2787+ }
2788+ }
2789+ } , {
2790+ key : "_updateRepeatedEvent" ,
2791+ value : function _updateRepeatedEvent ( event , attributes , timestamp ) {
2792+ var duration = Math . max ( timestamp - event . timestamp_ms , 1 ) ;
2793+ event . body . value = attributes . value ;
2794+ event . otelAttributes . value = attributes . value ;
2795+ event . otelAttributes . height = attributes . height ;
2796+ event . otelAttributes . width = attributes . width ;
2797+ event . otelAttributes . textZoomRatio = attributes . textZoomRatio ;
2798+ event . otelAttributes [ 'endTimeUnixNano' ] = fromMillis ( timestamp ) ;
2799+ event . otelAttributes [ 'durationUnixNano' ] = fromMillis ( duration ) ;
2800+ event . otelAttributes . count = ( event . otelAttributes . count || 1 ) + 1 ;
2801+ event . otelAttributes . ratio = event . otelAttributes . count / ( duration / 1000 ) ;
2802+ }
2803+ } , {
2804+ key : "_lastEvent" ,
2805+ value : function _lastEvent ( list ) {
2806+ return list . length > 0 ? list [ list . length - 1 ] : null ;
2807+ }
27862808 } , {
27872809 key : "captureFocus" ,
27882810 value : function captureFocus ( _ref4 ) {
@@ -2830,9 +2852,9 @@ var Telemeter = /*#__PURE__*/function () {
28302852 height : height ,
28312853 textZoomRatio : textZoomRatio
28322854 } ;
2833- var event = _assertClassBrand ( _Telemeter_brand , this , _getRepeatedEvent ) . call ( this , name , otelAttributes ) ;
2855+ var event = this . _getRepeatedEvent ( name , otelAttributes ) ;
28342856 if ( event ) {
2835- return _assertClassBrand ( _Telemeter_brand , this , _updateRepeatedEvent ) . call ( this , event , otelAttributes , timestamp ) ;
2857+ return this . _updateRepeatedEvent ( event , otelAttributes , timestamp ) ;
28362858 }
28372859 ( _this$telemetrySpan8 = this . telemetrySpan ) === null || _this$telemetrySpan8 === void 0 || _this$telemetrySpan8 . addEvent ( name , otelAttributes , fromMillis ( timestamp ) ) ;
28382860 return this . capture ( 'dom' , metadata , 'info' , null , timestamp , otelAttributes ) ;
@@ -2972,27 +2994,6 @@ var Telemeter = /*#__PURE__*/function () {
29722994 }
29732995 } ] ) ;
29742996} ( ) ;
2975- function _getRepeatedEvent ( name , attributes ) {
2976- var lastEvent = _assertClassBrand ( _Telemeter_brand , this , _lastEvent ) . call ( this , this . queue ) ;
2977- if ( lastEvent && lastEvent . body . type === name && lastEvent . otelAttributes . target === attributes . target ) {
2978- return lastEvent ;
2979- }
2980- }
2981- function _updateRepeatedEvent ( event , attributes , timestamp ) {
2982- var duration = Math . max ( timestamp - event . timestamp_ms , 1 ) ;
2983- event . body . value = attributes . value ;
2984- event . otelAttributes . value = attributes . value ;
2985- event . otelAttributes . height = attributes . height ;
2986- event . otelAttributes . width = attributes . width ;
2987- event . otelAttributes . textZoomRatio = attributes . textZoomRatio ;
2988- event . otelAttributes [ 'endTimeUnixNano' ] = fromMillis ( timestamp ) ;
2989- event . otelAttributes [ 'durationUnixNano' ] = fromMillis ( duration ) ;
2990- event . otelAttributes . count = ( event . otelAttributes . count || 1 ) + 1 ;
2991- event . otelAttributes . ratio = event . otelAttributes . count / ( duration / 1000 ) ;
2992- }
2993- function _lastEvent ( list ) {
2994- return list . length > 0 ? list [ list . length - 1 ] : null ;
2995- }
29962997function getLevel ( type , level ) {
29972998 if ( level ) {
29982999 return level ;
0 commit comments