2026-07-20 16:05:17 +00:00
// Module ID: 1136
2026-07-24 07:16:23 +00:00
// Function ID: 12921
2026-07-20 16:05:17 +00:00
// Name: getDefaultIdleNavigationSpanOptions
2026-07-23 10:11:24 +00:00
// Dependencies: [27, 794, 1098, 1137, 1134]
2026-07-20 16:05:17 +00:00
// Exports: addDefaultOpForSpanFrom, addThreadInfoToSpan, setMainThreadInfo, startIdleNavigationSpan
// Module 1136 (getDefaultIdleNavigationSpanOptions)
2026-07-23 10:11:24 +00:00
import { AppState } from "get ActivityIndicator" ;
2026-07-20 16:05:17 +00:00
function getDefaultIdleNavigationSpanOptions ( ) {
2026-07-23 10:11:24 +00:00
const obj = { name : c3 , op : "navigation" , forceTransaction : true , scope : require ( 794 ) /* registerSpanErrorInstrumentation */ . getCurrentScope ( ) } ;
2026-07-20 16:05:17 +00:00
return obj ;
}
function isSentryInteractionSpan ( activeSpan ) {
2026-07-23 10:11:24 +00:00
const items = [ require ( 1134 ) . SPAN _ORIGIN _AUTO _INTERACTION , require ( 1134 ) . SPAN _ORIGIN _MANUAL _INTERACTION ] ;
const obj = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
return items . includes ( require ( 794 ) /* registerSpanErrorInstrumentation */ . spanToJSON ( activeSpan ) . origin || "" ) ;
2026-07-20 16:05:17 +00:00
}
function clearActiveSpanFromScope ( currentScope ) {
2026-07-23 10:11:24 +00:00
delete tmp [ tmp2 ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c3 = "Route Change" ;
let obj = { idleTimeout : 1000 , finalTimeout : 600000 } ;
2026-07-20 16:05:17 +00:00
function startIdleSpan ( name ) {
let finalTimeout ;
let idleTimeout ;
( { finalTimeout , idleTimeout } = arg1 ) ;
2026-07-23 10:11:24 +00:00
let obj = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
2026-07-20 16:05:17 +00:00
const client = obj . getClient ( ) ;
if ( client ) {
if ( "background" === AppState . currentState ) {
2026-07-23 10:11:24 +00:00
const debug2 = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
debug2 . log ( "[startIdleSpan] App is already in background, not starting span for " + name . name ) ;
2026-07-23 10:11:24 +00:00
const SentryNonRecordingSpan2 = require ( 794 ) /* registerSpanErrorInstrumentation */ . SentryNonRecordingSpan ;
2026-07-20 16:05:17 +00:00
const prototype2 = SentryNonRecordingSpan2 . prototype ;
const sentryNonRecordingSpan2 = new SentryNonRecordingSpan2 ( ) ;
return sentryNonRecordingSpan2 ;
} else {
2026-07-23 10:11:24 +00:00
const currentScope = require ( 794 ) /* registerSpanErrorInstrumentation */ . getCurrentScope ( ) ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-07-23 10:11:24 +00:00
const obj2 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
obj . traceId = require ( 794 ) /* registerSpanErrorInstrumentation */ . generateTraceId ( ) ;
2026-07-20 16:05:17 +00:00
const _Math = Math ;
obj . sampleRand = Math . random ( ) ;
const result = currentScope . setPropagationContext ( obj ) ;
2026-07-23 10:11:24 +00:00
const obj5 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
2026-07-20 16:05:17 +00:00
obj = { finalTimeout , idleTimeout } ;
2026-07-23 10:11:24 +00:00
const startIdleSpanResult = require ( 794 ) /* registerSpanErrorInstrumentation */ . startIdleSpan ( name , obj ) ;
const obj6 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
require ( 1137 ) /* discardEmptyNavigationSpan */ . cancelInBackground ( client , startIdleSpanResult ) ;
2026-07-20 16:05:17 +00:00
return startIdleSpanResult ;
}
} else {
2026-07-23 10:11:24 +00:00
const debug = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "[startIdleSpan] Can't create idle span, missing client." ) ;
2026-07-23 10:11:24 +00:00
const SentryNonRecordingSpan = require ( 794 ) /* registerSpanErrorInstrumentation */ . SentryNonRecordingSpan ;
2026-07-20 16:05:17 +00:00
const prototype = SentryNonRecordingSpan . prototype ;
const sentryNonRecordingSpan = new SentryNonRecordingSpan ( ) ;
return sentryNonRecordingSpan ;
}
}
2026-07-23 10:11:24 +00:00
const _sentrySpan = "_sentrySpan" ;
2026-07-20 16:05:17 +00:00
export const DEFAULT _NAVIGATION _SPAN _NAME = "Route Change" ;
export const defaultIdleOptions = obj ;
export const startIdleNavigationSpan = function startIdleNavigationSpan ( arg0 ) {
if ( arguments . length > 1 ) {
if ( undefined !== arguments [ 1 ] ) {
let obj = arguments [ 1 ] ;
}
let finalTimeout = obj . finalTimeout ;
if ( undefined === finalTimeout ) {
finalTimeout = obj . finalTimeout ;
}
let idleTimeout = obj . idleTimeout ;
if ( undefined === idleTimeout ) {
idleTimeout = obj . idleTimeout ;
}
const isAppRestart = obj . isAppRestart ;
2026-07-23 10:11:24 +00:00
const client = require ( 794 ) /* registerSpanErrorInstrumentation */ . getClient ( ) ;
const obj3 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
2026-07-20 16:05:17 +00:00
if ( client ) {
const activeSpan = obj3 . getActiveSpan ( ) ;
let isRootSpanResult = activeSpan ;
if ( activeSpan ) {
2026-07-23 10:11:24 +00:00
isRootSpanResult = require ( 1098 ) /* isSentrySpan */ . isRootSpan ( activeSpan ) ;
const obj5 = require ( 1098 ) /* isSentrySpan */ ;
2026-07-20 16:05:17 +00:00
}
if ( isRootSpanResult ) {
isRootSpanResult = isSentryInteractionSpan ( activeSpan ) ;
}
2026-07-23 10:11:24 +00:00
clearActiveSpanFromScope ( require ( 794 ) /* registerSpanErrorInstrumentation */ . getCurrentScope ( ) ) ;
2026-07-20 16:05:17 +00:00
if ( isRootSpanResult ) {
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
const debug3 = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug3 . log ( "[startIdleNavigationSpan] Not canceling " + require ( 794 ) /* registerSpanErrorInstrumentation */ . spanToJSON ( activeSpan ) . op + " transaction because navigation is from app restart - preserving error context." ) ;
const obj9 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
2026-07-20 16:05:17 +00:00
}
const _Object = Object ;
const _Object2 = Object ;
const merged = Object . assign ( Object . assign ( { } , getDefaultIdleNavigationSpanOptions ( ) ) , arg0 ) ;
obj = { finalTimeout , idleTimeout } ;
const obj11 = startIdleSpan ( merged , obj ) ;
2026-07-23 10:11:24 +00:00
const debug4 = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
let str7 = merged . op ;
if ( ! str7 ) {
str7 = "unknown op" ;
}
const _HermesInternal3 = HermesInternal ;
debug4 . log ( "[startIdleNavigationSpan] Starting " + str7 + " transaction \"" + merged . name + "\" on scope" ) ;
2026-07-23 10:11:24 +00:00
const result = require ( 1137 ) /* discardEmptyNavigationSpan */ . adjustTransactionDuration ( client , obj11 , finalTimeout ) ;
const attr = obj11 . setAttribute ( require ( 794 ) /* registerSpanErrorInstrumentation */ . SEMANTIC _ATTRIBUTE _SENTRY _ORIGIN , require ( 1134 ) . SPAN _ORIGIN _AUTO _NAVIGATION _CUSTOM ) ;
2026-07-20 16:05:17 +00:00
return obj11 ;
}
if ( isRootSpanResult ) {
2026-07-23 10:11:24 +00:00
const debug2 = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug2 . log ( "[startIdleNavigationSpan] Canceling " + require ( 794 ) /* registerSpanErrorInstrumentation */ . spanToJSON ( activeSpan ) . op + " transaction because of a new navigation root span." ) ;
obj = { code : require ( 794 ) /* registerSpanErrorInstrumentation */ . SPAN _STATUS _ERROR , message : "cancelled" } ;
2026-07-20 16:05:17 +00:00
activeSpan . setStatus ( obj ) ;
activeSpan . end ( ) ;
2026-07-23 10:11:24 +00:00
const obj7 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj6 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
2026-07-20 16:05:17 +00:00
} else {
const debug = obj3 . debug ;
debug . warn ( "[startIdleNavigationSpan] Can't create route change span, missing client." ) ;
}
2026-07-23 10:11:24 +00:00
const obj2 = require ( 794 ) /* registerSpanErrorInstrumentation */ ;
tmp3 = undefined !== isAppRestart && isAppRestart ;
2026-07-20 16:05:17 +00:00
}
obj = { } ;
} ;
export { startIdleSpan } ;
export { getDefaultIdleNavigationSpanOptions } ;
export { isSentryInteractionSpan } ;
export const SCOPE _SPAN _FIELD = "_sentrySpan" ;
export { clearActiveSpanFromScope } ;
export const addDefaultOpForSpanFrom = function addDefaultOpForSpanFrom ( on ) {
on . on ( "spanStart" , ( setAttribute ) => {
if ( ! obj . spanToJSON ( setAttribute ) . op ) {
2026-07-23 10:11:24 +00:00
const attr = setAttribute . setAttribute ( outer1 _0 ( outer1 _1 [ 1 ] ) . SEMANTIC _ATTRIBUTE _SENTRY _OP , "default" ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
} ;
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 ) => {
2026-07-23 10:11:24 +00:00
const data = outer1 _0 ( outer1 _1 [ 1 ] ) . spanToJSON ( setAttribute ) . data ;
2026-07-20 16:05:17 +00:00
let prop ;
if ( null !== data ) {
if ( undefined !== data ) {
2026-07-23 10:11:24 +00:00
prop = data [ "thread.name" ] ;
2026-07-20 16:05:17 +00:00
}
}
if ( ! prop ) {
const attr = setAttribute . setAttribute ( "thread.name" , "javascript" ) ;
}
} ) ;
} ;
export const setMainThreadInfo = function setMainThreadInfo ( childSpanJSON ) {
childSpanJSON . data = childSpanJSON . data || { } ;
2026-07-23 10:11:24 +00:00
childSpanJSON . data [ "thread.name" ] = "main" ;
2026-07-20 16:05:17 +00:00
return childSpanJSON ;
} ;