2026-07-20 16:05:17 +00:00
// Module ID: 1138
2026-07-21 22:01:30 +00:00
// Function ID: 12950
2026-07-20 16:05:17 +00:00
// Name: fetchNativeFrames
// Dependencies: []
// Module 1138 (fetchNativeFrames)
function fetchNativeFrames ( ) {
return new Promise ( ( arg0 , arg1 ) => {
let closure _2 = false ;
const timeout = setTimeout ( ( ) => {
if ( ! closure _2 ) {
closure _2 = true ;
arg1 ( "Fetching native frames took too long. Dropping frames." ) ;
}
} , 2000 ) ;
const NATIVE = arg0 ( arg1 [ 0 ] ) . NATIVE ;
const nativeFrames = NATIVE . fetchNativeFrames ( ) ;
nativeFrames . then ( ( arg0 ) => {
if ( ! closure _2 ) {
const _clearTimeout = clearTimeout ;
clearTimeout ( closure _3 ) ;
closure _2 = true ;
if ( arg0 ) {
arg0 ( arg0 ) ;
} else {
arg1 ( "Native frames response is null." ) ;
}
}
} ) . then ( undefined , ( arg0 ) => {
if ( ! closure _2 ) {
const _clearTimeout = clearTimeout ;
clearTimeout ( closure _3 ) ;
closure _2 = true ;
arg1 ( arg0 ) ;
}
} ) ;
} ) ;
}
function isClose ( arg0 , arg1 ) {
return Math . abs ( arg0 - arg1 ) < 0.05 ;
}
let fn = this ;
if ( this ) {
fn = this . _ _awaiter ;
}
if ( ! fn ) {
fn = ( arg0 , arg1 , arg2 , arg3 ) => {
let _Promise = arg2 ;
arg1 = arg0 ;
const arg6 = arg1 ;
let closure _3 = arg3 ;
if ( ! arg2 ) {
_Promise = Promise ;
}
_Promise = new _Promise ( ( arg0 , arg1 ) => {
function fulfilled ( arg0 ) {
step ( iter . next ( arg0 ) ) ;
}
let arg3 = function rejected ( arg0 ) {
step ( iter . throw ( arg0 ) ) ;
} ;
function step ( iter ) {
if ( iter . done ) {
iter ( iter . value ) ;
} else {
function adopt ( value ) {
let tmp = value ;
if ( ! ( value instanceof ctor ) ) {
const prototype = ctor . prototype ;
tmp = new ctor ( ( arg0 ) => {
arg0 ( arg0 ) ;
} ) ;
}
return tmp ;
} ( iter . value ) . then ( fulfilled , iter ) ;
const promise = function adopt ( value ) {
let tmp = value ;
if ( ! ( value instanceof ctor ) ) {
const prototype = ctor . prototype ;
tmp = new ctor ( ( arg0 ) => {
arg0 ( arg0 ) ;
} ) ;
}
return tmp ;
} ( iter . value ) ;
}
}
let items = arg1 ;
if ( ! arg1 ) {
items = [ ] ;
}
const iter = arg3 . apply ( arg0 , items ) ;
arg3 = iter ;
step ( iter . next ( ) ) ;
} ) ;
return _Promise ;
} ;
}
let closure _3 = "NativeFrames" ;
function nativeFramesIntegration ( ) {
const callback = null ;
let obj = { ttl : 60000 } ;
const asyncExpiringMap = new callback ( arg6 [ 1 ] ) . AsyncExpiringMap ( obj ) ;
const arg6 = asyncExpiringMap ;
obj = { ttl : 2000 } ;
const asyncExpiringMap1 = new callback ( arg6 [ 1 ] ) . AsyncExpiringMap ( obj ) ;
function fetchStartFramesForSpan ( spanContext ) {
const spanId = spanContext . spanContext ( ) . spanId ;
let str = "child" ;
if ( obj . isRootSpan ( spanContext ) ) {
str = "root" ;
}
const debug = _null ( asyncExpiringMap [ 2 ] ) . debug ;
debug . log ( "[" + fetchStartFramesForSpan + "] Fetching frames for " + str + " span start (" + spanId + ")." ) ;
const obj = _null ( asyncExpiringMap [ 3 ] ) ;
const result = asyncExpiringMap . set ( spanId , new Promise ( ( arg0 ) => {
const promise = callback ( ) ;
callback ( ) . then ( ( arg0 ) => arg0 ( arg0 ) ) . then ( undefined , ( arg0 ) => {
const debug = arg0 ( closure _1 [ 2 ] ) . debug ;
debug . log ( "[" + closure _3 + "] Error while fetching native frames." , arg0 ) ;
arg0 ( null ) ;
} ) ;
} ) ) ;
}
function fetchEndFramesForSpan ( arg0 ) {
let closure _0 = arg0 ;
return asyncExpiringMap1 ( undefined , undefined , undefined , function * ( ) {
let obj ;
obj = obj ( set [ 2 ] ) ;
const timestampInSecondsResult = obj . timestampInSeconds ( ) ;
obj = timestampInSecondsResult ;
const spanId = obj . spanContext ( ) . spanId ;
if ( set . has ( spanId ) ) {
if ( obj2 . isRootSpan ( obj ) ) {
const debug = obj ( set [ 2 ] ) . debug ;
const _HermesInternal = HermesInternal ;
debug . log ( "[" + closure _3 + "] Fetch frames for root span end (" + spanId + ")." ) ;
const promise = new Promise ( ( arg0 ) => {
const promise = callback ( ) ;
callback ( ) . then ( ( nativeFrames ) => {
nativeFrames ( { timestamp : nativeFrames , nativeFrames } ) ;
} ) . then ( undefined , ( arg0 ) => {
const debug = arg0 ( closure _1 [ 2 ] ) . debug ;
debug . log ( "[" + closure _3 + "] Error while fetching native frames." , arg0 ) ;
arg0 ( null ) ;
} ) ;
} ) ;
const result = closure _2 . set ( tmp2 , promise ) ;
}
const tmp21 = yield closure _1 . get ( tmp2 ) ;
if ( tmp21 ) {
const tmp30 = yield closure _5 ( ) ;
const diff = tmp30 . totalFrames - tmp21 . totalFrames ;
const diff1 = tmp30 . slowFrames - tmp21 . slowFrames ;
const diff2 = tmp30 . frozenFrames - tmp21 . frozenFrames ;
let tmp37 = tmp36 ;
if ( diff <= 0 ) {
tmp37 = diff1 > 0 ;
}
let tmp39 = tmp37 ;
if ( ! tmp37 ) {
tmp39 = diff2 > 0 ;
}
if ( tmp39 ) {
const attr = obj . setAttribute ( "frames.total" , tmp33 ) ;
const attr1 = obj . setAttribute ( "frames.slow" , diff1 ) ;
const attr2 = obj . setAttribute ( "frames.frozen" , diff2 ) ;
const debug3 = obj ( set [ 2 ] ) . debug ;
const _HermesInternal3 = HermesInternal ;
debug3 . log ( "[" + closure _3 + "] Attached frame data to span " + tmp2 + ": total=" + diff + ", slow=" + diff1 + ", frozen=" + diff2 ) ;
}
if ( ! obj3 . isRootSpan ( obj ) ) {
obj = { timestamp : timestampInSecondsResult , nativeFrames : tmp30 } ;
}
const obj3 = obj ( set [ 3 ] ) ;
} else {
const debug2 = obj ( set [ 2 ] ) . debug ;
const _HermesInternal2 = HermesInternal ;
debug2 . log ( "[" + closure _3 + "] No start frames found for span " + tmp2 + ", skipping frame data." ) ;
}
const obj2 = obj ( set [ 3 ] ) ;
}
} ) ;
}
obj = {
name : fetchStartFramesForSpan ,
setup ( on ) {
if ( _null ( asyncExpiringMap [ 0 ] ) . NATIVE . enableNative ) {
const NATIVE = tmp ( tmp2 [ 0 ] ) . NATIVE ;
const result = NATIVE . enableNativeFramesTracking ( ) ;
on . on ( "spanStart" , fetchStartFramesForSpan ) ;
on . on ( "spanEnd" , fetchEndFramesForSpan ) ;
} else {
const debug = tmp ( tmp2 [ 2 ] ) . debug ;
const _HermesInternal = HermesInternal ;
debug . warn ( "[" + fetchStartFramesForSpan + "] This is not available on the Web, Expo Go and other platforms without native modules." ) ;
}
} ,
processEvent ( arg0 ) {
let closure _0 = arg0 ;
return asyncExpiringMap1 ( undefined , undefined , undefined , function * ( ) {
if ( "transaction" === lib . type ) {
if ( lib . transaction ) {
if ( lib . contexts ) {
if ( lib . contexts . trace ) {
if ( lib . timestamp ) {
if ( lib . contexts . trace . span _id ) {
const op = lib . contexts . trace . op ;
const span _id = lib . contexts . trace . span _id ;
const tmp8 = yield closure _1 . pop ( span _id ) ;
if ( tmp8 ) {
const tmp16 = yield closure _2 . pop ( span _id ) ;
if ( tmp16 ) {
if ( callback ( tmp16 . timestamp , lib . timestamp ) ) {
const debug4 = lib ( closure _1 [ 2 ] ) . debug ;
const _HermesInternal4 = HermesInternal ;
debug4 . log ( "[" + closure _3 + "] Using frames from root span end (spanId, " + span _id + ")." ) ;
let nativeFrames = tmp16 . nativeFrames ;
}
let obj = { } ;
obj = { value : nativeFrames . totalFrames - tmp8 . totalFrames , unit : "none" } ;
obj . frames _total = obj ;
obj = { value : nativeFrames . frozenFrames - tmp8 . frozenFrames , unit : "none" } ;
obj . frames _frozen = obj ;
const obj1 = { value : nativeFrames . slowFrames - tmp8 . slowFrames , unit : "none" } ;
obj . frames _slow = obj1 ;
if ( obj . frames _frozen . value <= 0 ) {
if ( obj . frames _slow . value <= 0 ) {
if ( obj . frames _total . value <= 0 ) {
const debug6 = lib ( closure _1 [ 2 ] ) . debug ;
const _HermesInternal6 = HermesInternal ;
debug6 . warn ( "[" + closure _3 + "] Detected zero slow or frozen frames. Not adding measurements to spanId (" + span _id + ")." ) ;
let tmp52 = lib ;
}
return tmp52 ;
}
}
const debug5 = lib ( closure _1 [ 2 ] ) . debug ;
const _JSON = JSON ;
const _HermesInternal5 = HermesInternal ;
debug5 . log ( "[" + closure _3 + "] Adding measurements to " + op + " transaction " + lib . transaction + ": " + JSON . stringify ( obj , undefined , 2 ) ) ;
let measurements = lib . measurements ;
if ( null === measurements ) {
measurements = { } ;
}
lib . measurements = Object . assign ( Object . assign ( { } , measurements ) , obj ) ;
tmp52 = lib ;
const tmp46 = lib ;
}
if ( lib ) {
if ( callback ( lib . timestamp , lib . timestamp ) ) {
const debug3 = lib ( closure _1 [ 2 ] ) . debug ;
const _HermesInternal3 = HermesInternal ;
debug3 . log ( "[" + closure _3 + "] Using native frames from last child span end (spanId, " + span _id + ")." ) ;
nativeFrames = lib . nativeFrames ;
}
}
const debug2 = lib ( closure _1 [ 2 ] ) . debug ;
const _HermesInternal2 = HermesInternal ;
debug2 . warn ( "[" + closure _3 + "] Frames were collected within larger than margin of error delay for spanId (" + span _id + "). Dropping the inaccurate values." ) ;
return lib ;
} else {
const debug = lib ( closure _1 [ 2 ] ) . debug ;
const _HermesInternal = HermesInternal ;
debug . warn ( "[" + closure _3 + "] Start frames of transaction " + lib . transaction + " (eventId, " + lib . event _id + ") are missing, but the transaction already ended." ) ;
return lib ;
}
}
}
}
}
}
}
return lib ;
} ) ;
}
} ;
return obj ;
}
arg5 . createNativeFramesIntegrations = function createNativeFramesIntegrations ( enableNative2 ) {
if ( ! enableNative2 ) {
if ( arg1 ( arg6 [ 0 ] ) . NATIVE . enableNative ) {
const NATIVE = arg1 ( arg6 [ 0 ] ) . NATIVE ;
const result = NATIVE . disableNativeFramesTracking ( ) ;
}
}
return nativeFramesIntegration ( ) ;
} ;
arg5 . nativeFramesIntegration = nativeFramesIntegration ;