{"mappings":";AAcA,IAAMA,EAAgB,OAAO,IAAI,6CAAA,EASjC,SAAgBC,EAA8BC,EAAwC,CAClF,WAA6BF,CAAA,EAAiBE,EAMlD,SAAgBC,GAA8D,CAC5E,OAAQ,WAA6BH,CAAA","names":["EXTRACTOR_KEY","registerTraceContextExtractor","extractor","getTraceContextExtractor"],"sources":["../esm/npm/@supabase/supabase-js@2.117.3/node_modules/@supabase/supabase-js/src/lib/tracingRegistry.ts"],"sourcesContent":["import type { TraceContextExtractor } from '@supabase/tracing'\n\nexport type { TraceContextExtractor }\n\n// The extractor lives in a `Symbol.for()`-keyed slot on `globalThis` rather\n// than a module-level variable. Bundlers and the ESM/CJS dual build can load\n// this module more than once in a single application (e.g. the tracing\n// subpath resolved to `dist/tracing.mjs` while the main entry resolves to\n// `dist/index.cjs`) — separate module instances would each get their own\n// variable, but they all share the global symbol registry.\n//\n// The symbol string is a de-facto stable contract: module-resolution tests\n// read the slot directly, and changing it orphans registrations from other\n// copies of this package in the same process.\nconst EXTRACTOR_KEY = Symbol.for('@supabase/supabase-js.traceContextExtractor')\n\ntype ExtractorSlot = { [EXTRACTOR_KEY]?: TraceContextExtractor }\n\n/**\n * Register the trace context extractor used by all Supabase clients in this\n * process. Called by the `@supabase/supabase-js/tracing` subpath as an import\n * side effect; the last registration wins.\n */\nexport function registerTraceContextExtractor(extractor: TraceContextExtractor): void {\n  ;(globalThis as ExtractorSlot)[EXTRACTOR_KEY] = extractor\n}\n\n/**\n * The currently registered trace context extractor, if any.\n */\nexport function getTraceContextExtractor(): TraceContextExtractor | undefined {\n  return (globalThis as ExtractorSlot)[EXTRACTOR_KEY]\n}\n\n/**\n * For tests only. Removes the registered extractor.\n *\n * @internal\n */\nexport function _unregisterTraceContextExtractor(): void {\n  delete (globalThis as ExtractorSlot)[EXTRACTOR_KEY]\n}\n"],"version":3}
