{"version":3,"file":"double-wrap-warning.js","sources":["../../../../src/integrations/http/double-wrap-warning.ts"],"sourcesContent":["import { DEBUG_BUILD } from '../../debug-build';\nimport { debug } from '../../utils/debug-logger';\nimport type { HttpModuleExport } from './types';\n\nconst isOtelWrapped = (fn: Function & { __unwrap?: Function }): fn is Function & { __unwrap: Function } =>\n  typeof fn.__unwrap === 'function';\n\n// exported for tess\nexport const warning =\n  'Double-wrapped http.client detected. Either disable spans in Sentry.httpIntegration, or disable the OpenTelemetry HTTP instrumentation.';\n\nlet didDoubleWrapWarning = false;\n// no-op in non-debug builds\nexport const doubleWrapWarning = DEBUG_BUILD\n  ? (http: HttpModuleExport) => {\n      if (!didDoubleWrapWarning) {\n        if (isOtelWrapped(http.request) || isOtelWrapped(http.get)) {\n          // TODO: add link to documentation\n          didDoubleWrapWarning = true;\n          debug.warn(warning);\n        }\n      }\n    }\n  : () => {};\n"],"names":["DEBUG_BUILD","debug"],"mappings":";;;;;AAIA,MAAM,aAAA,GAAgB,CAAC,EAAE;AACzB,EAAE,OAAO,EAAE,CAAC,QAAA,KAAa,UAAU;;AAEnC;MACa,OAAA;AACb,EAAE;;AAEF,IAAI,oBAAA,GAAuB,KAAK;AAChC;AACO,MAAM,oBAAoBA;AACjC,IAAI,CAAC,IAAI,KAAuB;AAChC,MAAM,IAAI,CAAC,oBAAoB,EAAE;AACjC,QAAQ,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAA,IAAK,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AACpE;AACA,UAAU,oBAAA,GAAuB,IAAI;AACrC,UAAUC,iBAAK,CAAC,IAAI,CAAC,OAAO,CAAC;AAC7B,QAAQ;AACR,MAAM;AACN,IAAI;AACJ,IAAI,MAAM,CAAC;;;;;"}