2026-07-20 16:05:17 +00:00
// Module ID: 811
2026-07-21 22:01:30 +00:00
// Function ID: 9092
2026-07-20 16:05:17 +00:00
// Name: extractTraceparentData
// Dependencies: []
// Module 811 (extractTraceparentData)
function extractTraceparentData ( str ) {
if ( str ) {
const match = str . match ( regExp ) ;
if ( match ) {
let flag = true ;
if ( "1" !== match [ 3 ] ) {
if ( "0" === match [ 3 ] ) {
flag = false ;
}
}
const obj = { traceId : match [ 1 ] , parentSampled : flag , parentSpanId : match [ 2 ] } ;
return obj ;
}
}
}
Object . defineProperty ( arg5 , Symbol . toStringTag , { value : "Module" } ) ;
const regExp = new RegExp ( "^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$" ) ;
arg5 . TRACEPARENT _REGEXP = regExp ;
arg5 . extractTraceparentData = extractTraceparentData ;
arg5 . generateSentryTraceHeader = function generateSentryTraceHeader ( ) {
if ( arguments . length > 0 ) {
if ( undefined !== arguments [ 0 ] ) {
let first = arguments [ 0 ] ;
}
if ( arguments . length > 1 ) {
if ( undefined !== arguments [ 1 ] ) {
let spanId = arguments [ 1 ] ;
}
let tmp5 ;
if ( arguments . length > 2 ) {
tmp5 = arguments [ 2 ] ;
}
let str2 = "" ;
if ( undefined !== tmp5 ) {
let str3 = "-0" ;
if ( tmp5 ) {
str3 = "-1" ;
}
str2 = str3 ;
}
const _HermesInternal = HermesInternal ;
return "" + first + "-" + spanId + str2 ;
}
spanId = arg1 ( arg6 [ 1 ] ) . generateSpanId ( ) ;
const obj2 = arg1 ( arg6 [ 1 ] ) ;
}
first = arg1 ( arg6 [ 1 ] ) . generateTraceId ( ) ;
} ;
arg5 . generateTraceparentHeader = function generateTraceparentHeader ( traceId , propagationSpanId2 , sampled2 ) {
if ( arguments . length > 0 ) {
if ( undefined !== arguments [ 0 ] ) {
let first = arguments [ 0 ] ;
}
if ( arguments . length > 1 ) {
if ( undefined !== arguments [ 1 ] ) {
let spanId = arguments [ 1 ] ;
}
let tmp5 ;
if ( arguments . length > 2 ) {
tmp5 = arguments [ 2 ] ;
}
let str = "00" ;
if ( tmp5 ) {
str = "01" ;
}
const _HermesInternal = HermesInternal ;
return "00-" + first + "-" + spanId + "-" + str ;
}
spanId = propagationSpanId2 ( arg6 [ 1 ] ) . generateSpanId ( ) ;
const obj2 = propagationSpanId2 ( arg6 [ 1 ] ) ;
}
first = propagationSpanId2 ( arg6 [ 1 ] ) . generateTraceId ( ) ;
} ;
arg5 . propagationContextFromHeaders = function propagationContextFromHeaders ( arg0 , arg1 ) {
const tmp = extractTraceparentData ( arg0 ) ;
let obj = arg1 ( arg6 [ 0 ] ) ;
let result = obj . baggageHeaderToDynamicSamplingContext ( arg1 ) ;
if ( null != tmp ) {
if ( tmp . traceId ) {
let sample _rand ;
if ( null != result ) {
sample _rand = result . sample _rand ;
}
const str = arg1 ( arg6 [ 3 ] ) . parseSampleRate ( sample _rand ) ;
if ( undefined !== str ) {
if ( result ) {
result . sample _rand = str . toString ( ) ;
}
obj = { } ;
( { traceId : obj6 . traceId , parentSpanId : obj6 . parentSpanId , parentSampled : obj6 . sampled } = tmp ) ;
if ( ! result ) {
result = { } ;
}
obj . dsc = result ;
obj . sampleRand = str ;
return obj ;
} else {
let sample _rate ;
if ( null != result ) {
sample _rate = result . sample _rate ;
}
const parseSampleRateResult = arg1 ( arg6 [ 3 ] ) . parseSampleRate ( sample _rate ) ;
if ( ! parseSampleRateResult ) {
arg1 ( arg6 [ 2 ] ) . safeMathRandom ( ) ;
const obj4 = arg1 ( arg6 [ 2 ] ) ;
} else {
let parentSampled ;
if ( null != tmp ) {
parentSampled = tmp . parentSampled ;
}
}
const obj10 = arg1 ( arg6 [ 3 ] ) ;
const safeMathRandomResult1 = arg1 ( arg6 [ 2 ] ) . safeMathRandom ( ) ;
if ( tmp . parentSampled ) {
let result1 = safeMathRandomResult1 * parseSampleRateResult ;
} else {
result1 = parseSampleRateResult + safeMathRandomResult1 * ( 1 - parseSampleRateResult ) ;
}
const obj5 = arg1 ( arg6 [ 2 ] ) ;
}
const obj3 = arg1 ( arg6 [ 3 ] ) ;
}
}
obj = { traceId : arg1 ( arg6 [ 1 ] ) . generateTraceId ( ) } ;
const obj8 = arg1 ( arg6 [ 1 ] ) ;
obj . sampleRand = arg1 ( arg6 [ 2 ] ) . safeMathRandom ( ) ;
return obj ;
} ;
arg5 . shouldContinueTrace = function shouldContinueTrace ( client , org _id ) {
const result = org _id ( arg6 [ 4 ] ) . extractOrgIdFromClient ( client ) ;
if ( org _id ) {
if ( result ) {
if ( org _id !== result ) {
const debug2 = org _id ( arg6 [ 5 ] ) . debug ;
const _HermesInternal2 = HermesInternal ;
debug2 . log ( "Won't continue trace because org IDs don't match (incoming baggage: " + org _id + ", SDK options: " + result + ")" ) ;
let flag = false ;
}
return flag ;
}
}
const obj = org _id ( arg6 [ 4 ] ) ;
flag = ! ( client . getOptions ( ) . strictTraceContinuation || false ) ;
if ( ! flag ) {
let tmp3 = org _id ;
if ( org _id ) {
tmp3 = ! result ;
}
if ( ! tmp3 ) {
tmp3 = ! org _id && result ;
const tmp4 = ! org _id && result ;
}
flag = ! tmp3 ;
}
if ( ! flag ) {
const debug = org _id ( arg6 [ 5 ] ) . debug ;
const _HermesInternal = HermesInternal ;
debug . log ( "Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: " + org _id + ", Sentry client: " + result + ")" ) ;
flag = false ;
}
} ;