2026-07-20 16:05:17 +00:00
// Module ID: 1138
2026-07-25 08:10:48 +00:00
// Function ID: 12958
2026-07-20 16:05:17 +00:00
// Name: fetchNativeFrames
2026-07-23 10:11:24 +00:00
// Dependencies: [977, 1139, 794, 1098]
2026-07-20 16:05:17 +00:00
// Module 1138 (fetchNativeFrames)
2026-07-23 10:11:24 +00:00
const require = arg1 ;
const dependencyMap = arg6 ;
2026-07-20 16:05:17 +00:00
function fetchNativeFrames ( ) {
return new Promise ( ( arg0 , arg1 ) => {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
let c2 = false ;
2026-07-20 16:05:17 +00:00
const timeout = setTimeout ( ( ) => {
2026-07-23 10:11:24 +00:00
if ( ! c2 ) {
c2 = true ;
callback2 ( "Fetching native frames took too long. Dropping frames." ) ;
2026-07-20 16:05:17 +00:00
}
} , 2000 ) ;
2026-07-23 10:11:24 +00:00
const NATIVE = outer1 _0 ( outer1 _1 [ 0 ] ) . NATIVE ;
2026-07-20 16:05:17 +00:00
const nativeFrames = NATIVE . fetchNativeFrames ( ) ;
nativeFrames . then ( ( arg0 ) => {
2026-07-23 10:11:24 +00:00
if ( ! c2 ) {
2026-07-20 16:05:17 +00:00
const _clearTimeout = clearTimeout ;
clearTimeout ( closure _3 ) ;
2026-07-23 10:11:24 +00:00
c2 = true ;
2026-07-20 16:05:17 +00:00
if ( arg0 ) {
2026-07-23 10:11:24 +00:00
callback ( arg0 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
callback2 ( "Native frames response is null." ) ;
2026-07-20 16:05:17 +00:00
}
}
} ) . then ( undefined , ( arg0 ) => {
2026-07-23 10:11:24 +00:00
if ( ! c2 ) {
2026-07-20 16:05:17 +00:00
const _clearTimeout = clearTimeout ;
clearTimeout ( closure _3 ) ;
2026-07-23 10:11:24 +00:00
c2 = true ;
callback2 ( arg0 ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
} ) ;
}
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 ;
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
2026-07-20 16:05:17 +00:00
let closure _3 = arg3 ;
if ( ! arg2 ) {
_Promise = Promise ;
}
_Promise = new _Promise ( ( arg0 , arg1 ) => {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
2026-07-20 16:05:17 +00:00
function fulfilled ( arg0 ) {
step ( iter . next ( arg0 ) ) ;
}
2026-07-23 10:11:24 +00:00
let iter = function rejected ( arg0 ) {
2026-07-20 16:05:17 +00:00
step ( iter . throw ( arg0 ) ) ;
} ;
function step ( iter ) {
if ( iter . done ) {
2026-07-23 10:11:24 +00:00
callback ( iter . value ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
( function adopt ( value ) {
2026-07-20 16:05:17 +00:00
let tmp = value ;
2026-07-23 10:11:24 +00:00
let closure _0 = value ;
if ( ! ( value instanceof fulfilled ) ) {
const prototype = fulfilled . prototype ;
tmp = new fulfilled ( ( arg0 ) => {
arg0 ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
return tmp ;
2026-07-23 10:11:24 +00:00
} ) ( iter . value ) . then ( fulfilled , iter ) ;
const promise = ( function adopt ( value ) {
2026-07-20 16:05:17 +00:00
let tmp = value ;
2026-07-23 10:11:24 +00:00
let closure _0 = value ;
if ( ! ( value instanceof fulfilled ) ) {
const prototype = fulfilled . prototype ;
tmp = new fulfilled ( ( arg0 ) => {
arg0 ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
return tmp ;
2026-07-23 10:11:24 +00:00
} ) ( iter . value ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let items = closure _1 ;
if ( ! closure _1 ) {
2026-07-20 16:05:17 +00:00
items = [ ] ;
}
2026-07-23 10:11:24 +00:00
iter = iter . apply ( closure _0 , items ) ;
2026-07-20 16:05:17 +00:00
step ( iter . next ( ) ) ;
} ) ;
return _Promise ;
} ;
}
2026-07-23 10:11:24 +00:00
const NativeFrames = "NativeFrames" ;
2026-07-20 16:05:17 +00:00
function nativeFramesIntegration ( ) {
2026-07-23 10:11:24 +00:00
const _require = null ;
2026-07-20 16:05:17 +00:00
let obj = { ttl : 60000 } ;
2026-07-23 10:11:24 +00:00
asyncExpiringMap = new _require ( asyncExpiringMap [ 1 ] ) . AsyncExpiringMap ( obj ) ;
2026-07-20 16:05:17 +00:00
obj = { ttl : 2000 } ;
2026-07-23 10:11:24 +00:00
const asyncExpiringMap1 = new _require ( asyncExpiringMap [ 1 ] ) . AsyncExpiringMap ( obj ) ;
2026-07-20 16:05:17 +00:00
function fetchStartFramesForSpan ( spanContext ) {
const spanId = spanContext . spanContext ( ) . spanId ;
let str = "child" ;
if ( obj . isRootSpan ( spanContext ) ) {
str = "root" ;
}
2026-07-23 10:11:24 +00:00
let debug = _null ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
debug . log ( "[" + fetchStartFramesForSpan + "] Fetching frames for " + str + " span start (" + spanId + ")." ) ;
2026-07-23 10:11:24 +00:00
obj = _null ( asyncExpiringMap [ 3 ] ) ;
2026-07-20 16:05:17 +00:00
const result = asyncExpiringMap . set ( spanId , new Promise ( ( arg0 ) => {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
const promise = outer2 _5 ( ) ;
outer2 _5 ( ) . then ( ( arg0 ) => callback ( arg0 ) ) . then ( undefined , ( arg0 ) => {
const debug = callback ( asyncExpiringMap [ 2 ] ) . debug ;
debug . log ( "[" + fetchStartFramesForSpan + "] Error while fetching native frames." , arg0 ) ;
callback ( null ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ) ;
}
function fetchEndFramesForSpan ( arg0 ) {
let closure _0 = arg0 ;
return asyncExpiringMap1 ( undefined , undefined , undefined , function * ( ) {
2026-07-23 10:11:24 +00:00
let callback ;
let obj = callback ( asyncExpiringMap [ 2 ] ) ;
2026-07-20 16:05:17 +00:00
const timestampInSecondsResult = obj . timestampInSeconds ( ) ;
2026-07-23 10:11:24 +00:00
callback = timestampInSecondsResult ;
const spanId = outer1 _0 . spanContext ( ) . spanId ;
if ( outer2 _1 . has ( spanId ) ) {
if ( obj2 . isRootSpan ( outer1 _0 ) ) {
let debug = callback ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug . log ( "[" + fetchStartFramesForSpan + "] Fetch frames for root span end (" + spanId + ")." ) ;
let promise = new Promise ( ( arg0 ) => {
let closure _0 = arg0 ;
const promise = outer4 _5 ( ) ;
outer4 _5 ( ) . then ( ( nativeFrames ) => {
callback ( { timestamp : callback , nativeFrames } ) ;
2026-07-20 16:05:17 +00:00
} ) . then ( undefined , ( arg0 ) => {
2026-07-23 10:11:24 +00:00
const debug = callback ( asyncExpiringMap [ 2 ] ) . debug ;
debug . log ( "[" + fetchStartFramesForSpan + "] Error while fetching native frames." , arg0 ) ;
callback ( null ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-07-23 10:11:24 +00:00
const result = outer2 _2 . set ( tmp2 , promise ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const tmp21 = yield outer2 _1 . get ( tmp2 ) ;
2026-07-20 16:05:17 +00:00
if ( tmp21 ) {
2026-07-23 10:11:24 +00:00
const tmp30 = yield outer3 _5 ( ) ;
2026-07-20 16:05:17 +00:00
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 ) {
2026-07-23 10:11:24 +00:00
const attr = outer1 _0 . setAttribute ( "frames.total" , tmp33 ) ;
const attr1 = outer1 _0 . setAttribute ( "frames.slow" , diff1 ) ;
const attr2 = outer1 _0 . setAttribute ( "frames.frozen" , diff2 ) ;
const debug3 = callback ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal3 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug3 . log ( "[" + fetchStartFramesForSpan + "] Attached frame data to span " + tmp2 + ": total=" + diff + ", slow=" + diff1 + ", frozen=" + diff2 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! obj3 . isRootSpan ( outer1 _0 ) ) {
2026-07-20 16:05:17 +00:00
obj = { timestamp : timestampInSecondsResult , nativeFrames : tmp30 } ;
2026-07-23 10:11:24 +00:00
let closure _0 = obj ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj3 = callback ( asyncExpiringMap [ 3 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const debug2 = callback ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug2 . log ( "[" + fetchStartFramesForSpan + "] No start frames found for span " + tmp2 + ", skipping frame data." ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj2 = callback ( asyncExpiringMap [ 3 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
}
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 * ( ) {
2026-07-23 10:11:24 +00:00
if ( "transaction" === outer1 _0 . type ) {
if ( outer1 _0 . transaction ) {
if ( outer1 _0 . contexts ) {
if ( outer1 _0 . contexts . trace ) {
if ( outer1 _0 . timestamp ) {
if ( outer1 _0 . contexts . trace . span _id ) {
const op = outer1 _0 . contexts . trace . op ;
const span _id = outer1 _0 . contexts . trace . span _id ;
const tmp8 = yield outer2 _1 . pop ( span _id ) ;
2026-07-20 16:05:17 +00:00
if ( tmp8 ) {
2026-07-23 10:11:24 +00:00
const tmp16 = yield outer2 _2 . pop ( span _id ) ;
2026-07-20 16:05:17 +00:00
if ( tmp16 ) {
2026-07-23 10:11:24 +00:00
if ( outer3 _6 ( tmp16 . timestamp , outer1 _0 . timestamp ) ) {
const debug4 = lib ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal4 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug4 . log ( "[" + fetchStartFramesForSpan + "] Using frames from root span end (spanId, " + span _id + ")." ) ;
2026-07-20 16:05:17 +00:00
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 ) {
2026-07-23 10:11:24 +00:00
const debug6 = lib ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal6 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug6 . warn ( "[" + fetchStartFramesForSpan + "] Detected zero slow or frozen frames. Not adding measurements to spanId (" + span _id + ")." ) ;
let tmp52 = outer1 _0 ;
2026-07-20 16:05:17 +00:00
}
return tmp52 ;
}
}
2026-07-23 10:11:24 +00:00
const debug5 = lib ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _JSON = JSON ;
const _HermesInternal5 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug5 . log ( "[" + fetchStartFramesForSpan + "] Adding measurements to " + op + " transaction " + outer1 _0 . transaction + ": " + JSON . stringify ( obj , undefined , 2 ) ) ;
let measurements = outer1 _0 . measurements ;
2026-07-20 16:05:17 +00:00
if ( null === measurements ) {
measurements = { } ;
}
2026-07-23 10:11:24 +00:00
outer1 _0 . measurements = Object . assign ( Object . assign ( { } , measurements ) , obj ) ;
tmp52 = outer1 _0 ;
const tmp46 = outer1 _0 ;
2026-07-20 16:05:17 +00:00
}
if ( lib ) {
2026-07-23 10:11:24 +00:00
if ( outer3 _6 ( lib . timestamp , outer1 _0 . timestamp ) ) {
const debug3 = lib ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal3 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug3 . log ( "[" + fetchStartFramesForSpan + "] Using native frames from last child span end (spanId, " + span _id + ")." ) ;
2026-07-20 16:05:17 +00:00
nativeFrames = lib . nativeFrames ;
}
}
2026-07-23 10:11:24 +00:00
const debug2 = lib ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug2 . warn ( "[" + fetchStartFramesForSpan + "] Frames were collected within larger than margin of error delay for spanId (" + span _id + "). Dropping the inaccurate values." ) ;
return outer1 _0 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const debug = lib ( asyncExpiringMap [ 2 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug . warn ( "[" + fetchStartFramesForSpan + "] Start frames of transaction " + outer1 _0 . transaction + " (eventId, " + outer1 _0 . event _id + ") are missing, but the transaction already ended." ) ;
return outer1 _0 ;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
}
2026-07-23 10:11:24 +00:00
return outer1 _0 ;
2026-07-20 16:05:17 +00:00
} ) ;
}
} ;
return obj ;
}
arg5 . createNativeFramesIntegrations = function createNativeFramesIntegrations ( enableNative2 ) {
if ( ! enableNative2 ) {
2026-07-23 10:11:24 +00:00
if ( require ( 977 ) /* getRNSentryModule */ . NATIVE . enableNative ) {
const NATIVE = require ( 977 ) /* getRNSentryModule */ . NATIVE ;
2026-07-20 16:05:17 +00:00
const result = NATIVE . disableNativeFramesTracking ( ) ;
}
}
return nativeFramesIntegration ( ) ;
} ;
arg5 . nativeFramesIntegration = nativeFramesIntegration ;