{"version":3,"file":"trace-info.js","sources":["../../../src/utils/trace-info.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { getTraceContextFromScope, withScope } from '../currentScopes';\nimport type { Scope } from '../scope';\nimport {\n getDynamicSamplingContextFromScope,\n getDynamicSamplingContextFromSpan,\n} from '../tracing/dynamicSamplingContext';\nimport type { TraceContext } from '../types-hoist/context';\nimport type { DynamicSamplingContext } from '../types-hoist/envelope';\nimport { getActiveSpan, spanToTraceContext } from './spanUtils';\n\n/** Extract trace information from scope */\nexport function _getTraceInfoFromScope(\n client: Client,\n scope: Scope | undefined,\n): [dynamicSamplingContext: Partial | undefined, traceContext: TraceContext | undefined] {\n if (!scope) {\n return [undefined, undefined];\n }\n\n return withScope(scope, () => {\n const span = getActiveSpan();\n const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope);\n const dynamicSamplingContext = span\n ? getDynamicSamplingContextFromSpan(span)\n : getDynamicSamplingContextFromScope(client, scope);\n return [dynamicSamplingContext, traceContext];\n });\n}\n"],"names":["withScope","getActiveSpan","spanToTraceContext","getTraceContextFromScope","dynamicSamplingContext","getDynamicSamplingContextFromSpan","getDynamicSamplingContextFromScope"],"mappings":";;;;;;AAWA;AACO,SAAS,sBAAsB;AACtC,EAAE,MAAM;AACR,EAAE,KAAK;AACP,EAAiH;AACjH,EAAE,IAAI,CAAC,KAAK,EAAE;AACd,IAAI,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;AACjC,EAAE;;AAEF,EAAE,OAAOA,uBAAS,CAAC,KAAK,EAAE,MAAM;AAChC,IAAI,MAAM,IAAA,GAAOC,uBAAa,EAAE;AAChC,IAAI,MAAM,YAAA,GAAe,IAAA,GAAOC,4BAAkB,CAAC,IAAI,CAAA,GAAIC,sCAAwB,CAAC,KAAK,CAAC;AAC1F,IAAI,MAAMC,2BAAyB;AACnC,QAAQC,wDAAiC,CAAC,IAAI;AAC9C,QAAQC,yDAAkC,CAAC,MAAM,EAAE,KAAK,CAAC;AACzD,IAAI,OAAO,CAACF,wBAAsB,EAAE,YAAY,CAAC;AACjD,EAAE,CAAC,CAAC;AACJ;;;;"}