{"version":3,"file":"global.mjs","sources":["../../lib/global.js"],"sourcesContent":["'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.2')\nconst legacyGlobalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\nconst Dispatcher1Wrapper = require('./dispatcher/dispatcher1-wrapper')\n\n// Fallback storage for when globalThis is not extensible (e.g. frozen)\nlet fallbackDispatcher\n\nfunction setGlobalDispatcher (agent) {\n  if (!agent || typeof agent.dispatch !== 'function') {\n    throw new InvalidArgumentError('Argument agent must implement Agent')\n  }\n\n  fallbackDispatcher = agent\n}\n\nfunction getGlobalDispatcher () {\n  return fallbackDispatcher\n}\n\nmodule.exports = {\n  setGlobalDispatcher,\n  getGlobalDispatcher,\n}\n"],"names":["InvalidArgumentError","require$$0","fallbackDispatcher","global","setGlobalDispatcher","agent","dispatch","getGlobalDispatcher"],"mappings":"uHAMA,MAAMA,sBAA2BC;uEAKjC;IAAIC,mBAcJ,IAAAC,OAAiB,CACfC,oBAbF,SAA8BC,OAC5B,IAAKA,OAAmC,mBAAnBA,MAAMC,SACzB,MAAM,IAAIN,qBAAqB,uCAGjCE,mBAAqBG,KACvB,EAQEE,oBANF,WACE,OAAOL,kBACT"}