2026-07-29 08:29:29 +00:00
// Module ID: 1160
// Function ID: 1161
// Name: startIdleSpan
// Dependencies: [17, 817, 1122, 1161, 1158]
// Exports: addDefaultOpForSpanFrom, addThreadInfoToSpan, clearActiveSpanFromScope, getDefaultIdleNavigationSpanOptions, isSentryInteractionSpan, setMainThreadInfo, startIdleNavigationSpan
// Module 1160 (startIdleSpan)
2026-08-24 06:08:38 +00:00
import get _ActivityIndicator from "get ActivityIndicator" /* 17 */ ;
import registerSpanErrorInstrumentation from "registerSpanErrorInstrumentation" /* 817 */ ;
import _mod1158 from "module_1158" /* 1158 */ ;
2026-07-29 08:29:29 +00:00
2026-08-24 06:08:38 +00:00
const AppState = get _ActivityIndicator . AppState ;
2026-07-29 08:29:29 +00:00
let c3 = "Route Change" ;
let obj = { idleTimeout : 1000 , finalTimeout : 600000 } ;
function startIdleSpan ( name ) {
( { finalTimeout , idleTimeout } = arg1 ) ;
2026-08-24 06:08:38 +00:00
obj = registerSpanErrorInstrumentation ;
2026-07-29 08:29:29 +00:00
const client = obj . getClient ( ) ;
if ( client ) {
if ( "background" === AppState . currentState ) {
const debug2 = tmp ( 817 ) . debug ;
const _HermesInternal = HermesInternal ;
debug2 . log ( "[startIdleSpan] App is already in background, not starting span for " + name . name ) ;
const sentryNonRecordingSpan = new tmp ( 817 ) . SentryNonRecordingSpan ( ) ;
return sentryNonRecordingSpan ;
} else {
let tmpResult = tmp ( 817 ) ;
const currentScope = tmpResult . getCurrentScope ( ) ;
obj = { traceId : null , sampleRand : null } ;
tmpResult = tmp ( 817 ) ;
obj [ 0 ] = tmpResult . generateTraceId ( ) ;
const _Math = Math ;
obj [ 1 ] = Math . random ( ) ;
const result = currentScope . setPropagationContext ( obj ) ;
obj = { finalTimeout : null , idleTimeout : null } ;
obj [ 0 ] = finalTimeout ;
obj [ 1 ] = idleTimeout ;
const startIdleSpanResult = tmp ( 817 ) . startIdleSpan ( name , obj ) ;
const tmpResult1 = tmp ( 817 ) ;
tmp ( 1161 ) . cancelInBackground ( client , startIdleSpanResult ) ;
return startIdleSpanResult ;
}
} else {
const debug = tmp ( 817 ) . debug ;
debug . warn ( "[startIdleSpan] Can't create idle span, missing client." ) ;
const sentryNonRecordingSpan1 = new tmp ( 817 ) . SentryNonRecordingSpan ( ) ;
return sentryNonRecordingSpan1 ;
}
}
const _sentrySpan = "_sentrySpan" ;
let c7 = "thread.name" ;
const main = "main" ;
const javascript = "javascript" ;
export const DEFAULT _NAVIGATION _SPAN _NAME = "Route Change" ;
export const defaultIdleOptions = obj ;
export const startIdleNavigationSpan = ( arg0 ) => {
2026-08-24 06:08:38 +00:00
obj = arg1 ;
2026-07-29 08:29:29 +00:00
if ( arg1 === undefined ) {
obj = { } ;
}
let finalTimeout = obj . finalTimeout ;
if ( finalTimeout === undefined ) {
finalTimeout = obj . finalTimeout ;
}
let idleTimeout = obj . idleTimeout ;
if ( idleTimeout === undefined ) {
idleTimeout = obj . idleTimeout ;
}
let flag = obj . isAppRestart ;
if ( flag === undefined ) {
flag = false ;
}
2026-08-24 06:08:38 +00:00
obj1 = registerSpanErrorInstrumentation ;
2026-07-29 08:29:29 +00:00
const client = obj1 . getClient ( ) ;
2026-08-24 06:08:38 +00:00
const obj3 = registerSpanErrorInstrumentation ;
2026-07-29 08:29:29 +00:00
if ( client ) {
const activeSpan = obj3 . getActiveSpan ( ) ;
let isRootSpanResult = activeSpan ;
if ( activeSpan ) {
let tmp5Result = tmp5 ( 1122 ) ;
isRootSpanResult = tmp5Result . isRootSpan ( activeSpan ) ;
}
if ( isRootSpanResult ) {
const items = [ tmp5 ( 1158 ) . SPAN _ORIGIN _AUTO _INTERACTION , tmp5 ( 1158 ) . SPAN _ORIGIN _MANUAL _INTERACTION ] ;
tmp5Result = tmp5 ( 817 ) ;
isRootSpanResult = items . includes ( tmp5Result . spanToJSON ( activeSpan ) . origin || "" ) ;
const tmp10 = tmp5Result . spanToJSON ( activeSpan ) . origin || "" ;
}
const currentScope = tmp5 ( 817 ) . getCurrentScope ( ) ;
delete tmp2 [ tmp ] ;
if ( isRootSpanResult ) {
if ( flag ) {
const debug3 = tmp5 ( 817 ) . debug ;
const _HermesInternal2 = HermesInternal ;
debug3 . log ( "[startIdleNavigationSpan] Not canceling " + tmp5 ( 817 ) . spanToJSON ( activeSpan ) . op + " transaction because navigation is from app restart - preserving error context." ) ;
const tmp5Result2 = tmp5 ( 817 ) ;
}
const _Object = Object ;
const _Object2 = Object ;
obj = { name : null , op : "navigation" , forceTransaction : true , scope : null } ;
obj [ 0 ] = c3 ;
obj [ 3 ] = tmp5 ( 817 ) . getCurrentScope ( ) ;
const merged = Object . assign ( Object . assign ( { } , obj ) , arg0 ) ;
obj = { finalTimeout : null , idleTimeout : null } ;
obj [ 0 ] = finalTimeout ;
obj [ 1 ] = idleTimeout ;
const obj14 = startIdleSpan ( merged , obj ) ;
const debug4 = tmp5 ( 817 ) . debug ;
let str6 = merged . op ;
if ( ! str6 ) {
str6 = "unknown op" ;
}
const _HermesInternal3 = HermesInternal ;
debug4 . log ( "[startIdleNavigationSpan] Starting " + str6 + " transaction \"" + merged . name + "\" on scope" ) ;
const tmp5Result3 = tmp5 ( 817 ) ;
const result = tmp5 ( 1161 ) . adjustTransactionDuration ( client , obj14 , finalTimeout ) ;
const attr = obj14 . setAttribute ( tmp5 ( 817 ) . SEMANTIC _ATTRIBUTE _SENTRY _ORIGIN , tmp5 ( 1158 ) . SPAN _ORIGIN _AUTO _NAVIGATION _CUSTOM ) ;
return obj14 ;
}
if ( isRootSpanResult ) {
const debug2 = tmp5 ( 817 ) . debug ;
const _HermesInternal = HermesInternal ;
debug2 . log ( "[startIdleNavigationSpan] Canceling " + tmp5 ( 817 ) . spanToJSON ( activeSpan ) . op + " transaction because of a new navigation root span." ) ;
obj1 = { code : null , message : "cancelled" } ;
obj1 [ 0 ] = tmp5 ( 817 ) . SPAN _STATUS _ERROR ;
activeSpan . setStatus ( obj1 ) ;
activeSpan . end ( ) ;
const tmp5Result5 = tmp5 ( 817 ) ;
}
const tmp5Result1 = tmp5 ( 817 ) ;
} else {
const debug = obj3 . debug ;
debug . warn ( "[startIdleNavigationSpan] Can't create route change span, missing client." ) ;
}
} ;
export { startIdleSpan } ;
export const getDefaultIdleNavigationSpanOptions = function getDefaultIdleNavigationSpanOptions ( ) {
2026-08-24 06:08:38 +00:00
obj = { name : c3 , op : "navigation" , forceTransaction : true , scope : registerSpanErrorInstrumentation . getCurrentScope ( ) } ;
2026-07-29 08:29:29 +00:00
return obj ;
} ;
export const isSentryInteractionSpan = function isSentryInteractionSpan ( activeSpan ) {
2026-08-24 06:08:38 +00:00
const items = [ _mod1158 . SPAN _ORIGIN _AUTO _INTERACTION , _mod1158 . SPAN _ORIGIN _MANUAL _INTERACTION ] ;
obj = registerSpanErrorInstrumentation ;
return items . includes ( registerSpanErrorInstrumentation . spanToJSON ( activeSpan ) . origin || "" ) ;
2026-07-29 08:29:29 +00:00
} ;
export const SCOPE _SPAN _FIELD = "_sentrySpan" ;
export const clearActiveSpanFromScope = function clearActiveSpanFromScope ( currentScope ) {
delete tmp [ tmp2 ] ;
} ;
export const addDefaultOpForSpanFrom = function addDefaultOpForSpanFrom ( on ) {
on . on ( "spanStart" , ( setAttribute ) => {
if ( ! obj . spanToJSON ( setAttribute ) . op ) {
const attr = setAttribute . setAttribute ( callback ( table [ 1 ] ) . SEMANTIC _ATTRIBUTE _SENTRY _OP , "default" ) ;
}
} ) ;
} ;
export const SPAN _THREAD _NAME = "thread.name" ;
export const SPAN _THREAD _NAME _MAIN = "main" ;
export const SPAN _THREAD _NAME _JAVASCRIPT = "javascript" ;
export const addThreadInfoToSpan = function addThreadInfoToSpan ( on ) {
on . on ( "spanStart" , ( setAttribute ) => {
const data = callback ( table [ 1 ] ) . spanToJSON ( setAttribute ) . data ;
let tmp ;
if ( null !== data ) {
if ( undefined !== data ) {
tmp = data [ closure _7 ] ;
}
}
if ( ! tmp ) {
const attr = setAttribute . setAttribute ( closure _7 , closure _9 ) ;
}
} ) ;
} ;
export const setMainThreadInfo = function setMainThreadInfo ( childSpanJSON ) {
childSpanJSON . data = childSpanJSON . data || { } ;
childSpanJSON . data [ c7 ] = main ;
return childSpanJSON ;
} ;